Repository navigation
Unify companion global error estimators into GlobalErrorEstimation - #4492
Merged
ChrisRackauckas merged 1 commit intoSep 10, 2026
Merged
Conversation
Replace the separate GlobalDefectCorrection and GlobalErrorTransport wrappers
with a single GlobalErrorEstimation(alg; equation, mode) parameterized by two
orthogonal enums:
- equation (GlobalErrorEquation): DefectCorrection (nonlinear
ε' = f(P+ε) - P') or ErrorTransport (linearized ε' = J(P)ε + d, matrix-free
JVP via DifferentiationInterface).
- mode (GlobalErrorMode): InterpolatingMode (store the dense solution,
integrate the companion in a second pass) or SimultaneousMode (advance the
companion inline over each step for O(1) extra memory and no second solve).
Both axes share one defect-companion implementation. Supersedes SciML#3956 and SciML#3957.
Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude <[email protected]>
Agent-Harness: Claude Code
Agent-Model: claude-opus-4-8
Agent-Session: https://claude.ai/code/session_01MfUh8tgp3iBmMv9nkBqoyY
This was referenced Sep 10, 2026
ChrisRackauckas
marked this pull request as ready for review
September 10, 2026 22:59
ChrisRackauckas
referenced
this pull request
Sep 11, 2026
Add two orthogonal enum options to GlobalAdjoint:
- scope (GlobalAdjointScope): EndpointError (default) fills only
sol.global_error[end]; TrajectoryError estimates the error 2-norm at every
saved time via a discrete adjoint cost placed at each t_i, filling
sol.global_error along the whole trajectory.
- control (GlobalAdjointControl): ToleranceRefinement (default) tightens local
tolerances and re-solves adaptively; StepGridRefinement re-solves
non-adaptively on exactly the accepted step grid (adaptive=false, stepping on
the adjoint-informed dts) for a reproducible fixed-step schedule.
Both keep the autojacvec=false (ForwardDiff Jacobian) path, since the estimator
differentiates a RHS that reads the solution interpolant (SciML/SciMLSensitivity.jl#1649).
Closes #4493 and #4494.
Agent-Harness: Claude Code
Agent-Model: claude-opus-4-8
Agent-Session: https://claude.ai/code/session_01MfUh8tgp3iBmMv9nkBqoyY
Co-authored-by: ChrisRackauckas-Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
This was referenced Sep 11, 2026
ChrisRackauckas
added a commit
that referenced
this pull request
Sep 11, 2026
- Unify companion global error estimators into GlobalErrorEstimation (#4492) - Add adjoint-based global error control as a SciMLSensitivity extension (#3953) - ExpRK: cache ishermitian (rebase of #4305, + review fixes) (#4497) - Mark discrete time-grid search helpers as Enzyme inactive (#4496) - GlobalAdjoint: every-step trajectory scope and step-grid control (#4495) - GlobalAdjoint: defer to adjoint_sensitivities default instead of pinning an adjoint (#4498) - Release GlobalDiffEq 1.7.1 (#4501) - Fix GlobalDiffEq precompilation on Julia 1.13 and companion accuracy (#4500) - Make mass-matrix identity/zero/diagonal checks GPU-safe (#4502) - Fix BDF step rejection for backward-in-time integration (#4503) 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 11, 2026
- Precompile SDE solves through specialization levels (#4467) - Add 32-bit InterfaceI CI lane via test_groups.toml (#4480) - incorporate time/stab filter for larger steps in FBDF (#3878) - Keep 32-bit CI lane hard-failing. (#4482) - Correct and validate FBDF time and stability filters (#4484) - Keep DAE init from overwriting uprev during callback truncation (#4486) - DiffEqBase: Int64 interp_points range length for 32-bit (#4487) - Release OrdinaryDiffEqBDF 2.4.7 (#4490) - Unify companion global error estimators into GlobalErrorEstimation (#4492) - Add adjoint-based global error control as a SciMLSensitivity extension (#3953) 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 12, 2026
- Release OrdinaryDiffEqBDF 2.4.7 (#4490) - Unify companion global error estimators into GlobalErrorEstimation (#4492) - Add adjoint-based global error control as a SciMLSensitivity extension (#3953) - ExpRK: cache ishermitian (rebase of #4305, + review fixes) (#4497) - Mark discrete time-grid search helpers as Enzyme inactive (#4496) - GlobalAdjoint: every-step trajectory scope and step-grid control (#4495) - GlobalAdjoint: defer to adjoint_sensitivities default instead of pinning an adjoint (#4498) - Release GlobalDiffEq 1.7.1 (#4501) - Fix GlobalDiffEq precompilation on Julia 1.13 and companion accuracy (#4500) - Make mass-matrix identity/zero/diagonal checks GPU-safe (#4502) 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
- Unify companion global error estimators into GlobalErrorEstimation (#4492) - Add adjoint-based global error control as a SciMLSensitivity extension (#3953) - ExpRK: cache ishermitian (rebase of #4305, + review fixes) (#4497) - Mark discrete time-grid search helpers as Enzyme inactive (#4496) - GlobalAdjoint: every-step trajectory scope and step-grid control (#4495) - GlobalAdjoint: defer to adjoint_sensitivities default instead of pinning an adjoint (#4498) - Release GlobalDiffEq 1.7.1 (#4501) - Fix GlobalDiffEq precompilation on Julia 1.13 and companion accuracy (#4500) - Make mass-matrix identity/zero/diagonal checks GPU-safe (#4502) - Fix BDF step rejection for backward-in-time integration (#4503) 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]>
4 tasks done
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.
What changed and why
Unifies the two defect-companion global-error wrappers into a single algorithm.
Previously #3956 (
GlobalErrorTransport) and #3957 (GlobalDefectCorrection)added two separate structs; they share the same machinery (dense forward solve →
companion ODE driven by the defect
d(t) = f(P(t)) - P'(t)) and differ only inthe companion equation. This PR replaces both with
parameterized by two orthogonal enums:
equation(GlobalErrorEquation):DefectCorrection— the nonlinearcorrection
ε' = f(P+ε) - P'(no Jacobian); orErrorTransport— thelinearized transport
ε' = J(P)ε + d(matrix-free JVP viaDifferentiationInterface).
ErrorTransportis the first-order linearization ofDefectCorrection.mode(GlobalErrorMode):InterpolatingMode— store the dense solutionand integrate the companion in a second pass (
O(n_steps)memory); orSimultaneousMode— drive the forward integrator one step at a time and advancethe companion across each step using that step's live dense output (
O(1)extramemory, no second solve).
All 2×2 combinations are supported by one implementation. Supersedes #3956 and
#3957 (closing both).
Verification
Run locally from
lib/GlobalDiffEq(Julia 1.11).GROUP=Core:The 43 companion tests cover every
equation × modecombination for theestimate accuracy (in-place and out-of-place,
est/true_err ≈ 1 rtol=0.1against a
1e-13reference),gtolcontrol (endpoint error≤ gtol),SimultaneousMode ≈ InterpolatingMode(rtol = 5e-3; see note below), andargument/dense-output validation.
GROUP=QA(Aqua + ExplicitImports + JET):Testing GlobalDiffEq tests passed.Runic: clean.
Note for the reviewer
SimultaneousModevsInterpolatingModeagree to ~few×1e-3, not machineprecision. They integrate the same companion ODE, but the streaming mode
restarts the companion solver at every forward step (resetting its adaptive
controller), so the accumulated quadrature differs slightly. This is negligible
next to the ~10% accuracy of the global-error estimate itself; the
rtol=5e-3match tolerance is set from the observed difference, not to hide a bug — the
independent
gtolcontrol tests confirm both modes produce correcterror-controlling estimates.
GlobalDefectCorrection/GlobalErrorTransportnolonger exist. Since neither has been released on
master(they lived only inthe two open PRs this supersedes), this is not a break of any shipped API.
ErrorTransportJVP) — all MIT/permissive, matching the host package.Not verified
Downstream packages, GPU paths, and allowed-to-fail CI jobs were not run locally.
🤖 Generated with Claude Code (model: claude-opus-4-8)
https://claude.ai/code/session_01MfUh8tgp3iBmMv9nkBqoyY