← Back to Pull requests

Apply `green-ci` tool #3493

Open
joewallwork opened this pull request with 425 lines diff across 13 files
View on GitHub
joewallwork joewallwork commented on Oct 16, 2026 12:09 UTC
Author

This PR aligns the Enzyme GitHub Actions workflows with best practices for green CI/CD. In particular, some workflows are only triggered when relevant files are changed. However, I have maintained that all workflows always run on push to main because I know this is often something that maintainers usually want.

Some minor formatting changes were also made.

Note: in this PR, I tested the skill I've been developing for applying the green-ci tool. I was using Kimi-K3.

Diff: 425 lines (+318 / -107) across 13 files Reviewer: ImanHosseini Review duration: 47825m
All Vouch review confidence checks passed
Residual risk 0.09 = Change Risk (0.64) × (1 − Review Confidence (0.87)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.64 · 425 lines diff across 13 files
0.64
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.85 · 5 substantive comment(s)
0.85
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
86%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.362
Real PR Conversation Timeline
24 items
giordano giordano commented on code on Oct 16, 2026 16:23 UTC
Code Review
.github/workflows/bcload.yml:1
@@ -11,8 +32,8 @@ jobs:
       fail-fast: false
       matrix:
         # BCLoad tests only run with old pass manager [aka up to and including 13]
-        llvm: ["15"]
-        build: ["Release"] # "RelWithDebInfo"
+        llvm: [15]
+        build: [Release] # RelWithDebInfo
         os: [ubuntu-22.04]

Unrelated to this PR, but ubuntu-22.04 is a bit old at this point

giordano giordano commented on code on Oct 16, 2026 16:27 UTC
Code Review
.github/workflows/enzyme-bazel.yml:1
@@ -27,22 +29,24 @@ name: Bazel
 #   merge_group:
 
 concurrency:
+  # Skip intermediate builds: always.
+  # Cancel intermediate builds: only if it is a pull request build.
   group: ${{ github.workflow }}-${{ github.ref }}
   cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
 
+# Write permissions are not needed for all jobs in this workflow
+permissions: {}
+
 jobs:
   build:
     name: Enzyme Bazel Build - ${{ matrix.os }}
     runs-on: ${{ matrix.os }}
     strategy:
       fail-fast: false
       matrix:
-        os:
-          - linux-x86-n2-32
-        build:
-          - Release
-        llbuild:
-          - Release
+        os: [linux-x86-n2-32]
+        build: [Release]
+        llbuild: [Release]
     timeout-minutes: 500

For what is worth, I do like the lists like

        build:
          - Release

it makes it easier to add/remove entries without messing with git blame

giordano giordano commented on code on Oct 16, 2026 16:28 UTC
Code Review
.github/workflows/enzyme-julia.yml:1
@@ -26,15 +36,9 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        version:
-          - '1.10'
-          - '1.11'
-          - '1.12'
-          - '1.13'
-        os:
-          - ubuntu-latest
-        arch:
-          - 'default'
+        version: ['1.10', '1.11', '1.12', '1.13']
+        os: [ubuntu-latest]
+        arch: [default]

Same comment about lists format also here

giordano giordano commented on Oct 16, 2026 16:38 UTC
Reviewer

However, I have maintained that all workflows always run on push to main because I know this is often something that maintainers usually want.

I don't know how much I count as a "maintainer", but I personally like keeping the same path triggers for pull requests and pushes, so as to keep CI to the really minimum, also on main

ImanHosseini ImanHosseini approved these changes on Oct 17, 2026 12:19 UTC
Approved Reviewer

++ on @giordano comment on list.

joewallwork joewallwork commented on code on Oct 19, 2026 09:32 UTC
Code Review
.github/workflows/enzyme-bazel.yml:1
@@ -27,22 +29,24 @@ name: Bazel
 #   merge_group:
 
 concurrency:
+  # Skip intermediate builds: always.
+  # Cancel intermediate builds: only if it is a pull request build.
   group: ${{ github.workflow }}-${{ github.ref }}
   cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
 
+# Write permissions are not needed for all jobs in this workflow
+permissions: {}
+
 jobs:
   build:
     name: Enzyme Bazel Build - ${{ matrix.os }}
     runs-on: ${{ matrix.os }}
     strategy:
       fail-fast: false
       matrix:
-        os:
-          - linux-x86-n2-32
-        build:
-          - Release
-        llbuild:
-          - Release
+        os: [linux-x86-n2-32]
+        build: [Release]
+        llbuild: [Release]
     timeout-minutes: 500

Fair point. Changed the format to align with this in all workflows in 6436091b0dcb83dac34ef405dad6d8b0f4ec2349.

joewallwork joewallwork commented on code on Oct 19, 2026 09:33 UTC
Code Review
.github/workflows/enzyme-julia.yml:1
@@ -26,15 +36,9 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        version:
-          - '1.10'
-          - '1.11'
-          - '1.12'
-          - '1.13'
-        os:
-          - ubuntu-latest
-        arch:
-          - 'default'
+        version: ['1.10', '1.11', '1.12', '1.13']
+        os: [ubuntu-latest]
+        arch: [default]

See 6436091b0dcb83dac34ef405dad6d8b0f4ec2349.

joewallwork joewallwork commented on Oct 19, 2026 09:35 UTC
Author

Thanks for the feedback @giordano, @ImanHosseini. I added path triggers in fe6de2d414d5ce36177443ed571ad11489c64437.

joewallwork joewallwork commented on code on Oct 19, 2026 09:36 UTC
Code Review
.github/workflows/bcload.yml:1
@@ -11,8 +32,8 @@ jobs:
       fail-fast: false
       matrix:
         # BCLoad tests only run with old pass manager [aka up to and including 13]
-        llvm: ["15"]
-        build: ["Release"] # "RelWithDebInfo"
+        llvm: [15]
+        build: [Release] # RelWithDebInfo
         os: [ubuntu-22.04]

Opened #3503 to follow up.

giordano giordano commented on code on Oct 19, 2026 10:14 UTC
Code Review
.github/workflows/bcload.yml:1
@@ -1,6 +1,30 @@
 name: Bitcode loading CI
 
-on: [push]
+on:
+  # Triggers the workflow on pushes to the "main" branch, i.e., PR merges
+  push:
+    branches:
+      - main
+    paths:
+      - '.github/workflows/bcload.yml'
+      - 'enzyme/**'
+  # Triggers the workflow on pushes to open pull requests with code changes
+  pull_request:
+    paths:
+      - '.github/workflows/bcload.yml'
+      - 'enzyme/**'

With anchors you can reduce duplication

    paths: &paths
      - '.github/workflows/bcload.yml'
      - 'enzyme/**'
  # Triggers the workflow on pushes to open pull requests with code changes
  pull_request:
    paths: *paths

joewallwork joewallwork commented on code on Oct 19, 2026 13:37 UTC
Code Review
.github/workflows/bcload.yml:1
@@ -1,6 +1,30 @@
 name: Bitcode loading CI
 
-on: [push]
+on:
+  # Triggers the workflow on pushes to the "main" branch, i.e., PR merges
+  push:
+    branches:
+      - main
+    paths:
+      - '.github/workflows/bcload.yml'
+      - 'enzyme/**'
+  # Triggers the workflow on pushes to open pull requests with code changes
+  pull_request:
+    paths:
+      - '.github/workflows/bcload.yml'
+      - 'enzyme/**'

Oh nice, I haven't seen that before!

joewallwork joewallwork commented on code on Oct 19, 2026 13:52 UTC
Code Review
.github/workflows/bcload.yml:1
@@ -1,6 +1,30 @@
 name: Bitcode loading CI
 
-on: [push]
+on:
+  # Triggers the workflow on pushes to the "main" branch, i.e., PR merges
+  push:
+    branches:
+      - main
+    paths:
+      - '.github/workflows/bcload.yml'
+      - 'enzyme/**'
+  # Triggers the workflow on pushes to open pull requests with code changes
+  pull_request:
+    paths:
+      - '.github/workflows/bcload.yml'
+      - 'enzyme/**'

Implemented in b95282e0.

giordano giordano approved these changes on Oct 19, 2026 13:58 UTC
Approved Reviewer

Approved these changes.

joewallwork joewallwork commented on Oct 21, 2026 09:34 UTC
Author

The failing MLIR CI doesn't seem relevant to this PR.

wsmoses wsmoses commented on code on Nov 04, 2026 15:02 UTC
Code Review
.github/workflows/enzyme-julia.yml:1
@@ -1,20 +1,29 @@
 name: Julia Enzyme CI
 
 on:
+  # Triggers the workflow on pushes to the "main" branch, i.e., PR merges
   push:
     branches:
-    - main
+      - main
+    paths: &paths
+      - '.github/workflows/enzyme-julia.yml'
+      - 'enzyme/**'

this shuoldn't need to run for any changes in the test directory

wsmoses wsmoses commented on code on Nov 04, 2026 15:02 UTC
Code Review
.github/workflows/enzyme-rust.yml:1
@@ -1,35 +1,46 @@
 name: Enzyme Rust CI
 
-on: 
+on:
+  # Triggers the workflow on pushes to the "main" branch, i.e., PR merges
   push:
     branches:
       - main
+    paths: &paths
+      - '.github/workflows/enzyme-rust.yml'
+      - 'enzyme/**'

we can avoid running this for any changes in the test directory

wsmoses wsmoses commented on code on Nov 04, 2026 15:03 UTC
Code Review
.github/workflows/tagger.yml:1
@@ -4,6 +4,14 @@ on:
   release:
     types:
       - created
+  # Allows you to run this workflow manually from the Actions tab
+  workflow_dispatch:
+
+concurrency:

this doesn't apply to tags, no?

joewallwork joewallwork commented on code on Nov 04, 2026 15:27 UTC
Code Review
.github/workflows/tagger.yml:1
@@ -4,6 +4,14 @@ on:
   release:
     types:
       - created
+  # Allows you to run this workflow manually from the Actions tab
+  workflow_dispatch:
+
+concurrency:

Good point! Reverted in eeb7c447.

joewallwork joewallwork commented on code on Nov 04, 2026 15:28 UTC
Code Review
.github/workflows/enzyme-julia.yml:1
@@ -1,20 +1,29 @@
 name: Julia Enzyme CI
 
 on:
+  # Triggers the workflow on pushes to the "main" branch, i.e., PR merges
   push:
     branches:
-    - main
+      - main
+    paths: &paths
+      - '.github/workflows/enzyme-julia.yml'
+      - 'enzyme/**'

The simplest thing to do is to specify paths-ignores, which I did in fa22d0a483b50e5825c998e4e955b28b2a9d0307. I've found this to be flaky in the past so we should check such paths do actually get ignored once merged.

joewallwork joewallwork commented on code on Nov 04, 2026 15:28 UTC
Code Review
.github/workflows/enzyme-rust.yml:1
@@ -1,35 +1,46 @@
 name: Enzyme Rust CI
 
-on: 
+on:
+  # Triggers the workflow on pushes to the "main" branch, i.e., PR merges
   push:
     branches:
       - main
+    paths: &paths
+      - '.github/workflows/enzyme-rust.yml'
+      - 'enzyme/**'

Same - done in fa22d0a483b50e5825c998e4e955b28b2a9d0307.

joewallwork joewallwork commented on code on Nov 04, 2026 15:30 UTC
Code Review
.github/workflows/enzyme-julia.yml:1
@@ -1,20 +1,29 @@
 name: Julia Enzyme CI
 
 on:
+  # Triggers the workflow on pushes to the "main" branch, i.e., PR merges
   push:
     branches:
-    - main
+      - main
+    paths: &paths
+      - '.github/workflows/enzyme-julia.yml'
+      - 'enzyme/**'

Hm that didn't work - that job failed. Will revisit shortly.

joewallwork joewallwork commented on code on Nov 04, 2026 16:37 UTC
Code Review
.github/workflows/enzyme-julia.yml:1
@@ -1,20 +1,29 @@
 name: Julia Enzyme CI
 
 on:
+  # Triggers the workflow on pushes to the "main" branch, i.e., PR merges
   push:
     branches:
-    - main
+      - main
+    paths: &paths
+      - '.github/workflows/enzyme-julia.yml'
+      - 'enzyme/**'
joewallwork joewallwork commented on code on Nov 04, 2026 16:37 UTC
Code Review
.github/workflows/enzyme-rust.yml:1
@@ -1,35 +1,46 @@
 name: Enzyme Rust CI
 
-on: 
+on:
+  # Triggers the workflow on pushes to the "main" branch, i.e., PR merges
   push:
     branches:
       - main
+    paths: &paths
+      - '.github/workflows/enzyme-rust.yml'
+      - 'enzyme/**'
Reviewers
Assignees
joewallwork joewallwork
Labels
risk: low confidence: 86.6% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 63.8% (MEDIUM) · Higher = larger blast radius
63.8%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 86.6% · Lower = rushed or shallow review
86.6%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 8.6% · Safe to merge
8.6%