Repository navigation
GlobalAdjoint: every-step trajectory scope and step-grid control (closes #4493, #4494) - #4495
Merged
ChrisRackauckas merged 1 commit intoSep 11, 2026
Conversation
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 SciML#4493 and SciML#4494.
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
ChrisRackauckas
marked this pull request as ready for review
September 11, 2026 10:40
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 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]>
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.
Implements the two
GlobalAdjointfollow-ups from the merged adjoint PR (#3953),as two orthogonal enum options. Closes #4493 and #4494.
What changed
scope(GlobalAdjointScope):EndpointError(default, unchanged) fillsonly
sol.global_error[end];TrajectoryErrorestimates the error 2-normat every saved time by placing the adjoint's discrete cost at each
t_i(
dgdu_discretewitht = [t_i]), fillingsol.global_erroralong the wholetrajectory (GlobalAdjoint: every-step global-error mode (fill sol.global_error along the trajectory) #4493).
control(GlobalAdjointControl):ToleranceRefinement(default,unchanged) tightens local tolerances and re-solves adaptively;
StepGridRefinementfinds the accepted grid the same way, then re-solvesnon-adaptively on exactly that grid via the integrator interface
(
adaptive=false,set_proposed_dt!on eachdt), for a reproduciblefixed-step schedule (GlobalAdjoint: adjoint-derived tstops control strategy (adaptive=false, tstops=dts) #4494).
Both reuse the existing machinery: the extension's
_adjoint_defect_projectiongains a
terminal_timeargument, and theautojacvec=falseForwardDiff-Jacobiandefault is kept (the RHS reads the solution interpolant, which the VJP backends
mishandle — SciML/SciMLSensitivity.jl#1649).
Verification
Local, Julia 1.12,
lib/GlobalDiffEq.GROUP=Core:The new mode tests verify (on the linear problem
u'=2u, exact error known):TrajectoryErrorfillsglobal_erroralong the path withglobal_error[1]=0,global_error[end] ≤ gtol, and each well-resolved per-time estimate (error abovegtol/10) matches the true error tortol=0.2;StepGridRefinementreturns asuccessful non-adaptive solution meeting
gtol.GROUP=QA(Aqua + ExplicitImports + JET):Testing GlobalDiffEq tests passed.Runic: clean.
Note for the reviewer
gtol/10. Below that the trueerror is at the adjoint noise floor, so a ratio of two tiny numbers is
meaningless — not a loosened tolerance hiding a defect (the endpoint estimate is
validated separately in the existing suite).
TrajectoryErrorcosts one reverse-adjoint solve per saved time per sample andreturns a dense, every-step solution; it is opt-in.
Not verified
Downstream packages, GPU paths, allowed-to-fail CI jobs.
🤖 Generated with Claude Code (model: claude-opus-4-8)
https://claude.ai/code/session_01MfUh8tgp3iBmMv9nkBqoyY