From fac41e2f632df9c0e8c78cc53c3209b60d1e1c11 Mon Sep 17 00:00:00 2001 From: Alex Reinking Date: Sun, 15 Feb 2026 14:14:55 -0500 Subject: [PATCH 1/3] Add automated upgrade workflow for halide-llvm --- .github/workflows/upgrade-llvm.yml | 62 ++++++++++++++++++++++++++++++ pyproject.toml | 8 ++-- uv.lock | 8 ++-- 3 files changed, 70 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/upgrade-llvm.yml diff --git a/.github/workflows/upgrade-llvm.yml b/.github/workflows/upgrade-llvm.yml new file mode 100644 index 000000000000..12c89b8237be --- /dev/null +++ b/.github/workflows/upgrade-llvm.yml @@ -0,0 +1,62 @@ +name: Upgrade halide-llvm + +on: + schedule: + - cron: "0 6 * * *" # Daily at 1am EST / 2am EDT + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + upgrade: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: astral-sh/setup-uv@v5 + + - name: Upgrade halide-llvm + run: uv lock -P halide-llvm + + - name: Check for changes + id: diff + run: | + if git diff --quiet uv.lock; then + echo "changed=false" >> "$GITHUB_OUTPUT" + else + echo "changed=true" >> "$GITHUB_OUTPUT" + + # Extract new resolved versions from the diff + VERSIONS=$(git diff uv.lock \ + | grep '^+.*name = "halide-llvm", version' \ + | sed 's/.*version = "\([^"]*\)".*/\1/' \ + | tr '\n' ',' | sed 's/,/, /g; s/, $//') + echo "versions=$VERSIONS" >> "$GITHUB_OUTPUT" + fi + + - name: Create or update PR + if: steps.diff.outputs.changed == 'true' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + BRANCH="automated/upgrade-halide-llvm" + TITLE="Upgrade halide-llvm to ${{ steps.diff.outputs.versions }}" + + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git checkout -B "$BRANCH" + git add uv.lock + git commit -m "$TITLE" + git push -u origin "$BRANCH" --force-with-lease + + # Update existing PR or create a new one + if gh pr view "$BRANCH" --json state -q .state 2>/dev/null | grep -q OPEN; then + gh pr edit "$BRANCH" --title "$TITLE" + else + gh pr create \ + --title "$TITLE" \ + --body "Automated upgrade via \`uv lock -P halide-llvm\`." \ + --head "$BRANCH" + fi diff --git a/pyproject.toml b/pyproject.toml index 986120e67ab2..b7bc1647ce9d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,10 +86,10 @@ ci-base = [ { include-group = "tools" }, ] -ci-llvm-main = [{ include-group = "ci-base" }, "halide-llvm==23.0.0.dev0+g80f627e6"] -ci-llvm-22 = [{ include-group = "ci-base" }, "halide-llvm==22.1.0rc3"] -ci-llvm-21 = [{ include-group = "ci-base" }, "halide-llvm==21.1.8"] -ci-llvm-20 = [{ include-group = "ci-base" }, "halide-llvm==20.1.8"] +ci-llvm-main = [{ include-group = "ci-base" }, "halide-llvm~=23.0.0.dev0"] +ci-llvm-22 = [{ include-group = "ci-base" }, "halide-llvm~=22.1.0rc0"] +ci-llvm-21 = [{ include-group = "ci-base" }, "halide-llvm~=21.1.0"] +ci-llvm-20 = [{ include-group = "ci-base" }, "halide-llvm~=20.1.0"] [project.urls] Homepage = "https://halide-lang.org" diff --git a/uv.lock b/uv.lock index 108b76bd7fc4..53e504bd50d5 100644 --- a/uv.lock +++ b/uv.lock @@ -188,7 +188,7 @@ ci-base = [ ] ci-llvm-20 = [ { name = "cmake", specifier = ">=3.28" }, - { name = "halide-llvm", specifier = "==20.1.8", index = "https://pypi.halide-lang.org/simple" }, + { name = "halide-llvm", specifier = "~=20.1.0", index = "https://pypi.halide-lang.org/simple" }, { name = "ninja", specifier = ">=1.11,!=1.13.0" }, { name = "onnx", specifier = "==1.18.0" }, { name = "pybind11", specifier = ">=2.11.1" }, @@ -200,7 +200,7 @@ ci-llvm-20 = [ ] ci-llvm-21 = [ { name = "cmake", specifier = ">=3.28" }, - { name = "halide-llvm", specifier = "==21.1.8", index = "https://pypi.halide-lang.org/simple" }, + { name = "halide-llvm", specifier = "~=21.1.0", index = "https://pypi.halide-lang.org/simple" }, { name = "ninja", specifier = ">=1.11,!=1.13.0" }, { name = "onnx", specifier = "==1.18.0" }, { name = "pybind11", specifier = ">=2.11.1" }, @@ -212,7 +212,7 @@ ci-llvm-21 = [ ] ci-llvm-22 = [ { name = "cmake", specifier = ">=3.28" }, - { name = "halide-llvm", specifier = "==22.1.0rc3", index = "https://pypi.halide-lang.org/simple" }, + { name = "halide-llvm", specifier = "~=22.1.0rc0", index = "https://pypi.halide-lang.org/simple" }, { name = "ninja", specifier = ">=1.11,!=1.13.0" }, { name = "onnx", specifier = "==1.18.0" }, { name = "pybind11", specifier = ">=2.11.1" }, @@ -224,7 +224,7 @@ ci-llvm-22 = [ ] ci-llvm-main = [ { name = "cmake", specifier = ">=3.28" }, - { name = "halide-llvm", specifier = "==23.0.0.dev0+g80f627e6", index = "https://pypi.halide-lang.org/simple" }, + { name = "halide-llvm", specifier = "~=23.0.0.dev0", index = "https://pypi.halide-lang.org/simple" }, { name = "ninja", specifier = ">=1.11,!=1.13.0" }, { name = "onnx", specifier = "==1.18.0" }, { name = "pybind11", specifier = ">=2.11.1" }, From b7361ad109d2e777499ac5702b9ab9189418c5b4 Mon Sep 17 00:00:00 2001 From: Alex Reinking Date: Sun, 15 Feb 2026 14:39:43 -0500 Subject: [PATCH 2/3] Be more defensive about state management --- .github/workflows/upgrade-llvm.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upgrade-llvm.yml b/.github/workflows/upgrade-llvm.yml index 12c89b8237be..7a42d51190d0 100644 --- a/.github/workflows/upgrade-llvm.yml +++ b/.github/workflows/upgrade-llvm.yml @@ -49,12 +49,15 @@ jobs: git checkout -B "$BRANCH" git add uv.lock git commit -m "$TITLE" - git push -u origin "$BRANCH" --force-with-lease # Update existing PR or create a new one if gh pr view "$BRANCH" --json state -q .state 2>/dev/null | grep -q OPEN; then - gh pr edit "$BRANCH" --title "$TITLE" + git push -u origin "$BRANCH" --force-with-lease \ + && gh pr edit "$BRANCH" --title "$TITLE" else + # Delete stale remote branch (e.g. leftover from a merged PR) + git push origin --delete "$BRANCH" 2>/dev/null || true + git push -u origin "$BRANCH" gh pr create \ --title "$TITLE" \ --body "Automated upgrade via \`uv lock -P halide-llvm\`." \ From f7fbbc07d8c679cc8857f21985c756dc5a218589 Mon Sep 17 00:00:00 2001 From: Alex Reinking Date: Sun, 15 Feb 2026 14:41:35 -0500 Subject: [PATCH 3/3] Limit Makefile tests when editing other workflows --- .github/workflows/testing-make.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/testing-make.yml b/.github/workflows/testing-make.yml index 10a495a141c1..ccd6c600f851 100644 --- a/.github/workflows/testing-make.yml +++ b/.github/workflows/testing-make.yml @@ -6,6 +6,9 @@ env: on: pull_request: types: [ opened, synchronize, reopened ] + paths-ignore: + - ".github/**" + - "!.github/workflows/testing-make.yml" concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}