From f7a82496b4632a1a5123d8cf6545034ca5cd5e79 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 31 Oct 2026 08:21:42 +0000 Subject: [PATCH 1/3] chore(deps): update rust toolchain to 6ecf534 --- flake.lock | 8 ++++---- flake.nix | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 7827d017773..67ae78a3487 100644 --- a/flake.lock +++ b/flake.lock @@ -51,17 +51,17 @@ ] }, "locked": { - "lastModified": 1793348683, - "narHash": "sha256-qv+P8z2xS5Xdws5Kigvr/WKJiaJSa6Ke8iH7ozmO53w=", + "lastModified": 1793434469, + "narHash": "sha256-+sgVNI2c67di+XIeMaz5KSei4T65kX68s5Nl0E5Gzbc=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "96a0986b0486341fbc163fa2fabc6d3b44cdcbf1", + "rev": "6ecf534a7c16e7c969f26838fdd8c93597ae93f3", "type": "github" }, "original": { "owner": "oxalica", "repo": "rust-overlay", - "rev": "96a0986b0486341fbc163fa2fabc6d3b44cdcbf1", + "rev": "6ecf534a7c16e7c969f26838fdd8c93597ae93f3", "type": "github" } }, diff --git a/flake.nix b/flake.nix index ac21ab4efbc..c3264443f3a 100644 --- a/flake.nix +++ b/flake.nix @@ -9,7 +9,7 @@ }; rust-overlay = { # Pin the revision explicitly so Renovate can group overlay and Rust updates. - url = "github:oxalica/rust-overlay/96a0986b0486341fbc163fa2fabc6d3b44cdcbf1"; + url = "github:oxalica/rust-overlay/6ecf534a7c16e7c969f26838fdd8c93597ae93f3"; inputs.nixpkgs.follows = "nixpkgs"; }; # The xezim reference simulator for the shared test suite, pinned by From 4c54693be042ab1a47c098462f7c410c711f023b Mon Sep 17 00:00:00 2001 From: tignear Date: Sat, 31 Oct 2026 16:37:55 +0900 Subject: [PATCH 2/3] 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. From ea377446ec58b7c7a440a962844a5196d3b9afbc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 31 Oct 2026 08:30:57 +0000 Subject: [PATCH 3/3] test(xezim): update xezim digest to 441bd47 --- flake.lock | 8 ++++---- flake.nix | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 7827d017773..0d1fdc0a328 100644 --- a/flake.lock +++ b/flake.lock @@ -68,17 +68,17 @@ "xezim": { "flake": false, "locked": { - "lastModified": 1793416628, - "narHash": "sha256-2ZeLbw6Mc1RAZY2SJ3/Iv3XV/3+N4CXJFAGv11DNUpA=", + "lastModified": 1793434493, + "narHash": "sha256-Mp0Ij6r4SC54cvfqs+I1/BDWQ1Dek5MXd8KLH0Du+no=", "owner": "aionhw", "repo": "xezim", - "rev": "9fadb2eb4996d5b18100455e82e27f0de573fa4f", + "rev": "441bd475ce5eaaa9137f49710203995e51b7b0c2", "type": "github" }, "original": { "owner": "aionhw", "repo": "xezim", - "rev": "9fadb2eb4996d5b18100455e82e27f0de573fa4f", + "rev": "441bd475ce5eaaa9137f49710203995e51b7b0c2", "type": "github" } } diff --git a/flake.nix b/flake.nix index ac21ab4efbc..ab25963a61f 100644 --- a/flake.nix +++ b/flake.nix @@ -15,7 +15,7 @@ # The xezim reference simulator for the shared test suite, pinned by # revision so that Renovate proposes updates. xezim = { - url = "github:aionhw/xezim/9fadb2eb4996d5b18100455e82e27f0de573fa4f"; + url = "github:aionhw/xezim/441bd475ce5eaaa9137f49710203995e51b7b0c2"; flake = false; }; };