feat(tri): types dup --defs emits the identity of every definition it counted - #3036
Merged
Conversation
… 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
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
PR DashboardGenerated at: 2026-09-03 18:17:13 UTC
Summary
Seal Status
|
This was referenced Sep 3, 2026
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.
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.
--defsprints 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
The rule is
after.trim().starts_with("struct")— no word boundary, sostructurereads asstruct. 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 incensus.rsall 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
—
totalused to be its own counter, and a counter cannot be subtracted fromanother reader's. So
header == lenis structurally true and is not what thetest 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:
The mutant that survives on
--sitesis killed here. That is the measureddifference 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
--sitesfrom the same pass labels a source path with a generated-Verilogline 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/, soit 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