From ef8ff9f9fc7b676e677358be529b2d766a80b914 Mon Sep 17 00:00:00 2001 From: tignear Date: Tue, 27 Oct 2026 03:48:36 +0900 Subject: [PATCH 1/2] ci(deps): configure security-only Cargo updates Configure Dependabot for the root Cargo workspace with open-pull-requests-limit: 0, allowing vulnerability-fix PRs while disabling ordinary version-update PRs. Use conventional chore(deps) titles and the dependencies label; security PRs require review before queueing. Document the required repository security settings and the distinction between GitHub's advisory database and the existing RustSec cargo-deny gate. Upstream version requirements can still prevent an automatic fix. No Renovate lockfile maintenance or advisory exclusions are introduced. Repository setting: Dependabot alerts were already enabled; automated security fixes have now been enabled and verified via the GitHub API. The configuration takes effect after merge. Validation: Dependabot JSON-schema validation passed; all 6 Mergify configuration tests passed; git diff --check passed. Dependency graph/alerts currently contain no open GitHub alerts, so no end-to-end generated security PR was available to verify. Change-Id: I5bf1be902f3b513518e0508630a5a370ef6a88c4 --- .github/dependabot.yml | 11 +++++++++++ CONTRIBUTING.md | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 145b2df393d..ae3e5bba29b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,3 +9,14 @@ updates: prefix: "ci(deps)" labels: - dependencies + - package-ecosystem: cargo + directory: / + # Required by the schema; security updates are triggered by alerts. + schedule: + interval: daily + # Disable version updates, while retaining security updates. + open-pull-requests-limit: 0 + labels: + - dependencies + commit-message: + prefix: "chore(deps)" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9fba73763de..d7dcff99c92 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -556,3 +556,24 @@ to succeed; failures, cancellations, and skips block merging. All Mergify queues also require the standalone `Verify workflow lockfile` check. Keep that check required in the master/develop rulesets so older PR check results cannot bypass a newly introduced lockfile requirement. + +## Dependency security updates + +Dependabot security updates open PRs when GitHub reports a vulnerable dependency +with an available compatible fix. The root Cargo configuration in +`.github/dependabot.yml` sets `open-pull-requests-limit: 0`: this disables +Dependabot version-update PRs while allowing security-update PRs. The required +`schedule` field does not turn these into routine lockfile refreshes. + +Enable Dependabot alerts and security updates in the repository's security +settings; the YAML file alone does not enable security updates. Security PRs +carry `dependencies` and require review before queueing. + +The daily `cargo-deny` workflow remains the RustSec advisory gate. GitHub's +advisory database and RustSec can differ, so a cargo-deny failure does not +guarantee an immediate Dependabot PR. An incompatible requirement in an +upstream dependency can also prevent an automatic fix; those cases need an +upstream release or an explicitly maintained patch. + +See [Dependabot security updates](https://docs.github.com/en/code-security/concepts/supply-chain-security/dependabot-security-updates) +and [security-only configuration](https://docs.github.com/en/code-security/how-tos/secure-your-supply-chain/secure-your-dependencies/configure-security-updates). From 4c54693be042ab1a47c098462f7c410c711f023b Mon Sep 17 00:00:00 2001 From: tignear Date: Sat, 31 Oct 2026 16:37:55 +0900 Subject: [PATCH 2/2] perf(scheduler): leave settle inputs and aliases out of TB level slices Before each time step's edges, a compiled testbench computes the levels of the event signals and of every clock and reset baseline through a slice of the settle. The baselines include each instance's clock and reset ports, which follow their sources; only the sources are compared. On Heliodor, the slice held 26k of the settle's 81k instructions and ran at both edges of every cycle. The slice now covers the scheduler's events and the baselines' sources. A slice for storage that no unit stores, such as a TB-driven clock, also kept every loop it could not fold, with what the loops read; reads that no unit stores already hold their values, so such a slice is now empty. Change-Id: I61202a2ad90482ce6186ce9c1de353e3545637f9 --- crates/celox/src/scheduler/slice.rs | 77 ++++++++++++++++++++++++- crates/celox/src/scheduler/testbench.rs | 10 +++- 2 files changed, 84 insertions(+), 3 deletions(-) diff --git a/crates/celox/src/scheduler/slice.rs b/crates/celox/src/scheduler/slice.rs index 916e45afdc6..4e14b4b3521 100644 --- a/crates/celox/src/scheduler/slice.rs +++ b/crates/celox/src/scheduler/slice.rs @@ -248,8 +248,15 @@ impl<'a> CombSlicer<'a> { let mut seen: HashSet = HashSet::default(); let mut work: Vec = reads .into_iter() - .map(|address| Need::Storage(self.representative(address))) + .map(|address| self.representative(address)) + .filter(|address| self.stores.contains_key(address)) + .map(Need::Storage) .collect(); + // Reads no unit stores hold their values already. Built from no + // needs, the part would still keep the loops it cannot fold. + if work.is_empty() { + return Vec::new(); + } let mut units: Vec; loop { self.walk(&mut work, &mut seen, &mut kept); @@ -577,4 +584,72 @@ mod tests { "`a` is no longer read" ); } + + /// `for i in 0..a { z = c; }` + fn looping_settle() -> Unit { + let mut b = Builder::new(); + let [a, c, z] = [0, 1, 4]; + let bound = b.alloc_bit(8, false); + b.emit(SIRInstruction::Load( + bound, + stable(a), + SIROffset::Static(0), + 8, + )); + let zero = b.alloc_bit(8, false); + b.emit(SIRInstruction::Imm(zero, SIRValue::new(0u8))); + let index = b.alloc_bit(8, false); + let header = b.new_block_with(vec![index]); + let body = b.new_block(); + let exit = b.new_block(); + b.seal_block(SIRTerminator::Jump(header, vec![zero])); + b.switch_to_block(header); + let more = b.alloc_bit(1, false); + b.emit(SIRInstruction::Binary(more, index, BinaryOp::LtU, bound)); + b.seal_block(SIRTerminator::Branch { + cond: more, + true_block: (body, Vec::new()), + false_block: (exit, Vec::new()), + }); + b.switch_to_block(body); + let value = b.alloc_bit(8, false); + b.emit(SIRInstruction::Load( + value, + stable(c), + SIROffset::Static(0), + 8, + )); + b.emit(SIRInstruction::Store( + stable(z), + SIROffset::Static(0), + 8, + value, + Vec::new(), + Vec::new(), + )); + let one = b.alloc_bit(8, false); + b.emit(SIRInstruction::Imm(one, SIRValue::new(1u8))); + let next = b.alloc_bit(8, false); + b.emit(SIRInstruction::Binary(next, index, BinaryOp::Add, one)); + b.seal_block(SIRTerminator::Jump(header, vec![next])); + b.switch_to_block(exit); + b.seal_block(SIRTerminator::Return); + let (blocks, register_map, _) = b.drain(); + Unit { + entry_block_id: BlockId(0), + blocks, + register_map, + } + } + + #[test] + fn slice_of_storage_no_unit_stores_is_empty() { + let units = [looping_settle()]; + let slicer = CombSlicer::new(&units, HashMap::default()); + // `a` is an input of the settle: nothing computes it, not even the + // loop it bounds. + assert!(slicer.slice([address(0)]).is_empty()); + let slice = slicer.slice([address(0), address(4)]); + assert_eq!(stored(&slice), [address(4)]); + } } diff --git a/crates/celox/src/scheduler/testbench.rs b/crates/celox/src/scheduler/testbench.rs index 823e9ae0b44..09373bddd6f 100644 --- a/crates/celox/src/scheduler/testbench.rs +++ b/crates/celox/src/scheduler/testbench.rs @@ -1014,11 +1014,18 @@ fn generate( // the edges it and this unit judge need the levels of the event // signals: compute those (the part of the settle they need, or the // settle), or require a settled design. + let events = &program.design.events; let mut allowed = if deferred { + // Only the sources' baselines are compared below. let levels: Vec = schema .events .iter() - .chain(m.baselines.iter().map(|(source, _)| source)) + .chain( + m.baselines + .iter() + .map(|(source, _)| source) + .filter(|&&source| events.canonical(source) == source), + ) .copied() .collect(); let judge = g.b.new_block(); @@ -1056,7 +1063,6 @@ fn generate( // clocks included. An alias, such as a port copying a clock, only // follows it, and while a settle is pending its baseline was saved // before the copy caught up. - let events = &program.design.events; let offsets = &program.layout().offsets; // The resets the TB wrote since the baselines: their writes become // edges of their clock slots, applied with the clocks due now.