From c22647714023daa340e4407fca36689db6e737ea Mon Sep 17 00:00:00 2001 From: tignear Date: Sat, 17 Oct 2026 09:23:18 +0900 Subject: [PATCH 1/2] feat(sv): know every system task and function IEEE 1800-2023 names Add $stacktrace (20.17.2), $global_clock (14.14), $inferred_clock and $inferred_disable (16.14.7), $sdf_annotate (32.9) and the optional names of Annex D to the catalog as unsupported, so a call of one is reported as unsupported by name instead of as an unknown name. Correct the catalog's clause numbers from 20.11 on to the 2023 numbering. --- .../celox-sv-analyzer/src/system_functions.rs | 62 ++++++++++++++----- .../systemverilog/system_functions.rs | 8 +++ docs/guide/systemverilog.md | 4 +- docs/ja/guide/systemverilog.md | 4 +- 4 files changed, 60 insertions(+), 18 deletions(-) diff --git a/crates/celox-sv-analyzer/src/system_functions.rs b/crates/celox-sv-analyzer/src/system_functions.rs index 4f675690537..11bdd0b0a9e 100644 --- a/crates/celox-sv-analyzer/src/system_functions.rs +++ b/crates/celox-sv-analyzer/src/system_functions.rs @@ -1,5 +1,6 @@ -//! The system tasks and functions Celox knows (IEEE 1800-2023 clauses 20 and -//! 21), and where the SystemVerilog frontend supports each one. +//! The system tasks and functions Celox knows (those IEEE 1800-2023 defines, +//! mostly in clauses 20 and 21, and the optional ones of its Annex D), and +//! where the SystemVerilog frontend supports each one. //! //! The analyzer checks each call against this catalog where it converts the //! call, with the context it converts it in ([`CallSite`]), so a name the @@ -49,7 +50,7 @@ pub enum SystemFunction { Onehot0, /// `$isunknown` (20.9). Isunknown, - /// `$urandom` (18.13.1, 20.15.2). + /// `$urandom` (18.13.1). Urandom, } @@ -416,7 +417,8 @@ const fn function(function: SystemFunction, min_args: usize, max_args: Option Date: Sat, 17 Oct 2026 09:28:47 +0900 Subject: [PATCH 2/2] ci: select PR checks from the merge base, not the base tip A PR's base.sha is the current base tip, so PR branches behind it reported unmerged base changes as their own. After #1382 changed lydite.yml, every older PR selected all Lydite lanes. --- scripts/ci-changes.mjs | 3 ++- scripts/ci-changes.test.mjs | 30 +++++++++++++++++++++++++++++- scripts/ci-rust-scope.mjs | 11 ++++++++--- 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/scripts/ci-changes.mjs b/scripts/ci-changes.mjs index ff5349b3e4f..924e3bc5595 100644 --- a/scripts/ci-changes.mjs +++ b/scripts/ci-changes.mjs @@ -236,7 +236,8 @@ function changedFiles(base, head) { try { const output = execFileSync( "git", - ["diff", "--name-only", "-z", base, head], + // Diff from the merge base: a PR's base.sha is the current base tip. + ["diff", "--name-only", "-z", `${base}...${head}`], { encoding: "utf8" }, ); return output.split("\0").filter(Boolean); diff --git a/scripts/ci-changes.test.mjs b/scripts/ci-changes.test.mjs index 54f41654427..6873d679941 100644 --- a/scripts/ci-changes.test.mjs +++ b/scripts/ci-changes.test.mjs @@ -6,6 +6,7 @@ import { dirname, join, relative } from "node:path"; import test from "node:test"; import { fileURLToPath } from "node:url"; +import { changedFilesBetween } from "./ci-rust-scope.mjs"; import { affectsHeliodorArm64, classifyFiles, @@ -161,7 +162,7 @@ const MASTER_GROUP = { const classifier = fileURLToPath(new URL("./ci-changes.mjs", import.meta.url)); -// The classifier diffs base..head in the repository at cwd. +// The classifier diffs base...head in the repository at cwd. function runClassifier( base, head, @@ -506,3 +507,30 @@ test("queue configuration runs script checks without rebuilding the product", () }); assert.deepEqual(classifyFiles([".mergify.yml", "unknown/new-source"]), all); }); + +test("PR branches behind their base ignore unmerged base changes", (t) => { + const repository = mkdtempSync(join(tmpdir(), "celox-ci-changes-")); + t.after(() => rmSync(repository, { recursive: true, force: true })); + const git = (...args) => + execFileSync("git", args, { cwd: repository, encoding: "utf8" }).trim(); + const commit = (path) => { + writeFileSync(join(repository, path), `${path}\n`); + git("add", path); + git("commit", "--quiet", "-m", path); + return git("rev-parse", "HEAD"); + }; + git("init", "--quiet"); + git("config", "user.name", "test"); + git("config", "user.email", "test@example.com"); + git("config", "commit.gpgsign", "false"); + const fork = commit("README.md"); + git("checkout", "--quiet", "-b", "pr"); + const head = commit("CONTRIBUTING.md"); + git("checkout", "--quiet", fork); + const base = commit("unknown-base-change.xyz"); + assert.deepEqual(changedFilesBetween(base, head, repository), ["CONTRIBUTING.md"]); + assert.deepEqual( + runClassifier(base, head, { GITHUB_EVENT_NAME: "pull_request" }, repository), + { ...none, docs: true, heliodor_arm64: false, release: false }, + ); +}); diff --git a/scripts/ci-rust-scope.mjs b/scripts/ci-rust-scope.mjs index f81bab85071..75a18ea9ed0 100644 --- a/scripts/ci-rust-scope.mjs +++ b/scripts/ci-rust-scope.mjs @@ -206,12 +206,17 @@ export function rustTestScope(files, packages) { }; } -/** Changed files between two commits, or null when they cannot be compared. */ -export function changedFilesBetween(base, head) { +/** + * Files changed on head since it forked from base, or null when they cannot be + * compared. A PR's base.sha is the current base tip, so a two-point diff would + * also report base changes that the PR branch has not merged yet. + */ +export function changedFilesBetween(base, head, cwd = undefined) { const sha = /^[0-9a-f]{40,64}$/i; if (!sha.test(base) || !sha.test(head) || /^0+$/.test(base)) return null; try { - return execFileSync("git", ["diff", "--name-only", "-z", base, head], { + return execFileSync("git", ["diff", "--name-only", "-z", `${base}...${head}`], { + cwd, encoding: "utf8", }) .split("\0")