Skip to content

Commit e73ab4c

Browse files
Copilotalexreinking
andcommitted
Resolve remaining PR merge conflicts
Co-authored-by: alexreinking <169273+alexreinking@users.noreply.github.com>
1 parent 329e7b1 commit e73ab4c

2 files changed

Lines changed: 18 additions & 32 deletions

File tree

.github/workflows/pre-commit-push-fixes.yml

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ jobs:
1212
push-fixes:
1313
name: Push auto-fixes to PR branch
1414
runs-on: ubuntu-slim
15-
if: >-
16-
github.event.workflow_run.event == 'pull_request'
17-
&& github.event.workflow_run.conclusion == 'failure'
15+
if: github.event.workflow_run.conclusion == 'failure'
1816
steps:
1917
- name: Download auto-fix artifacts
2018
id: download
@@ -29,16 +27,12 @@ jobs:
2927
- name: Read PR metadata
3028
if: steps.download.outcome == 'success'
3129
id: pr
32-
env:
33-
GH_TOKEN: ${{ github.token }}
34-
PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }}
3530
run: |
36-
pr_json="$(gh api repos/${{ github.repository }}/pulls/${PR_NUMBER})"
3731
{
38-
echo "number=${PR_NUMBER}"
39-
echo "head-repo=$(jq -r '.head.repo.full_name' <<<"${pr_json}")"
40-
echo "head-ref=$(jq -r '.head.ref' <<<"${pr_json}")"
41-
echo "maintainer-can-modify=$(jq -r '.maintainer_can_modify' <<<"${pr_json}")"
32+
echo "number=$(jq -r '.number' /tmp/pre-commit-fixes/pr-metadata.json)"
33+
echo "head-repo=$(jq -r '.head_repo' /tmp/pre-commit-fixes/pr-metadata.json)"
34+
echo "head-ref=$(jq -r '.head_ref' /tmp/pre-commit-fixes/pr-metadata.json)"
35+
echo "maintainer-can-modify=$(jq -r '.maintainer_can_modify' /tmp/pre-commit-fixes/pr-metadata.json)"
4236
} >> "$GITHUB_OUTPUT"
4337
4438
- name: Abort if maintainer edits not allowed
@@ -64,21 +58,15 @@ jobs:
6458
env:
6559
GH_TOKEN: ${{ steps.app-token.outputs.token }}
6660

67-
- name: Fetch PR branch
61+
- uses: actions/checkout@v4
6862
if: steps.download.outcome == 'success' && env.skip != 'true'
69-
env:
70-
HEAD_REPO: ${{ steps.pr.outputs.head-repo }}
71-
HEAD_REF: ${{ steps.pr.outputs.head-ref }}
72-
run: |
73-
git init .
74-
git remote add origin "https://github.com/${HEAD_REPO}.git"
75-
git -c advice.detachedHead=false fetch --depth=1 origin "refs/heads/${HEAD_REF}"
76-
git checkout --detach FETCH_HEAD
63+
with:
64+
repository: ${{ steps.pr.outputs.head-repo }}
65+
ref: ${{ steps.pr.outputs.head-ref }}
66+
token: ${{ steps.app-token.outputs.token }}
7767

7868
- name: Apply and push fixes
7969
if: steps.download.outcome == 'success' && env.skip != 'true'
80-
env:
81-
GH_TOKEN: ${{ steps.app-token.outputs.token }}
8270
run: |
8371
git config user.name "${{ steps.app-token.outputs.app-slug }}[bot]"
8472
git config user.email "${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com"
@@ -91,5 +79,4 @@ jobs:
9179
git apply /tmp/pre-commit-fixes/pre-commit-fixes.patch
9280
git add -A
9381
git commit -m "Apply pre-commit auto-fixes"
94-
git remote set-url --push origin "https://x-access-token:${GH_TOKEN}@github.com/${{ steps.pr.outputs.head-repo }}.git"
95-
git push origin HEAD:${{ steps.pr.outputs.head-ref }}
82+
git push

test/correctness/simplify.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -811,10 +811,6 @@ void check_vectors() {
811811
int_vector);
812812
check(VectorReduce::make(VectorReduce::Max, Broadcast::make(int_vector, 4), 8),
813813
VectorReduce::make(VectorReduce::Max, Broadcast::make(int_vector, 4), 8));
814-
check(cast(UInt(32, 2),
815-
VectorReduce::make(VectorReduce::Max, Ramp::make(cast(UInt(8), x), cast(UInt(8), y), 8), 2)),
816-
cast(UInt(32, 2),
817-
VectorReduce::make(VectorReduce::Max, Ramp::make(cast(UInt(8), x), cast(UInt(8), y), 8), 2)));
818814

819815
{
820816
// h_add(broadcast(x, 8), 4) should simplify to broadcast(x * 2, 4)
@@ -824,17 +820,20 @@ void check_vectors() {
824820

825821
{
826822
Expr const_u8 = cast(UInt(8), 3);
827-
check(VectorReduce::make(VectorReduce::Add, broadcast(const_u8, 9), 3),
828-
broadcast(cast(UInt(8), 9), 3));
823+
check(VectorReduce::make(VectorReduce::Add, broadcast(const_u8, 9), 3), broadcast(cast(UInt(8), 9), 3));
829824
}
830825

831826
{
832827
// Test VectorReduce::Add on a variable of unsigned type to ensure the multiplied factor
833828
// keeps the correct type and avoids type-mismatch assertion failures.
834829
Expr u8_x = Variable::make(UInt(8), "u8_x");
835-
check(VectorReduce::make(VectorReduce::Add, broadcast(u8_x, 9), 3),
836-
broadcast(u8_x * cast(UInt(8), 3), 3));
830+
check(VectorReduce::make(VectorReduce::Add, broadcast(u8_x, 9), 3), broadcast(u8_x * cast(UInt(8), 3), 3));
837831
}
832+
833+
check(cast(UInt(32, 2),
834+
VectorReduce::make(VectorReduce::Max, Ramp::make(cast(UInt(8), x), cast(UInt(8), y), 8), 2)),
835+
cast(UInt(32, 2),
836+
VectorReduce::make(VectorReduce::Max, Ramp::make(cast(UInt(8), x), cast(UInt(8), y), 8), 2)));
838837
}
839838

840839
void check_bounds() {

0 commit comments

Comments
 (0)