JuliaC/trim compatibility for Core and Rosenbrock#3326
JuliaC/trim compatibility for Core and Rosenbrock#3326asinghvi17 wants to merge 5 commits intoSciML:masterfrom
Conversation
This avoids trimming issues and forces the compiler to specialize and propagate `_tType`.
Similar fix as the last one, for trim compatibility.
same old same old
a735edd to
dce4b00
Compare
|
This isn't one PR. Please split into the component parts. There's the inference improvements to Rosenbrock, which are missing JET tests. There's adding trim tests. There's adding default solvers. This is a mess. |
|
I'll split the trim CI out to a separate PR. |
|
Runic is complaining about files that I haven't touched, so that seems like something for another formatting PR to fix. |
daf09e6 to
1238519
Compare
|
|
||
| @muladd function _ode_initdt_iip( | ||
| u0, t, _tType, tdir, dtmax, abstol, reltol, internalnorm, | ||
| u0, t, ::Type{_tType}, tdir, dtmax, abstol, reltol, internalnorm, |
There was a problem hiding this comment.
since this funtion takes t we should see if we can just remove _tType entirely.
There was a problem hiding this comment.
That would be a bigger change though, right? I'm assuming a lot of solvers try to look at this?
There was a problem hiding this comment.
no. The only caller of initdit is __init so the initialization happens before any solver specific code runs.
|
Other than the initdt issue this seems mostly good to go. It also needs a rebase. |
|
initdt was already handled. Other stuff needs inference tests. |
1 similar comment
|
initdt was already handled. Other stuff needs inference tests. |
…ibility Backport of #3326 minus the initdt changes (the v6-backport branch already fixes that via eltype(t) inside the function body, so the ::Type{_tType} dispatch from the original PR no longer applies). - Specialize ode_interpolant, default_ode_interpolant, composite_ode_interpolant and interp_at_saveat on ::Type{deriv} to force compiler specialization - Specialize Rosenbrock tableau constructors on ::Type{T}/::Type{T2} so Julia propagates the concrete element type through the tableau builders These changes close dynamic-dispatch paths that cause --trim=safe (JuliaC AOT) to fail, by adding type parameters that let the compiler statically resolve method calls. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
…ibility Applies the type-inference portions of #3326 (which targets master/v7): - Specialize ode_interpolant, default_ode_interpolant, composite_ode_interpolant, and interp_at_saveat on ::Type{deriv} to force compiler specialization - Specialize Rosenbrock tableau constructors on ::Type{T}/::Type{T2} (in both OrdinaryDiffEqRosenbrock and OrdinaryDiffEqRosenbrockTableaus) so Julia propagates the concrete element type through the tableau builders The initdt changes from #3326 are already obsoleted on master/v6-backport: both branches now compute _tType = eltype(t) inside the function body instead of passing _tType as a positional argument. These changes close dynamic-dispatch paths that cause --trim=safe (JuliaC AOT) to fail, by adding type parameters that let the compiler statically resolve method calls. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Summary
tTypeininitdtto force compiler specialization and type propagationderivtype in genericode_interpolantandinterp_at_saveatfor trim compatibilityThese changes fix dynamic dispatch paths that cause Julia's
--trim=safe(JuliaC AOT compilation) to fail, by adding type parameters that allow the compiler to statically resolve method calls.🤖 Generated with Claude Code