specs: rename the duplicated test names instead of deleting them - #3484
Merged
Conversation
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
enabled auto-merge (squash)
September 8, 2026 11:21
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
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.
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 > 32000then s > 9000 && s < 10000adder_tree_4_zero_plus_any_identity
given a = 7given a = 0, b = 42, c = 0bram_weights_flatten_addr_zero_zero
depth: 3, width: 3depth: 4, width: 4Distribution 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_Nsuffix, 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()andtest booth_encode_zerolower to the same C identifier. 66functions in the corpus are literally named
test_*, and 4 collide witha 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_testsreports 0 andthis tool is idempotent (a second run renames 0). Full suite 3533 passed
0 failed. 25 stale seals refreshed.
🤖 Generated with Claude Code