Fix Julia 1.11 compatibility by handling SSAValue callees#39
Closed
ChrisRackauckas-Claude wants to merge 1 commit into
Closed
Fix Julia 1.11 compatibility by handling SSAValue callees#39ChrisRackauckas-Claude wants to merge 1 commit into
ChrisRackauckas-Claude wants to merge 1 commit into
Conversation
In Julia 1.11, the IR representation changed: function calls now store the function reference in an SSA slot first, then use SSAValue as the callee. For example: %1 = Main.:+ %3 = (%1)(x, y) The _pass function was wrapping callstmt.args[1] with :nooverdub unconditionally, which doesn't work when args[1] is an SSAValue (the function lookup already happened in a prior statement). This fix only wraps the callee with :nooverdub when it's a GlobalRef, which preserves correct behavior on Julia 1.10 while fixing 1.11. Also updates the test file to work with current Lux API (the deprecated Lux.apply_activation was replaced with identity broadcasting). Fixes SciML#18 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
68fc571 to
5319fa9
Compare
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.
Summary
This PR fixes the Julia 1.11 segfault/crash reported in #18.
Root Cause
In Julia 1.11, the IR representation changed: function calls now store the function reference in an SSA slot first, then use
SSAValueas the callee. For example:Julia 1.10 IR:
Julia 1.11 IR:
The
_passfunction was wrappingcallstmt.args[1]with:nooverdubunconditionally, which doesn't work whenargs[1]is anSSAValue(the function lookup already happened in a prior statement and wrapping an SSAValue with:nooverdubis incorrect).Fix
This fix only wraps the callee with
:nooverdubwhen it's aGlobalRef, which preserves correct behavior on Julia 1.10 while fixing Julia 1.11.Test Changes
The test file was also updated to work with the current Lux API -
Lux.apply_activationwas deprecated/removed and replaced with simple identity broadcasting.Test plan
Fixes #18
cc @ChrisRackauckas
🤖 Generated with Claude Code