Skip to content

Define default_linear_interpolation with the problem first - #4834

Merged
ChrisRackauckas merged 3 commits into
SciML:masterfrom
ramlakhanmadheshiya:sg/default-linear-interpolation-order
Oct 11, 2026
Merged

ChrisRackauckas merged 3 commits into
SciML:masterfrom
ramlakhanmadheshiya:sg/default-linear-interpolation-order

Conversation

@ramlakhanmadheshiya

@ramlakhanmadheshiya ramlakhanmadheshiya commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

__init and ManifoldDiffEq call default_linear_interpolation(prob, alg), so the methods are now defined in that order and the DiscreteProblem, VerletLeapfrog and LeapfrogDriftKickDrift opt-outs apply again, as they did before 42b98fc.
DAE algorithms stay on dense output, because SciMLSensitivity's DAEAdjointProblem rejects a solution with dense = false.
The RODE method is folded into the generic one, because any solver method with an untyped prob is ambiguous with it under Aqua.
TrixiParticles' SymplecticPositionVerlet method is still written algorithm first and needs flipping once this is released.

Fixes #4684

@ramlakhanmadheshiya
ramlakhanmadheshiya marked this pull request as ready for review October 10, 2026 15:19
Copilot AI balanced review requested due to automatic review settings October 10, 2026 15:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

….3.0

The problem-first default_linear_interpolation changes the default `dense`
for DAE algorithms without a stiff interpolant, DiscreteProblems,
VerletLeapfrog and LeapfrogDriftKickDrift, so both get a minor bump.
SymplecticRK's problem-first methods require the new Core: against an older
Core they are ambiguous with the AbstractRODEProblem method and the generic
method still reads its arguments in the old order.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <[email protected]>
Agent-Harness: Devin CLI 3000.11.3
Agent-Model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium
Agent-Session: local job ode-4834 (transcript kept on the agent host)
@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

Independent review (Claude Code 2.1.285, model claude-opus-5-5): MERGE, risk low. Commit d38dec6 (version bumps Core 4.19.0 / SymplecticRK 2.3.0 and the SymplecticRK floor OrdinaryDiffEqCore = "4.19") was added by a Devin agent at @ChrisRackauckas's request; Chris has ruled the change non-breaking.

Release-note item: dense now defaults to false (linear sol(t) between steps) for DImplicitEuler, DABDF2, VerletLeapfrog, LeapfrogDriftKickDrift and every DiscreteProblem, restoring the pre-Dec-2024 intent; DFBDF/DNordsieckBDF keep dense output.

Full review

VERDICT: MERGE
RISK: low

Reviewer: Claude Code (Opus 5.5, claude-opus-5-5), read-only adversarial review of #4834 at head d38dec6 (base origin/master 65f5e50).

Blocking findings

None.

Non-blocking findings

  1. The change is visible to users, though Chris has ruled it non-breaking. (Confirmed by running.) Default dense flips from true to false for DImplicitEuler, DABDF2, VerletLeapfrog, LeapfrogDriftKickDrift, and every DiscreteProblem solve. For those algorithms, sol(t) between steps is now linear instead of Hermite. For example, DABDF2 gives sol(0.37)[1] = 0.690789 on master and 0.690501 on the PR, against an exact value of 0.690734. This restores the behavior from before 42b98fc (2024-12-17). Before that commit, solve.jl had !(alg isa DAEAlgorithm) && !(prob isa DiscreteProblem) inline. The release notes or PR body should say this so that users of sol(t) with these algorithms are not surprised. Also suspected from reading: allocation and memory use go down for these algorithms, because k is no longer stored.
  2. The new docstring wording is slightly inaccurate. lib/OrdinaryDiffEqCore/src/alg_utils.jl:1035-1036 says "DAE algorithms without their own interpolant". On master, DImplicitEuler and DABDF2 did produce Hermite dense output (confirmed: dense=true, with different sol(t) values), so "without a stiff (method-specific) interpolant" would be more accurate. This is cosmetic.
  3. A retrocap in General for new Core with old SymplecticRK is optional. (Confirmed by running.) Core 4.19.0 with SymplecticRK 2.2.3 resolves, has 0 default_linear_interpolation ambiguities, and gives VerletLeapfrog/LeapfrogDriftKickDrift dense=true. That is exactly today's master behavior: no error and no regression, only a fix that doesn't take effect. The retrocaps Devin proposed in REPORT.md §4 are optional consistency hygiene, not a correctness requirement.
  4. There is an external dead method in TrixiParticles.jl. ext/TrixiParticlesOrdinaryDiffEqSymplecticRKExt.jl:30 defines default_linear_interpolation(alg::SymplecticPositionVerlet, prob) = true, with the algorithm first. It is dead on master and stays dead after this PR. It is neither a regression nor ambiguous, because a concrete alg type in arg 1 does not intersect the new (Any, Any) generic method. Devin's issue draft for it is unfiled. Filing it needs Chris's permission, because TrixiParticles is not one of Chris's repos.
  5. The has_stiff_interpolation guard is correct across the compat range. (Read from history.) has_stiff_interpolation(::DFBDF) has existed since BDF 1.16.0 (df0d55a), and DNordsieckBDF was introduced together with its trait (b193172, BDF 2.4.1). So every BDF 2.x that resolves with Core 4.19 keeps DFBDF/DNordsieckBDF dense. BDF needs no floor.
  6. CI has not run on this PR (gh pr checks reports no checks; this is an outside-contributor branch). My local runs cover only the targeted groups listed below.

What I ran

All of the following ran on Julia 1.12, with envs built from git archive copies of the PR head and of origin/master in review-scratch/. Nothing was run in the tracked checkout.

1. Definitions and calls (git grep default_linear_interpolation on both trees):

  • After the PR, the definitions are Core alg_utils.jl:1038 (prob, alg) and SymplecticRK algorithms.jl:51,62 (prob, alg::...).
  • The only call is solve.jl:293 (prob, alg). The docstring, the public list (OrdinaryDiffEqCore.jl:434), and the docs @docs entry are consistent.
  • No in-repo sublib other than SymplecticRK defines a method. StochasticDiffEqCore sets dense = false itself (StochasticDiffEqCore/src/solve.jl:183), and DelayDiffEq has its own default.
  • methods(default_linear_interpolation) on the PR shows exactly 3 methods, all problem-first.
  • Test.detect_ambiguities(Core, SymplecticRK, BDF) filtered to default_linear_interpolation is empty on both master and the PR.
  • Core has 2 unrelated ambiguities on both master and the PR, so they are pre-existing.

2. Behavior probe (probe.jl; master → PR):

Case master dense PR dense
DImplicitEuler true false
DABDF2 true false
DFBDF true true
DNordsieckBDF true true
VerletLeapfrog true false
LeapfrogDriftKickDrift true false
PseudoVerletLeapfrog true true
McAte2 true true
FunctionMap true false
DiscreteProblem with the default algorithm true false
Tsit5 true true
FBDF true true
  • FunctionMap keeps its left-constant sol(2.5) = 1.21 in both, because evaluate_interpolant checks isdiscretecache before !id.dense.
  • default_linear_interpolation(RODEProblem, EM()), (RODEProblem, Tsit5()) and (SDEProblem, EM()) are true on both, so RODE behavior is unchanged.
  • solve(SDEProblem, EM()) gives dense=false on both.

3. Compat, using real mixed environments:

Combination default_linear_interpolation ambiguities VerletLeapfrog/LeapfrogDriftKickDrift
envX: PR Core 4.19.0 + master SymplecticRK 2.2.3 0 dense=true (status quo)
envY: master Core 4.18.1 + PR SymplecticRK 2.3.0, with the compat floor removed in a scratch copy 2: (prob::AbstractRODEProblem, alg) vs (prob, alg::VerletLeapfrog) / (prob, alg::LeapfrogDriftKickDrift) —
  • envY shows the SymplecticRK OrdinaryDiffEqCore = "4.19" floor is required: without it, Aqua would fail on old Core.
  • General registry (fetched via gh api): Core latest is 4.18.1 (5.0.0 is yanked), and SymplecticRK latest is 2.2.3. The bumps to 4.19.0 and 2.3.0 are minor, with no major.

4. New test, master vs PR. I included test/InterfaceI/default_linear_interpolation_tests.jl:

  • Against master's Core it gives 3 pass and 5 fail (DImplicitEuler, DABDF2, VerletLeapfrog, LeapfrogDriftKickDrift, DiscreteProblem).
  • Against the PR it gives 8/8 pass.
  • Root [targets].test includes BDF, SymplecticRK and FunctionMap.

5. The SymplecticRK test edits (dense = true added to 5 test_convergence(...; dense_errors = true) calls) are necessary:

  • On the PR, without dense=true: KeyError: key :L2 not found.
  • With it: l2 order 2.0004 and L2 order 1.997.
  • These edits are related to the fix and are not tolerance or expectation changes.

6. Sublibrary test runs on the PR copy, using the standard Pkg.test path with [sources]. Core 4.19.0 resolved from the path through transitive sources, so the unregistered floor does not break the sublib test env.

Run Result
GROUP=Core SymplecticRK passed
GROUP=QA SymplecticRK (Alloc, JET, Aqua) passed
GROUP=Core FunctionMap passed
GROUP=Core BDF passed; all DAE convergence, AD, event, derivative_discontinuity, init, nlsolve-path and Nordsieck sets pass, and the 2 broken in DAE Initialization are pre-existing @test_brokens on master

7. Format, spelling, and unrelated changes:

  • Runic --check on all 5 changed .jl files is clean.
  • typos on the added lines is clean.
  • The diff contains no changes unrelated to the fix. It touches the generic method, the two SymplecticRK methods, the tests that needed dense=true, the new test plus its runtests.jl include, and the version and compat bumps.

8. Downstream usage (gh search code default_linear_interpolation):

Repo Usage Effect
TestParticle.jl BorisPushers (prob, ::AbstractBoris) correct on both master and PR
ManifoldDiffEq.jl calls (prob, alg) consistent
TrixiParticles.jl algorithm-first dead on both (see non-blocking 4)
SciMLSensitivity Aqua ignore list only none

What I did not verify

  • Full GROUP=All/InterfaceI, Core QA (JET/Aqua for OrdinaryDiffEqCore itself), and BDF GROUP=QA (allocation tests). Per instruction, I ran only targeted groups. From reading, I expect BDF allocation tests not to regress, because dense=false stores less.
  • Julia 1.10 (LTS) resolution through runtests.jl's develop_sources! path. I ran only Julia 1.12.
  • Downstream packages (ModelingToolkit, SciMLSensitivity, DiffEqCallbacks, JumpProcesses) that might rely on the 2024–2026 dense=true default for DAE or discrete solves. Code search found no direct use of the trait, but implicit reliance on sol(t) accuracy was not tested.
  • Docs build: the docstring is already wired via public_api.md:198, but I did not build the docs.
  • The General retrocap proposal in REPORT.md §4. I did not check its exact TOML ranges against the current General Compat.toml.

🤖 Posted by an AI agent — harness: Claude Code 2.1.285 · model: claude-opus-5-5
Conversation: local Claude session 3c311569-dda6-4687-bc9f-65febb212c33 (fleet master)

@singhharsh1708 singhharsh1708 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SciMLSensitivity Core3 is red here and green on master: DImplicitEuler and DABDF2 now default to dense = false, which DAEAdjointProblem rejects, and dropping the alg isa DAEAlgorithm clause makes that test pass locally while the leapfrog and DiscreteProblem opt-outs still apply.

@ramlakhanmadheshiya

Copy link
Copy Markdown
Contributor Author

DAE algorithms stay dense after fd90924, and SciMLSensitivity Core3 dae_adjoint.jl passes with it. The release-note item should drop DImplicitEuler and DABDF2.

@ChrisRackauckas
ChrisRackauckas merged commit b1d7885 into SciML:master Oct 11, 2026
390 of 403 checks passed
ChrisRackauckas referenced this pull request Oct 13, 2026
…inaryDiffEqBDF, OrdinaryDiffEqExplicitRK, OrdinaryDiffEqFIRK, OrdinaryDiffEqFeagin, OrdinaryDiffEqHighOrderRK, OrdinaryDiffEqPDIRK, OrdinaryDiffEqRKN, OrdinaryDiffEqSDIRK, StochasticDiffEqHighOrder, StochasticDiffEqLowOrder, and StochasticDiffEqMilstein for release (#4871)

Agent-Harness: Devin CLI 3000.11.3
Agent-Model: Fusion (Claude Opus 5.5 Medium + SWE-2 Medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/flash-hour.json

Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
ChrisRackauckas referenced this pull request Oct 14, 2026
Releases #4688 (CallbackCache non-differentiable for Mooncake), the only
DiffEqBase change since 7.21.3. SciMLSensitivity Core1 "Mooncake with
MooncakeAdjoint" keeps failing until it is registered.



Agent-Harness: Claude Code (subagent of ci-green head)
Agent-Model: claude-opus-5-5[1m]
Agent-Session: https://claude.ai/code/session_011aK5Xvp9NpdkzKuEwtiMGd

Co-authored-by: ChrisRackauckas-Claude <[email protected]>
Co-authored-by: Claude Opus 5.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.

default_linear_interpolation is called with its arguments swapped, so its opt-outs never apply

4 participants