Skip to content

feat(tri): types dup --defs emits the identity of every definition it counted - #3036

Merged
gHashTag merged 2 commits into
masterfrom
w46-types-dup-defs
Sep 3, 2026
Merged

feat(tri): types dup --defs emits the identity of every definition it counted#3036
gHashTag merged 2 commits into
masterfrom
w46-types-dup-defs

Conversation

@gHashTag

@gHashTag gHashTag commented Sep 3, 2026

Copy link
Copy Markdown
Owner

The census prints 1180 struct definitions and, until now, no way to say
WHICH. A second reader could compare totals and nothing else — and a total
that agrees can hide an equal number of errors in both directions.

--defs prints one <file>:<line>\t<name> per counted definition, sorted,
byte-identical across runs, so two readers subtract identities with comm.

It earned itself on a defect no total can show

$ sed -n '37p;90p' specs/demos/jones_topology_filter.t27
        const dim = structure.len();
            const t = structure[i];

$ tri types dup --defs | grep jones_topology_filter
specs/demos/jones_topology_filter.t27:21   JonesSignature
specs/demos/jones_topology_filter.t27:37   dim        <- a const, counted as a definition
specs/demos/jones_topology_filter.t27:90   t          <- likewise

The rule is after.trim().starts_with("struct")no word boundary, so
structure reads as struct. The published figure is 1178, not 1180.

Filed as #3035 rather than patched here: the repair moves a number that
docs/TYPE_CONFLICTS.md, the types ratchet and the UNCOVERED note in
census.rs all quote, so it wants those consumers updated in the same commit.

The control, and why it is not the tautology it looks like

The headline count and the emitted list come from one enumeration on purpose
total used to be its own counter, and a counter cannot be subtracted from
another reader's. So header == len is structurally true and is not what the
test asserts. It asserts the value 4 on a known fixture, an independently
written loose reader returning 5, and names the disagreeing row.

This matters because the sibling flag from the same pass has exactly that
tautology and a mutant that survives 504 green tests. Measured here:

MUTANT  collapse per (file, name) before rendering
  -> the_emitted_definitions_are_unique_and_sorted FAILED
  -> 31 passed; 1 failed
RESTORED
  -> 32 passed; 0 failed; 471 filtered out

The mutant that survives on --sites is killed here. That is the measured
difference between the two halves, which is why only this one ships.

My first attempt at that mutant wrote only a comment — a no-op treatment,
§455 — and was caught by printing the mutated function before running it.

Not shipped, deliberately

--sites from the same pass labels a source path with a generated-Verilog
line number
: 17 of 17 rows name a line that does not carry the construct and 5
are past EOF, and three independently written readers agreed with each other
because all three shared the coordinate bug. Agreement checks the set, never the
label.

One claim I could not reproduce, stated as such

The report that motivated this described a 2-for-2 swap against a loose second
reader with equal totals of 1180. My own second reader read 476 against
1180 — it asks a narrower question and includes bootstrap/tests/fixtures/, so
it is a different population, not a second reading of the same one. The defect
is confirmed directly instead, by reading the two lines the finding names.

Refs #3035

🤖 Generated with Claude Code

… counted

The census prints 1180 struct definitions and, until now, no way to say
WHICH. A second reader could compare totals and nothing else -- and a
total that agrees can hide an equal number of errors in both directions.

--defs prints one `<file>:<line>\t<name>` per counted definition, sorted,
byte-identical across runs, so two readers subtract IDENTITIES with comm.

It earned itself immediately, on a defect no total can show:
specs/demos/jones_topology_filter.t27:37 is `const dim = structure.len();`
and the census records it as a definition named `dim`; line 90 is
`const t = structure[i];`, recorded as `t`. The rule is
`after.trim().starts_with("struct")` -- no word boundary, so `structure`
reads as `struct`. The published figure is 1178, not 1180.

Filed as #3035 rather than patched here: the repair moves a number that
docs/TYPE_CONFLICTS.md, the types ratchet and the UNCOVERED note in
census.rs all quote, so it wants those consumers updated in the same
commit.

The headline count and the emitted list come from ONE enumeration on
purpose -- `total` used to be its own counter, and a counter cannot be
subtracted from another reader's. So the control is not that identity: it
is the VALUE 4 on a known fixture, an independently written loose reader
returning 5, and the disagreeing row named.

Mutation: the mutant that survives 504 green tests on the sibling --sites
flag -- collapse per (file, name) before rendering -- is KILLED here by
the_emitted_definitions_are_unique_and_sorted. 31 passed, 1 failed;
restored, 32 passed. The first attempt at that mutant wrote only a
comment and would have been a no-op treatment (SS455); caught by printing
the mutated function before running it.

--sites, from the same pass, is deliberately NOT included: it labels a
source path with a GENERATED-Verilog line number, and 17 of 17 rows name
a line that does not carry the construct.

Refs #3035
@github-actions

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

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-03 17:57:40 UTC

Summary

Status Count
Total Open PRs 11
PRs with Failing Checks 10
PRs with All Checks Green 1
READY 0
FAILING 10
PENDING 0

Seal Status

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

@github-actions

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

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-03 18:17:13 UTC

Summary

Status Count
Total Open PRs 11
PRs with Failing Checks 10
PRs with All Checks Green 1
READY 0
FAILING 10
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=9b8875f1c9d4 != 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 2c87946 into master Sep 3, 2026
36 checks passed
@gHashTag
gHashTag deleted the w46-types-dup-defs branch September 3, 2026 18:33
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