Skip to content

JuliaC/trim compatibility for Core and Rosenbrock#3326

Open
asinghvi17 wants to merge 5 commits intoSciML:masterfrom
asinghvi17:as/trimmability
Open

JuliaC/trim compatibility for Core and Rosenbrock#3326
asinghvi17 wants to merge 5 commits intoSciML:masterfrom
asinghvi17:as/trimmability

Conversation

@asinghvi17
Copy link
Copy Markdown
Contributor

@asinghvi17 asinghvi17 commented Apr 2, 2026

Summary

  • Specialize on tType in initdt to force compiler specialization and type propagation
  • Specialize on deriv type in generic ode_interpolant and interp_at_saveat for trim compatibility
  • Specialize on type input to Rosenbrock tableaus

These 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

@asinghvi17 asinghvi17 changed the title Fix type specialization for trim (JuliaC) compatibility JuliaC/trim compatibility for solvers + trim CI Apr 2, 2026
@ChrisRackauckas
Copy link
Copy Markdown
Member

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.

@asinghvi17
Copy link
Copy Markdown
Contributor Author

I'll split the trim CI out to a separate PR.

@asinghvi17
Copy link
Copy Markdown
Contributor Author

Runic is complaining about files that I haven't touched, so that seems like something for another formatting PR to fix.

@asinghvi17 asinghvi17 changed the title JuliaC/trim compatibility for solvers + trim CI JuliaC/trim compatibility for Core and Rosenbrock Apr 2, 2026

@muladd function _ode_initdt_iip(
u0, t, _tType, tdir, dtmax, abstol, reltol, internalnorm,
u0, t, ::Type{_tType}, tdir, dtmax, abstol, reltol, internalnorm,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this funtion takes t we should see if we can just remove _tType entirely.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be a bigger change though, right? I'm assuming a lot of solvers try to look at this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no. The only caller of initdit is __init so the initialization happens before any solver specific code runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants