diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8d0588f704a..8feff76b85a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -233,7 +233,8 @@ Lydite has its own test cadence (`scripts/ci-lydite-changes.mjs`): 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. + 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. diff --git a/scripts/ci-lydite-changes.mjs b/scripts/ci-lydite-changes.mjs index 21a0170f84c..8dec327c801 100644 --- a/scripts/ci-lydite-changes.mjs +++ b/scripts/ci-lydite-changes.mjs @@ -66,6 +66,9 @@ export function lyditeScope(files, packages, lock = null) { const owners = [...packages].sort((a, b) => b.dir.length - a.dir.length); for (const raw of files) { const path = raw.replace(/^\.\//, ""); + // Celox's SystemVerilog corpus is independent of Lydite's gates, whose + // fixtures live under lydite/conformance/. + if (path.startsWith("conformance/sv-tests/")) continue; if (path === "Cargo.lock" && lock !== null) { const reaches = (roots) => { const seen = closure(roots, (name) => lock.graph.get(name)); diff --git a/scripts/ci-lydite-changes.test.mjs b/scripts/ci-lydite-changes.test.mjs index 336a9f21005..b745af57b4a 100644 --- a/scripts/ci-lydite-changes.test.mjs +++ b/scripts/ci-lydite-changes.test.mjs @@ -29,6 +29,7 @@ test("Lydite core changes and shared configuration run both lanes", () => { "scripts/ci-lydite-changes.mjs", "vendor/new/src/lib.rs", "crates/new/src/lib.rs", + "conformance/new/case.sv", ]) assert.deepEqual(scope(path), both, path); assert.deepEqual(lyditeScope(null, packages), both); @@ -95,6 +96,35 @@ test("PRs run the bridge only for Lydite-owned changes", () => { assert.deepEqual(pullRequestScope(null, packages), both); }); +test("Celox sv-tests changes skip Lydite without masking other changes", () => { + const files = [ + ".github/workflows/ci.yml", + "conformance/sv-tests/README.md", + "conformance/sv-tests/expected.tsv", + "crates/celox/examples/sv_tests.rs", + ]; + for (const path of [ + ...files, + "conformance/sv-tests/revision", + "./conformance/sv-tests/expected.tsv", + ]) { + assert.deepEqual(scope(path), neither, path); + assert.deepEqual(pullRequestScope([path], packages), neither, path); + } + assert.deepEqual(pullRequestScope(files, packages), neither); + for (const path of [ + "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, "conformance/unknown/case.sv"], packages), + { core: true, bridge: false }, + ); +}); + test("Cargo.lock edits select only the lanes that reach the changed entries", () => { const lockfile = readFileSync(`${root}Cargo.lock`, "utf8"); const edit = (name, from, to) => {