From a49828bb986215365c0bbe2c3e2bf7b59701c35d Mon Sep 17 00:00:00 2001 From: tignear Date: Sun, 25 Oct 2026 04:28:49 +0900 Subject: [PATCH] ci: remove Lydite bridge from routine validation Change-Id: Id8090c5cbb732e2b632d7d0acb1cec6fe918ff2c --- .github/workflows/ci.yml | 4 +- .github/workflows/lydite-checks.yml | 112 +++------------------------ .github/workflows/nightly.yml | 5 +- .github/workflows/publish-crates.yml | 2 +- .github/workflows/rust-cache.yml | 2 +- CONTRIBUTING.md | 29 ++++--- lefthook.yml | 2 +- lydite/conformance/veryl/run_ci.sh | 2 +- scripts/ci-changes.mjs | 7 +- scripts/ci-changes.test.mjs | 10 +++ scripts/ci-lydite-changes.mjs | 25 ++---- scripts/ci-lydite-changes.test.mjs | 86 ++++++++++---------- scripts/ci-workflow.test.mjs | 6 +- 13 files changed, 94 insertions(+), 198 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a77cd3fe13a..7a7a4bb0e31 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -149,7 +149,7 @@ jobs: - name: cargo clippy if: (needs.changes.result != 'success' || needs.changes.outputs.rust == 'true') && needs.changes.outputs.rust_full != 'false' - run: cargo clippy --locked --workspace --all-targets --features celox/systemverilog,celox-test-suite/verilator,celox-test-suite/icarus --no-deps + run: cargo clippy --locked --workspace --exclude lydite-celox --all-targets --features celox/systemverilog,celox-test-suite/verilator,celox-test-suite/icarus --no-deps - name: Lint the crates this pull request can affect if: needs.changes.outputs.rust_full == 'false' && needs.changes.outputs.rust_lint_packages != '' @@ -162,7 +162,7 @@ jobs: if: (needs.changes.result != 'success' || needs.changes.outputs.rust == 'true') && needs.changes.outputs.rust_full != 'false' env: RUSTDOCFLAGS: -D warnings - run: cargo doc --locked --workspace --no-deps + run: cargo doc --locked --workspace --exclude lydite-celox --no-deps - name: Build the API documentation this pull request can affect if: needs.changes.outputs.rust_full == 'false' && needs.changes.outputs.rust_doc_libraries != '' diff --git a/.github/workflows/lydite-checks.yml b/.github/workflows/lydite-checks.yml index 92dff0e5283..1176b2834bc 100644 --- a/.github/workflows/lydite-checks.yml +++ b/.github/workflows/lydite-checks.yml @@ -5,8 +5,7 @@ name: Lydite # linted by ci.yml; this workflow owns Lydite tests and conformance gates. on: - # 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. + # Only Lydite core gates run here. Celox bridge/proof replay is disabled. pull_request: merge_group: schedule: @@ -37,7 +36,6 @@ jobs: runs-on: ubuntu-26.04 outputs: core: ${{ steps.scope.outputs.core }} - bridge: ${{ steps.scope.outputs.bridge }} defaults: run: working-directory: . @@ -57,7 +55,7 @@ jobs: rust: timeout-minutes: 30 needs: changes - if: always() && (needs.changes.result != 'success' || needs.changes.outputs.core == 'true' || needs.changes.outputs.bridge == 'true') + if: always() && (needs.changes.result != 'success' || needs.changes.outputs.core == 'true') runs-on: ubuntu-26.04 steps: - uses: actions/checkout@v7 @@ -72,21 +70,10 @@ jobs: - name: Install recorded solver version run: python -m pip install z3-solver==5.1.0 - name: Test affected Lydite packages and documentation - env: - CORE: ${{ needs.changes.outputs.core }} - BRIDGE: ${{ needs.changes.outputs.bridge }} - DETECTION: ${{ needs.changes.result }} run: | - args=() - if [ "$DETECTION" != success ] || [ "$CORE" = true ]; then - args+=(-p lydite -p lydite-ir -p lydite-solver -p lydite-syntax -p lydite-verify) - fi - if [ "$DETECTION" != success ] || [ "$BRIDGE" = true ]; then - args+=(-p lydite-celox) - fi Z3_BIN="$(command -v z3)" export Z3_BIN - cargo test --locked "${args[@]}" + cargo test --locked -p lydite -p lydite-ir -p lydite-solver -p lydite-syntax -p lydite-verify documentation: needs: changes @@ -110,7 +97,7 @@ jobs: persist-credentials: false - uses: ./.github/actions/setup-rust - name: Build the isolated editor worker - run: cargo build --release --locked --bin lydite-editor + run: cargo build --release --locked -p lydite --bin lydite-editor - name: Check bounded responses and reject deadlock and dropped-request mutants run: | cargo test --release --locked -p lydite --test responses --bin lydite-editor @@ -160,88 +147,9 @@ jobs: if-no-files-found: error retention-days: 14 - # 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 replay and the sequential proof/mutation gates. - timeout-minutes: 150 - 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 - - # 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 - python3 -m audit.guarded_expansion.ci --checker ../target/release/lydite --expected-checker-sha256 "$(sha256sum ../target/release/lydite | cut -d' ' -f1)" --out "$RUNNER_TEMP/guarded-expansion" - - name: Upload proof and diagnostic evidence - if: always() - uses: actions/upload-artifact@v7 - with: - name: veryl-proof-${{ github.run_id }}-${{ github.run_attempt }} - path: | - ${{ runner.temp }}/veryl-proof/ - ${{ runner.temp }}/veryl-symbolic/ - ${{ runner.temp }}/selected-rv32i/ - ${{ runner.temp }}/automatic-proof/ - ${{ runner.temp }}/equality-sharing/ - ${{ runner.temp }}/word-frontier/ - ${{ runner.temp }}/guarded-expansion/ - ${{ runner.temp }}/lemma-candidates/ - if-no-files-found: error - retention-days: 14 - result: name: Lydite checks - needs: [changes, rust, documentation, editor, veryl-fv, bridge] + needs: [changes, rust, documentation, editor, veryl-fv] if: always() runs-on: ubuntu-26.04 defaults: @@ -256,17 +164,17 @@ jobs: import json, os 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", "veryl-fv": "core", "bridge": "bridge"}.items(): + assert needs["changes"]["outputs"].get("core") in ("true", "false"), needs + for job in ("rust", "documentation", "editor", "veryl-fv"): outputs = needs["changes"]["outputs"] - selected = outputs.get(lane) == "true" if lane else any(outputs.get(key) == "true" for key in ("core", "bridge")) + selected = outputs.get("core") == "true" 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 daily/manual core runs. report: name: Report Lydite validation - needs: [changes, rust, documentation, editor, veryl-fv, bridge, result] + needs: [changes, rust, documentation, editor, veryl-fv, 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: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index bcc5e607f1e..58c3878c615 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -21,15 +21,14 @@ jobs: - name: Dispatch full CI on develop run: gh workflow run ci.yml --repo "$GITHUB_REPOSITORY" --ref develop - # lydite-checks.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. + # Lydite core validation also runs on develop; bridge gates are disabled. 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 + - name: Dispatch Lydite core validation on develop run: gh workflow run lydite-checks.yml --repo "$GITHUB_REPOSITORY" --ref develop # heliodor-bench.yml schedules the stable master lane directly. Dispatch the diff --git a/.github/workflows/publish-crates.yml b/.github/workflows/publish-crates.yml index adf6c1559f0..1854ecf87d2 100644 --- a/.github/workflows/publish-crates.yml +++ b/.github/workflows/publish-crates.yml @@ -107,7 +107,7 @@ jobs: - name: Build Rust API documentation env: RUSTDOCFLAGS: -D warnings - run: cargo doc --locked --workspace --no-deps + run: cargo doc --locked --workspace --exclude lydite-celox --no-deps publish: name: Publish to crates.io diff --git a/.github/workflows/rust-cache.yml b/.github/workflows/rust-cache.yml index b7113223635..c060a78f9ec 100644 --- a/.github/workflows/rust-cache.yml +++ b/.github/workflows/rust-cache.yml @@ -53,6 +53,6 @@ jobs: - name: Build test targets to populate dependencies if: steps.cache.outputs.cache-hit != 'true' run: >- - cargo nextest list --locked --workspace --message-format json + cargo nextest list --locked --workspace --exclude 'lydite*' --message-format json --features celox/systemverilog,celox-test-suite/verilator,celox-test-suite/icarus,celox-test-suite/runtime-cases > /dev/null diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b178404a8a2..1155a636b03 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -281,32 +281,31 @@ 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. 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. +- Lydite core sources and fixtures select proof-engine Rust tests, editor and + standalone Veryl conformance. Celox bridge/replay/proof-corpus CI is disabled + for PRs, merge queues, scheduled runs and manual workflow dispatches. + `lydite-celox` remains available for explicit local development, but normal + CI does not build, lint, document or test it. The routine pre-push Cargo + check also excludes it. +- Daily and manual core runs on `master` and `develop` report failures in the + issue "Lydite validation is failing on ". Celox and bridge-crate + changes do not select core gates. - Version-only Release Please diffs, including their queue drafts, skip Lydite. - PR workflows come from the PR's merge ref, so branches based on an older base still carry the earlier `lydite.yml`, which selected every lane. That workflow file stays disabled in repository settings; `lydite-checks.yml` replaces it. Re-enable nothing under the old path. - Shared dependency/toolchain configuration runs the core lane; an unreadable - diff or dependency graph runs both lanes. The graph includes optional, build + diff or dependency graph runs the core lane. The graph includes optional, build and dev edges. A `Cargo.lock` diff selects a lane only when a changed lock entry is in that lane's lockfile dependency closure, so adding a dependency to a Celox crate does not run Lydite. The Nix flake and `ci.yml` do not select Lydite; its jobs use neither. Celox's `conformance/sv-tests/` corpus also skips Lydite; Lydite's fixtures live under `lydite/conformance/`. - 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. + lint and API documentation also exclude `lydite-celox`. The dedicated + workflow tests only core Lydite packages, including doctests, and installs + its solver. Cache warming excludes `lydite*`. - `Lydite checks` accepts skipped lanes only when change detection explicitly excludes them, and fails on selected-job failures or cancellations. Repository branch protection must require this check to make it a merge gate. @@ -360,7 +359,7 @@ Local validation uses the behavior-based matrix above. | 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 daily/manual full CI run | Run the pinned upstream `common_cells` Gray code SV TB through `celox run --project`, plus an assertion negative control. Logs are retained for 14 days and failures feed the Full CI issue. See [the reproduction instructions](conformance/common-cells/README.md). | | 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; daily at 03:41 UTC (12:41 JST); on demand | `lydite-checks.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. | +| Affected pull requests and merge groups; daily at 03:41 UTC (12:41 JST); on demand | `lydite-checks.yml` owns Lydite Rust tests, proof, conformance, editor, and mutation gates. Unrelated changes skip these jobs. Bridge gates are disabled; daily and manual runs enable only core 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/lefthook.yml b/lefthook.yml index 74fa538bb1c..7f7af4133f7 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -18,4 +18,4 @@ pre-push: # builds, and documentation builds remain required in GitHub Actions. cargo-check: priority: 3 - run: cargo check --workspace --locked + run: cargo check --workspace --exclude lydite-celox --locked diff --git a/lydite/conformance/veryl/run_ci.sh b/lydite/conformance/veryl/run_ci.sh index 4847d8816f4..ba832516268 100755 --- a/lydite/conformance/veryl/run_ci.sh +++ b/lydite/conformance/veryl/run_ci.sh @@ -60,7 +60,7 @@ PY cd "$HERE" python3 generate.py # --locked forbids resolving newer dependencies. These are independent workspaces. -cargo build --release --locked --manifest-path "$REPO/../Cargo.toml" -p lydite-ir -p lydite -p lydite-celox -p lydite-solver -p lydite-syntax -p lydite-verify +cargo build --release --locked --manifest-path "$REPO/../Cargo.toml" -p lydite-ir -p lydite -p lydite-solver -p lydite-syntax -p lydite-verify cargo build --locked --manifest-path analyzer-probe/Cargo.toml --target-dir "$HERE/analyzer-probe/target" cargo build --locked --manifest-path Cargo.toml --target-dir "$HERE/target" -p extract-suite export LYDITE_BIN="$REPO/../target/release/lydite" diff --git a/scripts/ci-changes.mjs b/scripts/ci-changes.mjs index 3defbd38d10..a97b9d17302 100644 --- a/scripts/ci-changes.mjs +++ b/scripts/ci-changes.mjs @@ -305,7 +305,7 @@ if ( }); } -// Lydite tests are selected independently by lydite-checks.yml, including its bridge. +// Lydite core tests run independently; bridge CI is disabled. export function celoxRustTestScope(files, packages) { return rustTestScope( files.filter((path) => !/^(?:\.\/)?(?:lydite\/|crates\/lydite(?:-|\/))/.test(path)), @@ -324,7 +324,10 @@ export function rustScopeOutputs(files) { const packages = readWorkspace(root); scope = celoxRustTestScope(files, packages); // Lydite owns its tests, but lint and API documentation still live here. - checks = rustTestScope(files, packages); + checks = rustTestScope( + files.filter((path) => !/^(?:\.\/)?crates\/lydite-celox\//.test(path)), + packages.filter((pkg) => pkg.name !== "lydite-celox"), + ); } catch (error) { console.warn(`Unable to scope the Rust tests: ${error.message}`); } diff --git a/scripts/ci-changes.test.mjs b/scripts/ci-changes.test.mjs index d00b604c03a..7d2b80e76b2 100644 --- a/scripts/ci-changes.test.mjs +++ b/scripts/ci-changes.test.mjs @@ -597,3 +597,13 @@ test("VPI test-only edits do not select the unrelated ignored cocotb end-to-end assert.equal(rustScopeOutputs([path]).rust_vpi_e2e, true); assert.equal(rustScopeOutputs(null).rust_vpi_e2e, true); }); + + +test("disabled bridge is absent from every scoped test, lint and documentation plan", () => { + for (const path of ["crates/lydite-celox/src/lib.rs", "crates/celox/src/lib.rs", "crates/lydite-ir/src/lib.rs"]) { + const scope = rustScopeOutputs([path]); + assert.equal(scope.rust_full, false, path); + for (const key of ["rust_packages", "rust_libraries", "rust_lint_packages", "rust_doc_libraries", "rust_builds", "rust_lint_builds"]) + assert.ok(!scope[key].includes("lydite-celox"), `${path}: ${key}`); + } +}); diff --git a/scripts/ci-lydite-changes.mjs b/scripts/ci-lydite-changes.mjs index 8dec327c801..bc870e24ac2 100644 --- a/scripts/ci-lydite-changes.mjs +++ b/scripts/ci-lydite-changes.mjs @@ -6,7 +6,7 @@ import { changedFilesBetween, readWorkspace } from "./ci-rust-scope.mjs"; export const isLydite = (name) => name === "lydite" || name.startsWith("lydite-"); -const all = () => ({ core: true, bridge: true }); +const all = () => ({ core: true }); // Cargo.lock's `[[package]]` entries, keyed by "name version", with the names // each one depends on. @@ -40,7 +40,7 @@ export function lockChanges(baseText, headText) { // Follow actual Cargo edges, including optional, build and dev dependencies. // Celox consumes none of the proof engine; only lydite-celox consumes Celox. -// `lock` is lockChanges() of the diff; without it a Cargo.lock edit runs both. +// `lock` is lockChanges() of the diff; without it a Cargo.lock edit runs core checks. export function lyditeScope(files, packages, lock = null) { if (files === null) return all(); const byName = new Map(packages.map((pkg) => [pkg.name, pkg])); @@ -61,8 +61,7 @@ export function lyditeScope(files, packages, lock = null) { .filter((p) => isLydite(p.name) && p.name !== "lydite-celox") .map((p) => p.name); const core = closure(coreRoots); - const bridge = closure(["lydite-celox"]); - const result = { core: false, bridge: false }; + const result = { core: false }; const owners = [...packages].sort((a, b) => b.dir.length - a.dir.length); for (const raw of files) { const path = raw.replace(/^\.\//, ""); @@ -75,7 +74,6 @@ export function lyditeScope(files, packages, lock = null) { return [...lock.changed].some((name) => seen.has(name)); }; result.core ||= reaches(coreRoots); - result.bridge ||= reaches(["lydite-celox"]); continue; } if ( @@ -111,7 +109,6 @@ export function lyditeScope(files, packages, lock = null) { ) continue; result.core ||= core.has(owner.name); - result.bridge ||= bridge.has(owner.name); } else if ( ["crates/", "vendor/", "testdata/", "conformance/"].some((prefix) => path.startsWith(prefix), @@ -125,21 +122,9 @@ export function lyditeScope(files, packages, lock = null) { 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 -// sources; daily runs cover Celox and CI changes and report failures. -const ownsBridge = (path) => - ["lydite/", "crates/lydite"].some((prefix) => - path.replace(/^\.\//, "").startsWith(prefix), - ); - export function pullRequestScope(files, packages, lock = null) { - // Release PRs and their queue drafts only bump versions. - if (files !== null && isVersionOnlyRelease(files)) - return { core: false, bridge: false }; - const scope = lyditeScope(files, packages, lock); - if (files === null) return scope; - return { ...scope, bridge: scope.bridge && files.some(ownsBridge) }; + if (files !== null && isVersionOnlyRelease(files)) return { core: false }; + return lyditeScope(files, packages, lock); } // The lockfile at the merge base and at head, as changedFilesBetween compares. diff --git a/scripts/ci-lydite-changes.test.mjs b/scripts/ci-lydite-changes.test.mjs index b745af57b4a..fac8fdc01e6 100644 --- a/scripts/ci-lydite-changes.test.mjs +++ b/scripts/ci-lydite-changes.test.mjs @@ -14,10 +14,10 @@ import { readWorkspace } from "./ci-rust-scope.mjs"; const root = fileURLToPath(new URL("../", import.meta.url)); const packages = readWorkspace(root); const scope = (...files) => lyditeScope(files, packages); -const both = { core: true, bridge: true }; -const neither = { core: false, bridge: false }; +const coreOnly = { core: true }; +const neither = { core: false }; -test("Lydite core changes and shared configuration run both lanes", () => { +test("Lydite core changes and shared configuration run core checks", () => { for (const path of [ "crates/lydite/src/main.rs", "crates/lydite-ir/src/lib.rs", @@ -31,11 +31,11 @@ test("Lydite core changes and shared configuration run both lanes", () => { "crates/new/src/lib.rs", "conformance/new/case.sv", ]) - assert.deepEqual(scope(path), both, path); - assert.deepEqual(lyditeScope(null, packages), both); + assert.deepEqual(scope(path), coreOnly, path); + assert.deepEqual(lyditeScope(null, packages), coreOnly); }); -test("Celox dependencies select the bridge, without rerunning the editor/core", () => { +test("Celox and bridge changes do not select core checks", () => { for (const name of [ "celox", "celox-design", @@ -47,7 +47,7 @@ test("Celox dependencies select the bridge, without rerunning the editor/core", ]) assert.deepEqual( scope(`crates/${name}/src/lib.rs`), - { core: false, bridge: true }, + { core: false }, name, ); }); @@ -69,31 +69,14 @@ test("unrelated consumers and upstream private tests do not select Lydite", () = assert.deepEqual(scope(), neither); assert.deepEqual( scope("packages/celox/src/index.ts", "crates/lydite/src/main.rs"), - both, + coreOnly, ); }); -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/lydite-checks.yml", - "scripts/ci-lydite-changes.mjs", - ]) - 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", - ]) - assert.equal(pr(path).bridge, true, path); - assert.deepEqual(pullRequestScope(null, packages), both); +test("bridge-only PRs do not select core gates", () => { + assert.deepEqual(pullRequestScope(["crates/lydite-celox/src/lib.rs"], packages), neither); + assert.deepEqual(pullRequestScope(["crates/lydite/src/main.rs"], packages), coreOnly); + assert.deepEqual(pullRequestScope(null, packages), coreOnly); }); test("Celox sv-tests changes skip Lydite without masking other changes", () => { @@ -116,12 +99,12 @@ test("Celox sv-tests changes skip Lydite without masking other changes", () => { "crates/lydite/src/main.rs", "lydite/conformance/veryl/run_ci.sh", ]) { - assert.deepEqual(pullRequestScope([...files, path], packages), both, path); - assert.deepEqual(pullRequestScope([path, ...files], packages), both, path); + assert.deepEqual(pullRequestScope([...files, path], packages), coreOnly, path); + assert.deepEqual(pullRequestScope([path, ...files], packages), coreOnly, path); } assert.deepEqual( pullRequestScope([...files, "conformance/unknown/case.sv"], packages), - { core: true, bridge: false }, + { core: true }, ); }); @@ -146,14 +129,13 @@ test("Cargo.lock edits select only the lanes that reach the changed entries", () ); assert.deepEqual(pr(edit("serde_json", "dependencies = [", "dependencies = [\n \"new\",")), { core: true, - bridge: false, }); assert.deepEqual( lyditeScope(["Cargo.lock"], packages, edit("celox", "dependencies = [", "dependencies = [\n \"new\",")), - { core: false, bridge: true }, + { core: false }, ); assert.deepEqual(pr(lockChanges(lockfile, lockfile)), neither); - assert.deepEqual(pr(null), { core: true, bridge: false }); + assert.deepEqual(pr(null), { core: true }); }); test("version-only release PRs skip Lydite", () => { @@ -171,10 +153,9 @@ test("version-only release PRs skip Lydite", () => { // Without the release manifest, Cargo changes are ordinary dependency edits. assert.deepEqual(pullRequestScope(release.slice(1), packages), { core: true, - bridge: false, }); assert.equal( - pullRequestScope([...release, "crates/lydite/src/main.rs"], packages).bridge, + pullRequestScope([...release, "crates/lydite/src/main.rs"], packages).core, true, ); }); @@ -196,10 +177,9 @@ test("dependency selection follows new transitive edges automatically", () => { ]; assert.deepEqual(lyditeScope(["crates/new-runtime/src/lib.rs"], graph), { core: false, - bridge: true, }); graph[0].dependencies.push("new-runtime"); - assert.deepEqual(lyditeScope(["crates/new-runtime/src/lib.rs"], graph), both); + assert.deepEqual(lyditeScope(["crates/new-runtime/src/lib.rs"], graph), coreOnly); }); test("Celox packages do not consume the excluded Lydite packages", () => { @@ -211,7 +191,7 @@ test("Celox packages do not consume the excluded Lydite packages", () => { } }); -test("daily, manual and unknown-diff invocations run every lane", () => { +test("daily, manual and unknown-diff invocations run only core gates", () => { for (const event of ["schedule", "workflow_dispatch", "merge_group"]) { const output = execFileSync( process.execPath, @@ -222,7 +202,7 @@ test("daily, manual and unknown-diff invocations run every lane", () => { encoding: "utf8", }, ); - assert.match(output, /core=true\nbridge=true/); + assert.match(output, /^core=true\n$/); } }); @@ -245,7 +225,6 @@ test("workflows transfer Rust tests and gate each Lydite lane", () => { ["documentation", "core"], ["editor", "core"], ["veryl-fv", "core"], - ["bridge", "bridge"], ]) { assert.ok( workflow.includes( @@ -254,7 +233,8 @@ test("workflows transfer Rust tests and gate each Lydite lane", () => { job, ); } - assert.match(workflow, /cargo test --locked "\$\{args\[@\]\}"/); + assert.match(workflow, /cargo test --locked -p lydite -p lydite-ir -p lydite-solver -p lydite-syntax -p lydite-verify/); + assert.doesNotMatch(workflow, / bridge:|outputs\.bridge|-p lydite-celox|conformance\/(axi4lite|veryl-proof|veryl-symbolic)/); assert.match( workflow, / report:\n name: Report Lydite validation\n[\s\S]*REPORT_NAME: Lydite validation\n run: node scripts\/report-full-ci\.mjs/, @@ -265,19 +245,18 @@ test("workflows transfer Rust tests and gate each Lydite lane", () => { .split(" PYCODE")[0] .replace(/^ /gm, ""); for (const core of [false, true]) - for (const bridge of [false, true]) { + { const needs = { changes: { result: "success", - outputs: { core: String(core), bridge: String(bridge) }, + outputs: { core: String(core) }, }, }; for (const [job, selected] of [ - ["rust", core || bridge], + ["rust", core], ["documentation", core], ["editor", core], ["veryl-fv", core], - ["bridge", bridge], ]) needs[job] = { result: selected ? "success" : "skipped" }; const run = () => @@ -315,3 +294,16 @@ test("scoped Celox PR tests also exclude the bridge and Lydite fixtures", () => assert.deepEqual(result.packages, []); } }); + + +test("normal CI and standalone core conformance never build the bridge", () => { + for (const pkg of packages.filter(p => p.name !== "lydite-celox")) + assert.ok(!pkg.dependencies.includes("lydite-celox"), pkg.name); + for (const path of [".github/workflows/ci.yml", ".github/workflows/publish-crates.yml"]) + assert.match(readFileSync(`${root}${path}`, "utf8"), /cargo doc --locked --workspace --exclude lydite-celox --no-deps/); + assert.match(readFileSync(`${root}.github/workflows/rust-cache.yml`, "utf8"), /cargo nextest list --locked --workspace --exclude 'lydite\*'/); + assert.match(readFileSync(`${root}lefthook.yml`, "utf8"), /cargo check --workspace --exclude lydite-celox --locked/); + const coreGate = readFileSync(`${root}lydite/conformance/veryl/run_ci.sh`, "utf8"); + assert.doesNotMatch(coreGate, /lydite-celox/); + assert.match(coreGate, /-p lydite-ir -p lydite -p lydite-solver -p lydite-syntax -p lydite-verify/); +}); diff --git a/scripts/ci-workflow.test.mjs b/scripts/ci-workflow.test.mjs index ed9ff3e9e7c..5eb9b86789d 100644 --- a/scripts/ci-workflow.test.mjs +++ b/scripts/ci-workflow.test.mjs @@ -389,7 +389,7 @@ test("cache warming shares the Rust Tests key and builds without running tests", assert.match(warm, /"scripts\/run-vtest.mjs"/); assert.match( warm, - /cargo nextest list --locked --workspace --message-format json/, + /cargo nextest list --locked --workspace --exclude 'lydite\*' --message-format json/, ); const features = job("rust-tests").match(/--features (\S+)/)[1]; assert.ok(warm.includes(`--features ${features}`)); @@ -501,8 +501,8 @@ test("cocotb retains Celox features without enabling unrelated adapter features" assert.match(job("rust-tests"), /name: Run cocotb VPI end-to-end test\n if: needs.changes.outputs.rust_vpi_e2e != 'false'/); }); -test("full Clippy validation covers every workspace crate", () => { - assert.match(job("lint"), /run: cargo clippy --locked --workspace --all-targets --features/); +test("full Clippy validation excludes the disabled bridge", () => { + assert.match(job("lint"), /run: cargo clippy --locked --workspace --exclude lydite-celox --all-targets --features/); }); test("upstream SV TB runs on full CI and feeds failure reporting", () => {