Fixes related to FunctionWrappers and wrapped number types#3293
Merged
Conversation
The FunctionWrapper type reaching abstract interpretation may be a UnionAll when inference is imprecise, accessing .parameters on it threw a FieldError and aborted compilation. Rewrite only fully determined calls. Created by generative AI.
Reactant's kind-split number types (TracedRFloat, ConcretePJRTFloat, ...) subtype AbstractFloat and Integer, so active_reg_inner classified them as raw scalars (ActiveState) before the is_wrapped_number check could see them: Enzyme.gradient then annotated them Active instead of Duplicated. Move the wrapped-number check ahead of the BigFloat/AbstractFloat fast paths and extend the recognized names to the kind-split types. Compare module names with nameof instead of string: identical for the root modules being matched, allocation-free, and it makes the classification testable with mock modules, without a Reactant dependency. Created by generative AI.
Contributor
Author
|
@wsmoses EnzymeAD/Reactant.jl#2170 needs this to work. |
wsmoses
approved these changes
Jul 8, 2026
Contributor
Author
|
Runic failure seems due to failed Runic installation. Distributions integration test failure on Julia v.1.10 looks pre-existing? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3293 +/- ##
==========================================
+ Coverage 74.28% 74.35% +0.06%
==========================================
Files 66 66
Lines 22602 22601 -1
==========================================
+ Hits 16791 16805 +14
+ Misses 5811 5796 -15 ☔ 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.
While making a new attempt at EnzymeAD/Reactant.jl#2170 and (independently) making MGVI.jl Reactant-compatible, I needed these fixes.
The fixes are AI-generated (Claude Fable at max effort), but I reviewed them and tested them with Reactant (EnzymeAD/Reactant.jl#2170) and MGVI (in-flight improvements).