Repository navigation
Add a global error interface: has_global_error trait + ODESolution.global_error field - #1531
Merged
ChrisRackauckas merged 1 commit intoAug 17, 2026
Conversation
Adds a uniform way for ODE solvers and solver wrappers to report an estimate of the global (accumulated) error: - `has_global_error(alg)` trait (default `false`) declaring whether an algorithm populates a global error estimate. - a `global_error` field on `ODESolution` (default `nothing`), an array matching `u` with per-time-point global error estimates when present. The field is threaded through `build_solution` (new `global_error` keyword, default `nothing`), the convenience constructor (optional last argument), `ConstructionBase.setproperties` (so `@set`/`@reset` preserve it), `solution_new_original_retcode`, and `solution_slice` (which slices it alongside `u`). All defaults are `nothing`, so existing solutions and constructors are unchanged. `has_global_error` is made public and documented alongside the other algorithm traits; the `global_error` field is documented on ODESolution. Minor version bump for the new public API. Co-Authored-By: Chris Rackauckas <[email protected]>
This was referenced Aug 15, 2026
ChrisRackauckas
marked this pull request as ready for review
August 17, 2026 06:40
ChrisRackauckas-Claude
pushed a commit
to ChrisRackauckas-Claude/OrdinaryDiffEq.jl
that referenced
this pull request
Aug 17, 2026
Migrates the GLEE/MM5GEE solvers onto the SciMLBase global-error interface (SciML/SciMLBase.jl#1531): has_global_error(alg) = true, and solving returns an ordinary solution (sol.u and sol(t) are the solution) with the estimate in sol.global_error. The extended (y, ε) ArrayPartition solve is split in __solve, and a projecting interpolation reuses the high-order extended dense output so sol(t) returns the solution component at full order (values, derivatives, and the in-place form). global_error_estimate(sol) now returns sol.global_error. Users no longer see the internal ArrayPartition. Requires SciMLBase >= 3.48 (compat bumped); depends on SciML/SciMLBase.jl#1531. Verified locally against the SciMLBase branch: GLEE test suite 91/91 (including a new interface testset), plus smoke tests of the split solution, dense output, derivatives, and the in-place interp form. Co-Authored-By: Chris Rackauckas <[email protected]>
ChrisRackauckas-Claude
pushed a commit
to ChrisRackauckas-Claude/OrdinaryDiffEq.jl
that referenced
this pull request
Aug 17, 2026
Migrates the GLEE/MM5GEE solvers onto the SciMLBase global-error interface (SciML/SciMLBase.jl#1531): has_global_error(alg) = true, and solving returns an ordinary solution (sol.u and sol(t) are the solution) with the estimate in sol.global_error. The extended (y, ε) ArrayPartition solve is split in __solve, and a projecting interpolation reuses the high-order extended dense output so sol(t) returns the solution component at full order (values, derivatives, and the in-place form). global_error_estimate(sol) now returns sol.global_error. Users no longer see the internal ArrayPartition. Requires SciMLBase >= 3.48 (compat bumped); depends on SciML/SciMLBase.jl#1531. Verified locally against the SciMLBase branch: GLEE test suite 91/91 (including a new interface testset), plus smoke tests of the split solution, dense output, derivatives, and the in-place interp form. Co-Authored-By: Chris Rackauckas <[email protected]>
ChrisRackauckas-Claude
pushed a commit
to ChrisRackauckas-Claude/OrdinaryDiffEq.jl
that referenced
this pull request
Aug 21, 2026
Migrates the GLEE/MM5GEE solvers onto the SciMLBase global-error interface (SciML/SciMLBase.jl#1531): has_global_error(alg) = true, and solving returns an ordinary solution (sol.u and sol(t) are the solution) with the estimate in sol.global_error. The extended (y, ε) ArrayPartition solve is split in __solve, and a projecting interpolation reuses the high-order extended dense output so sol(t) returns the solution component at full order (values, derivatives, and the in-place form). global_error_estimate(sol) now returns sol.global_error. Users no longer see the internal ArrayPartition. Requires SciMLBase >= 3.48 (compat bumped); depends on SciML/SciMLBase.jl#1531. Verified locally against the SciMLBase branch: GLEE test suite 91/91 (including a new interface testset), plus smoke tests of the split solution, dense output, derivatives, and the in-place interp form. Co-Authored-By: Chris Rackauckas <[email protected]>
ChrisRackauckas
added a commit
to SciML/OrdinaryDiffEq.jl
that referenced
this pull request
Aug 21, 2026
Migrates the GLEE/MM5GEE solvers onto the SciMLBase global-error interface (SciML/SciMLBase.jl#1531): has_global_error(alg) = true, and solving returns an ordinary solution (sol.u and sol(t) are the solution) with the estimate in sol.global_error. The extended (y, ε) ArrayPartition solve is split in __solve, and a projecting interpolation reuses the high-order extended dense output so sol(t) returns the solution component at full order (values, derivatives, and the in-place form). global_error_estimate(sol) now returns sol.global_error. Users no longer see the internal ArrayPartition. Requires SciMLBase >= 3.48 (compat bumped); depends on SciML/SciMLBase.jl#1531. Verified locally against the SciMLBase branch: GLEE test suite 91/91 (including a new interface testset), plus smoke tests of the split solution, dense output, derivatives, and the in-place interp form. 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.
Important
Ignore this PR until it has been reviewed by @ChrisRackauckas.
Summary
Adds a uniform interface for ODE solvers and solver wrappers to report an estimate of the global (accumulated) error of a solution, rather than only controlling local error per step. This is the foundation requested in the GlobalDiffEq review discussion (SciML/OrdinaryDiffEq.jl#3956): a trait for whether a method computes the global error, and a solution field (an array-of-arrays matching
u,nothingwhen the method doesn't compute it).has_global_error(alg)— algorithm trait, defaultfalse;truewhen the algorithm/wrapper populates a global error estimate. Added next to the other algorithm traits, made@public, and documented indocs/src/interfaces/Algorithms.md.ODESolution.global_error— new field, defaultnothing; when present, an array matchinguwhereglobal_error[i]is the estimated global error ofu[i]att[i]. Documented in theODESolutiondocstring.Backward compatibility
All defaults are
nothing, so existing solutions and constructors are structurally and behaviorally unchanged (the defaultGEtype parameter isNothing). The field is threaded through:build_solution— newglobal_error = nothingkeyword, passed to the constructor;ODESolution{T,N}(...)convenience constructor — optional last argument defaulting tonothing, so existing 17-argument positional calls still work;ConstructionBase.setproperties— so@set/@resetpreserveglobal_error;solution_new_original_retcode(direct reconstruction) andsolution_slice(slicesglobal_erroralongsideu).Only code constructing
ODESolutionthrough the fully type-parameterized inner constructor with an explicit 16-parameter/17-field signature would need updating; the standardbuild_solutionand convenience-constructor paths are unaffected.Minor version bump (3.47.0 → 3.48.0) for the new public API.
How it will be used (follow-ups, not in this PR)
has_global_error = trueand, insavevalues!, split their internal(y, ε)ArrayPartitionso the user gets a normalsol.uand theεregister lands insol.global_error.GlobalErrorTransport/GlobalDefectCorrection/GlobalAdjointwrappers will populate the samesol.global_error, so the user-facing surface is uniform across methods.Validation (run locally)
false/ overridetrue;sol.global_error === nothingby default; populated via thebuild_solutionkeyword; preserved through@set/setproperties; sliced correctly bysolution_slice. All pass.GROUP=CoreSciMLBase test suite: pass — fullGROUP=Coresuite green ("SciMLBase tests passed"), including the setproperties/@set-heavy Remake group (4430/4430).Runic --checkon the changed files.🤖 Generated with Claude Code