Skip to content

Standardize QA test environments across sublibraries - #3439

Merged
ChrisRackauckas merged 2 commits into
SciML:masterfrom
ChrisRackauckas-Claude:standardize-qa-test-envs
Apr 15, 2026
Merged

ChrisRackauckas merged 2 commits into
SciML:masterfrom
ChrisRackauckas-Claude:standardize-qa-test-envs

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Summary

Builds on #3383 to finish the QA refactor and standardize the pattern. Now that every solver subpackage has test/qa/Project.toml for AllocCheck, move JET and Aqua into the same isolated environment instead of inline Pkg.add calls, and apply the same layout to the remaining sublibraries that were not touched by #3383.

  • Moves jet.jl, qa.jl, and allocation_tests.jl into test/qa/ across every sublibrary that has QA tests (~35 packages).
  • Extends each test/qa/Project.toml with JET and Aqua deps (with [sources] entries resolving internal deps to in-tree paths, like the gpu/ envs do).
  • Removes using Pkg; Pkg.add("JET") / Pkg.add("Aqua") shims from test files.
  • Removes JET and Aqua from each sublibrary's main [extras] and [compat] — they no longer need to live in the main test env, only in the QA env.
  • Updates runtests.jl in each sublibrary so the QA group activates test/qa/ once and runs alloc + JET + Aqua against it.
  • Adds a new test/qa/ environment to the sublibraries that were skipped by feat: add AllocCheck.jl allocation tests across all solver packages #3383 (they had inline Pkg.add only): ImplicitDiscreteSolve, SimpleImplicitDiscreteSolve, OrdinaryDiffEqCore, OrdinaryDiffEqDefault, OrdinaryDiffEqDifferentiation, OrdinaryDiffEqNonlinearSolve, OrdinaryDiffEqRKIP.
  • Documents the "one Project.toml per test group" convention in CONTRIBUTING.md and references it from .github/scripts/compute_affected_sublibraries.jl.

Why

  • Pkg.add at test time is flaky (hits the registry on every run, can install versions outside the compat ranges declared elsewhere, and mutates whatever environment happens to be active).
  • Having JET/Aqua in each sublibrary's main [extras] was dead weight — nothing in [targets].test used them.
  • The gpu/ group already demonstrates the "isolated test/<group>/Project.toml" pattern; this PR makes it the standard for every group that needs extra deps.

Test plan

  • Ran ODEDIFFEQ_TEST_GROUP=QA julia --project=. -e 'using Pkg; Pkg.test()' locally on OrdinaryDiffEqCore → AllocCheck / JET (30 pass, 1 broken) / Aqua (9 pass) all green.
  • Same for OrdinaryDiffEqSDIRK → Allocation Tests (29 broken, matching main), JET (1 pass), Aqua (11 pass), Convergence (80 pass, 2 broken), DAE (8 pass).
  • Same for OrdinaryDiffEqTsit5 → Allocation (1 pass), JET (1 pass, 2 broken), Aqua (11 pass).
  • Same for ImplicitDiscreteSolve → JET (1 pass), Aqua (10 pass).
  • CI green across the affected-sublibraries matrix.

ChrisRackauckas and others added 2 commits April 15, 2026 03:22
Moves JET, Aqua, and AllocCheck tests into test/qa/ with an isolated
Project.toml per sublibrary, following the pattern established by
test/gpu/. Removes inline Pkg.add("JET")/Pkg.add("Aqua") calls from
test files so heavy tooling lives only in the QA env, not in each
sublibrary's [extras]. Documents the "one Project.toml per test group"
convention in CONTRIBUTING.md and compute_affected_sublibraries.jl.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Chris Rackauckas <[email protected]>
They were also left in [targets].test when removed from [extras] — Pkg's
project validator rejects a target that names a package not declared in
deps/weakdeps/extras, which broke every job that Pkg.develops BDF
(docs build, all sublibrary tests).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Chris Rackauckas <[email protected]>
@ChrisRackauckas
ChrisRackauckas merged commit 3772d1f into SciML:master Apr 15, 2026
320 of 335 checks passed
ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/OrdinaryDiffEq.jl that referenced this pull request Apr 15, 2026
…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]>
ChrisRackauckas added a commit that referenced this pull request Apr 15, 2026
…ly import (#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 #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 #3439 and the TSRKC3 JET failure introduced by #3420.

Co-authored-by: ChrisRackauckas-Claude <[email protected]>
singhharsh1708 pushed a commit to singhharsh1708/OrdinaryDiffEq.jl that referenced this pull request Apr 16, 2026
* standardize QA test environments across all sublibraries

Moves JET, Aqua, and AllocCheck tests into test/qa/ with an isolated
Project.toml per sublibrary, following the pattern established by
test/gpu/. Removes inline Pkg.add("JET")/Pkg.add("Aqua") calls from
test files so heavy tooling lives only in the QA env, not in each
sublibrary's [extras]. Documents the "one Project.toml per test group"
convention in CONTRIBUTING.md and compute_affected_sublibraries.jl.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Chris Rackauckas <[email protected]>

* fix: drop JET and Aqua from OrdinaryDiffEqBDF test target

They were also left in [targets].test when removed from [extras] — Pkg's
project validator rejects a target that names a package not declared in
deps/weakdeps/extras, which broke every job that Pkg.develops BDF
(docs build, all sublibrary tests).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Chris Rackauckas <[email protected]>

---------

Co-authored-by: ChrisRackauckas-Claude <[email protected]>
Co-authored-by: Claude Opus 4.6 (1M context) <[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]>
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