Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions scripts/ci-lydite-changes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include rename source paths before skipping sv-tests

When a PR renames a Lydite-owned or unknown conformance file into conformance/sv-tests/, changedFilesBetween() uses git diff --name-only, which reports only the destination path for a detected rename. This early continue then returns no affected lanes even though the original Lydite source was removed, so the required core/bridge validation is skipped. Include both sides of renames (or disable rename detection) before applying this exclusion.

Useful? React with 👍 / 👎.

if (path === "Cargo.lock" && lock !== null) {
const reaches = (roots) => {
const seen = closure(roots, (name) => lock.graph.get(name));
Expand Down
30 changes: 30 additions & 0 deletions scripts/ci-lydite-changes.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) => {
Expand Down
Loading