From f702f14c9116647b14dd497e43f49aa49c0366e4 Mon Sep 17 00:00:00 2001 From: tignear Date: Sat, 17 Oct 2026 07:40:27 +0900 Subject: [PATCH 1/3] ci: move non-required PR checks into required lint or schedules PR-triggered checks that no ruleset or Mergify condition requires let failures merge. Run the Heliodor fixture and Updatecli selector tests in Lint & Format (workflow, scripts and .updatecli changes select it), and run CodeQL and mbx validation only on their schedules. --- .github/workflows/ci.yml | 7 +++- .github/workflows/codeql.yml | 13 +++---- .github/workflows/heliodor-bench.yml | 42 ++-------------------- .github/workflows/update-mbx.yml | 14 +++----- .github/workflows/updatecli-check.yml | 40 --------------------- .updatecli/README.md | 5 +-- CONTRIBUTING.md | 18 +++++----- docs/development.md | 4 +-- scripts/benchmark-workflows.test.mjs | 12 +++---- scripts/ci-changes.mjs | 10 ++++-- scripts/ci-changes.test.mjs | 13 ++++--- scripts/codeql-workflow.test.mjs | 52 ++++++--------------------- 12 files changed, 66 insertions(+), 164 deletions(-) delete mode 100644 .github/workflows/updatecli-check.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27038159534..f266a99d85f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -167,7 +167,12 @@ jobs: - name: Test repository scripts if: needs.changes.result != 'success' || needs.changes.outputs.scripts == 'true' - run: node --test scripts/*.test.mjs + run: | + node --test scripts/*.test.mjs + bash scripts/tests/convert-heliodor-bench.sh + bash scripts/tests/run-heliodor-bench-results.sh + bash scripts/tests/run-heliodor-bench-gate.sh + python3 -m unittest discover -s .updatecli/tests -v # A new dependency edge can invalidate the NAPI exclusions or the # backend and frontend variants that pull requests narrow celox to. diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 46b8940d891..a1d50eacc90 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -2,25 +2,22 @@ name: CodeQL # Enable CODEQL_ADVANCED_ENABLED only after disabling GitHub's default setup. # See CONTRIBUTING.md for the cutover and rollback procedure. +# Code scanning does not gate merges, so it runs on a schedule rather than PRs. on: - pull_request: - paths: - - ".github/workflows/**" - - ".github/actions/**" schedule: - cron: "17 4 * * 0" workflow_dispatch: concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'pull_request' && 'pr' || 'full' }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false permissions: contents: read jobs: analyze: - if: vars.CODEQL_ADVANCED_ENABLED == 'true' && !startsWith(github.head_ref, 'mergify/merge-queue/') + if: vars.CODEQL_ADVANCED_ENABLED == 'true' name: Analyze (${{ matrix.language }}) runs-on: ubuntu-latest timeout-minutes: 45 @@ -31,7 +28,7 @@ jobs: fail-fast: false max-parallel: 2 matrix: - language: ${{ fromJSON(github.event_name == 'pull_request' && '["actions"]' || '["actions", "c-cpp", "javascript-typescript", "python", "rust"]') }} + language: [actions, c-cpp, javascript-typescript, python, rust] steps: - uses: actions/checkout@v7 with: diff --git a/.github/workflows/heliodor-bench.yml b/.github/workflows/heliodor-bench.yml index 808f952354d..f83b047a3f7 100644 --- a/.github/workflows/heliodor-bench.yml +++ b/.github/workflows/heliodor-bench.yml @@ -1,23 +1,6 @@ name: Heliodor Benchmark on: - pull_request: - paths: - - ".github/actions/setup-rust/**" - - ".github/workflows/heliodor-bench.yml" - - ".github/workflows/bench.yml" - - "scripts/benchmark-workflows.test.mjs" - - "scripts/publish-bench.mjs" - - "scripts/convert-heliodor-bench.mjs" - - "scripts/heliodor-revision" - - "scripts/publish-heliodor-bench.mjs" - - "scripts/publish-heliodor-bench.test.mjs" - - "scripts/heliodor-suite.mjs" - - "scripts/heliodor-suite.test.mjs" - - "scripts/run-heliodor-bench.sh" - - "scripts/tests/convert-heliodor-bench.sh" - - "scripts/tests/run-heliodor-bench-results.sh" - - "scripts/tests/run-heliodor-bench-gate.sh" schedule: - cron: "37 2 * * *" workflow_dispatch: @@ -57,8 +40,8 @@ env: # Measurement workflows have independent queues; publishers retry against the # latest gh-pages tip instead of locking the entire suite behind other benches. concurrency: - group: ${{ (inputs.suite_test || inputs.suite_runner || inputs.suite_arch) && format('heliodor-suite-{0}-{1}-{2}-{3}', github.ref, inputs.suite_test, inputs.suite_runner, inputs.suite_arch) || inputs.arm64_profile && format('heliodor-arm64-profile-{0}', github.ref) || github.event_name == 'pull_request' && format('heliodor-pr-{0}', github.event.pull_request.number) || format('heliodor-bench-{0}', github.ref) }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} + group: ${{ (inputs.suite_test || inputs.suite_runner || inputs.suite_arch) && format('heliodor-suite-{0}-{1}-{2}-{3}', github.ref, inputs.suite_test, inputs.suite_runner, inputs.suite_arch) || inputs.arm64_profile && format('heliodor-arm64-profile-{0}', github.ref) || format('heliodor-bench-{0}', github.ref) }} + cancel-in-progress: false jobs: validate-dispatch: @@ -80,27 +63,6 @@ jobs: SUITE_ARCH: ${{ inputs.suite_arch }} run: node scripts/heliodor-suite.mjs validate - converter-test: - name: Test Heliodor result conversion - if: github.event_name == 'pull_request' - permissions: - contents: read - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v7 - - - uses: actions/setup-node@v7 - with: - node-version: 24 - - - name: Test benchmark conversion fixtures - shell: bash - run: | - node --test scripts/benchmark-workflows.test.mjs scripts/heliodor-suite.test.mjs scripts/publish-heliodor-bench.test.mjs - bash scripts/tests/convert-heliodor-bench.sh - bash scripts/tests/run-heliodor-bench-results.sh - bash scripts/tests/run-heliodor-bench-gate.sh - # The stable daily suite already covers this pinned workload. Develop runs # its smaller fixed gate daily to check the Veryl HEAD lane without duplicating # the full suite. Explicit suite selections and profiling remain manual. diff --git a/.github/workflows/update-mbx.yml b/.github/workflows/update-mbx.yml index 6163773d37b..4751f9cace5 100644 --- a/.github/workflows/update-mbx.yml +++ b/.github/workflows/update-mbx.yml @@ -4,23 +4,16 @@ on: schedule: - cron: "37 5 * * *" workflow_dispatch: - pull_request: - paths: - - "flake.nix" - - "flake.lock" - - ".github/workflows/update-mbx.yml" - merge_group: permissions: contents: read concurrency: - group: update-mbx-${{ github.event.pull_request.number || github.ref }} + group: update-mbx-${{ github.ref }} cancel-in-progress: false jobs: update: - if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest timeout-minutes: 20 steps: @@ -79,13 +72,14 @@ jobs: `${{ steps.update.outputs.old-version }}` to `${{ steps.update.outputs.new-version }}`. Validated the locked flake for both Linux architectures and built - and ran mbx on x86_64. PR checks also run mbx on ARM64. + and ran mbx on x86_64. The daily run also builds and runs the + committed mbx on ARM64. Other flake inputs remain pinned. Package-definition changes may update the lock even when the mbx version is unchanged. + # Not a merge gate: check the committed lock on both architectures daily. validate: name: Validate mbx (${{ matrix.runner }}) - if: github.event_name == 'pull_request' || github.event_name == 'merge_group' strategy: fail-fast: false matrix: diff --git a/.github/workflows/updatecli-check.yml b/.github/workflows/updatecli-check.yml deleted file mode 100644 index 50621121008..00000000000 --- a/.github/workflows/updatecli-check.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Validate Python and cocotb update policy - -on: - pull_request: - paths: - - ".github/workflows/ci.yml" - - ".github/workflows/updatecli.yml" - - ".github/workflows/updatecli-check.yml" - - ".updatecli-version" - - ".updatecli/**" - - "renovate.json" - -permissions: - contents: read - -concurrency: - group: updatecli-check-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - validate: - name: Updatecli - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@v7 - - - name: Install Updatecli - uses: updatecli/updatecli-action@v3.9.0 - with: - version-file: .updatecli-version - - - name: Test Python compatibility selector - run: python3 -m unittest discover -s .updatecli/tests -v - - - name: Preview update policy - run: updatecli pipeline diff --config .updatecli/updatecli.d - env: - UPDATECLI_GITHUB_ACTOR: ${{ github.actor }} - UPDATECLI_GITHUB_TOKEN: ${{ github.token }} diff --git a/.updatecli/README.md b/.updatecli/README.md index c37b9750943..1f2c8ff52a9 100644 --- a/.updatecli/README.md +++ b/.updatecli/README.md @@ -21,7 +21,8 @@ export UPDATECLI_GITHUB_ACTOR=... updatecli pipeline diff --config .updatecli/updatecli.d ``` -Pull request validation uses the read-only `GITHUB_TOKEN`. Scheduled and manual -updates mint a short-lived token for the `celox-automation` GitHub App from the +Pull requests run the selector unit tests in the required `Lint & Format` +check. The weekly and manual `updatecli.yml` runs repeat those tests and preview +the policy before applying it. Scheduled and manual updates mint a short-lived token for the `celox-automation` GitHub App from the existing `RELEASE_APP_ID` variable and `RELEASE_APP_PRIVATE_KEY` secret. Pull requests created with that installation token trigger the regular CI workflows. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c17b52d7f05..20393e260d8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -70,12 +70,11 @@ minimum safety net, not the definition of validation completeness. ### Code scanning -`.github/workflows/codeql.yml` scans Actions on pull requests that change -workflow or local action files. Other ordinary PRs and Mergify queue drafts -do not run this workflow's analysis. Every Sunday at 04:17 UTC, and on manual +`.github/workflows/codeql.yml` does not gate merges, so pull requests and +Mergify queue drafts do not run it. Every Sunday at 04:17 UTC, and on manual dispatch, it scans Actions, C/C++, JavaScript/TypeScript, Python, and Rust, with at most two analyses running concurrently. Compiled languages use CodeQL's -`none` build mode. There is no push-triggered full scan or merge requirement. +`none` build mode. There is no push-triggered scan. The workflow is inactive until the repository variable `CODEQL_ADVANCED_ENABLED` is set to `true`. To replace the existing automatic @@ -88,9 +87,8 @@ scans after this workflow merges: using runners on PRs and pushes. 3. Set the repository Actions variable `CODEQL_ADVANCED_ENABLED` to `true`, then manually dispatch `codeql.yml` on `master`. -4. Confirm that all five analyses upload results and that an Actions-changing - PR runs only the Actions analysis. Rust/application-only PRs should not - start CodeQL or Code Quality scans. +4. Confirm that all five analyses upload results and that PRs no longer start + CodeQL or Code Quality scans. For rollback, unset `CODEQL_ADVANCED_ENABLED` and re-enable default setup. This variable allows the replacement to be reviewed without running both @@ -191,6 +189,10 @@ Job selection: including unit tests mixed with implementation, remain conservative. - Cargo manifests and lockfiles retain broad coverage. Mixed changes combine their requirements; unknown paths and failed change detection run all jobs. +- Workflow, `scripts/` and `.updatecli/` changes run the repository script + tests in `Lint & Format`, including the Heliodor fixture and Updatecli + selector tests. A test that runs on pull requests must be a required check + or feed one; otherwise it belongs to a scheduled workflow. - Rust-only changes still pass through the existing `Rust Test & NAPI Build` required check. Only explicitly unneeded producers may be skipped; failures and cancellations fail the check. @@ -223,7 +225,7 @@ uses the finer behavior-based matrix above. | Daily from `nightly.yml` at 02:43 UTC (11:43 JST) | Dispatch the same full CI on `develop`, with detection of its Veryl dependency lane. Queue nightly packages and the small pinned/HEAD Heliodor Linux boot compatibility checks. | | Daily at 01:47 UTC (10:47 JST) | `bench.yml` measures Rust, Verilator, and TypeScript on one host and publishes master history. Manual dispatch supports branch measurements. | | Daily at 02:17 UTC (11:17 JST) | `codspeed.yml` measures compile time on the default branch using CPU simulation. Execution failures and CodSpeed performance-check failures open or update a branch issue; the next healthy run closes it. Manual dispatch supports branch measurements. PRs, merge groups, and pushes do not run CodSpeed. | -| Daily at 02:37 UTC (11:37 JST) | `heliodor-bench.yml` runs the complete master Linux suite on x86-64 and AArch64. Explicit manual selections retain focused suite runs and ARM64 profiling. PRs run only the benchmark tooling tests when those files change. | +| Daily at 02:37 UTC (11:37 JST) | `heliodor-bench.yml` runs the complete master Linux suite on x86-64 and AArch64. Explicit manual selections retain focused suite runs and ARM64 profiling. PRs do not run this workflow; its tooling tests run in `Lint & Format` with the other script tests. | | Every full CI run | Run every shared Veryl and SystemVerilog case against both Verilator and Icarus, with locked Nix tools. Run the live adapter tests normally marked ignored because they need external tools. Preserve reports and per-case diagnostics as artifacts for 14 days, including on failure; matrix failures do not cancel the other comparisons. | | Affected pull requests and merge groups; weekly Monday at 03:41 UTC (12:41 JST); on demand | `lydite.yml` owns Lydite Rust tests, proof, conformance, editor, and mutation gates. Unrelated changes skip these jobs. Weekly and manual runs enable all lanes. | | On demand | Dispatch `ci.yml` on the desired branch to run full CI and external comparisons, regardless of its diff. | diff --git a/docs/development.md b/docs/development.md index 4787ca0d937..5ed9bcfe549 100644 --- a/docs/development.md +++ b/docs/development.md @@ -220,8 +220,8 @@ be dispatched manually. It validates the updated flake and mbx executable, then opens or updates `automation/update-mbx` against the default branch. Only `flake.lock` is included in the PR; other flake inputs stay pinned. The workflow uses the existing release GitHub App credentials so its PR -triggers normal CI. PR and merge-queue checks build and run the pinned mbx -package on both x86_64 and ARM64 Linux. Updates are proposed as PRs for review; +triggers normal CI. The daily and manual runs also build and run the +committed mbx package on both x86_64 and ARM64 Linux. Updates are proposed as PRs for review; the workflow does not merge them automatically. Upstream package-definition updates can produce a PR even when the mbx version is unchanged. diff --git a/scripts/benchmark-workflows.test.mjs b/scripts/benchmark-workflows.test.mjs index 741387595c7..6e43919e1b1 100644 --- a/scripts/benchmark-workflows.test.mjs +++ b/scripts/benchmark-workflows.test.mjs @@ -29,17 +29,17 @@ function runs(name, event, ref, inputs = {}, validation = event === "workflow_di )); } -test("benchmarks run daily and manually; PRs only test the Heliodor tooling", () => { +test("benchmarks run daily and manually; required lint tests the Heliodor tooling", () => { for (const workflow of [heliodor, bench, codspeed]) { const triggers = workflow.match(/^on:\n([\s\S]*?)\n\S/m)[1]; - assert.doesNotMatch(triggers, /^\s+push:|^\s+merge_group:/m); + assert.doesNotMatch(triggers, /^\s+(push|pull_request|merge_group):/m); assert.match(triggers, /^\s+schedule:/m); assert.match(triggers, /^\s+workflow_dispatch:/m); } - assert.doesNotMatch(codspeed, /^ pull_request:/m); - const paths = heliodor.match(/ pull_request:\n paths:\n([\s\S]*?) schedule:/)[1]; - assert.doesNotMatch(paths, /Cargo\.(lock|toml)|crates\/|ci-changes/); - assert.match(job(heliodor, "converter-test"), /scripts\/benchmark-workflows\.test\.mjs/); + const scriptTests = read("ci").match(/name: Test repository scripts\n[\s\S]*?\n\n/)[0]; + for (const fixture of ["convert-heliodor-bench", "run-heliodor-bench-results", "run-heliodor-bench-gate"]) { + assert.match(scriptTests, new RegExp(`bash scripts/tests/${fixture}\\.sh`)); + } assert.doesNotMatch(heliodor, /^ arm64-linux-boot:|^ arm64-changes:/m); for (const name of ["heliodor", "linux-suite-matrix", "heliodor-head", "arm64-linux-boot-full"]) { assert.equal(runs(name, "pull_request", "master"), false, name); diff --git a/scripts/ci-changes.mjs b/scripts/ci-changes.mjs index 9200c7aaa87..ff5349b3e4f 100644 --- a/scripts/ci-changes.mjs +++ b/scripts/ci-changes.mjs @@ -200,14 +200,20 @@ export function classifyFiles(files, { releasePlease = false } = {}) { continue; } - if (path === ".mergify.yml" || startsWithAny(path, ["scripts/"])) { + // Repository script tests also validate workflow files and the Updatecli + // policy, so these run in the required lint job instead of path-filtered + // workflows that cannot gate merges. + if ( + path === ".mergify.yml" || + startsWithAny(path, ["scripts/", ".updatecli/", ".github/workflows/"]) + ) { affected.scripts = true; continue; } if ( NEUTRAL_FILES.has(path) || - startsWithAny(path, [".github/ISSUE_TEMPLATE/", ".github/workflows/"]) || + startsWithAny(path, [".github/ISSUE_TEMPLATE/"]) || path === ".github/pull_request_template.md" ) { continue; diff --git a/scripts/ci-changes.test.mjs b/scripts/ci-changes.test.mjs index 9064b745da7..54f41654427 100644 --- a/scripts/ci-changes.test.mjs +++ b/scripts/ci-changes.test.mjs @@ -412,10 +412,15 @@ test("CI classifier changes exercise every path", () => { }); test("repository script changes only run script tests", () => { - assert.deepEqual(classifyFiles(["scripts/check-pr-title.mjs"]), { - ...none, - scripts: true, - }); + for (const path of [ + "scripts/check-pr-title.mjs", + "scripts/tests/run-heliodor-bench-gate.sh", + ".updatecli/scripts/latest_compatible_python.py", + ".github/workflows/heliodor-bench.yml", + ".github/workflows/codeql.yml", + ]) { + assert.deepEqual(classifyFiles([path]), { ...none, scripts: true }, path); + } }); test("unknown paths fail open", () => { diff --git a/scripts/codeql-workflow.test.mjs b/scripts/codeql-workflow.test.mjs index 760adf1a42a..6f5bc616d9a 100644 --- a/scripts/codeql-workflow.test.mjs +++ b/scripts/codeql-workflow.test.mjs @@ -7,55 +7,25 @@ const workflow = readFileSync( "utf8", ); -test("PR analysis stays light while scheduled and manual scans cover all languages", () => { - const expression = workflow.match(/language: \$\{\{ (.+) \}\}/)[1]; - const languages = new Function("github", "fromJSON", `return ${expression}`); - assert.deepEqual(languages({ event_name: "pull_request" }, JSON.parse), [ - "actions", - ]); - for (const event_name of ["schedule", "workflow_dispatch"]) { - assert.deepEqual(languages({ event_name }, JSON.parse), [ - "actions", - "c-cpp", - "javascript-typescript", - "python", - "rust", - ]); - } +test("scheduled and manual scans cover all languages", () => { + assert.match( + workflow, + /language: \[actions, c-cpp, javascript-typescript, python, rust\]/, + ); assert.match(workflow, /max-parallel: 2/); assert.match(workflow, /build-mode: none/); }); -test("cutover is explicit and queue drafts do not repeat PR analysis", () => { - const expression = workflow.match(/^ if: (.+)$/m)[1]; - const enabled = new Function( - "vars", - "github", - "startsWith", - `return ${expression}`, - ); - const startsWith = (value, prefix) => value.startsWith(prefix); - for (const value of [undefined, "false", "true"]) { - for (const head_ref of [ - "", - "feature/example", - "mergify/merge-queue/batch", - ]) { - assert.equal( - enabled({ CODEQL_ADVANCED_ENABLED: value }, { head_ref }, startsWith), - value === "true" && !head_ref.startsWith("mergify/merge-queue/"), - ); - } - } +test("cutover is explicit", () => { + assert.match(workflow, /^ if: vars\.CODEQL_ADVANCED_ENABLED == 'true'$/m); }); -test("ordinary source changes and pushes do not start CodeQL", () => { +test("CodeQL is not a non-required PR, queue or push check", () => { const triggers = workflow.split("on:\n")[1].split("\nconcurrency:")[0]; - assert.doesNotMatch(triggers, /^ (push|pull_request_target|merge_group):/m); - const paths = [...triggers.matchAll(/^ - "(.+)"$/gm)].map( - (match) => match[1], + assert.doesNotMatch( + triggers, + /^ (push|pull_request|pull_request_target|merge_group):/m, ); - assert.deepEqual(paths, [".github/workflows/**", ".github/actions/**"]); assert.match(triggers, /cron: "17 4 \* \* 0"/); assert.match(triggers, /^ workflow_dispatch:/m); assert.match(workflow, /persist-credentials: false/); From 5f4ffa52d949cc4680ac22f67b0e2d18edc61986 Mon Sep 17 00:00:00 2001 From: tignear Date: Sat, 17 Oct 2026 07:46:38 +0900 Subject: [PATCH 2/3] ci(lydite): run the bridge daily instead of on Celox PRs The replay and proof corpus take about an hour of scarce runner time on every Celox change. Run them on PRs only for Lydite-owned changes, merge them into one job sharing a release build, and run every lane daily on master and develop, reporting failures in an issue. --- .github/workflows/lydite.yml | 97 +++++++++++++++++++----------- .github/workflows/nightly.yml | 11 ++++ CONTRIBUTING.md | 24 +++++--- lydite/docs/specifications.md | 2 +- scripts/ci-lydite-changes.mjs | 16 ++++- scripts/ci-lydite-changes.test.mjs | 36 ++++++++--- scripts/report-full-ci.mjs | 1 + 7 files changed, 135 insertions(+), 52 deletions(-) diff --git a/.github/workflows/lydite.yml b/.github/workflows/lydite.yml index 13e3296ffad..c76896075fc 100644 --- a/.github/workflows/lydite.yml +++ b/.github/workflows/lydite.yml @@ -5,16 +5,18 @@ name: lydite # linted by ci.yml; this workflow owns Lydite tests and conformance gates. on: - # Select affected lanes on changes; run every lane weekly and on demand. + # PRs select affected lanes; the heavy bridge runs on PRs only for Lydite-owned + # changes. Daily and manual runs enable every lane and report failures. pull_request: merge_group: schedule: - - cron: "41 3 * * 1" + - cron: "41 3 * * *" workflow_dispatch: concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + # A new push must not cancel the daily full run halfway through its corpus. + group: ${{ github.workflow }}-${{ github.ref }}-${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && 'full' || 'changes' }} + cancel-in-progress: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }} permissions: contents: read @@ -129,31 +131,8 @@ jobs: timeout-minutes: 5 run: xvfb-run -a npm test --prefix editor/vscode - # celox-replay and veryl-proof use the in-tree Celox; the narrow veryl gate - # checks lydite's own Veryl lowering against a pinned upstream corpus. - celox-replay: - needs: changes - if: always() && (needs.changes.result != 'success' || needs.changes.outputs.bridge == 'true') - runs-on: ubuntu-26.04 - timeout-minutes: 30 - steps: - - uses: actions/checkout@v7 - with: - persist-credentials: false - - uses: ./.github/actions/setup-rust - with: - components: rustfmt - - name: Reproduce source violations and AXI4-Lite protocol regressions with Celox - run: ./conformance/axi4lite/run_ci.sh "$RUNNER_TEMP/celox-replay" - - name: Upload complete replay evidence - if: always() - uses: actions/upload-artifact@v7 - with: - name: celox-replay-${{ github.run_id }}-${{ github.run_attempt }} - path: ${{ runner.temp }}/celox-replay/ - if-no-files-found: error - retention-days: 14 - + # The narrow veryl gate checks lydite's own Veryl lowering against a pinned + # upstream corpus. veryl-fv: needs: changes if: always() && (needs.changes.result != 'success' || needs.changes.outputs.core == 'true') @@ -181,12 +160,13 @@ jobs: if-no-files-found: error retention-days: 14 - veryl-proof-corpus: + # The bridge lanes use the in-tree Celox and share one release build. + bridge: needs: changes if: always() && (needs.changes.result != 'success' || needs.changes.outputs.bridge == 'true') runs-on: ubuntu-26.04 - # Cold builds plus the sequential proof/mutation gates can exceed one hour. - timeout-minutes: 120 + # Cold builds plus replay and the sequential proof/mutation gates. + timeout-minutes: 150 steps: - uses: actions/checkout@v7 with: @@ -194,29 +174,50 @@ jobs: - uses: ./.github/actions/setup-rust with: components: rustfmt + - name: Reproduce source violations and AXI4-Lite protocol regressions with Celox + run: ./conformance/axi4lite/run_ci.sh "$RUNNER_TEMP/celox-replay" + - name: Upload complete replay evidence + if: always() + uses: actions/upload-artifact@v7 + with: + name: celox-replay-${{ github.run_id }}-${{ github.run_attempt }} + path: ${{ runner.temp }}/celox-replay/ + if-no-files-found: error + retention-days: 14 + + # Keep collecting proof evidence after a replay failure. # The conformance gates are pinned to Python 3.12. - uses: actions/setup-python@v7 + if: ${{ !cancelled() }} with: python-version: "3.12" - name: Run every reusable suite case with proof-backed reads + if: ${{ !cancelled() }} run: ./conformance/veryl-proof/run_ci.sh "$RUNNER_TEMP/veryl-proof" - name: Verify symbolic Veryl pipeline against ISA and reject RTL mutants + if: ${{ !cancelled() }} run: ./conformance/veryl-symbolic/run_ci.sh "$RUNNER_TEMP/veryl-symbolic" - name: Verify typed lemma candidates and proof-use diagnostics + if: ${{ !cancelled() }} run: python3 -m audit.lemma_candidates.ci --out "$RUNNER_TEMP/lemma-candidates" - name: Verify selected RV32I architecture, memory, latency and mutations + if: ${{ !cancelled() }} run: ./conformance/veryl-symbolic/run_rv32i_ci.sh "$RUNNER_TEMP/selected-rv32i" - name: Verify fixed automatic-proof held-outs and original-formula mutants + if: ${{ !cancelled() }} run: ./conformance/veryl-symbolic/run_automatic_ci.sh "$RUNNER_TEMP/automatic-proof" - name: Verify checked equality sharing and retain explicit Unknown diagnostics + if: ${{ !cancelled() }} run: | python3 -m unittest audit.equality_sharing.test_generate audit.equality_sharing.test_evidence audit.equality_sharing.test_ci python3 -m audit.equality_sharing.ci --checker ../target/release/lydite --out "$RUNNER_TEMP/equality-sharing" - name: Verify whole-word frontier controls and original-formula mutants + if: ${{ !cancelled() }} run: | python3 -m unittest audit.word_frontier.test_generate audit.word_frontier.test_ci python3 -m audit.word_frontier.ci --checker ../target/release/lydite --expected-checker-sha256 "$(sha256sum ../target/release/lydite | cut -d' ' -f1)" --out "$RUNNER_TEMP/word-frontier" - name: Verify guarded word expansion and reject escaped guards + if: ${{ !cancelled() }} run: | cargo test --release --locked -p lydite-solver equality_sharing::tests python3 -m unittest audit.guarded_expansion.test_generate audit.guarded_expansion.test_ci @@ -240,7 +241,7 @@ jobs: result: name: Lydite checks - needs: [changes, rust, documentation, editor, celox-replay, veryl-fv, veryl-proof-corpus] + needs: [changes, rust, documentation, editor, veryl-fv, bridge] if: always() runs-on: ubuntu-26.04 defaults: @@ -256,8 +257,36 @@ jobs: needs = json.loads(os.environ["NEEDS"]) assert needs["changes"]["result"] == "success", needs assert all(needs["changes"]["outputs"].get(key) in ("true", "false") for key in ("core", "bridge")), needs - for job, lane in {"rust": None, "documentation": "core", "editor": "core", "celox-replay": "bridge", "veryl-fv": "core", "veryl-proof-corpus": "bridge"}.items(): + for job, lane in {"rust": None, "documentation": "core", "editor": "core", "veryl-fv": "core", "bridge": "bridge"}.items(): outputs = needs["changes"]["outputs"] selected = outputs.get(lane) == "true" if lane else any(outputs.get(key) == "true" for key in ("core", "bridge")) assert needs[job]["result"] == ("success" if selected else "skipped"), (job, needs[job]) PYCODE + + # Report daily/manual runs; the bridge does not gate Celox PRs. + report: + name: Report Lydite validation + needs: [changes, rust, documentation, editor, veryl-fv, bridge, result] + if: ${{ !cancelled() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && (github.ref_name == 'master' || github.ref_name == 'develop') }} + runs-on: ubuntu-26.04 + permissions: + contents: read + issues: write + defaults: + run: + working-directory: . + steps: + - uses: actions/checkout@v7 + with: + persist-credentials: false + sparse-checkout: scripts + + - name: Open, update, or close the Lydite issue + env: + GH_TOKEN: ${{ github.token }} + NEEDS: ${{ toJSON(needs) }} + BRANCH: ${{ github.ref_name }} + SHA: ${{ github.sha }} + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + REPORT_NAME: Lydite validation + run: node scripts/report-full-ci.mjs diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 1cfd6fdd8cd..7d904866769 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -21,6 +21,17 @@ jobs: - name: Dispatch full CI on develop run: gh workflow run ci.yml --repo "$GITHUB_REPOSITORY" --ref develop + # lydite.yml schedules the default branch itself; its bridge lanes do not run + # for Celox PRs, so check develop's in-tree Celox daily as well. + queue-lydite-develop: + name: Queue develop Lydite validation + runs-on: ubuntu-latest + env: + GH_TOKEN: ${{ github.token }} + steps: + - name: Dispatch every Lydite lane on develop + run: gh workflow run lydite.yml --repo "$GITHUB_REPOSITORY" --ref develop + # heliodor-bench.yml schedules the stable master lane directly. Dispatch the # develop ref here for the small pinned/HEAD Linux boot compatibility gates. queue-heliodor-develop: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 20393e260d8..1fed841ec2d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -149,7 +149,7 @@ This does not prioritize jobs inside GitHub Actions or preempt occupied runners. See [Mergify priorities](https://docs.mergify.com/merge-queue/priority/) and [Mergify queue modes](https://docs.mergify.com/merge-queue/queue-modes/). -Lydite tests use the independent change-selected and weekly cadence described +Lydite tests use the independent change-selected and daily cadence described below, including on Mergify queue draft PRs. The `Queue validation` merge condition requires the selected checks in `ci.yml` to pass; ordinary PR checks cannot satisfy it. The `ci:full` label opts a PR into the @@ -200,13 +200,19 @@ Job selection: Lydite has its own test cadence (`scripts/ci-lydite-changes.mjs`): - Lydite sources and fixtures run its core and bridge lanes. The core lane owns - the proof-engine Rust tests, editor and standalone Veryl conformance. -- Celox changes run only the bridge lane when Cargo's dependency graph reaches - `lydite-celox`. This includes replay and proof-backed Veryl/symbolic corpus - gates, which use the in-tree exporter. Upstream private tests and Markdown - do not trigger consumer checks. NAPI/JS changes do not reach Lydite. -- Shared dependency/toolchain configuration and an unreadable diff or dependency - graph run both lanes. The graph includes optional, build and dev edges. + the proof-engine Rust tests, editor and standalone Veryl conformance. The + bridge lane (`bridge` job) runs replay and proof-backed Veryl/symbolic corpus + gates against the in-tree Celox exporter in one job sharing a release build. +- The bridge takes about an hour of runner time, so Celox changes do not run it + on PRs or queue drafts even when Cargo's dependency graph reaches + `lydite-celox`. The daily and manual runs on `master` (scheduled) and + `develop` (dispatched by `nightly.yml`) enable every lane and report failures + in the issue "Lydite validation is failing on ", closed by the next + passing run. NAPI/JS changes, upstream private tests and Markdown do not + reach Lydite. +- Shared dependency/toolchain configuration runs the core lane; an unreadable + diff or dependency graph runs both lanes. The graph includes optional, build + and dev edges. - Ordinary `ci.yml` tests exclude `lydite*`, including daily and release runs; formatting/lint/build checks remain there. The dedicated workflow tests the selected Lydite packages, including doctests, and installs its solver. @@ -227,7 +233,7 @@ uses the finer behavior-based matrix above. | Daily at 02:17 UTC (11:17 JST) | `codspeed.yml` measures compile time on the default branch using CPU simulation. Execution failures and CodSpeed performance-check failures open or update a branch issue; the next healthy run closes it. Manual dispatch supports branch measurements. PRs, merge groups, and pushes do not run CodSpeed. | | Daily at 02:37 UTC (11:37 JST) | `heliodor-bench.yml` runs the complete master Linux suite on x86-64 and AArch64. Explicit manual selections retain focused suite runs and ARM64 profiling. PRs do not run this workflow; its tooling tests run in `Lint & Format` with the other script tests. | | Every full CI run | Run every shared Veryl and SystemVerilog case against both Verilator and Icarus, with locked Nix tools. Run the live adapter tests normally marked ignored because they need external tools. Preserve reports and per-case diagnostics as artifacts for 14 days, including on failure; matrix failures do not cancel the other comparisons. | -| Affected pull requests and merge groups; weekly Monday at 03:41 UTC (12:41 JST); on demand | `lydite.yml` owns Lydite Rust tests, proof, conformance, editor, and mutation gates. Unrelated changes skip these jobs. Weekly and manual runs enable all lanes. | +| Affected pull requests and merge groups; daily at 03:41 UTC (12:41 JST); on demand | `lydite.yml` owns Lydite Rust tests, proof, conformance, editor, and mutation gates. Unrelated changes skip these jobs, and Celox changes skip the bridge. Daily and manual runs enable all lanes and report failures in an issue. | | On demand | Dispatch `ci.yml` on the desired branch to run full CI and external comparisons, regardless of its diff. | | Pull requests that cut a release | A `master` pull request or legacy merge group whose diff changes `.release-please-manifest.json` (only the release pull request does there; syncing it into `develop` is not a release) runs full CI and the external comparisons. `Rust Test & NAPI Build` then requires the comparisons to pass, so a release cannot merge after only change-based checks. Daily and manual full runs do not gate on the comparisons; their failures reach the full CI issue below. A `master` pull request or legacy merge group whose diff cannot be determined is treated the same way. | diff --git a/lydite/docs/specifications.md b/lydite/docs/specifications.md index 56eccff59cd..9bee4393397 100644 --- a/lydite/docs/specifications.md +++ b/lydite/docs/specifications.md @@ -498,7 +498,7 @@ mutant and correct source under identical stimuli. An unreachable-only fault retains its induction countermodel but has no bounded reset failure and passes concrete reset traces. Failure controls also reject internal-state writes, malformed/stale witnesses, bad sampling/reset indices, and simulation divergence. -The mandatory `celox-replay` CI job uploads fresh evidence; `--record` is an +The `bridge` CI job uploads fresh replay evidence; `--record` is an explicit developer action for changing reviewed regressions and is never used by CI. diff --git a/scripts/ci-lydite-changes.mjs b/scripts/ci-lydite-changes.mjs index 3ca350fab53..1449692eeae 100644 --- a/scripts/ci-lydite-changes.mjs +++ b/scripts/ci-lydite-changes.mjs @@ -84,6 +84,20 @@ export function lyditeScope(files, packages) { return result; } +// Celox dependency changes reach the bridge, but its replay and proof corpus +// are too heavy for every Celox PR. PRs run the bridge only for Lydite-owned +// changes; daily runs cover Celox changes and report failures in an issue. +const ownsBridge = (path) => + ["lydite/", "crates/lydite", "scripts/ci-lydite-changes."].some((prefix) => + path.replace(/^\.\//, "").startsWith(prefix), + ) || path.replace(/^\.\//, "") === ".github/workflows/lydite.yml"; + +export function pullRequestScope(files, packages) { + const scope = lyditeScope(files, packages); + if (files === null) return scope; + return { ...scope, bridge: scope.bridge && files.some(ownsBridge) }; +} + if ( process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href @@ -93,7 +107,7 @@ if ( !["schedule", "workflow_dispatch"].includes(process.env.GITHUB_EVENT_NAME) ) { try { - scope = lyditeScope( + scope = pullRequestScope( changedFilesBetween(process.argv[2] ?? "", process.argv[3] ?? ""), readWorkspace(fileURLToPath(new URL("../", import.meta.url))), ); diff --git a/scripts/ci-lydite-changes.test.mjs b/scripts/ci-lydite-changes.test.mjs index c1f54076dbb..d2b59a3de8c 100644 --- a/scripts/ci-lydite-changes.test.mjs +++ b/scripts/ci-lydite-changes.test.mjs @@ -3,7 +3,7 @@ import { execFileSync } from "node:child_process"; import { readFileSync } from "node:fs"; import test from "node:test"; import { fileURLToPath } from "node:url"; -import { lyditeScope, isLydite } from "./ci-lydite-changes.mjs"; +import { lyditeScope, isLydite, pullRequestScope } from "./ci-lydite-changes.mjs"; import { celoxRustTestScope } from "./ci-changes.mjs"; import { readWorkspace } from "./ci-rust-scope.mjs"; const root = fileURLToPath(new URL("../", import.meta.url)); @@ -64,6 +64,26 @@ test("unrelated consumers and upstream private tests do not select Lydite", () = ); }); +test("PRs run the bridge only for Lydite-owned changes", () => { + const pr = (...files) => pullRequestScope(files, packages); + for (const path of [ + "crates/celox/src/lib.rs", + "crates/celox-test-suite/src/veryl/cases/flip_flop.vtest", + ]) + assert.deepEqual(pr(path), neither, path); + for (const path of ["Cargo.lock", "rust-toolchain.toml", ".github/workflows/ci.yml"]) + assert.deepEqual(pr(path), { core: true, bridge: false }, path); + for (const path of [ + "crates/lydite-celox/src/lib.rs", + "crates/lydite/src/main.rs", + "lydite/conformance/veryl-proof/case-exceptions.json", + ".github/workflows/lydite.yml", + "scripts/ci-lydite-changes.mjs", + ]) + assert.equal(pr(path).bridge, true, path); + assert.deepEqual(pullRequestScope(null, packages), both); +}); + test("dependency selection follows new transitive edges automatically", () => { const graph = [ { name: "lydite", dir: "crates/lydite", dependencies: [] }, @@ -96,7 +116,7 @@ test("Celox packages do not consume the excluded Lydite packages", () => { } }); -test("weekly, manual and unknown-diff invocations run every lane", () => { +test("daily, manual and unknown-diff invocations run every lane", () => { for (const event of ["schedule", "workflow_dispatch", "merge_group"]) { const output = execFileSync( process.execPath, @@ -124,14 +144,13 @@ test("workflows transfer Rust tests and gate each Lydite lane", () => { const workflow = readFileSync(`${root}.github/workflows/lydite.yml`, "utf8"); assert.match( workflow, - /pull_request:\n merge_group:\n schedule:\n - cron: "41 3 \* \* 1"/, + /pull_request:\n merge_group:\n schedule:\n - cron: "41 3 \* \* \*"/, ); for (const [job, lane] of [ ["documentation", "core"], ["editor", "core"], ["veryl-fv", "core"], - ["celox-replay", "bridge"], - ["veryl-proof-corpus", "bridge"], + ["bridge", "bridge"], ]) { assert.ok( workflow.includes( @@ -141,6 +160,10 @@ test("workflows transfer Rust tests and gate each Lydite lane", () => { ); } assert.match(workflow, /cargo test --locked "\$\{args\[@\]\}"/); + assert.match( + workflow, + / report:\n name: Report Lydite validation\n[\s\S]*REPORT_NAME: Lydite validation\n run: node scripts\/report-full-ci\.mjs/, + ); // Execute the actual required-check script for all selected/skipped combinations. const script = workflow .split(" python3 - <<'PYCODE'\n")[1] @@ -159,8 +182,7 @@ test("workflows transfer Rust tests and gate each Lydite lane", () => { ["documentation", core], ["editor", core], ["veryl-fv", core], - ["celox-replay", bridge], - ["veryl-proof-corpus", bridge], + ["bridge", bridge], ]) needs[job] = { result: selected ? "success" : "skipped" }; const run = () => diff --git a/scripts/report-full-ci.mjs b/scripts/report-full-ci.mjs index 003adee92e7..b68993d2a9d 100644 --- a/scripts/report-full-ci.mjs +++ b/scripts/report-full-ci.mjs @@ -149,6 +149,7 @@ if ( branch: process.env.BRANCH, sha: process.env.SHA, runUrl: process.env.RUN_URL, + name: process.env.REPORT_NAME || undefined, }); } catch (error) { console.error(error.message); From b280ce46e26f0f80131b0abab83b17bd6226e465 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 16 Oct 2026 22:49:01 +0000 Subject: [PATCH 3/3] fix(deps): update rust crate wasm-encoder to 0.262 --- Cargo.lock | 14 +++++++------- crates/celox-backend-wasm/Cargo.toml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 53ff84aee25..4ca20c86ed5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -512,7 +512,7 @@ dependencies = [ "celox-state-layout", "fxhash", "num-bigint", - "wasm-encoder 0.261.0", + "wasm-encoder 0.262.0", "wasmtime", ] @@ -963,7 +963,7 @@ checksum = "af491d569909a7e4dee0ad7db7f5341fef5c614d5b8ec8cf765732aba3cff681" dependencies = [ "serde", "termcolor", - "unicode-width 0.1.14", + "unicode-width 0.2.2", ] [[package]] @@ -4740,12 +4740,12 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.261.0" +version = "0.262.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2608e8bb6d67fd68f5a8d0eb1363d6e7bcbc1f8ded5a0bd3a1e382462b876b22" +checksum = "4495a6f85dd94c411c749303efcbc5defade0b0cbdbc0541495241ab917a9b5a" dependencies = [ "leb128fmt", - "wasmparser 0.261.0", + "wasmparser 0.262.0", ] [[package]] @@ -4786,9 +4786,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.261.0" +version = "0.262.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f20f20e44f7e8aeb6744823ea9d869ede51e51be4fdaedede2852282e54d2d8" +checksum = "974d643b125b272607e2fff8012ea14a8328acd7621e4bafa7afb32500052b1b" dependencies = [ "bitflags 2.13.0", "indexmap", diff --git a/crates/celox-backend-wasm/Cargo.toml b/crates/celox-backend-wasm/Cargo.toml index 07908286898..0631000c68d 100644 --- a/crates/celox-backend-wasm/Cargo.toml +++ b/crates/celox-backend-wasm/Cargo.toml @@ -14,7 +14,7 @@ celox-design = { workspace = true } celox-sir = { workspace = true } celox-state-layout = { workspace = true } fxhash = { workspace = true } -wasm-encoder = "0.261" +wasm-encoder = "0.262" [dev-dependencies] celox-backend-cranelift = { workspace = true }