Skip to content

fix(assembly): data-label func_start false positives + tri-comparison reconciler dot-normalization - #2320

Merged
squid-protocol merged 1 commit into
mainfrom
fix-assembly-tricomparison-precision
Aug 27, 2026
Merged

fix(assembly): data-label func_start false positives + tri-comparison reconciler dot-normalization#2320
squid-protocol merged 1 commit into
mainfrom
fix-assembly-tricomparison-precision

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

What

Takes generic assembly tri-comparison Func Precision from 95/102 (93.1%) → a validated 97/97 (100%), GitGalaxy holding the panel badge outright. Run via the tri-comparison-ledger-sweep skill against the language's last remaining precision gap. agc_assembly is unaffected; only assembly moves in the full 45-language chart.

Root cause — the old 7-occurrence assembly/function/existence/agree[gitgalaxy]_vs[ctags] shape had three separable causes

# occ cause fix
1 4 Name-serialization artifact. NASM/GAS local labels carry a leading . 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.py now normalizes a single leading dot before cross-tool pairing (_pairing_name), scoped to assembly/agc_assembly only. reconcile_symbols() gains a language param the two chart call sites pass.
2 1 Genuine GitGalaxy false positive. ape.mbrpad: / .org 0x1b4 (cosmopolitan/ape.S) counted as a subroutine. func_start gains 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/NASM db/resb/times/…). 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 deliberately not in the reject list.
3 2 Real GitGalaxy win. .1/.2 numeric 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 (raw func_start signal 61→39), start.S (ELF-note labels), and hellosilicon/matrixmultneon.s (.short/.fill matrices) — 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.json re-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 global avg_tech_debt average (25.019→24.997 ripple). No other language touched. Both modes verified via crucible_check.py.

Note: local golden-master regen initially showed 56 cross-language diffs — traced to scan-artifact directories (.gitgalaxy/, .gradle/, a stray ast_ground_truth.db) sitting untracked inside the local language-crucible checkout and being ingested. Removed those; clean main then reproduced both fixtures exactly before re-blessing.

Also regenerated (--all)

docs/self_scan/tri_comparison_{chart.svg,ledger.json,points_of_interest.md}, and docs/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.py green
  • ReDoS adversarial scaling on the new func_start — flat to n=40000
  • ruff / mypy / dead-key / ast-accuracy baselines — clean
  • crucible_check.py — both modes PASS after re-bless
  • tri_comparison_chart.py --all --ci — PASS (javascript/typescript/zig baselines; assembly not baselined)

🤖 Generated with Claude Code

… 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>
@squid-protocol
squid-protocol merged commit 51ce6c9 into main Aug 27, 2026
28 checks passed
@squid-protocol
squid-protocol deleted the fix-assembly-tricomparison-precision branch August 27, 2026 13:01
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

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