-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Fix jl_method_lookup_by_tt for custom method tables.
#60718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+27
−6
Conversation
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
`jl_mt_assoc_by_type` was hardcoding `jl_method_table` in its fallback path, causing `jl_method_lookup_by_tt` to incorrectly search the global method table when given a custom one. This resulted in two issues: 1. Methods in custom MTs weren't found when not already cached 2. Global methods were incorrectly cached in custom MT caches, leading to stale entries after redefinition Fix by passing the method table through to `jl_mt_assoc_by_type` so it uses the correct MT for fallback lookups.
vtjnash
approved these changes
Jan 16, 2026
Member
Author
|
This backports cleanly to 1.12 without breaking GPUCompiler, so I propose adding it to that release as well so that we'll be able to use fast method instance lookups on a released version of Julia too. |
maleadt
added a commit
that referenced
this pull request
Jan 20, 2026
They did not reproduce the actual issue because of using cached methods from the OverlayModule.
maleadt
added a commit
that referenced
this pull request
Jan 20, 2026
DilumAluthge
pushed a commit
that referenced
this pull request
Jan 20, 2026
DilumAluthge
pushed a commit
that referenced
this pull request
Jan 20, 2026
…60750) I'm only backporting this because I know we're doing another 1.11 release anyway. This fixes bugs with GPUCompiler.jl that would otherwise require expensive workarounds for every GPU kernel launch.
maleadt
added a commit
that referenced
this pull request
Jan 20, 2026
This was referenced Jan 26, 2026
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport 1.12
Change should be backported to release-1.12
backport 1.13
Change should be backported to release-1.13
types and dispatch
Types, subtyping and method dispatch
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.
jl_mt_assoc_by_typewas hardcodingjl_method_tablein its fallback path, causingjl_method_lookup_by_ttto incorrectly search the global method table when given a custom one. This resulted in two issues:jl_method_lookup_by_ttdoesn't find overlay method #60716)jl_method_lookup_by_ttwith overlay MT doesn't always always respect redefinitions #60712)Fix by passing the method table through to
jl_mt_assoc_by_typeso it uses the correct MT for fallback lookups.This behavior is "more strict", since
jl_method_lookup_by_ttqueries with a method table specified won't return global methods now, so I'm not sure if we should backport this very far. Other areas are not affected by this, e.g., GPUCompiler.jl's inference uses explicit StackedMethodTables.Fixes #60712, fixes #60716, fixes #60702.