fix(testing): replace csharp's #1427 3-name exclusion with a general parse-cascade detector - #1585
Merged
Merged
Conversation
…general detector #1427 found tree-sitter-c-sharp misparsing roslyn/LanguageParser.cs and hand-excluded 3 affected names, attributing it to a `ref struct` at line 14575. #1567 found that attribution wrong: the ref struct parses cleanly in isolation, and the real trigger is a C# 11 list-pattern + property-pattern construct at line 5198 -- ~9,500 lines earlier -- after which tree-sitter recovers 0 real_functions for the rest of the file, not just 3. Replaces the hand-listed exclusion with _find_trailing_error_cascade_start, a general, language-agnostic detector: any file where a large ERROR span extends to (or near) EOF has its trailing GitGalaxy matches excluded from the extra_functions count, since ground truth is structurally blind there regardless of which language or which construct triggered it. No more re-diagnosing and re-hand-listing names every time the pinned corpus changes. csharp: extra_functions 316 -> 1, precision 67.0% -> 99.8%. Since the detector is general, it also fixed previously-undiagnosed cascades in other pinned corpus files -- all pure improvements, baselines regenerated: javascript extra_functions 197 -> 11 (precision 75.3% -> 98.2%), python 32 -> 0 (99.1% -> 100%), powershell 1 -> 0 (99.1% -> 100%), tcl 2 -> 1 (98.6% -> 99.3%). Fixes #1567 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
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
roslyn/LanguageParser.cs, hand-excluded 3 affected names, and attributed it to aref structat line 14575.ref structparses cleanly in isolation. The real trigger is a C# 11 list-pattern + property-pattern construct at line 5198 (modifiers is [.., SyntaxToken { Kind: ... } scopedKeyword]) — after which tree-sitter recovers 0real_functionsfor the rest of the 14,680-line file, not just 3 names._find_trailing_error_cascade_start, a general, language-agnostic detector: any file where a largeERRORspan extends to (or near) EOF has its trailing GitGalaxy matches excluded fromextra_functions, since ground truth is structurally blind there regardless of language or trigger construct.extra_functions316 → 1, precision 67.0% → 99.8%.extra_functions197 → 11 (precision 75.3% → 98.2%), python 32 → 0 (99.1% → 100%), powershell 1 → 0 (99.1% → 100%), tcl 2 → 1 (98.6% → 99.3%).Fixes #1567
Test plan
python tests/tools/tree_sitter_accuracy_audit.py --lang csharp— baseline regenerated, numbers abovepython tests/tools/tree_sitter_accuracy_audit.py --all --ci— all 31 languages pass after regenerating the 5 affected baselines--summary-tableregenerated ingitgalaxy/standards/language_standards.py🤖 Generated with Claude Code