Skip to content

check: a collision that only lowering creates - #3486

Merged
gHashTag merged 1 commit into
masterfrom
c/lowered-collisions
Sep 8, 2026
Merged

check: a collision that only lowering creates#3486
gHashTag merged 1 commit into
masterfrom
c/lowered-collisions

Conversation

@gHashTag

@gHashTag gHashTag commented Sep 8, 2026

Copy link
Copy Markdown
Owner

check: a collision that only lowering creates

Closes #3485

fn test_booth_encode_zero and test booth_encode_zero are DIFFERENT
NAMESPACES IN t27 and the SAME IDENTIFIER IN C, where a test block
becomes void test_{name}(void). The duplicate gate compares raw names,
so it was silent while the corpus printed
redefinition of 'test_booth_encode_zero'.

MEASURED PER BACKEND, NOT ASSUMED, and the message names only the
backends it is true of:

gen-c void test_X(void) / void bench_X(void) COLLIDES on both
gen (zig) test "X" is a STRING, not an identifier no collision
fn bench_X() COLLIDES
gen-rust tests are not lowered at all no collision
gen-verilog a test is emitted as a comment no collision

Repeating the existing "every backend rejects a redeclaration" would
have been false for three of the four.

POPULATION:
functions named test_* 66
... with a test block of the matching name 4 in 2 specs
functions named bench_* 0
test blocks named test_* 532
... whose stripped name is also a test 0

The 4 split, and neither half is repaired here. The two in
igla/race/backend.t27 are NEVER CALLED -- each appears once in the whole
tree, as its own declaration -- while the two in
math/property_test_template.t27 ARE called from test blocks. One pair is
dead code that also collides; the other is a live helper that needs one
of two names changed. Both are a spec author's decision.

THE bench HALF HAS POPULATION ZERO AND IS KEPT ANYWAY, written, tested
and shown reachable rather than left out -- the same reasoning already
recorded in this function for the type/function finding: a zero nothing
could have produced is not evidence.

THE RULE KEYS ON fn, AND 532 TEST BLOCKS NAMED test_* ARE WHY THAT
MATTERS. test "test_thing" beside test "thing" gives
void test_test_thing(void) and void test_thing(void) -- two
identifiers, no collision. A mutant letting any declaration kind trigger
the rule survived every test until a fixture for that case existed.

It gets ITS OWN RATCHET rather than a number shared with the existing
one: they are different claims, and a shared count lets one kind be paid
for with the other. The Spec Guards paths: filter is extended to the
new baseline, which otherwise would not have triggered the workflow that
reads it.

The corpus is unchanged -- 11 642 before and after, all 582 generated
headers identical. This is a check change.

Tests: 4 new Rust cases, 3 new self-check cases (8 of 8 pass), full
suite 3537 passed 0 failed. Five mutants, all killed.

🤖 Generated with Claude Code

Closes #3485

`fn test_booth_encode_zero` and `test booth_encode_zero` are DIFFERENT
NAMESPACES IN t27 and the SAME IDENTIFIER IN C, where a test block
becomes `void test_{name}(void)`. The duplicate gate compares raw names,
so it was silent while the corpus printed
`redefinition of 'test_booth_encode_zero'`.

MEASURED PER BACKEND, NOT ASSUMED, and the message names only the
backends it is true of:

  gen-c        `void test_X(void)` / `void bench_X(void)`  COLLIDES on both
  gen (zig)    `test "X"` is a STRING, not an identifier   no collision
               `fn bench_X()`                              COLLIDES
  gen-rust     tests are not lowered at all                no collision
  gen-verilog  a test is emitted as a comment              no collision

Repeating the existing "every backend rejects a redeclaration" would
have been false for three of the four.

POPULATION:
  functions named `test_*`                              66
  ... with a test block of the matching name             4  in 2 specs
  functions named `bench_*`                              0
  test blocks named `test_*`                           532
  ... whose stripped name is also a test                 0

The 4 split, and neither half is repaired here. The two in
igla/race/backend.t27 are NEVER CALLED -- each appears once in the whole
tree, as its own declaration -- while the two in
math/property_test_template.t27 ARE called from test blocks. One pair is
dead code that also collides; the other is a live helper that needs one
of two names changed. Both are a spec author's decision.

THE `bench` HALF HAS POPULATION ZERO AND IS KEPT ANYWAY, written, tested
and shown reachable rather than left out -- the same reasoning already
recorded in this function for the type/function finding: a zero nothing
could have produced is not evidence.

THE RULE KEYS ON `fn`, AND 532 TEST BLOCKS NAMED `test_*` ARE WHY THAT
MATTERS. `test "test_thing"` beside `test "thing"` gives
`void test_test_thing(void)` and `void test_thing(void)` -- two
identifiers, no collision. A mutant letting any declaration kind trigger
the rule survived every test until a fixture for that case existed.

It gets ITS OWN RATCHET rather than a number shared with the existing
one: they are different claims, and a shared count lets one kind be paid
for with the other. The Spec Guards `paths:` filter is extended to the
new baseline, which otherwise would not have triggered the workflow that
reads it.

The corpus is unchanged -- 11 642 before and after, all 582 generated
headers identical. This is a `check` change.

Tests: 4 new Rust cases, 3 new self-check cases (8 of 8 pass), full
suite 3537 passed 0 failed. Five mutants, all killed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@gHashTag
gHashTag enabled auto-merge (squash) September 8, 2026 11:46
@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:48:32 UTC

Summary

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=d5f667361f3d != 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 8194a6e into master Sep 8, 2026
30 of 33 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.

check: two names that collide only after a backend adds its prefix -- fn test_x beside test x

1 participant