Skip to content

fix(tree_sitter_accuracy_audit): csharp ground truth misses methods after a ref-struct parse error - #1551

Merged
squid-protocol merged 3 commits into
mainfrom
fix/csharp-1427-parse-error-narrow
Aug 14, 2026
Merged

fix(tree_sitter_accuracy_audit): csharp ground truth misses methods after a ref-struct parse error#1551
squid-protocol merged 3 commits into
mainfrom
fix/csharp-1427-parse-error-narrow

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Fixes #1427.

Summary

tree-sitter-c-sharp's bundled grammar fails to parse C# 7.2+ ref struct syntax -- specifically private ref struct DisposableResetPoint at roslyn/LanguageParser.cs:14575. This triggers a cascading ERROR node in the parse tree that swallows a large downstream region of the file, so tree-sitter ground-truth extraction produces zero method_declaration nodes for several real methods buried in that region (not just the one originally reported: AccumulateExplicitInterfaceName, CanFollowCast, CanReuseVariableDeclarator all confirmed affected). The audit tool's set-difference "extra" classification then misclassifies GitGalaxy's own correct matches for those names as false positives.

This is a measurement-tool ground-truth gap (tests/tools/tree_sitter_accuracy_audit.py), not a GitGalaxy precision defect -- same class as the existing Flow-typed-JS ground-truth gap already handled in this tool. True recovery isn't feasible: the ERROR node has no salvageable structural subtree, just flat unstructured tokens (would require writing a mini C# parser). Narrow, file+name-scoped exclusion follows the established precedent instead.

Numbers

extra_functions: 319 -> 316 (csharp corpus). No gitgalaxy/ code changed.

Test plan

  • tree_sitter_accuracy_audit.py --lang csharp -- confirmed AccumulateExplicitInterfaceName etc. no longer misclassified
  • tree_sitter_accuracy_audit.py --all --ci -- clean across all 31 languages
  • crucible_check.py --mode both -- PASS/PASS (no drift, audit-tool-only change)
  • audit_check.py --ci -- all clear

🤖 Generated with Claude Code

squid-protocol and others added 3 commits August 13, 2026 23:04
…fter a ref-struct parse error

#1427: tree-sitter-c-sharp's bundled grammar fails to parse C# 7.2+ `ref
struct` syntax (`private ref struct DisposableResetPoint` at
roslyn/LanguageParser.cs:14575), producing a cascading ERROR node that
swallows a large downstream region of the file. Ground truth extraction
then has zero method_declaration nodes for several real methods buried in
that region, so the audit tool's set-difference "extra" classification
misclassifies GitGalaxy's own correct matches for those names as false
positives.

This is a measurement-tool ground-truth gap, not a GitGalaxy precision
defect -- same class as the Flow-typed JS ground-truth gap already handled
in this tool. True recovery isn't feasible (the ERROR node has no salvageable
structural subtree, just flat tokens); narrow exclusion for the three
confirmed-affected real names follows the established precedent.

extra_functions: 319 -> 316 (csharp corpus), no other GitGalaxy code changed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Rebased onto current main and regenerated the csharp baseline + summary
table against the combined state. No additional code change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@squid-protocol
squid-protocol merged commit 63ba888 into main Aug 14, 2026
27 checks passed
@squid-protocol
squid-protocol deleted the fix/csharp-1427-parse-error-narrow branch August 14, 2026 03:10
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

squid-protocol added a commit that referenced this pull request Aug 14, 2026
Per CLAUDE.md's standing instruction to log evidenced cases of GitGalaxy
beating tree-sitter ground truth as their own dated claim. #1427 (merged
#1551) is a genuinely new mechanism, distinct from the existing two claims:
tree-sitter-c-sharp fails to parse valid C# 7.2+ `ref struct` syntax, and the
resulting ERROR node cascade swallows unrelated real methods elsewhere in the
file -- a grammar parse-error/version-gap corrupting ground truth for
syntactically-unrelated code, not a dialect the grammar has no concept of
(Claim 2) or a language-design absence of formal syntax (Claim 1).

Co-authored-by: Joe Esquibel <squid-protocol@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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.

tree_sitter_accuracy_audit.py: csharp ground truth misses a real method due to a tree-sitter parse error in a large corpus file

1 participant