Repository navigation
Remove invalidating show method for GeneratedKernelError - #895
Merged
Merged
Conversation
The `Base.show(::IO, ::Type{GeneratedKernelError{Msg}})` method invalidated
3054 MethodInstances of `show(::IO, ::Type)` callers when loading the package
(3297 invalidations total on Julia 1.12, 178 without it). It also threw
UndefVarError when printing the UnionAll `GeneratedKernelError{Msg}`. Without
it the type prints as `GeneratedKernelError{Symbol("...")}`, which still
carries the generator error message.
Contributor
Benchmark ResultsShow table
Benchmark PlotsA plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR. |
vchuravy
approved these changes
Oct 13, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #895 +/- ##
==========================================
- Coverage 82.59% 82.58% -0.02%
==========================================
Files 28 28
Lines 2454 2452 -2
==========================================
- Hits 2027 2025 -2
Misses 427 427 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
The
Base.show(::IO, ::Type{GeneratedKernelError{Msg}})overload invalidates 3054 MethodInstances ofshow(::IO, ::Type)callers when KernelAbstractions loads (measured with SnoopCompile on Julia 1.12 with all dependencies preloaded: 3297 invalidations in total before, 178 after). Every KA user pays for that at load time.The method was also broken: printing the UnionAll
GeneratedKernelError{Msg}, e.g. in a method signature, threwUndefVarError: Msg not defined in static parameter matching.Without it, a failing
generated=truekernel now reports:The message is still there, just wrapped in
Symbol(...). The existing tests intest/unroll.jlpass unchanged.