Skip to content

specs: rename the duplicated test names instead of deleting them - #3484

Merged
gHashTag merged 1 commit into
masterfrom
c/rename-duplicate-tests
Sep 8, 2026
Merged

specs: rename the duplicated test names instead of deleting them#3484
gHashTag merged 1 commit into
masterfrom
c/rename-duplicate-tests

Conversation

@gHashTag

@gHashTag gHashTag commented Sep 8, 2026

Copy link
Copy Markdown
Owner

specs: rename the duplicated test names instead of deleting them

Closes #3483

THE PLAN FILED WITH #3481 WAS REFUTED BY MEASURING IT. It proposed
checking whether the LATER twin is systematically the revised one and,
if so, keeping the last. It is not. Every one of the 144 remaining
duplicated test names has bodies that differ in INPUTS AND EXPECTATIONS:

cordic_fixed_sin_half_pi then s > 32000
then s > 9000 && s < 10000
adder_tree_4_zero_plus_any_identity given a = 7
given a = 0, b = 42, c = 0
bram_weights_flatten_addr_zero_zero depth: 3, width: 3
depth: 4, width: 4

Distribution over the 144: 45 differ in length, 34 by one line, 31 by
two, 28 by three, 6 by four or more, and exactly 1 is a superset of its
twin. Deleting either copy loses a real test case. The NAME is the only
thing that was ever wrong.

185 names renamed -- the second and later occurrence takes _2, _3,
..., skipping any suffix already used. 25 specs, 185 insertions and 185
deletions: a pure rename.

errors 11 780 -> 11 642 (-138)
redefinition of 'X' 204 -> 66 (-138)
baseline 27 / 172 names -> 5 / 28

The two deltas are equal, so the repair cascaded in neither direction.

The suffix carries no meaning and does not pretend to. A better name is
a reading of what each case actually covers, and that is a human's to
write; this makes the generated code compile without losing a case, and
it is reversible.

THE CONTROL WAS AGAIN A DIFF OF THE GENERATED C rather than of the
specs. Across all 582 headers: 25 changed -- exactly the specs edited --
with 370 differing lines, EVERY ONE a test_ identifier gaining a _N
suffix, and nothing else. 185 renames x 2 (prototype and definition) =
370. The test-count summary line did not move, which is what proves
nothing was deleted.

A NEW CLASS FOUND ON THE WAY, FILED NOT FIXED: fn test_booth_encode_ zero() and test booth_encode_zero lower to the same C identifier. 66
functions in the corpus are literally named test_*, and 4 collide with
a test block of the matching name in 2 specs. Same law as #3479 -- two
declarations colliding after lowering -- in a pair the gate does not
compare, because in t27 they sit in different namespaces and only the
test_ prefix brings them together.

What remains under the ratchet is 28 names in 5 specs, none of them test
blocks: structs, enums and functions declared twice, the original #3438
family.

Gates: specs parse, specs generate, duplicate declarations, assertionless
tests, seal currency all pass; dedupe_identical_tests reports 0 and
this tool is idempotent (a second run renames 0). Full suite 3533 passed
0 failed. 25 stale seals refreshed.

🤖 Generated with Claude Code

Closes #3483

THE PLAN FILED WITH #3481 WAS REFUTED BY MEASURING IT. It proposed
checking whether the LATER twin is systematically the revised one and,
if so, keeping the last. It is not. Every one of the 144 remaining
duplicated test names has bodies that differ in INPUTS AND EXPECTATIONS:

  cordic_fixed_sin_half_pi     `then s > 32000`
                               `then s > 9000 && s < 10000`
  adder_tree_4_zero_plus_any_identity   `given a = 7`
                               `given a = 0, b = 42, c = 0`
  bram_weights_flatten_addr_zero_zero   `depth: 3, width: 3`
                               `depth: 4, width: 4`

Distribution over the 144: 45 differ in length, 34 by one line, 31 by
two, 28 by three, 6 by four or more, and exactly 1 is a superset of its
twin. Deleting either copy loses a real test case. The NAME is the only
thing that was ever wrong.

185 names renamed -- the second and later occurrence takes `_2`, `_3`,
..., skipping any suffix already used. 25 specs, 185 insertions and 185
deletions: a pure rename.

  errors            11 780 -> 11 642   (-138)
  redefinition of 'X'  204 ->     66   (-138)
  baseline    27 / 172 names -> 5 / 28

The two deltas are equal, so the repair cascaded in neither direction.

The suffix carries no meaning and does not pretend to. A better name is
a reading of what each case actually covers, and that is a human's to
write; this makes the generated code compile without losing a case, and
it is reversible.

THE CONTROL WAS AGAIN A DIFF OF THE GENERATED C rather than of the
specs. Across all 582 headers: 25 changed -- exactly the specs edited --
with 370 differing lines, EVERY ONE a `test_` identifier gaining a `_N`
suffix, and nothing else. 185 renames x 2 (prototype and definition) =
370. The test-count summary line did not move, which is what proves
nothing was deleted.

A NEW CLASS FOUND ON THE WAY, FILED NOT FIXED: `fn test_booth_encode_
zero()` and `test booth_encode_zero` lower to the same C identifier. 66
functions in the corpus are literally named `test_*`, and 4 collide with
a test block of the matching name in 2 specs. Same law as #3479 -- two
declarations colliding after lowering -- in a pair the gate does not
compare, because in t27 they sit in different namespaces and only the
`test_` prefix brings them together.

What remains under the ratchet is 28 names in 5 specs, none of them test
blocks: structs, enums and functions declared twice, the original #3438
family.

Gates: specs parse, specs generate, duplicate declarations, assertionless
tests, seal currency all pass; `dedupe_identical_tests` reports 0 and
this tool is idempotent (a second run renames 0). Full suite 3533 passed
0 failed. 25 stale seals refreshed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@gHashTag
gHashTag enabled auto-merge (squash) September 8, 2026 11:21
@github-actions

github-actions Bot commented Sep 8, 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 Sep 8, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-08 11:21:14 UTC

Summary

Status Count
Total Open PRs 16
PRs with Failing Checks 13
PRs with All Checks Green 3
READY 2
FAILING 13
PENDING 0
NO CHECKS YET 0

These columns do not partition: 2 + 13 + 0 + 0 = 15, and there are 16 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=d0bfdbd5a5fc != 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).

@gHashTag
gHashTag merged commit 256d57f into master Sep 8, 2026
28 of 30 checks passed
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.

specs: rename the 185 duplicated test names -- their bodies differ, so deleting either loses a case

1 participant