[v6-backport] Specialize on deriv type and Rosenbrock tableau types for trim compat#3510
Merged
ChrisRackauckas merged 1 commit intoSciML:v6-backportfrom Apr 23, 2026
Conversation
…ibility Backport of SciML#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>
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
v6 backport of the type-inference portions of #3326 (companion to #3509 on master). On
v6-backport, all Rosenbrock tableaus still live inOrdinaryDiffEqRosenbrock(they get split intoOrdinaryDiffEqRosenbrockTableauson master), so only two files pick up the tableau changes.ode_interpolant,default_ode_interpolant,composite_ode_interpolant, andinterp_at_saveaton::Type{deriv}to force compiler specialization and static dispatch.::Type{T}/::Type{T2}so Julia propagates the concrete element type through the builders.The
initdtchanges from #3326 are omitted —v6-backportalready computes_tType = eltype(t)inside the function body instead of taking it as a positional argument, which achieves the same effect a different way.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.Test plan
v6-backport:Rosenbrock23,Rosenbrock32,Rodas4,Rodas5Pall solve the linear ODEdu/dt = 1.01uto within tolerance.saveatpath exercised (interp_at_saveat→ode_interpolant(..., ::Type{Val{0}})).sol(t)interpolation exercised.🤖 Generated with Claude Code
Co-Authored-By: Chris Rackauckas accounts@chrisrackauckas.com