Skip to content

GlobalAdjoint: defer to adjoint_sensitivities default instead of pinning an adjoint - #4498

Merged
ChrisRackauckas merged 2 commits into
SciML:masterfrom
ChrisRackauckas-Claude:fix/globaladjoint-default-sensealg
Sep 11, 2026
Merged

ChrisRackauckas merged 2 commits into
SciML:masterfrom
ChrisRackauckas-Claude:fix/globaladjoint-default-sensealg

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #3953: drop the ForwardDiff-Jacobian workaround for SciML/SciMLSensitivity.jl#1649 entirely.

The estimator is adjoint-agnostic, so nothing is pinned anymore: _default_adjoint_sensealg is gone, a nothing sensealg is forwarded as omitted kwargs, and adjoint_sensitivities applies its own default. User-passed sensealgs flow through unchanged.

Verification (run locally):

julia -m Runic --check on both touched files: clean. typos --diff: clean.

Estimator cross-check on the linear problem (default vs explicit adjoints):

default: 0.00013241391111588064
Interp: 0.00013241391111588064 (identical — upstream default is InterpolatingAdjoint())
Interp_False: 0.00013241251785696054
Quad: 0.00013244528870780053
Gauss: 0.00013213878972206228
actual: 0.00013244509132448457 (ratio default/actual 0.99976)

lib/GlobalDiffEq/test/adjoint_tests.jl with the new default:

Adjoint error estimation and control | 18 18 6m09.2s
GlobalAdjoint scope and control modes | 17 17 1m22.5s

Also verified on the #1649 MWE (with SciMLSensitivity#1650 + #4496 present) that explicit ReverseDiffVJP(), EnzymeVJP(), and false all agree with finite differences for Interp/Quad/Gauss.

Not verified:

Full GlobalDiffEq suite (only adjoint_tests.jl run), QA group, GPU/downstream. Pre-existing _positive_finite_real method-overwrite precompile warning (companion.jl:8 vs adjoint.jl:176, from #4492/#3953) still present and untouched.

This PR should be ignored until reviewed by @ChrisRackauckas.

🤖 Generated with OpenCode (model: opencode/muse-spark-1.3-contributor-free)
Session: /home/crackauc/sandbox/tmp_20260911_055415_17778 (local, no shareable URL)

ChrisRackauckas and others added 2 commits September 11, 2026 06:52
The ForwardDiff-Jacobian workaround for SciML/SciMLSensitivity.jl#1649 is no
longer needed: the ReverseDiff tape-freeze is fixed upstream and Enzyme
compiles ode_interpolation since the search helpers went inactive. Use the
default adjoint and VJP.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: OpenCode <[email protected]>
Agent-Harness: OpenCode (unknown version)
Agent-Model: opencode/muse-spark-1.3-contributor-free
Agent-Session: /home/crackauc/sandbox/tmp_20260911_055415_17778 (local, no shareable URL)
…ing InterpolatingAdjoint

The estimator is adjoint-agnostic (verified default/Interpolating/Quadrature/
Gauss all agree), so drop the _default_adjoint_sensealg hook entirely: a
nothing sensealg is forwarded as omitted kwargs and SciMLSensitivity picks
its own default. User-passed sensealgs flow through unchanged.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: OpenCode <[email protected]>
Agent-Harness: OpenCode (unknown version)
Agent-Model: opencode/muse-spark-1.3-contributor-free
Agent-Session: /home/crackauc/sandbox/tmp_20260911_055415_17778 (local, no shareable URL)
@ChrisRackauckas-Claude ChrisRackauckas-Claude changed the title GlobalAdjoint: default to InterpolatingAdjoint with automatic VJP GlobalAdjoint: defer to adjoint_sensitivities default instead of pinning an adjoint Sep 11, 2026
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review September 11, 2026 11:51
@ChrisRackauckas
ChrisRackauckas merged commit cf29de0 into SciML:master Sep 11, 2026
125 of 133 checks passed
ChrisRackauckas added a commit that referenced this pull request Sep 11, 2026
- GlobalAdjoint: defer to adjoint_sensitivities default instead of pinning an adjoint (#4498)



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
- 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]>
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.

2 participants