fix: Distinguish unloaded extensions from dispatch errors - #189
Closed
mvanhorn wants to merge 1 commit into
Closed
Conversation
Contributor
Benchmark Results (Julia v1)Time benchmarks
Memory benchmarks
|
Member
|
@MilesCranmerBot can you make a new PR based on this, but which implements the following fixes?
Load ponytail skill |
Contributor
|
Done: #190 — based on @mvanhorn's branch with the three fixes:
Also fixed two issues in the new tests that would have failed CI: the varargs dispatch wrappers trip DispatchDoctor, so successful extension-dispatched calls are now wrapped in |
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.
DynamicExpressions currently implements several optional-package entry points as catch-all methods that always report that the corresponding extension is not loaded. Once SymbolicUtils, Zygote, or Bumper is loaded, an unsupported argument combination can still fall through to that catch-all and produce the same message, incorrectly blaming extension loading instead of method dispatch. The issue proposes an extension-presence predicate plus separate internal generics so the package can distinguish these cases without adding runtime overhead, and the maintainer acknowledged the problem. The supplied timeline contains no prior closed attempts or competing open pull requests.
Summary
Add a shared,
Val-dispatched extension-presence predicate insrc/ExtensionInterface.jl, and make each affected public/core entry point check its extension state before delegating to a separate internal generic. Update the SymbolicUtils, Zygote, and Bumper extension modules to mark themselves loaded and attach their existing implementations to those internal generics, preserving current successful behavior and unloaded-package guidance. When an extension is loaded but no implementation matches, allow normal Julia dispatch to surface aMethodErrorrather than emitting the false “please load” message.Verification
node_to_symbolic,symbolic_to_node, Zygote-backed differentiation, and Bumper-backed evaluation retain their current package-specific guidance.Fixes #68