refactor: distinguish unloaded extensions from dispatch errors - #190
Conversation
Benchmark Results (Julia v1)Time benchmarks
Memory benchmarks
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@MilesCranmerBot See the CI errors. I think this function |
|
@MilesCranmerBot CI is still failing... Please fix. Also the branch is out-of-date with master. |
- Move node_to_symbolic docstring back to the public entry point in
ExtensionInterface.jl so `?node_to_symbolic` keeps working
- Rename _is_extension_loaded to is_extension_loaded (imported by other code)
- Move is_extension_loaded(::Val{...}) markers to the bottom of each
extension module so consts stay ahead of method definitions
- Fix added tests: wrap extension-dispatched calls in allow_unstable
(DispatchDoctor errors on the varargs wrappers) and use the node-call
return value directly for the bumper check
Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
be0b0b0 to
973feb0
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #190 +/- ##
==========================================
+ Coverage 72.56% 72.88% +0.32%
==========================================
Files 30 30
Lines 2810 2818 +8
==========================================
+ Hits 2039 2054 +15
+ Misses 771 764 -7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Based on #189 by @mvanhorn, with the review fixes from #189 (comment):
node_to_symbolicdocstring now lives on the public entry point inExtensionInterface.jl, so?node_to_symbolickeeps working at the REPL_is_extension_loadedrenamed tois_extension_loadedsince it is imported by other codeis_extension_loaded(::Val{...})markers moved to the bottom of each extension module, keepingconsts ahead of method definitionsallow_unstable(matching this file's existing pattern), and the bumper check uses the node-call return value directly (call syntax returns only the result vector, not a tuple)Original summary (from #189)
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
test/test_initial_errors.jlpasses locally (covers unloaded guidance, loaded happy paths, and post-loadMethodErrordispatch for SymbolicUtils, Zygote, and Bumper)Fixes #68