[travsr-analysis] #780 reconcile scip-ruby accessor/operator/DSL symbols - #793
Open
Abhishek5517 wants to merge 2 commits into
Open
[travsr-analysis] #780 reconcile scip-ruby accessor/operator/DSL symbols#793Abhishek5517 wants to merge 2 commits into
Abhishek5517 wants to merge 2 commits into
Conversation
Benchmark comparison (master → PR)Threshold: p95 regression ≥ +10% fails this check. |
Abhishek5517
force-pushed
the
fix/travsr-store-780-scip-ruby-symbol-reconciliation
branch
from
August 24, 2026 12:11
64be1d0 to
0527899
Compare
scip-ruby reported ~52% of semantic definitions as unreconciled on Ruby corpora (fastlane: 8572/16527). The number was three unrelated causes wearing one figure. This fixes all three plus the tokenization and measurement issues that let them escape, taking fastlane's rate to 36/10697 (0.34%). Prong A (measurement honesty + precision): - scip_name_kind: parse the descriptor chain backtick-aware. The 4 metadata fields split on the 4th space (not split_whitespace().last()), and the leaf/container/paren splits skip separators inside backticks, so RSpec DSL scopes whose descriptions contain spaces, '#' or '/' parse intact instead of as garbage that still counted as a miss. - is_synthetic_dsl_scope: recognize Sorbet DSL meta-scopes (describe/context/it blocks) that have no tree-sitter twin, distinguishing them from real Class:/Module: singleton scopes and from operator methods that start with '<'. - unify_all: drop synthetic DSL defs and defs in files tree-sitter never indexed (gitignored vendored code scip-ruby indexes anyway); exclude both from the attempted/missed counters and drop their inbound refs/edges so they stop stealing spec-file references. Adds Store::phase_a_indexed_paths. - Unwrap a Class:/Module: leaf (a metaclass) to the real type so it unifies onto class:X instead of orphaning. Prong B (real reconciliation, Ruby parser): - capture setter (def x=) and operator (def ==, <=>, [], []=, ...) methods, whose name node is not an identifier. - new post_parse hook expands attr_accessor/attr_reader/attr_writer into reader/writer method nodes, and Struct.new into class:X plus member accessors, block methods, and the implicit initialize. Guards against double-emission when an explicit def also exists. Prong C: emit constants (const:X) and instance variables (field:C.@x) as def nodes so scip const/ivar references stop resolving to duplicates. Schema unchanged (v22); no plugin-* src touched. Unit tests lock each behavior.
Abhishek5517
force-pushed
the
fix/travsr-store-780-scip-ruby-symbol-reconciliation
branch
from
August 24, 2026 12:12
0527899 to
8619614
Compare
Ad-hoc probe_*/*_probe/calib_* example binaries under crates/*/examples were untracked scratch that could be swept into a commit by a broad `git add`. Ignore them by pattern; the one real tracked example (rerank_bench.rs) does not match.
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.
Issue
#780: on Ruby corpora,
travsr statuswarned that ~52% of semantic definitions did not reconcile with the tree-sitter parse (fastlane @ 426146e:8572/16527, 51.9%), so references could resolve to duplicate orphan nodes.The 52% was three unrelated causes wearing one figure. This PR fixes all three, plus the tokenization and measurement issues that let them escape.
Result (fastlane, clean semantic reindex)
travsr fsckclean (no ghost nodes). Proof casesupply/lib/supply/generated_universal_apk.rb: the 4attr_accessoraccessors (reader+writer) and==now have realmethod:twins, thescip:twins are gone, andtravsr references package_name/travsr graph ==resolve to the real node.What changed
Prong A (measurement honesty + precision) -
travsr-indexer,travsr-daemon,travsr-store:scip_name_kindparses the descriptor chain backtick-aware: the four metadata fields split on the 4th space (notsplit_whitespace().last()), and the leaf/container/paren splits skip separators inside backticks. RSpec DSL scopes whose descriptions contain spaces,#or/now parse intact instead of as garbage that still counted as a miss.is_synthetic_dsl_scoperecognizes Sorbet DSL meta-scopes (describe/context/itblocks) that have no tree-sitter twin, distinguishing them from real<Class:>/<Module:>singleton scopes and from operator methods that start with<.unify_alldrops synthetic DSL defs and defs in files tree-sitter never indexed (gitignored vendored code scip-ruby indexes anyway), excludes both from the attempted/missed counters, and drops their inbound refs/edges so they stop stealing spec-file references. AddsStore::phase_a_indexed_paths.<Class:>/<Module:>leaf (a metaclass) unwraps to the real type so it unifies ontoclass:X.Prong B (real reconciliation) -
travsr-analysis:def x=) and operator (def ==,<=>,[],[]=, ...) methods, whose name node is not anidentifier.post_parsehook onLanguageConfig(Ruby only) expandsattr_accessor/attr_reader/attr_writerinto reader/writer method nodes, andStruct.newintoclass:Xplus member accessors, block methods, and the implicitinitialize. Guards against double-emission when an explicitdefalso exists.Prong C -
travsr-analysis:const:X) and instance variables (field:C.@x) as def nodes so scip const/ivar references stop resolving to duplicates.Notes
travsr-plugin-*src touched, so noplugin-hashes.lockregeneration.post_parse: None.ruby.rs,generic.rspath, indexerscip_unifier.rs, daemonscip_unifier.rs, andstorelock each behavior in.Out of scope (residual 36)
A handful of edge cases remain: methods added by reopening core classes (
Hash), a few metaprogramming-defined methods, and classes defined insidedescribeblocks. These are distinct constructs, not part of this issue's root causes.