Repository navigation
GlobalDiffEq: fix Julia 1.13 precompilation and InterpolatingMode companion accuracy - #4500
Merged
ChrisRackauckas merged 1 commit intoSep 11, 2026
Conversation
- adjoint.jl re-defined _positive_finite_real and _validate_tolerances, which already live in companion.jl as shared machinery. Method overwriting is an error during module precompilation on Julia 1.13, so GlobalDiffEq failed to precompile (and took down the GlobalDiffEqSciMLSensitivityExt and every downstream test env with it). Remove the duplicates. - InterpolatingMode integrated the defect-driven companion ODE in one adaptive solve over the whole span. The defect is only piecewise smooth, with kinks at the forward step nodes; companion steps straddling a node smooth over the kink and underestimate the local error, so the estimate was biased low relative to SimultaneousMode, which restarts the companion on every forward step. Pass the forward step nodes as tstops so companion steps land on the kinks. This makes the two modes agree to ~1e-6 relative (test tolerance is 5e-3) and the interpolating estimate now matches the converged companion integral. - Runic-format companion.jl. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Agent-Harness: Devin CLI 3000.10.21 Agent-Model: SWE-2 High Agent-Session: local Devin CLI session (no shareable URL); session db at /home/crackauc/.local/share/devin/cli/sessions.db
ChrisRackauckas
added a commit
that referenced
this pull request
Sep 11, 2026
- 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
- 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.
Summary
GlobalDiffEqprecompilation on Julia 1.13.src/adjoint.jlre-defined_positive_finite_realand_validate_tolerances, which already exist insrc/companion.jlas shared machinery (introduced by GlobalAdjoint: every-step trajectory scope and step-grid control (closes #4493, #4494) #4495 on top of Unify companion global error estimators into GlobalErrorEstimation #4492). Method overwriting is a hard error during module precompilation on Julia 1.13, so the package failed to precompile, which also brokeGlobalDiffEqSciMLSensitivityExt, Aqua'spersistent_taskscheck in the QA group, and every downstream test env that loadsGlobalDiffEq. The duplicates inadjoint.jlare removed; the single definitions incompanion.jlare kept.SimultaneousMode matches InterpolatingModetest failure (lib/GlobalDiffEq/test/companion_tests.jl:44) by makingInterpolatingModeintegrate the companion ODE accurately: the defectd(t) = f(P) - P'driving the companion is only piecewise smooth — it has kinks (derivative jumps) at the forward solver's step nodes. A companion step straddling a node smooths over the kink and underestimates its local error, biasing the endpoint estimate.SimultaneousModeimplicitly avoids this by restarting the companion on every forward step. Passing the forward step nodes aststopsto the interpolating-mode companion solve confines each companion step to a smooth piece — the modes now agree to ~1e-6 relative (see below) and the interpolating estimate matches the converged companion integral.src/companion.jl(the file failing masterformat-check);runic --checknow passes on all oflib/GlobalDiffEq.Investigation detail (test failure was not borderline)
At the default companion tolerances (
companion_abstol=1e-10,companion_reltol=1e-8) on the Lotka–Volterra test problem attol=1e-6:[t0, T](old InterpolatingMode)tstops)The live-integrator and stored-solution interpolants agree to ~1e-13, and restarting the companion on the stored interpolant reproduces the SimultaneousMode value exactly — so the discrepancy came entirely from the one-shot companion solve straddling defect kinks, i.e. the old InterpolatingMode value was the less accurate one.
tstops = sol.tfixes that directly rather than loosening the test tolerance.Test plan
Julia 1.13.0-rc4 (what CI's
1resolves to),cd lib/GlobalDiffEq,GROUP=Core julia +1.13 --project=. -e 'using Pkg; Pkg.test()'.Before (master; identical values in CI log and local run — local run needed the precompile fix to load the package at all, companion code unchanged):
After (this branch):
GlobalDiffEqandGlobalDiffEq → GlobalDiffEqSciMLSensitivityExtprecompile cleanly with no method-overwrite warnings, and:GROUP=QAalso passes (QA | 23 passed, 1 broken (pre-existing @test_broken) | Testing GlobalDiffEq tests passed), andrunic --check lib/GlobalDiffEqexits 0. Docs build not run — no docstrings or public API changed.🤖 Generated with Devin (harness: Devin CLI 3000.10.21, model: SWE-2 High). Session: local Devin CLI session (no shareable URL); session db at /home/crackauc/.local/share/devin/cli/sessions.db