Import ReturnCode in independentlylinearizedtests.jl (fixes Core test group)#317
Merged
ChrisRackauckas merged 3 commits intoJun 17, 2026
Conversation
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>
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.
Problem
The Core test group fails on master across every Julia version / OS:
Root cause
test/independentlylinearizedtests.jlreferencesReturnCode.Default(lines 112, 117, 122, 125) but only doesusing Test, DiffEqCallbacksplus a narrowusing DiffEqCallbacks: sample, store!, ...— it never importsReturnCode.DiffEqCallbacksdoes not exportReturnCode, 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 oldruntests.jl, all files wereincluded into one shared module, soReturnCodeleaked in fromperiodic_tests.jl(which doesusing SciMLBase: ... ReturnCode). With per-file modules that leakage is gone and the missing import is now a hard error.Fix
Add
using SciMLBase: ReturnCodeto the test file, matching the existing pattern intest/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:
Reverting the one-line import reproduces the exact CI failure (
Thrown: UndefVarErrorat lines 112/117/...), confirming causation.Scope
This PR fixes only the Core
ReturnCodefailure. The other red checks on master are separate, genuine upstream/dependency breakages and are intentionally left out of this focused PR:test/AD/saving_tracker_tests.jlaccessesintegrator.EEst, a field OrdinaryDiffEq'sODEIntegratorno longer has (FieldError). Real upstream API change.using OrdinaryDiffEqin@exampleblocks leavesEuler/EnsembleProblemundefined; OrdinaryDiffEq loading/re-export regression.DiffEqBaseChainRulesCoreExtmethod-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
ReturnCodefix, the Core group was still red on a different file with the same root cause:test/integrating_GK_sum_tests.jlrelied on helper functions (simple_linear_system,adjoint_linear[_inplace],analytical_derivative,callback_saving_linear[_inplace],compute_dGdp) defined inintegrating_GK_tests.jl. Under the SciMLTesting v1.2 per-file isolated-module harness those no longer leak across files, so it errored with: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_systemUndefVarError(theDiffEqBaseChainRulesCoreExtmethod-overwrite andNoiseSizeIncompatabilityErrorlines were non-fatalWARNING:s, not the failure).Local verification (Julia 1.10.11, the Core compat floor)
Ran the file inside a fresh isolated
Moduleto mimic the harness:Reverting just this commit reproduces the exact CI error (
UndefVarError: simple_linear_system not definedat line 37), confirming causation.Still out of scope (separate, genuine upstream breakages)
test/AD/saving_tracker_tests.jl:33andsrc/probints.jl:43accessintegrator.EEst, a field OrdinaryDiffEqCore'sODEIntegratorno longer has (FieldError). Real upstream API change; needs a source-side fix to read the error estimate from its new location.using OrdinaryDiffEqleavesEuler/EnsembleProblemundefined in@exampleblocks; an OrdinaryDiffEq loading/re-export regression.Update (additional commit: read error estimate without the removed
EEstfield)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
ODEIntegratorno longer has anEEstfield — the scalar error estimate moved onto the controller cache (integrator.controller_cache.EEst, surfaced there asget_EEst). Readingintegrator.EEstdirectly now throws:This broke two call sites:
src/probints.jl:43inAdaptiveProbIntsUncertainty, exercised by the Core group'stest/probints.jl(AdaptiveProbIntsUncertainty(5)+ adaptiveTsit5).test/AD/saving_tracker_tests.jl:33, the AD group'sSavingCallbacksave function.Fix
Add a dependency-free
_integrator_EEst(integrator)accessor that uses theEEstfield 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 accessesOrdinaryDiffEqCore.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:
Reverting the commit reproduces
FieldError: type ODEIntegrator has no field EEstatsrc/probints.jlandsaving_tracker_tests.jl, confirming causation. Both branches of_integrator_EEstwere unit-checked against mock integrators (field-present and controller-cache layouts).Please ignore until reviewed by @ChrisRackauckas.