fix(agc_assembly): real per-function args count, earn a manual-verification badge - #1952
Merged
Merged
Conversation
…ication badge detector.py's generic args derivation does a single .search() (first match only) against each function body, then splits that one match's text on whitespace. AGC assembly's args regex only ever matches "EBANK=" (1 token) or "OPCODE<ws>REGISTER" (always exactly 2 tokens), so every function's args value was capped at a near-meaningless 0/1/2 regardless of how many registers it actually touched -- not a real argument count, closer to "does this function contain a recognizable calling-convention idiom at all". Adds _count_agc_register_args, wired into _slice_by_labels the same way ABAP's own _count_abap_declared_params overrides the generic derivation: counts the number of DISTINCT registers (A/Q/L/Z) referenced anywhere in the body via a real math/memory opcode (findall, not search-then-split), plus one more if an EBANK=/FBANK=/BBANK= bank-context assignment is present. Corpus-wide total moved 469 -> 296 (a real, varying per-function signal now, not three fixed buckets). Hand-verified against 5 functions across 4 files (see manual_verification.json's new agc_assembly.args entry for the full note). ctags emits no signature: field for Asm-parsed files, so this metric can never be cross-tool corroborated even though agc_assembly has real ctags coverage for func/class existence. Extends tri_comparison_chart.py's manual-verification badge mechanism (previously gated on "the whole language has exactly one tool") to also recognize this narrower, metric-specific case -- gated strictly on ARGS_GRANULARITY's "proxy"/ "program_level" categories, never the default per_function case where a missing second tool really would just mean "not yet compared". Chart now shows 296/296 (verified badge) instead of the old bare 469 proxy marker. Golden master fixtures re-blessed (tests/tools/update_golden_master.py, both full-precision and zero-dependency venvs) -- all 102 diffs traced to agc_assembly's Input Parameters values changing plus expected downstream ripple in the global 3D spatial normalization. crucible_check.py passes clean on both venvs; 785 tests pass (agc_assembly's own 231 + core_engine). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
--ours conflict resolution during rebase onto main (PR #1950) left this generated report stale; regenerated fresh per the standard false-conflict resolution procedure. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
4 tasks
squid-protocol
added a commit
that referenced
this pull request
Aug 20, 2026
…nting (#1955) Same generic single-.search()-then-split derivation bug as agc_assembly (#1949's fix, PR #1952): assembly's args regex has exactly one capturing group, so every match's text has no comma/whitespace to split on -- every function was capped at a bare 0/1 regardless of how many calling-convention registers it actually referenced (rdi/rsi/rdx/rcx/r8/r9/xmm0-7 for x86-64 SysV, x0-7/w0-7/v0-7 for ARM AAPCS, ax/bx/cx/dx/si/di for legacy 16-bit). Adds _count_assembly_register_args (mirrors _count_agc_register_args's pattern): counts DISTINCT argument-passing registers referenced anywhere in the body via .findall, canonicalizing different-width references to the same physical register (edi/rdi, w3/x3, al/ah/ax) to one slot via _ASSEMBLY_ARG_REG_CANON_RE. Hand-verified against matrixmultneon.s's `main` (args=10: x0, x1, v0-v7 -- confirmed by reading every real register reference in the function body, including inside a .macro definition its call sites expand). Also validates both assembly tri-comparison function-existence ledger shapes. Confirmed mechanisms: a dot-prefix NASM/GAS local-label naming split (both tools find the same real label, ctags strips the leading dot GitGalaxy preserves -- a name-string artifact, not a detection gap); a genuine ctags gap on purely-numeric local labels (.1/.2, neither tagged under any name); the SAME #1949 detector.py bug (RELINT-style truncation / single-line-block discard) independently confirmed live here too (del_command, C, prtstr); a correct-by-design GitGalaxy exclusion for GCC's .L-prefix local-label convention (.Lenv0/.Largv0, both real data labels ctags over-tags); and a genuine GitGalaxy precision gap -- unlike agc_assembly's opcode-coupled func_start, generic assembly's has no following-instruction requirement, so it also matches pure data/constant labels (max_entries, *.ident, str.*) ctags is comparatively more conservative about. No credit/debit either direction -- real wins and real gaps mix within both shapes. ctags legitimately earns its first chart badge on assembly's Func Precision panel as a result (92.6% vs GitGalaxy's 85%) -- an honest result, not forced. Golden master fixtures re-blessed (both venvs); crucible_check.py passes clean; 785 tests pass (assembly's own 231 + core_engine). Co-authored-by: Joe Esquibel <squid-protocol@users.noreply.github.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
detector.py's genericargsderivation does a single.search()(first match only) against each function body, then splits that one match's text on whitespace. AGC assembly'sargsregex only ever matchesEBANK=(1 token) orOPCODE<ws>REGISTER(always exactly 2 tokens), so every function's value was capped at a near-meaningless 0/1/2 regardless of how many registers it actually touched -- not a real argument count._count_agc_register_args, wired into_slice_by_labelsthe same way ABAP's own_count_abap_declared_paramsoverrides the generic derivation: counts the number of DISTINCT registers (A/Q/L/Z) referenced anywhere in the body via a real math/memory opcode (.findall, not search-then-split), plus one more if anEBANK=/FBANK=/BBANK=bank-context assignment is present. Corpus-wide total moved 469 -> 296 (a real, varying signal now).manual_verification.json's newagc_assembly.argsentry).tri_comparison_chart.py's manual-verification badge mechanism (previously gated on "the whole language has exactly one tool") to also recognize a narrower, metric-specific case: a language can have real ctags coverage for func/class while ctags structurally cannot ever reportargsat all (nosignature:field for Asm-parsed files). Gated strictly onARGS_GRANULARITY's"proxy"/"program_level"categories -- never the default per-function case, where a missing second tool really would just mean "not yet compared."296/296§with a real GitGalaxy badge on agc_assembly's Args Found panel, instead of the old bare469§proxy marker.update_golden_master.py, both venvs) -- all diffs trace to agc_assembly's Input Parameters values plus expected downstream 3D-layout ripple.Test plan
pytest tests/extraction/languages/test_agc_assembly.py tests/extraction/languages/test_agc_assembly_strict.py tests/core_engine/-- 785 passed, 1 xfailedcrucible_check.py-- clean on both full-precision and zero-dependency venvsruff_audit.py --ci/mypy_audit.py --ci-- no new findings🤖 Generated with Claude Code