fix(registry): don't swallow call suffixes on aliased-import direct hits#1011
Merged
Conversation
The #979 direct-hit early return in resolve_import_map fires before suffix handling, so any imported_symbol.method() call whose base symbol is itself an indexed node resolved to the base node instead of base.method — the exact mis-resolution the neighboring comment warns about. On django this degraded the graph by ~11K edges (CALLS 74,685->72,175, TESTS 38,032->29,236); auth.login => Signal.send became an edge onto the user_logged_in Variable node. Take the direct hit only for suffix-less callees — precisely the aliased direct-symbol import case (#875) the early return was added for. Verified on django: CALLS 74,708 (baseline + the 23 genuine #979 wins), TESTS 38,035; the #979 bare-alias test stays green. Reproduce-first: resolve_import_map_alias_with_suffix_hits_method is RED on the unguarded code (returns the bare symbol QN) and GREEN with the guard. Closes #1000 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
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.
Closes #1000.
Bisected regression from #979 (not in any release — v0.9.0 predates it). The direct-hit early return in
resolve_import_mapfires before suffix handling, soimported_symbol.method()calls whose base symbol is an indexed node bound to the base node instead ofbase.method.Measured on django (identical checkout, full mode):
The fix keeps #979's feature intact (direct hit only for suffix-less callees — the aliased bare-call case it was written for); the +23 CALLS over baseline are #979's genuine wins. Example of the regression:
auth.login ⇒ Signal.sendhad degraded to an edge onto theuser_logged_inVariable node.Reproduce-first:
resolve_import_map_alias_with_suffix_hits_method— RED on unguarded code, GREEN with the fix; #979's ownresolve_import_map_bare_aliasstays green (registry suite 56/56). lint-ci clean.Thanks @LA-10 — the #979 feature itself is solid; this only scopes its early return.