Repository navigation
Fix OrdinaryDiffEqStabilizedRK cache/JET failures from #3420 and #3439 - #3442
Merged
ChrisRackauckas merged 1 commit intoApr 15, 2026
Conversation
…ly import
The package imports SVector from StaticArraysCore rather than full
StaticArrays, which only supplies the tuple-form constructor and
leaves out the varargs constructor and getindex. In the isolated QA
test environment (no transitive StaticArrays) this surfaced two
distinct failures:
1. SERK2, ESERK4, ESERK5 cache construction failed because the
struct fields ms/Cᵤ/Cₑ were typed as SVector{N, Int} but the
tableaus returned plain Vector{Int}, and no Vector -> SVector
convert method was available.
2. ROCK2 and ROCK4 cache construction failed because the tableaus
called SVector{N, Int}(args...) with 46 / 50 varargs, a
constructor not defined in StaticArraysCore.
3. ROCK4 perform_step failed with CanonicalIndexError on
SVector{6, Float64} because StaticArraysCore does not define
getindex for SArray.
Switch the ms / fp1 / fp2 / Cᵤ / Cₑ struct fields to plain Vector
(they are built once per cache at solve time and indexed, so the
SVector specialization is not buying anything in the hot loop) and
drop the SVector wrapping from the ROCK2 / ROCK4 tableaus. Convert
the ROCK4 per-step tableau blocks from SVector{N, T} to NTuple{N, T}
to preserve the static-length, tuple-indexable shape without
requiring the full StaticArrays package.
Also fix a separate JET regression introduced in SciML#3420 (TSRKC3):
dtsw0 and d2tsw0 are defined only in the non-rkcstep branch but
read unconditionally in a later if (!rkcstep) block; JET flagged
them as possibly-undefined. Initialize both to
zero(typeof(cache.tsw0)) (and the constantcache variant) before
the branch so the definitions dominate every use.
Fixes CI failures in the OrdinaryDiffEqStabilizedRK_QA sublibrary
job exposed by SciML#3439 and the TSRKC3 JET failure introduced by SciML#3420.
Co-Authored-By: Chris Rackauckas <[email protected]>
singhharsh1708
pushed a commit
to singhharsh1708/OrdinaryDiffEq.jl
that referenced
this pull request
Apr 16, 2026
…ly import (SciML#3442) The package imports SVector from StaticArraysCore rather than full StaticArrays, which only supplies the tuple-form constructor and leaves out the varargs constructor and getindex. In the isolated QA test environment (no transitive StaticArrays) this surfaced two distinct failures: 1. SERK2, ESERK4, ESERK5 cache construction failed because the struct fields ms/Cᵤ/Cₑ were typed as SVector{N, Int} but the tableaus returned plain Vector{Int}, and no Vector -> SVector convert method was available. 2. ROCK2 and ROCK4 cache construction failed because the tableaus called SVector{N, Int}(args...) with 46 / 50 varargs, a constructor not defined in StaticArraysCore. 3. ROCK4 perform_step failed with CanonicalIndexError on SVector{6, Float64} because StaticArraysCore does not define getindex for SArray. Switch the ms / fp1 / fp2 / Cᵤ / Cₑ struct fields to plain Vector (they are built once per cache at solve time and indexed, so the SVector specialization is not buying anything in the hot loop) and drop the SVector wrapping from the ROCK2 / ROCK4 tableaus. Convert the ROCK4 per-step tableau blocks from SVector{N, T} to NTuple{N, T} to preserve the static-length, tuple-indexable shape without requiring the full StaticArrays package. Also fix a separate JET regression introduced in SciML#3420 (TSRKC3): dtsw0 and d2tsw0 are defined only in the non-rkcstep branch but read unconditionally in a later if (!rkcstep) block; JET flagged them as possibly-undefined. Initialize both to zero(typeof(cache.tsw0)) (and the constantcache variant) before the branch so the definitions dominate every use. Fixes CI failures in the OrdinaryDiffEqStabilizedRK_QA sublibrary job exposed by SciML#3439 and the TSRKC3 JET failure introduced by SciML#3420. Co-authored-by: ChrisRackauckas-Claude <[email protected]>
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
Two unrelated failures are hitting the
OrdinaryDiffEqStabilizedRK_QAsublibrary job:Latent cache-construction bug exposed by Standardize QA test environments across sublibraries #3439. With QA now running in its own isolated
test/qa/Project.toml,StaticArraysis no longer in the dep graph, onlyStaticArraysCore. That breaks the stabilized-RK caches three ways:SERK2/ESERK4/ESERK5— struct fields areSVector{N, Int}but the tableaus return plainVector{Int}; there is noconvert(SVector, Vector)inStaticArraysCore.ROCK2/ROCK4— tableaus callSVector{46,Int}(x1, …, x46)/SVector{50,Int}(…); the varargs constructor is not inStaticArraysCore.ROCK4perform_step!— indexesfpa[i][j]over entries built asSVector{6, Float64};getindex(::SArray, ::Int)is not inStaticArraysCore.These allocate-once-per-solve fields do not need the
SVectorspecialization — they are indexed by a runtimedeg_indexin the hot loop, which is no faster onSVectorthan onVector/NTuple. Switchingms/fp1/fp2/Cᵤ/Cₑstruct fields toVector{T}and the ROCK4 per-step blocks fromSVector{N, T}toNTuple{N, T}removes theStaticArraysrequirement without touching numerics. Verified by the Core test suite below.TSRKC3 undefined-variable regression from TSRKC3 method #3420.
dtsw0andd2tsw0are defined only in theelsebranch (!rkcstep) atrkc_perform_step.jl:1108–1109/1238–1239, then read unconditionally inif (!rkcstep)later at1168/1298. The twoifs are correlated so it runs fine, but JET (correctly) flagged both asmay be undefined, failing the JET test. Pre-initializing both tozero(typeof(cache.tsw0))/zero(typeof(constantcache.tsw0))before the branch makes the definitions dominate every use.Test plan
Run locally on Julia 1.12.5 in the standardized QA env and the Core env:
ODEDIFFEQ_TEST_GROUP=QA julia --project=. -e 'using Pkg; Pkg.test()'→ Allocation Tests 6 broken (expected,broken=truein the test), JET 1 pass, Aqua 11 pass.ODEDIFFEQ_TEST_GROUP=Core julia --project=. -e 'using Pkg; Pkg.test()'→ RKC Tests 84 pass (covers ROCK2, ROCK4, RKC, TSRKC3, SERK2, ESERK4, ESERK5 — numerical behavior preserved).Bumps
OrdinaryDiffEqStabilizedRKfrom1.11.0to1.11.1.🤖 Generated with Claude Code