Skip to content

Run the QA test group last in every sublibrary that ran it first - #4551

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:qa-last-repo-wide
Sep 13, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:qa-last-repo-wide

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Closes #4542. Ignore until reviewed by @ChrisRackauckas. Draft.

What changed and why

JET.test_package re-evaluates a package's source into a virtual module. Every method the package defines on a generic function owned by another module is therefore replaced by a copy bound to a module that has no package extensions loaded, and anything that runs afterwards in the same process exercises those copies instead of the real methods.

So the QA group has to run last. This moves it there in the five sublibraries that ran it before their functional tests. The block itself is unchanged — same condition, same includes, same internal ordering comment where one existed — only its position, plus a comment saying why the position matters.

Scope: five files, not forty

My first note on #4542 said all 40 sublibraries shared the QA-first layout. That was wrong — it came from a detector that matched the activate_qa_env() function definition near the top of every file. Classifying properly, by comparing the line of the last include("qa/…") against the functional include(…) / @safetestset … begin entries:

QA already last : 47
QA first        :  5
n/a (no QA include, or QA-only file) : 7
package functional entries that ran after QA
OrdinaryDiffEqDifferentiation 19
DiffEqDevTools 12
OrdinaryDiffEqCore 11
OrdinaryDiffEqNonlinearSolve 3 (the ModelingToolkit group)
OrdinaryDiffEqPDIRK 3

OrdinaryDiffEqDifferentiation is the only one where the ordering currently produces a failure, because it is the only one whose functional tests depend on an extension-provided method (is_sparse(::SparseMatrixCSC)) reached through a generic owned by another module. The other four were latent — and OrdinaryDiffEqPDIRK's and OrdinaryDiffEqNonlinearSolve's functional tests are exactly the sort that could trip over it next.

Because QA-in-a-subprocess is not needed to close this, I did not go that route.

Second thing this fixes

activate_qa_env() does not restore the previous project. Every group that ran after it was therefore resolving against the QA environment rather than the test environment. Moving QA last removes that too.

Verification

Pkg.test per package, Julia 1.10.11, GROUP unset so QA and the functional tests share one process — the configuration that reproduces the bug.

OrdinaryDiffEqDifferentiation — the actual failure, before:

No Jac Tests | 11 pass, 1 error
  get_fresh_jacobian keeps a sparse J's pattern: Error During Test
    DimensionMismatch: `A` and `bg.S2` must have the same sparsity pattern.
    [5] @ Main.var"##JETVirtualModule#238".OrdinaryDiffEqDifferentiation
ERROR: Package OrdinaryDiffEqDifferentiation errored during testing

after:

No Jac Tests  |   21     21  56.3s     (line 691)
JET Tests     |    1      1  21.0s     (line 715)
Aqua          |   17     17  34.7s     (line 718)
     Testing OrdinaryDiffEqDifferentiation tests passed

Note the line numbers: QA now runs after the functional tests and still passes, which was the risk worth checking — the concern with reordering is that the functional tests might leave state that JET or Aqua then object to. They do not.

OrdinaryDiffEqCore: Testing OrdinaryDiffEqCore tests passed.

OrdinaryDiffEqPDIRK: every functional testset passes with QA moved after them —

SciMLBase reexport   |   2   2
Convergence Tests    |   4   4
nlsolve! Arguments   |   6   6
Core Interface Tests |   3   3
Allocation Tests     |   1 broken
JET Tests            |   1   1
Some tests did not pass: 17 passed, 1 failed, 1 errored, 0 broken
  no_stale_explicit_imports / No unapproved public reexports

The two remaining are the Aqua lint already filed as #4463 ("PDIRK QA fails on Julia 1.10: stale threading imports and documented SciMLBase reexports rejected"), untouched by this diff.

DiffEqDevTools: Testing DiffEqDevTools tests passed, 0 failures, with Aqua last —

Benchmark Tests |   15     15  3m35.1s
Tagging         |   42     42  4.9s
Timeout         |    7      7  5.0s      (line 2196)
Aqua            |   13     13  57.9s     (line 2199)

OrdinaryDiffEqNonlinearSolve: 5 passed, 8 failed, 0 errored, 33 broken — byte-for-byte the same counts as master, which I measured separately with GROUP=QA on unmodified master. All 8 are JET "Solver Type Stability Tests" (ABDF2, QNDF/QNDF1/QNDF2, FBDF, DFBDF, DABDF2, DImplicitEuler, MEBDF2, Rodas4), alongside 33 already marked broken. Unchanged by this diff.

Formatting and spelling checked over the diff: Runic 1.10.0 --check exit 0, typos exit 0. All five files parse (Meta.parseall). Re-running the classifier afterwards reports no remaining QA-first file.

No version bumps: this is test-only, matching #4541 ("Fix Runic formatting and typos failures on master"), which touched no Project.toml.

What I did not verify

  • GPU and Downstream groups; Julia pre (the QA blocks are all gated on isempty(VERSION.prerelease) anyway, so they do not run there).
  • The Sparse and ModelingToolkit groups of OrdinaryDiffEqDifferentiation in isolation — they are excluded from the QA condition, so their ordering relative to QA is unchanged, and the full GROUP unset run above covers them together.
  • I did not audit the 47 already-QA-last files for other in-process ordering hazards, only for this one.

Worth pushing back on

  • The rationale comment is repeated verbatim in five files. A single sentence plus a pointer to this PR would be less duplication; I went with the full explanation in each because the next person editing one of these files will not have the others open.
  • If you would rather have the durable guard instead of (or as well as) this — QA in its own subprocess, or a test that asserts no include("qa/…") precedes a functional include — say so and I will send it. This PR is the minimal correct fix.

🤖 Generated with Claude Code (model: claude-opus-5[1m], harness: Claude Code 2.1.269)

https://claude.ai/code/session_01JQATpLKMyYX3VbPPX8qdeE

`JET.test_package` re-evaluates a package's source into a virtual module. Every
method the package defines on a generic function owned by *another* module is
therefore replaced by a copy bound to a module that has no package extensions
loaded, and anything running afterwards in the same process exercises those
copies instead of the real methods.

`Pkg.test("OrdinaryDiffEqDifferentiation")` shows what that costs: after JET,
`is_sparse(::SparseMatrixCSC)` answers `false` because the SparseArrays
extension is absent from the virtual module, so `get_fresh_jacobian` takes its
`zero(cache.J)` branch (0 stored entries) and `decompress!` rejects it against
the 34-entry coloring pattern:

    get_fresh_jacobian keeps a sparse J's pattern: Error During Test
      DimensionMismatch: `A` and `bg.S2` must have the same sparsity pattern.
      [5] @ Main.var"##JETVirtualModule#238".OrdinaryDiffEqDifferentiation

CI never sees it: SublibraryCI.yml runs each `test_groups.toml` group in its own
job and never the default `GROUP=ALL`, so QA and the functional tests never share
a process there. Only a local bare `Pkg.test` reproduces it.

Moving the block also fixes a second latent problem in the same files:
`activate_qa_env()` does not restore the previous project, so the groups that ran
after it were resolving against the QA environment.

Five files needed this; the other 45 sublibraries already ran QA last.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Agent-Harness: Claude Code 2.1.269
Agent-Model: claude-opus-5[1m]
Agent-Session: https://claude.ai/code/session_01JQATpLKMyYX3VbPPX8qdeE
Claude-Session: https://claude.ai/code/session_01JQATpLKMyYX3VbPPX8qdeE
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review September 13, 2026 09:39
@ChrisRackauckas
ChrisRackauckas merged commit 56fb248 into SciML:master Sep 13, 2026
151 of 153 checks passed
ChrisRackauckas added a commit that referenced this pull request Sep 13, 2026
- Stop tying the state Jacobian's finite-difference direction to tdir (#4543)
- Extend OrdinaryDiffEqCore.dtnew_modification instead of shadowing it (#4547)
- Pick the DAE initialization dt by magnitude, not signed min (#4549)
- Accept a callable stage predictor on the nlsolve algorithms (#4539)
- Run the QA test group last in every sublibrary that ran it first (#4551)
- Apply stage limiters in every StabilizedRK method (#4550)



Agent-Harness: Claude Code
Agent-Model: claude-opus-5[1m]
Claude-Session: https://claude.ai/code/session_014FEzNTLFutCmTEAZ3zBg5R

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
ChrisRackauckas added a commit that referenced this pull request Sep 13, 2026
- Stop tying the state Jacobian's finite-difference direction to tdir (#4543)
- Extend OrdinaryDiffEqCore.dtnew_modification instead of shadowing it (#4547)
- Pick the DAE initialization dt by magnitude, not signed min (#4549)
- Accept a callable stage predictor on the nlsolve algorithms (#4539)
- Run the QA test group last in every sublibrary that ran it first (#4551)
- Apply stage limiters in every StabilizedRK method (#4550)
- Release OrdinaryDiffEqNonlinearSolve 2.9.8 (#4552)
- Declare OrdinaryDiffEqCore.dtnew_modification public (#4553)
- Fix baseline spelling and whitespace checks in tests (#4524)
- Raise OrdinaryDiffEqNonlinearSolve floor for stage_predictor (#4554)



Agent-Harness: Claude Code
Agent-Model: claude-opus-5[1m]
Claude-Session: https://claude.ai/code/session_014FEzNTLFutCmTEAZ3zBg5R

Co-authored-by: Claude Opus 5 (1M context) <[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.

Pkg.test("OrdinaryDiffEqDifferentiation") fails because JET runs before the functional tests in the same process

2 participants