Skip to content

ci(drift): iterate gen/rust directly (gen = SSOT) + resync stale twr gen - #366

Merged
gHashTag merged 1 commit into
mainfrom
ci/rust-drift-gen-ssot
Aug 9, 2026
Merged

ci(drift): iterate gen/rust directly (gen = SSOT) + resync stale twr gen#366
gHashTag merged 1 commit into
mainfrom
ci/rust-drift-gen-ssot

Conversation

@gHashTag

@gHashTag gHashTag commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Completes the gen-is-SSOT refactor (C and Zig landed in #365) for the Rust drift leg. It carried a hand-maintained 69-spec list while gen/rust holds 86 committed files — 17 committed gens were not drift-checked at all, the same 'gen exists but is un-gated' gap this series has been closing.

Two parts:

  1. Resync gen/rust/twr_timestamp.rs. Wave 54 changed the spec (t_end - t_startt_end -% t_start) but intentionally left the Rust gen stale because it was ungated; now that the leg checks it, regenerate (→ (t_end).wrapping_sub(t_start)).
  2. Dynamize the loop: for spec in $(ls gen/rust/*.rs | sed 's#^gen/rust/##; s#.rs$##' | sort). Every committed gen/rust is now drift-checked; a new gen/rust/*.rs auto-joins.

Verified locally: all 86 gen/rust byte-match t27c gen-rust modulo rustfmt (0 drift). twr_timestamp is not #[path]-included in src/lib.rs, so the resync does not touch build+test. YAML re-parses clean.

With this, all three committed-gen backends (Rust, C, Zig) are gen-SSOT-driven — no committed gen can escape its gate.

🤖 Generated with Claude Code

Completes the gen-is-SSOT refactor (C and Zig landed in #365) for the
Rust drift leg. It carried a hand-maintained 69-spec list while gen/rust
holds 86 committed files -- 17 committed gens were NOT drift-checked at
all, the same 'gen exists but is un-gated' gap this series has been
closing.

Two parts:
  1. Resync gen/rust/twr_timestamp.rs. Wave 54 changed the spec
     (t_end - t_start -> t_end -% t_start) but intentionally left the
     Rust gen stale because it was ungated; now that the leg checks it,
     regenerate it (-> (t_end).wrapping_sub(t_start)).
  2. Dynamize the loop:
       for spec in $(ls gen/rust/*.rs | sed 's#^gen/rust/##; s#.rs$##' | sort)
     Every committed gen/rust is now drift-checked; a new gen/rust/*.rs
     auto-joins.

Verified locally: all 86 gen/rust byte-match t27c gen-rust modulo
rustfmt (0 drift). twr_timestamp is not #[path]-included in src/lib.rs,
so the resync does not touch build+test. YAML re-parses clean.

With this, all three committed-gen backends (Rust, C, Zig) are
gen-SSOT-driven -- no committed gen can escape its gate.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@gHashTag
gHashTag merged commit 639b357 into main Aug 9, 2026
4 checks passed
@gHashTag
gHashTag deleted the ci/rust-drift-gen-ssot branch August 9, 2026 02:15
gHashTag added a commit that referenced this pull request Aug 9, 2026
…han closed) (#368)

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)

Co-authored-by: SSD DDD <ssdm4@MacBook-Pro.local>
gHashTag added a commit that referenced this pull request Aug 9, 2026
… target) (#376)

Continuing the negative audit: cargo test was the last unproven gate.
Injecting a failing test into tests/ did NOT redden it -- the file was
never compiled.

Cargo.toml sets 'autotests = false', so a test file runs ONLY with an
explicit [[test]] block. tests/compute_ring_invariants.rs had none. Its
own header explains why it exists:

  'The specs' own test blocks are only PARSED + TYPECHECKED by t27c ...
   This file re-runs the load-bearing invariants under cargo test, so a
   regression that silently reverts a hardened gate ... is caught by
   committed CI.'

The file written to close a verification gap was itself never executed:
18 tests covering burn conservation, slash/finalize ordering, verifier
accountability and width binding looked like CI coverage and were dead.

Enabling it needed the ten gen/rust modules it includes by #[path];
every spec existed but no gen was committed. Generated all ten
(rustfmt-normalized, byte-exact vs t27c). They auto-join the dynamic
rust drift leg (#366); its floor moves 86 -> 96.

The mod attributes used '#[allow(dead_code, unused_parens)]', which does
not cover clippy::double_parens, so 'clippy --all-targets -D warnings'
failed on the generated parens. Switched to '#[allow(clippy::all,
unused)]' -- the incantation src/lib.rs already uses for the same gens.

Adds a structural guard: every tests/*.rs must be declared in Cargo.toml,
or the gate fails and names the file. With autotests = false this is the
only thing standing between a new test file and silent death.

Verified: 18/18 pass, full cargo test exits 0, cargo fmt --all --check
and clippy --all-targets -D warnings both clean, zero drift on the ten
new gens, and the guard catches an undeclared probe file.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: SSD DDD <ssdm4@MacBook-Pro.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant