Skip to content

Tableau implementation for Tsit5 with generic RK interpolation#3028

Merged
ChrisRackauckas merged 8 commits intoSciML:masterfrom
ChrisRackauckas-Claude:tableau-tsit5-interp
Feb 3, 2026
Merged

Tableau implementation for Tsit5 with generic RK interpolation#3028
ChrisRackauckas merged 8 commits intoSciML:masterfrom
ChrisRackauckas-Claude:tableau-tsit5-interp

Conversation

@ChrisRackauckas-Claude
Copy link
Contributor

Summary

  • Adds constructTsit5ExplicitRK() to create a Tsit5 Butcher tableau for the generic ExplicitRK solver
  • Adds construct_tsit5_interp_matrix() with dispatch for compiled floats and high-precision types
  • Implements generic RK interpolation via B_interp matrix: _ode_addsteps! and _ode_interpolant dispatches for dense output
  • Adds B_interp field to ExplicitRKConstantCache to store interpolation coefficients

Based on #2913 by @KeshavVenkatesh and @SriramV739, rebased onto current master as a single clean commit with all review feedback addressed:

  • Uses type dispatch instead of separate function names for precision variants
  • Removes benchmark test files (benchmarks belong in asv)
  • Uses L2 convergence order tests for interpolation verification
  • Implements proper _ode_interpolant/_ode_addsteps! dispatches for dense output integration with OrdinaryDiffEqCore

Test plan

  • Basic solve tests pass for both scalar and vector problems
  • Interpolation tests pass (value, idxs, boundary conditions)
  • L2 convergence tests verify >= 4th order interpolation accuracy
  • All existing ExplicitRK tests (JET, allocation) continue to pass
  • CI passes

🤖 Generated with Claude Code

claude and others added 4 commits February 2, 2026 07:51
Add Tsit5 tableau in ExplicitRK format with interpolation support:
- construct_tsit5_interp_matrix: interpolation coefficient matrix with
  dispatch for compiled floats and high-precision types
- constructTsit5ExplicitRK: Tsit5 Butcher tableau for ExplicitRK solver
- Generic RK interpolation via B_interp matrix in ExplicitRKTableau
- _ode_addsteps! and _ode_interpolant dispatches for dense output
- L2 convergence order tests verifying >= 4th order interpolation

Based on PR SciML#2913 by KeshavVenkatesh and SriramV739, rebased and
cleaned up to address review feedback.

Co-Authored-By: Keshav Venkatesh <[email protected]>
Co-Authored-By: SriramV739 <[email protected]>
Co-Authored-By: Chris Rackauckas <[email protected]>
Performance fixes for generic RK interpolation:
- Eliminate heap-allocated Vector for polynomial weights in both
  generic_rk_interpolant and generic_rk_interpolant! by computing
  b_i values inline during the weighted sum accumulation
- Add @inline to eval_poly_derivative for better inlining in hot path
- Remove unnecessary @Assert in hot interpolation path

Add ExplicitRK with Tsit5 tableau to the main dense output regression
tests (test/regression/ode_dense_tests.jl):
- 1D and 2D regression tests with tolerance checks
- Derivative tests up to order 3 with left-derivative verification
- In-place interpolation with idxs parameter

Co-Authored-By: Chris Rackauckas <[email protected]>
Instead of computing bi values inline each call, store a pre-allocated
Vector in ExplicitRKConstantCache that gets updated in-place, avoiding
heap allocation in the interpolation hot path.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
When B_interp is nothing (e.g. default ExplicitRK with Dormand-Prince),
fall back to Hermite interpolation instead of throwing. Also skip the
custom _ode_addsteps! in this case so k contains only the 2 entries
Hermite expects. For the out-of-place interpolant, compute bi weights
inline to support ForwardDiff.Dual Θ values.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
claude and others added 4 commits February 3, 2026 07:00
Use module-qualified access instead of `using` to import the function.
This avoids issues with `using SubModule: function` when SubModule is
re-exported from a parent module on Julia 1.10.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
On Julia 1.10, the [sources] section in Project.toml is not supported,
so package resolution pulls OrdinaryDiffEqExplicitRK from the registry
rather than the local lib/ version. This means constructTsit5ExplicitRK
(added in this PR) is not available until a new release is made.

Wrap the Tsit5 ExplicitRK tests in an isdefined check to gracefully skip
them when the function is not available. Once this PR is merged and a
new version of OrdinaryDiffEqExplicitRK is released, the tests will run
on Julia 1.10 as well.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
@ChrisRackauckas ChrisRackauckas merged commit db664ed into SciML:master Feb 3, 2026
264 of 275 checks passed
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