Skip to content

fix(ci): Duplicate Body Ratchet green on master - #5501

Merged
dmitrii-f-t27 merged 1 commit into
masterfrom
fix/duplicate-bodies-master
Oct 2, 2026
Merged

dmitrii-f-t27 merged 1 commit into
masterfrom
fix/duplicate-bodies-master

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Collaborator

What

Duplicate Body Ratchet reported 11 unledgered groups on master 756bcffc. After this PR, python3 tools/dupe_scan.py passes on this branch and --self-test passes 11 shapes.

group cause change
digest_for x8, githubCiDeps_checkRuns_impl x5 scanner false positive: a declaration ending in ; borrowed the next body scanner
forwardPass x3 one empty-result literal written three times in specs/hslm/forward_pass.t27 shared helper, from #5473
rng_int_range x2 two return undefined; stubs in the gen_fuzz port real generator + tests
bytes_eq, session_status_str, led_config, validate_led_config, startup_config, update_oscillator_chain, shift_ir (x2 each) the same body in two files ledgered: use a::b; still generates no import (#4610), as in #4497

Scanner

The prototype/comment/literal repair comes from #5473. Two rules are new, both taken from bootstrap/src/compiler.rs:

  • ; followed by a space or tab at column 1, and #, are line comments.
  • A single-quoted literal never spans a line; the lexer reports it unterminated at the newline.

Without them, an apostrophe in ; the Queen's view ... opened a "literal" that ran up to forty lines and hid three bodies in specs/queen/views.t27 and specs/tools/catalog.t27. Two new self-test shapes cover this, and the #5473 lexer fails both. On today's corpus the new scanner finds 4691 bodies, against 4689 for the #5473 version.

gen_fuzz

The Zig original uses std.Random.DefaultPrng (xoshiro256++), whose additions wrap. t27c emits u64 + and * without wrapping in Zig and Rust, so the port uses xorshift64 (13/7/17): shifts and xors, nothing to overflow. It keeps the contract (deterministic per seed, one byte per draw, inclusive integer range), not the original stream.

  • t27c test-report (Zig 0.16.0): 8/8 pass. Five new tests replace assert(x >= 0 || x < 0).
  • Mutants caught: constant byte (2 tests fail), return min (1), off-by-one span (1), the old stubs (2), state never updated (3).
  • All four backends generate. The generated C and Rust did not compile before this change and still do not (C 6 -> 4 errors, Rust 11 -> 11); that is a backend matter outside this PR.

Seals

ForwardPass.json and hslm_ForwardPass.json were vacuous (gen_hash=none on all four). Resealed with the t27c built from this tree; t27c seal --verify reports all hashes MATCH, and every hash equals the #5473 seals produced on another machine.

Ledger diff

+7 rows for the cross-file copies above, -3 rows whose groups no longer exist (generate_all, next, is_orphan). No existing group grows.

Unchanged elsewhere

Against master: check_duplicate_declarations passes, check_specs_generate reports the same 15 specs, assertionless counts and tri types ratchet are identical. specs/hslm/forward_pass.t27 is still listed as a parse failure in docs/reports/suite_expectations.json, although it parses on master too; that ledger is handled with the rest of the corpus ratchet.

Refs #5497

🤖 Generated with Claude Code

Eleven groups were in no ledger on master 756bcff.

Scanner. tools/dupe_scan.py now reads the lexical forms t27c has: a
declaration ending in ';' no longer borrows the next function's body
(digest_for x8 and githubCiDeps_checkRuns_impl x5 were that), comments and
string literals are masked, ';' at column 1 and '#' are line comments, and a
single quote ends at the newline as the lexer ends it. The prototype, comment
and literal repair comes from #5473. The quote and ';' rules are new: an
apostrophe in "; the Queen's ..." opened a literal that hid three bodies in
specs/queen/views.t27 and specs/tools/catalog.t27. Eleven self-test shapes
pass; the #5473 lexer fails the two new ones.

forwardPass x3: one empty-result literal in specs/hslm/forward_pass.t27 is
shared (from #5473). Both seal files naming the spec are resealed with the
t27c built from this tree; all four gen hashes equal the #5473 seals.

rng_int_range x2: the gen_fuzz port had two 'return undefined;' stubs. They
are now a xorshift64 generator (shifts and xors only: t27c emits u64 '+'
and '*' without wrapping in Zig and Rust), and the port has five tests that
can fail. Zig: 8/8 pass; five mutants are each caught.

Seven copies across two files are ledgered, as #4497 did, because
'use a::b;' still generates no import (#4610): bytes_eq,
session_status_str, led_config, validate_led_config, startup_config,
update_oscillator_chain, shift_ir. Three rows whose groups no longer exist
are dropped: generate_all, next, is_orphan.

Refs #5497

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-02 01:14:25 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 47
PRs with All Checks Green 3
READY 3
FAILING 47
PENDING 0
NO CHECKS YET 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=b7d5cc5c4cf1 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@dmitrii-f-t27
dmitrii-f-t27 merged commit 3e77b41 into master Oct 2, 2026
32 of 36 checks passed
dmitrii-f-t27 added a commit that referenced this pull request Oct 2, 2026
Renaming OscillatorState in uart_echo_top.t27 makes its
update_oscillator_chain body name UartOscillatorState, so the two bodies are
no longer copies. The duplicate-body ratchet fails when a known group
disappears and its row stays, so the row (update_oscillator_chain 2, added in
#5501) leaves the ledger in this change.

Refs #5497

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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