Skip to content

Fix mass-matrix Rosenbrock test (Float32 dt) and raise downgrade compat floors#462

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix/mass-matrix-dt-and-downgrade-floor
Jun 23, 2026
Merged

Fix mass-matrix Rosenbrock test (Float32 dt) and raise downgrade compat floors#462
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix/mass-matrix-dt-and-downgrade-floor

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

Problem

On master, the CPU / JLArrays / OpenCL / QA test groups (all Julia versions) error on the first test, test/gpu_kernel_de/stiff_ode/gpu_ode_mass_matrix.jl, so every group goes red before reaching anything else:

MethodError: Cannot `convert` an object of type
  StaticWOperator{true, SMatrix{3,3,Float64,9}, ...} to
  StaticWOperator{true, SMatrix{3,3,Float32,9}, ...}
  @ setproperty!(::JacReuseState{Float64, SMatrix{3,3,Float32,9}, ...}, ::Symbol, ::StaticWOperator{...Float64...})
  @ OrdinaryDiffEqDifferentiation derivative_utils.jl:922  (jac_reuse.cached_W = W)

Root cause

The reference CPU bench solve used dt = 0.1 (Float64) on an otherwise all-Float32 problem (u0, p, tspan, tolerances are Float32; the GPU solve already uses dt = 0.1f0). OrdinaryDiffEqRosenbrock's JacReuseState (added in Rosenbrock 1.31.1 / all 2.x) types its cached_W slot from the state eltype (Float32), but with a Float64 dt, calc_W builds a Float64 StaticWOperator that cannot be stored into the Float32 slot. This is a genuine upstream mixed-precision bug, surfaced here by the test mixing a Float64 dt into a Float32 problem.

Fix

  1. Mass-matrix test: use a type-consistent dt = 0.1f0 for the reference bench solve (matches the Float32 problem and the GPU solve). The GPU-vs-reference tolerance assertions are unchanged — nothing is loosened, skipped, or broken.

  2. Downgrade compat floors (the Downgrade job hit a ModelingToolkit unsatisfiability: at downgrade StaticArrays was pinned to its 1.9 floor, forcing MTK below v11 while the test pins MTK ≥ 11.17):

    • StaticArrays 1.91.9.14 (MTK 10.18–11 requires StaticArrays ≥ 1.9.14)
    • SciMLBase 33.1 (lowest MTK compatible with SciMLBase 3 is 11.22; JumpProcesses 9.25.1+ requires SciMLBase ≥ 3.1.0, excluding 3.0.0)
    • ModelingToolkit 11.17.011.23.0 (test; lowest MTK consistent with the SciMLBase 3.1 and OrdinaryDiffEqRosenbrock 2 floors)

Verification (local)

  • Julia 1.12, GROUP=CPU: GPU Kernelized Stiff ODE Mass Matrix safetestset passes 2/2.
  • Julia 1.10: the floor set resolves cleanly (SciMLBase 3.1.0 / MTK 11.23.0 / StaticArrays 1.9.14 / OrdinaryDiffEqRosenbrock 2.0.0).
  • Normal latest-version resolution is unaffected (resolves SciMLBase 3.21, MTK 11.28, StaticArrays 1.9.18).
  • Changed .jl is Runic-clean.

Notes / out of scope

  • The Documentation and CUDA jobs run on self-hosted GPU runners and could not be reproduced locally. Documentation additionally fails on GPU-only issues (an AD DimensionMismatch, Rodas5 no longer auto-exported by OrdinaryDiffEq v7, and a new ModelingToolkit problem representation that is not GPU-inline-allocatable) that are separate from this PR.
  • The Downgrade job may still hit the pre-existing, maintainer-noted ForwardDiff/LogExpFunctions strict-floor wall (an upstream issue tracked separately); this PR removes the current MTK blocker so the downgrade can get further.

Please ignore until reviewed by @ChrisRackauckas

The CPU/JLArrays/OpenCL/QA test groups all errored on the first test,
test/gpu_kernel_de/stiff_ode/gpu_ode_mass_matrix.jl, with a
`Cannot convert StaticWOperator{Float64} to StaticWOperator{Float32}`
MethodError. The reference CPU bench solve used `dt = 0.1` (Float64) on
an otherwise all-Float32 problem (u0, p, tspan, tolerances are Float32,
and the GPU solve already uses `dt = 0.1f0`). OrdinaryDiffEqRosenbrock's
JacReuseState types its `cached_W` slot from the state eltype (Float32),
but with a Float64 dt `calc_W` builds a Float64 StaticWOperator that
cannot be stored, erroring at OrdinaryDiffEqDifferentiation
derivative_utils.jl:922 (`jac_reuse.cached_W = W`). Use a type-consistent
`dt = 0.1f0` for the bench solve; the GPU-vs-reference tolerance
assertions are unchanged. Verified locally on Julia 1.12 with GROUP=CPU:
the mass-matrix safetestset passes 2/2.

Also raise three compat floors so the Downgrade job can get past the
ModelingToolkit unsatisfiability it currently hits (StaticArrays was
pinned to its 1.9 floor at downgrade, which forced MTK below v11 while
the test pins MTK >= 11.17):
  - StaticArrays 1.9 -> 1.9.14 (MTK 10.18-11 needs StaticArrays >= 1.9.14)
  - SciMLBase 3 -> 3.1 (lowest MTK compatible with SciMLBase 3 is 11.22;
    JumpProcesses 9.25.1+ needs SciMLBase >= 3.1.0, excluding 3.0.0)
  - ModelingToolkit 11.17.0 -> 11.23.0 (test; lowest MTK consistent with
    the SciMLBase 3.1 and OrdinaryDiffEqRosenbrock 2 floors)
Verified the floor set resolves on Julia 1.10 (SciMLBase 3.1.0 / MTK
11.23.0 / StaticArrays 1.9.14 / OrdinaryDiffEqRosenbrock 2.0.0) and that
normal latest-version resolution is unaffected (SciMLBase 3.21, MTK
11.28, StaticArrays 1.9.18). The Downgrade job may still hit the
pre-existing, maintainer-noted ForwardDiff/LogExpFunctions strict-floor
wall, which is an upstream issue tracked separately.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisRackauckas ChrisRackauckas marked this pull request as ready for review June 23, 2026 01:14
@ChrisRackauckas ChrisRackauckas merged commit 15257f9 into SciML:master Jun 23, 2026
22 of 27 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.

2 participants