Repository navigation
Closed
Labels
bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing enginepriority: highCore feature broken, but workarounds existtestingUnit, integration, and E2E pipeline verificationthreat: false-negativeAccuracy tuning: Engine missed a bypass or vulnerability
Description
Summary
GitGalaxy's C++ func_start regex has a severe dual failure: 5.7% recall (only 5 real functions found out of 87) AND 0.4% precision (1,147 spurious matches vs. 87 real functions in corpus).
Related epic: #1261
Measurements
From tests/tree_sitter_accuracy_baseline_cpp.json:
files_scanned: 29real_functions: 87found_functions: 5 (5.7% recall)extra_functions: 1147 (massive false-positive burden)real_classes: 140found_classes: 138extra_classes: 29args_comparable: 5args_exact_match: 0
What this means
Unlike a narrow regex that simply misses some valid patterns (Tier 3), this regex is both:
- Broken at detection: missing 82 out of 87 real definitions
- Broken at precision: matching ~13x as many false positives as there are real functions in the entire corpus
This suggests the regex is matching something systematically wrong: likely function calls, template instantiations, constructor initializer lists, or macro expansions rather than actual definitions.
Action
- Examine the C++
func_startregex ingitgalaxy/standards/language_standards.py - Examine real C++ function definitions in
language-crucible/data/cpp(29 files) to identify valid definition patterns - Sample some of the 1,147 false positives: trace which syntactic elements they're matching (use
tests/tools/tree_sitter_accuracy_audit.pywith verbose output if available, or inspect manually) - Follow the
harden-language-extractionskill's methodology (gitgalaxy/standards/how_to_add_a_language.md) - Before pushing, run
python tests/tools/crucible_check.pyto confirm no cross-language regressions
Notes
- C++ is structurally complex (templates, macros, multiple definition syntaxes) but the corpus should be representative. Precision/recall both failing simultaneously is an unusual pattern worth investigating carefully.
- Class detection on the same files is working (138/140 = 99%), which rules out "the corpus is just hard" as the explanation.
Metadata
Metadata
Assignees
Labels
bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing enginepriority: highCore feature broken, but workarounds existtestingUnit, integration, and E2E pipeline verificationthreat: false-negativeAccuracy tuning: Engine missed a bypass or vulnerability
Activity
squid-protocol commentedon Aug 11, 2026
Fixed in #1281 (stacked on #1280, which needs to merge first).
Investigation found the original 5.7%/0.4% numbers were already stale measurement-tool artifacts — #1265/PR #1280 fixed a bug where the tree-sitter ground truth couldn't name any C/C++ function at all. Correctly measured, this issue's real baseline was actually 91%/94% recall/precision, not 5.7%/0.4%.
From there, three real engine bugs (not measurement bugs) were found and fixed in #1281:
func_start's return-type loop only matchedType* name(), not the equally-commonType *name()/Type * name()styles — this alone was the largest recall gap (many missed pointer/reference-returning getters)._extract_namedropped the class qualifier on operator overloads (Array::Iterator::operator*→operator*), colliding same-symbol operators across classes._extract_name's cleanup charset was missing~, colliding qualified destructors with their own class's constructor.Final measured state: 93% recall, 95% precision on the pinned corpus (up from the corrected-but-still-broken 91%/94% baseline). See #1281 for residual known gaps (parse-error files, macro-wrapped control flow, conversion operators, lambda-initializer ambiguity) and #1282 for a separately-filed C/C++
args-counting bug found along the way.test(core): update test_detector_cpp_objc_name_extraction for #1263's…
fix(core): C++ func_start missed pointer/reference returns and mishan…
fix(core): C args regex never recognized custom typedef'd parameter t…