| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…yGlobal
The native Rust engine's mirror of resolveByGlobal had an extra
resolution tier ("Broader fallback: same-file suffix scan") for this/
self/super receivers with no equivalent in the WASM/TS engine
(src/domain/graph/resolver/strategy.ts) - a pre-existing divergence
from the native-engine mirroring refactor (commit f814067, PR #1463),
predating and unrelated to #1863's resolveByGlobal fan-out fix.
Verified via a direct native-vs-native (fallback enabled vs disabled)
build comparison across all 34 tests/benchmarks/resolution/fixtures/<lang>
projects: zero edge differences in any fixture. Steps 1-3 of the
cascade (Object.defineProperty accessor dispatch, exact global name
lookup, class-scoped exact lookup) already find everything real code in
these fixtures needs - this tier never actually fired. Removed rather
than ported to TS, restoring dual-engine cascade parity. Also removed
the now-unused nodes_by_file field/population this tier was the sole
consumer of.
cargo test --release: 669 passed. npm test: 260 files, 4207 passed, 0
failed.
No README/CLAUDE.md/ROADMAP.md changes needed, docs check acknowledged.
Closes #1999
Greptile SummaryRemoves a native-only same-file suffix fallback from call-target resolution, restoring parity with the TypeScript resolver.
Confidence Score: 5/5The PR appears safe to merge with no actionable defects identified. The removed fallback had no TypeScript equivalent, its supporting index had no other consumer, and the remaining resolution cascade preserves the repository’s native/TypeScript parity contract. Important Files Changed
Reviews (1): Last reviewed commit: "fix(native): remove dead same-file suffi..." | Re-trigger Greptile |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
The native Rust engine's mirror of resolveByGlobal (crates/codegraph-core/.../build_edges.rs) had an extra resolution tier — "Broader fallback: same-file suffix scan" — for this/self/super receivers, with no equivalent in the WASM/TS engine (src/domain/graph/resolver/strategy.ts's resolveByGlobal). Pre-existing divergence from the native-engine mirroring refactor (commit f8140671, PR #1463), unrelated to #1863's resolveByGlobal fan-out fix that surfaced it.
Investigation
Per the issue's own suggested resolution path — port the tier to TS, or determine it's a native-only addition safe to remove — I verified empirically rather than guessing:
This means steps 1-3 of the cascade (Object.defineProperty accessor this-dispatch, exact global name lookup, class-scoped exact lookup) already find everything real code in these fixtures needs — the fourth tier never actually fired for any hand-annotated case across 34 languages. Structurally, it's also a plausible bug-masking tier rather than a legitimate need: it extracts the caller's class prefix via the first dot in caller_name (caller_name.find('.')), while step 3 (and TS's own equivalent) correctly use the last dot (rfind) to get the innermost enclosing class for nested/qualified names — the two would disagree for any deeply-qualified caller name.
Removed the tier entirely (restoring cascade parity with TS) rather than porting it, since porting would add complexity for a fallback with no demonstrated practical benefit and a structurally questionable design. Also removed nodes_by_file, the EdgeContext field this tier was the sole consumer of — otherwise it would have been dead code emitting a compiler warning.
Verification
Closes #1999