fix(assembly): data-label func_start false positives + tri-comparison reconciler dot-normalization - #2320
Merged
Conversation
… reconciler dot-normalization Drives assembly's tri-comparison Func Precision from 95/102 (93.1%) to a validated 97/97 (100%), via the tri-comparison-ledger-sweep skill. Three separable causes behind the old 7-occurrence `assembly/function/existence/agree[gitgalaxy]_vs[ctags]` gap: 1. Name-serialization artifact (4 occ) -- NASM/GAS local labels carry a leading `.` that GitGalaxy keeps and Universal Ctags' Asm parser strips, so `.loop` (gg) and `loop` (ctags) -- the same label at the same line -- landed in different name buckets and read as a two-sided disagreement. `tri_comparison_reconcile.py` now normalizes a single leading dot before cross-tool pairing, scoped to assembly/agc_assembly only (`_pairing_name`), same "checked for this language, not applied blindly" discipline as the gatherer's javascript-only normalization. `reconcile_symbols()` gains a `language` param the two chart call sites now pass. 2. Genuine GitGalaxy false positive (1 occ) -- `ape.mbrpad:` / `.org 0x1b4` in cosmopolitan/ape.S was counted as a subroutine. `func_start` gains a bounded trailing negative lookahead that rejects a label followed (same line or the next line) only by a pure data-emission / location-counter directive (`.asciz`/`.byte`/`.org`/`.endobj`/`.incbin`/NASM `db`/`resb`/ `times`/...). This is the generic-assembly counterpart to agc_assembly's positive "opcode must follow" lookahead, inverted for the own-line-label convention. Section/visibility/type/align directives are deliberately not in the reject list. Against the full corpus this also removed ~30 more genuine data-table labels wrongly counted as functions in ape.S (raw func_start signal 61->39), start.S, and matrixmultneon.s -- all verified against source as declarative data, no real subroutine touched. 3. Real GitGalaxy win (2 occ) -- `.1`/`.2` numeric local *code* labels in bootos/counter.asm that ctags' Asm parser structurally cannot tag. This is now the entire residual of the shape, so it earns `credit_tools: ["gitgalaxy"]`. Both assembly function/existence ledger shapes re-validated. Golden masters re-blessed (assembly corpus files + one global avg tech-debt); tri-comparison chart/ledger/points-of-interest regenerated `--all`; assembly.md sections 3, 5, 7, 9 refreshed. Verification: test_assembly.py + test_assembly_strict.py (231) green, ruff/mypy/dead-key/ast-accuracy baselines clean, crucible_check.py both modes pass, tri_comparison_chart.py --all --ci passes (assembly not baselined; only assembly moved in the full 45-language chart). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
What
Takes generic
assemblytri-comparison Func Precision from 95/102 (93.1%) → a validated 97/97 (100%), GitGalaxy holding the panel badge outright. Run via thetri-comparison-ledger-sweepskill against the language's last remaining precision gap.agc_assemblyis unaffected; onlyassemblymoves in the full 45-language chart.Root cause — the old 7-occurrence
assembly/function/existence/agree[gitgalaxy]_vs[ctags]shape had three separable causes.that GitGalaxy keeps (.loop) and Universal Ctags' Asm parser strips (loop) — the same label at the same line landed in two name buckets and read as a two-sided disagreement.tri_comparison_reconcile.pynow normalizes a single leading dot before cross-tool pairing (_pairing_name), scoped toassembly/agc_assemblyonly.reconcile_symbols()gains alanguageparam the two chart call sites pass.ape.mbrpad:/.org 0x1b4(cosmopolitan/ape.S) counted as a subroutine.func_startgains a bounded trailing negative lookahead rejecting a label followed (same line or next line) only by a pure data-emission / location-counter directive (.asciz/.byte/.org/.endobj/.incbin/NASMdb/resb/times/…). The generic-assembly counterpart toagc_assembly's positive "opcode must follow" lookahead, inverted for the own-line-label convention. Section/visibility/type/align directives deliberately not in the reject list..1/.2numeric local code labels (bootos/counter.asm) that ctags' Asm parser structurally cannot tag. Now the entire residual of the shape.credit_tools: ["gitgalaxy"]on the shape.Run against the full ~80-repo corpus, fix #2 also removed ~30 more genuine data-table labels wrongly counted as functions in
cosmopolitan/ape.S(rawfunc_startsignal 61→39),start.S(ELF-note labels), andhellosilicon/matrixmultneon.s(.short/.fillmatrices) — every one verified against source as declarative data, no real subroutine touched.Why the golden masters changed
tests/golden_master_audit.json/tests/golden_master_zero_dep_audit.jsonre-blessed: 44 diffs each, all in the four assembly corpus files (fewer data labels counted as functions, plus body-slice boundary shifts where a removed data label used to cap a preceding function) + one globalavg_tech_debtaverage (25.019→24.997 ripple). No other language touched. Both modes verified viacrucible_check.py.Also regenerated (
--all)docs/self_scan/tri_comparison_{chart.svg,ledger.json,points_of_interest.md}, anddocs/language_status/assembly.md§§3/5/7/9 (both function/existence shapes now validated → capstone; #1949 noted closed).Verification
test_assembly.py+test_assembly_strict.py— 231 pass;test_language_standards_strict.pygreenfunc_start— flat to n=40000ruff/mypy/ dead-key / ast-accuracy baselines — cleancrucible_check.py— both modes PASS after re-blesstri_comparison_chart.py --all --ci— PASS (javascript/typescript/zig baselines; assembly not baselined)🤖 Generated with Claude Code