Skip to content

Import ReturnCode in independentlylinearizedtests.jl (fixes Core test group)#317

Merged
ChrisRackauckas merged 3 commits into
SciML:masterfrom
ChrisRackauckas-Claude:fix-ils-returncode-import
Jun 17, 2026
Merged

Import ReturnCode in independentlylinearizedtests.jl (fixes Core test group)#317
ChrisRackauckas merged 3 commits into
SciML:masterfrom
ChrisRackauckas-Claude:fix-ils-returncode-import

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Problem

The Core test group fails on master across every Julia version / OS:

IndependentlyLinearizedSolutionChunks: Test Failed at test/independentlylinearizedtests.jl:112
    Expected: ArgumentError
      Thrown: UndefVarError
      UndefVarError: `ReturnCode` not defined in `Main.var"##Core/independentlylinearizedtests.jl#280"`

Root cause

test/independentlylinearizedtests.jl references ReturnCode.Default (lines 112, 117, 122, 125) but only does using Test, DiffEqCallbacks plus a narrow using DiffEqCallbacks: sample, store!, ... — it never imports ReturnCode. DiffEqCallbacks does not export ReturnCode, so it was never actually in scope on its own.

This only surfaced after #316 ("Use SciMLTesting v1.2 folder-based run_tests"). The SciMLTesting v1.2 harness runs each test file in its own isolated module (Main.var"##Core/independentlylinearizedtests.jl#280"). Previously, under the old runtests.jl, all files were included into one shared module, so ReturnCode leaked in from periodic_tests.jl (which does using SciMLBase: ... ReturnCode). With per-file modules that leakage is gone and the missing import is now a hard error.

Fix

Add using SciMLBase: ReturnCode to the test file, matching the existing pattern in test/periodic_tests.jl. SciMLBase is already a direct dependency.

This is the only failure in the Core group; the other Core files (autoabstol, domain, funccall) pass.

Local verification (Julia 1.10.11, the package's compat floor)

Ran the file inside a fresh isolated module to mimic the SciMLTesting harness:

Test Summary:                   | Pass  Total  Time
IndependentlyLinearizedSolution |   15     15
Test Summary:                         | Pass  Total  Time
IndependentlyLinearizedSolutionChunks |   16     16
>>> independentlylinearizedtests.jl COMPLETED WITHOUT ERROR <<<

Reverting the one-line import reproduces the exact CI failure (Thrown: UndefVarError at lines 112/117/...), confirming causation.

Scope

This PR fixes only the Core ReturnCode failure. The other red checks on master are separate, genuine upstream/dependency breakages and are intentionally left out of this focused PR:

  • AD grouptest/AD/saving_tracker_tests.jl accesses integrator.EEst, a field OrdinaryDiffEq's ODEIntegrator no longer has (FieldError). Real upstream API change.
  • Documentationusing OrdinaryDiffEq in @example blocks leaves Euler/EnsembleProblem undefined; OrdinaryDiffEq loading/re-export regression.
  • Downgrade / CoreDiffEqBaseChainRulesCoreExt method-overwriting precompile error + could not import SciMLBase.NoiseSizeIncompatabilityError into DiffEqBase; a DiffEqBase/SciMLBase downgrade compat-floor conflict.

Please ignore until reviewed by @ChrisRackauckas.

Update (additional commit: self-contained integrating_GK_sum_tests.jl)

After the ReturnCode fix, the Core group was still red on a different file with the same root cause: test/integrating_GK_sum_tests.jl relied on helper functions (simple_linear_system, adjoint_linear[_inplace], analytical_derivative, callback_saving_linear[_inplace], compute_dGdp) defined in integrating_GK_tests.jl. Under the SciMLTesting v1.2 per-file isolated-module harness those no longer leak across files, so it errored with:

Core/integrating_GK_sum_tests.jl: UndefVarError: `simple_linear_system` not defined
  @ test/integrating_GK_sum_tests.jl:37

Fix: define those helpers inline (matching the self-contained pattern of the other Core files).

This also fixes the Downgrade / Core group — contrary to the earlier note above, its only fatal error was the very same simple_linear_system UndefVarError (the DiffEqBaseChainRulesCoreExt method-overwrite and NoiseSizeIncompatabilityError lines were non-fatal WARNING:s, not the failure).

Local verification (Julia 1.10.11, the Core compat floor)

Ran the file inside a fresh isolated Module to mimic the harness:

[ Info: Running .../test/integrating_GK_sum_tests.jl in isolated module ##Core/integrating_GK_sum_tests.jl#repro
>>> integrating_GK_sum_tests.jl COMPLETED WITHOUT ERROR <<<

Reverting just this commit reproduces the exact CI error (UndefVarError: simple_linear_system not defined at line 37), confirming causation.

Still out of scope (separate, genuine upstream breakages)

  • AD grouptest/AD/saving_tracker_tests.jl:33 and src/probints.jl:43 access integrator.EEst, a field OrdinaryDiffEqCore's ODEIntegrator no longer has (FieldError). Real upstream API change; needs a source-side fix to read the error estimate from its new location.
  • Documentationusing OrdinaryDiffEq leaves Euler/EnsembleProblem undefined in @example blocks; an OrdinaryDiffEq loading/re-export regression.

Update (additional commit: read error estimate without the removed EEst field)

Fixes the AD group breakage that was previously listed as out of scope, and the same failure in the Core group.

Root cause

OrdinaryDiffEqCore's ODEIntegrator no longer has an EEst field — the scalar error estimate moved onto the controller cache (integrator.controller_cache.EEst, surfaced there as get_EEst). Reading integrator.EEst directly now throws:

FieldError: type OrdinaryDiffEqCore.ODEIntegrator has no field `EEst`

This broke two call sites:

  • src/probints.jl:43 in AdaptiveProbIntsUncertainty, exercised by the Core group's test/probints.jl (AdaptiveProbIntsUncertainty(5) + adaptive Tsit5).
  • test/AD/saving_tracker_tests.jl:33, the AD group's SavingCallback save function.

Fix

Add a dependency-free _integrator_EEst(integrator) accessor that uses the EEst field when present (older integrators / SDE integrators) and otherwise reads it off the controller cache. This keeps DiffEqCallbacks free of an OrdinaryDiffEqCore dependency while supporting both integrator layouts — mirroring how the current DelayDiffEq accesses OrdinaryDiffEqCore.get_EEst. The same fallback is applied in the AD test.

Local verification

Julia 1.12.6 (the "1" channel) and Julia 1.10.11 (compat floor), with OrdinaryDiffEqCore 4.3.0 (the new layout) resolving on both:

# AD group
Test Summary:     | Pass  Total   Time
AD/saving_tracker |    1      1  22.8s

# Core group (probints.jl)
>>> probints.jl COMPLETED <<<   (Julia 1.12 and 1.10, exit 0)

Reverting the commit reproduces FieldError: type ODEIntegrator has no field EEst at src/probints.jl and saving_tracker_tests.jl, confirming causation. Both branches of _integrator_EEst were unit-checked against mock integrators (field-present and controller-cache layouts).

Please ignore until reviewed by @ChrisRackauckas.

ChrisRackauckas and others added 3 commits June 15, 2026 10:11
The SciMLTesting v1.2 folder-based harness (SciML#316) runs each test file in
its own isolated module. `independentlylinearizedtests.jl` references
`ReturnCode.Default` but never imported `ReturnCode`; previously it leaked
in from `periodic_tests.jl` because all files shared one module. Import it
explicitly from SciMLBase, matching the existing pattern in periodic_tests.jl.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Under the SciMLTesting v1.2 per-file isolated-module harness, the linear-
system helpers (simple_linear_system, adjoint_linear[_inplace],
analytical_derivative, callback_saving_linear[_inplace], compute_dGdp) are
no longer leaked in from integrating_GK_tests.jl, so the file errored with
`UndefVarError: `simple_linear_system` not defined`. Define the helpers it
uses inline, matching the self-contained pattern of the other Core files.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
OrdinaryDiffEqCore's ODEIntegrator no longer exposes an `EEst` field; the
scalar error estimate now lives on the controller cache
(`integrator.controller_cache.EEst`, surfaced there as `get_EEst`). Reading
`integrator.EEst` directly threw `FieldError: type ODEIntegrator has no field
EEst`, breaking `AdaptiveProbIntsUncertainty` (src/probints.jl, exercised by
the Core group's probints.jl) and the AD group's saving_tracker_tests.jl.

Add a dependency-free `_integrator_EEst` accessor that uses the `EEst` field
when present (older integrators / SDE integrators) and otherwise reads it off
the controller cache, keeping DiffEqCallbacks free of an OrdinaryDiffEqCore
dependency while supporting both layouts. Apply the same fallback in the AD
test.

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 17, 2026 10:46
@ChrisRackauckas ChrisRackauckas merged commit 97ef817 into SciML:master Jun 17, 2026
14 of 19 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