feat(t27c): dupes can compare bodies, not only names - #4295
Merged
Merged
Conversation
`t27c dupes` compared declaration names: 9246 lines over master, most of them legitimate (gf4..gf64 each carry a validate_format by design), and blind to the duplication that costs - the same body written again under any name. --bodies compares the parsed children of each fn, with `line` left out and every other field kept: 686 functions in 189 groups, the largest 30 copies of one 935-character magadd. --name <fn> answers the question a bee has to ask before it writes: where does this already live. Two mistakes were made and fixed on the way, both recorded in the code: hashing the Debug form of the node included `line`, so identical bodies at different lines hashed differently and the count came out 276 against a text walk's 555; and a HashMap's iteration order made two runs list groups differently, which a reader cannot diff. Closes #4294 Gates: cargo build --release -p t27c; `dupes --bodies` twice byte-identical; a group member pair read by hand is identical after normalisation (935 chars); `dupes --name magadd` prints 30 places; `dupes` with no flag unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
gHashTag
enabled auto-merge (squash)
September 20, 2026 07:04
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.
Closes #4294
t27c dupessaw names; the duplication that costs is in the bodies.--bodiescompares parsed children (686 functions in 189 groups; largest ismagadd, 30 copies of 935 characters),--name <fn>tells a bee where a function already lives.Complements #4290 (the text-based gate): the compiler sees through formatting but only the 887 specs that parse; the text walk covers all 948.
🤖 Generated with Claude Code