fix(tri_settle): wrapping round_add + add gen/zig (last execution orphan closed) - #368
Merged
Conversation
…han closed) tri_settle was the final spec still missing an execution backend beyond icarus/C: it panicked under zig on two counts. The narrowing u64->u32 cast in reward_weighted was fixed compiler-side (t27#1999); the second was round_add's wrap-detect saturating idiom (let sum = round_total + epoch_bytes; if (sum < round_total) ...) on a plain '+', which zig-safe arithmetic aborts on before the guard runs. Switch that site to '+%' (wrapping) -- a no-op for C and Verilog, which already wrap by width, and explicit for zig. tri_settle now passes all 17 test blocks under zig, with icarus (17/17) and C still green. Regenerate its gens: gen/rust flips to .wrapping_add() (rust-drift, dynamic since #366), and gen/zig/tri_settle.zig is committed for the first time -- the dynamic Zig-drift leg (#365) picks it up automatically, no list edit. gen/c is byte-identical ('+%' lowers to '+'). With this, every spec in the corpus executes in at least the icarus and C backends, and tri_settle joins Rust/Zig too. gen/ regeneration via the no-gen-edits escape (LEFTHOOK=0). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
gHashTag
added a commit
that referenced
this pull request
Aug 9, 2026
…both (#373) The zig-test gate compiles and RUNS committed gens -- it is a real execution gate, not just a drift diff -- but it still iterated a hand-maintained list while gen/zig became the SSOT for drift in #365. The list had drifted: six specs had committed, drift-checked gens that were NEVER EXECUTED here -- rti_security, tri_compute_account, tri_compute_bond, tri_compute_pool, tri_settle, twr_timestamp precisely the specs closed in the execution-orphan series (#361, #363, #368). Their gens were verified locally at the time; CI never ran them. Iterate gen/zig directly, so a newly committed gen auto-joins execution the same way it auto-joins drift. Verified locally over the FULL committed set: zig test 107/107, zero failures. Also applies the #372 coverage-floor pattern to both execution gates (zig 107, C 75). A loop that silently matched zero files previously reported green having executed NOTHING; now it fails loudly. C-exec was already dynamic (#365) but had no floor. The stale 'gated to the passing set / tracked in t27#1928' header is corrected: the saturation idiom it referred to is fixed in-spec via '+%', and the whole committed set passes. Verified: zig 107/107 executed, C 75/75 executed, both exit 0; a zero-match loop correctly trips the floor. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: SSD DDD <ssdm4@MacBook-Pro.local>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tri_settlewas the final spec still missing an execution backend beyond icarus/C — it panicked underzig teston two counts:u64 -> u32cast inreward_weighted— fixed compiler-side in t27#1999;round_add's wrap-detect saturating idiom (let sum = round_total + epoch_bytes; if (sum < round_total) ...) on a plain+, which zig-safe arithmetic aborts on before the guard runs.Fix: switch that site to
+%(wrapping) — a no-op for C and Verilog (they already wrap by width), explicit for zig.tri_settlenow passes all 17 test blocks under zig, with icarus (17/17) and C still green.Regenerated gens:
gen/rustflips to.wrapping_add()(rust-drift, dynamic since #366), andgen/zig/tri_settle.zigis committed for the first time — the dynamic Zig-drift leg (#365) picks it up automatically, no list edit.gen/cis byte-identical (+%lowers to+).With this, every spec in the corpus executes in at least the icarus and C backends, and
tri_settlejoins Rust/Zig too — the execution-orphan series (waves 51–54, 58) is closed.gen/ regeneration via the
no-gen-editsescape (LEFTHOOK=0).🤖 Generated with Claude Code