Skip to content

test(recall-audit): stop counting tree-sitter's mistakes as GitGalaxy misses — c/cpp/fortran/objc → ~100% recall - #2463

Merged
squid-protocol merged 4 commits into
mainfrom
func-recall-fixes
Aug 29, 2026
Merged

test(recall-audit): stop counting tree-sitter's mistakes as GitGalaxy misses — c/cpp/fortran/objc → ~100% recall#2463
squid-protocol merged 4 commits into
mainfrom
func-recall-fixes

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Depends on #2458 (the step 2.6 process change + recall_audit.py — this branch includes its
commit; merge #2458 first). This PR executes step 2.6 for the 4 languages whose func recall
was < 100% and dominated by measurement noise.

Every function tree-sitter reported that GitGalaxy did not was individually read. The corrections
are all in tree_sitter_accuracy_audit.py's ground-truth walk (real_funcs) — never a gated
metric.

Corrections (bucket 2 — tree-sitter artifacts)

Mechanism Fix
#if 0 / #if false dead blocks (c + cpp) _find_dead_preproc_ranges (Claim 8)
Function-like macro invocations — OPCODE(X) { (~96), IFACEMETHOD_, bare if/for after a macro _CPP_KNOWN_MACRO_HALLUCINATIONS
= default / = delete special members (cpp) not body-bearing → drop
_FORCE_INLINE_-mangled parses (ERROR child, class_specifier as return type, field-with-initializer) drop; + drop tree-sitter's names inside a cpp/fortran blind spot (symmetric half of #2455's #1849 promotion)
fortran #ifdef VERT_UNIT unit-test program X … end program X drivers mark blind spots when the file also defines a module
tree-sitter naming a NeXT-era - unsigned char foo objc method by its return type _get_node_name uses the real selector (objc-only)

Result

Lang Func recall Func precision
C 99.7% → 100.0% 99.5% (unchanged)
Cpp 89.3% → 99.9% 100.0% (unchanged)
Fortran 98.6% → 100.0% 100.0% (unchanged)
Objective-C 98.7% → 100.0% 98.1% → 99.4%

tree_sitter_accuracy_audit --all --ci 31/31 OK. No engine change, no golden-master
re-bless. Baselines + summary table regenerated.

Genuine GitGalaxy recall gaps this surfaced (bucket 1 — filed)

Standing list: tri_comparison_README.md's RECALL_AUDIT block; per-language detail in each docs/language_status/<lang>.md §9.

🤖 Generated with Claude Code

https://claude.ai/code/session_019Zm1uVBpVEZJ9SB7bWFR8S

squid-protocol added a commit that referenced this pull request Aug 29, 2026
#2459 is the shell keyword-as-argument issue this audit work surfaced,
not the audit correction itself.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Zm1uVBpVEZJ9SB7bWFR8S
squid-protocol and others added 4 commits August 29, 2026 18:33
…laxy misses

Step 2.6's recall audit run against c / cpp / fortran / objective-c. Every
function tree-sitter reported that GitGalaxy did not was individually read;
the large majority were tree-sitter parse artifacts the accuracy audit was
wrongly folding into GitGalaxy's recall denominator. Corrections, all in
tree_sitter_accuracy_audit.py's ground-truth walk (real_funcs), never a
gated metric:

- `#if 0` / `#if false` dead-block detection (c + cpp) -- tree-sitter has
  no preprocessor model and parses the dead branch. `_PyObject_Managed
  DictValidityCheck`, `print_stack`, sqlite/lemon.c's K&R `PlinkPrint` /
  `SetPrint` are all inside `#if 0`. docs Claim 8's exact shape.
- `_CPP_KNOWN_MACRO_HALLUCINATIONS` (mirror of `_C_...`) -- `OPCODE(X) {`
  (~96, godot's bytecode computed-goto table), `IFACEMETHOD_`, and the
  bare control-flow keywords (`if`/`for`/...) error recovery emits as a
  "function name" after a macro in statement position.
- cpp `= default` / `= delete` special members -- not body-bearing, so
  GitGalaxy correctly doesn't count them (same rule as perl bodyless).
- cpp function_definition with an ERROR / class_specifier child -- a
  corrupted `_FORCE_INLINE_`-mangled parse or a field-with-initializer
  (`ptr_type _value = ptr_type();`) read as a definition. Name unreliable.
- cpp / fortran: a function_definition tree-sitter built INSIDE an
  already-identified blind spot is not ground truth -- #1849 Phase 2 already
  promotes GitGalaxy's correct reading there; this is the symmetric half.
- fortran: a WRF-style module file's `#ifdef VERT_UNIT` unit-test driver
  `program X ... end program X` blocks are dead when built as a module;
  mark them blind spots.
- objective-c `_get_node_name`: name a NeXT-era `- unsigned char foo` /
  `- void bar` method (no parenthesised return type) by its real selector,
  not by the return-type token tree-sitter picks. objc-only (the leading
  `-`/`+` marker gates it away from JS/TS `method_definition`).

Measured (recall / precision):
  c          99.7% -> 100.0%  /  99.5%  (unchanged)
  cpp        89.3% ->  99.9%  / 100.0%  (unchanged)
  fortran    98.6% -> 100.0%  / 100.0%  (unchanged)
  objc       98.7% -> 100.0%  /  98.1% -> 99.4%

`tree_sitter_accuracy_audit --all --ci` 31/31 OK; no engine change, no
golden-master re-bless. Baselines + summary table regenerated.

The genuine GitGalaxy recall gaps this surfaced are filed separately
(cpp macro-return-type `STDAPI Foo()`; shell keyword-as-argument;
lua multi-statement `local function` line). dart's remaining 9 stay in
#2072.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Zm1uVBpVEZJ9SB7bWFR8S
- tri_comparison_README.md's RECALL_AUDIT block: the complete list of
  genuine GitGalaxy function-recall gaps across the whole corpus (4 forms,
  each linked to #2459/#2460/#2461/#2462), plus a one-line note that
  everything else recall_audit.py prints is a catalogued tool artifact.
- c.md / cpp.md / fortran.md / lua.md §9: a "Recall audit" subsection per
  skill step 2.6 -- the before/after recall number, "every non-detection
  individually assessed", and the per-mechanism bucket breakdown with
  file:line citations.
- lua.md §5: corrected -- `constructs.lua:f` is a real gap (`local a;
  local function f`), not alignment fuzz; both lua misses are now #2461.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Zm1uVBpVEZJ9SB7bWFR8S
#2459 is the shell keyword-as-argument issue this audit work surfaced,
not the audit correction itself.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Zm1uVBpVEZJ9SB7bWFR8S
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit fdf0243 into main Aug 29, 2026
30 checks passed
@squid-protocol
squid-protocol deleted the func-recall-fixes branch August 29, 2026 22:41
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.

dart func_start: remaining recall/precision gaps from the switch-expression-arm sweep (#2071 follow-up)

1 participant