Skip to content

Report lazy interpolation for composites with a lazy member - #4931

Open
singhharsh1708 wants to merge 4 commits into
SciML:masterfrom
singhharsh1708:composite-lazy-interpolation
Open

singhharsh1708 wants to merge 4 commits into
SciML:masterfrom
singhharsh1708:composite-lazy-interpolation

Conversation

@singhharsh1708

@singhharsh1708 singhharsh1708 commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

SciMLBase.has_lazy_interpolation now returns true for a CompositeAlgorithm with a lazy member, so AutoVern7(Rodas5P()) and the default solver report what their dense output does, as Vern7() does.
The only reader of the trait for a composite is strip_solution, which now throws LazyInterpolationException for these solutions, as it does for Vern7(): the stripped solution has no f to build the lazy stages with. So strip_solution(solve(prob)) with the default solver now throws, even when only Tsit5 ran, where before it returned a stripped solution that interpolated wrongly (#4927). DefaultODEAlgorithm(lazy = Val(false)) still strips, so the default-solver testset in ode_strip_test.jl now uses it and checks that the lazy default throws. Non-lazy composites such as AutoTsit5(Rosenbrock23()) are unchanged here; their CompositeCache MethodError is #4907 (#4921).
integrator_interface.jl reads the trait through unwrap_alg, i.e. for the current member, so it is unaffected.
With this branch the issue's snippet prints true false true false for the four algorithms (master: true false false false); ode_strip_test.jl and Core QA pass.
Fixes #4906

Risk assessment

  • Risk: medium-high (MH3: changes a trait for every CompositeAlgorithm, so strip_solution on a default-solver solution now throws).
  • Blast radius: SciMLBase.has_lazy_interpolation for a CompositeAlgorithm now returns true when any member is lazy. Its only composite reader is strip_solution, which now throws LazyInterpolationException for AutoVern7(...) and default-solver solutions, as it already does for Vern7(); before, it returned a stripped solution that interpolated wrongly (Stripped default-solver solutions interpolate with the Hermite fallback, silently wrong #4927). Code calling strip_solution(solve(prob)) with the default solver will error and needs DefaultODEAlgorithm(lazy = Val(false)). Non-lazy composites and integrator_interface.jl (which reads the trait for the current member) are unchanged.
  • Evidence: The issue's snippet prints true false true false for the four algorithms (master: true false false false). The default-solver testset in ode_strip_test.jl now uses lazy = Val(false) and checks that the lazy default throws; ode_strip_test.jl and Core QA pass per the body. The red checks (SciMLSensitivity Core2, ProbNumDiffEq, AD lts, DiffEqDevTools downgrade, both GPU lanes, NonlinearSolve Core Julia 1) also fail on master.

@singhharsh1708

Copy link
Copy Markdown
Member Author

🤖 Automated comment from an AI agent running as @singhharsh1708, not written or reviewed by the account holder.

Independent review (Codex CLI 0.163.0, model gpt-6.1-sol, reasoning effort high): MERGE, risk medium-high (MH1). Reviewed head: 40a939e7824b34f6729f47b51fa7d95a280f9ea3.

Full review

VERDICT: MERGE
PR: #4931
Round: 1
Head: 40a939e
Base: 45ff46a
Slot: 1
Reviewer: Codex CLI 0.163.0 / gpt-6.1-sol
Session: 01a1976a-3681-7310-bee4-8e99074e169e
Reviewed: 2026-11-01T14:11:38Z
Summary: Propagates lazy-interpolation detection through composite algorithms and rejects unsafe solution stripping. The regression fails on base and passes on head, with no blocking defect found; CI remains partially red.

Risk

medium-high (MH1: Changes errors when stripping default and composite ODE solutions, affecting the core solution/interpolation interface.)

Risk assessment

  • Risk: medium-high (MH1: Default-solver solutions containing a lazy member now throw LazyInterpolationException during stripping.)
  • Blast radius: has_lazy_interpolation(::CompositeAlgorithm) and consumers such as strip_solution. The integrator’s existing caller queries the unwrapped member, preserving its behavior.
  • Evidence: Changed test copied into the merge-base worktree: head passes, base fails at the new exception assertion. Supplemental trait and analytic-decay checks pass. InterfaceI CI is green; eight other jobs fail, with six signatures also present in supplied master logs.
  • Verdict: MERGE
  • Round: 1
  • Blocking priorities: none
  • Merge: merge

Blocking findings

None.

Non-blocking findings

None.

What I ran

Launcher locations are normalized to jrun below to omit machine-specific paths. Every Julia invocation used the prescribed launcher, Julia 1.13.1, and its serialized execution environment.

Repository inspection, all exit 0:

git rev-parse HEAD
git diff origin/master...HEAD
git diff --check origin/master...HEAD
git merge-base origin/master HEAD
git rev-parse origin/master
git log -1 --format=%B
git log -1 --no-merges --format=%B
git status --short
gh pr view 4931 --repo SciML/OrdinaryDiffEq.jl --json state,headRefOid,baseRefOid
gh issue view 4906 --repo SciML/OrdinaryDiffEq.jl --json title,body,state,url

HEAD matched the requested commit; merge-base matched the supplied base SHA. The PR remained open. Neither author trailer was present. Final head status was clean; the base worktree’s sole tracked modification was the copied test.

Changed regression file, head - exit 0:

jrun --project=. -e 'using TestEnv; TestEnv.activate(); using Test, SafeTestsets; @show VERSION; include("test/InterfaceI/ode_strip_test.jl")'

Output tail:

Interpolation Stripping       | 3  3
Rosenbrock Solution Stripping | 7  7
TRBDF Solution Stripping      | 4  4
Default Solution Stripping   | 2  2

Fail-before verification, merge-base - exit 1:

I copied the PR’s test/InterfaceI/ode_strip_test.jl into the second worktree and ran the identical command there without changing source files.

Default Solution Stripping: Test Failed at test/InterfaceI/ode_strip_test.jl:46
  Expression: SciMLBase.strip_solution(default_sol)
    Expected: SciMLBase.LazyInterpolationException
  No exception thrown
Default Solution Stripping | 1 passed, 1 failed
ERROR: LoadError: Some tests did not pass

The preceding three testsets passed, as did the eager-default assertion.

Supplemental head probe - exit 0, 21 assertions passed:

jrun --project=. -e '
using TestEnv; TestEnv.activate()
using Test, OrdinaryDiffEq, OrdinaryDiffEqCore, OrdinaryDiffEqLowOrderRK
import SciMLBase
@show VERSION
@testset "Composite traits" begin
    for (alg, expected) in ((Vern7(), true), (Vern7(lazy=false), false), (AutoVern7(Rodas5P()), true), (AutoVern7(Rodas5P(); lazy=false), false), (DefaultODEAlgorithm(), true), (DefaultODEAlgorithm(lazy=Val(false)), false), (AutoTsit5(Rosenbrock23()), false), (OrdinaryDiffEqCore.CompositeAlgorithm((Tsit5(), BS5()), i->1), true), (OrdinaryDiffEqCore.CompositeAlgorithm((Tsit5(), BS5(lazy=false)), i->1), false))
        @test SciMLBase.has_lazy_interpolation(alg) === expected
    end
end
@testset "Analytic decay" begin
    f!(du,u,p,t) = (du[1] = -p[1]*u[1])
    for alg in (Vern7(), Vern7(lazy=false), AutoVern7(Rodas5P()), AutoVern7(Rodas5P(); lazy=false))
        p = [1.0]
        prob = ODEProblem(f!, [1.0], (0.0,1.0), p)
        sol = solve(prob, alg)
        @test SciMLBase.successful_retcode(sol)
        @test isapprox(sol(0.5)[1], exp(-0.5); atol=1e-8, rtol=1e-8)
        sol = solve(prob, alg)
        p[1] = 2.0
        err = sol(0.5)[1] - exp(-0.5)
        lazy = SciMLBase.has_lazy_interpolation(alg)
        println("trait=", lazy, " error_after_parameter_mutation=", err)
        @test (abs(err) > 1e-3) == lazy
    end
end
'

Output tail:

Composite traits | 9  9
trait=true error_after_parameter_mutation=-0.06273505143450764
trait=false error_after_parameter_mutation=2.8156654785505e-10
trait=true error_after_parameter_mutation=-0.06273505143450764
trait=false error_after_parameter_mutation=2.8156654785505e-10
Analytic decay | 12  12

The first probe invocation used the same command with unqualified CompositeAlgorithm at both constructor sites. It exited 1 before exercising behavior: UndefVarError: CompositeAlgorithm not defined in Main. Qualification corrected the reviewer-script error.

Inspected the supplied checks and failed-log excerpts for main CI, sublibrary CI, and downstream CI:

  • InterfaceI passes across all four reported configurations; Core and Core QA pass.
  • AD tape-recording errors, both GPUCompiler-warning failures, NonlinearSolve’s line-search exception, and SciMLSensitivity Core2/Core4 failures match signatures in master CI, master sublibrary CI, and master downstream CI.
  • ModelingToolkit’s causal-equation ordering failure and BDF’s resize failures lack matching signatures in the supplied master excerpts. Their cause remains unverified.

What I did not verify

  • Did not reproduce the unmatched ModelingToolkit or BDF CI failures; neither is established as pre-existing or PR-caused.
  • Did not run package-wide, heavy downstream, GPU, or AD suites locally. No GPU kernels or AD rules change in this PR.
  • Did not independently verify general stripped eager-solution interpolation accuracy beyond the changed test’s structural assertions.

AUTHOR_GRADE: {"task":"bugfix","score":5,"difficulty":2,"rounds":1,"author_harness":"unknown","author_model":"unknown","note":"Small, focused trait fix with a regression that fails on the merge-base and passes on head. Independent composite-trait and analytic-decay probes also pass; unmatched CI failures remain unattributed."}


🤖 Posted by an AI agent · harness: Claude Code · model: claude-opus-5-5 (coordinating gpt-6.1-sol reviewers)
Review: unreviewed
Session: 01a1976a-3681-7310-bee4-8e99074e169e

@singhharsh1708
singhharsh1708 force-pushed the composite-lazy-interpolation branch from 40a939e to eeb30f8 Compare November 3, 2026 07:39
@singhharsh1708
singhharsh1708 force-pushed the composite-lazy-interpolation branch from eeb30f8 to ac1e6f5 Compare November 3, 2026 18:58
@ChrisRackauckas

Copy link
Copy Markdown
Member

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

PR: #4931

Reviewed head: ac1e6f5
Raw SHA-256: 41b91f778969d4e65764d7a845441c96babe19d9b0c6ce5786ebd2f803a041b7
Source SHA-256: cf56761fb8569c7020f136faecb933615944afdfaed25cf9486b267170c47b75
Source: standard-review-v1 (harness-log)
Reviewer session: 01a1d256-8760-7033-a0d3-120ff6fda82a
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes

Risk assessment

  • Risk: medium (M1)
  • Verdict: CHANGES
  • Reviewed head: ac1e6f5

Review report

VERDICT: CHANGES
Round: 1
Head: ac1e6f5
Slot: 1
CI: CI is not green
Session: 01a1d256-8760-7033-a0d3-120ff6fda82a

Risk

medium (M1: adds dispatch on SciMLBase.has_lazy_interpolation that changes existing composite/default solution-stripping calls)

Blocking findings

  • Verdict: CHANGES

  • Round: 1

  • Blocking priorities: P2

  • [P2] Needs verification — lib/OrdinaryDiffEqCore/src/alg_utils.jl:40. The affected solver tests and adversarial numerical probes did not execute. After about an hour of resource checks, the machine had not simultaneously met the supplied limits of fewer than five existing Julia test workers, at least 16 GiB available memory, and load below 32. The waiting helper was interrupted and exited 130; no solver test was interrupted. Run the updated stripping test, failing-before/passing-after comparison, eager stripped-interpolation probes, and full GROUP=InterfaceI suite before accepting this head. This is a verification blocker, not a confirmed code regression.

Non-blocking findings

  • test/InterfaceI/ode_strip_test.jl:49 — Reading only: the successful eager-stripping case checks cache.args, but never evaluates the stripped solution. Add off-grid interpolation comparisons to exercise the successful path. No interpolation failure was confirmed.

What I ran

  • Reviewer: codex-cli 0.164.0, model gpt-6.1-sol; session identified above.
  • Inspected git diff origin/master...HEAD, affected implementation/tests, test-group wiring, and newest commit trailers. Root AGENTS.md and CLAUDE.md are absent. Newest commit has neither attribution trailer, so author harness/model are unknown.
  • git diff --check origin/master...HEAD: exit 0. Final git status --porcelain=v1: empty; requested head unchanged.
  • Julia 1.13.2: Pkg.instantiate(; allow_autoprecomp=false) in a scratch environment reproducing the root dependencies/test target and local sources: exit 0. Preserved the runtime's layered JULIA_DEPOT_PATH; no repository files were changed.
  • Dependency API diagnostics: SciMLBase 3.58.0 and the declared minimum 3.53.0 both report isdefined(SciMLBase, :has_lazy_interpolation) == true and Base.ispublic(SciMLBase, :has_lazy_interpolation) == true; both diagnostic processes exited 0.
  • uv run --locked python --version: Python 3.15.0. No uv.lock or Python project exists; uv warned that --locked has no effect outside a project. No system-Python substitution was used.
  • Both waiting helpers terminated; all started dependency/diagnostic commands completed. No review Julia process remained running.

What I did not verify

  • The changed stripping test, complete InterfaceI suite, or prepared targeted probes for mixed composites, eager stripped interpolation, callbacks, and baseline/head equality. The solver runner never passed resource admission.
  • Failing-before/passing-after behavior, numerical correctness, or downstream regressions.
  • CI results beyond the supplied status. No PR body, comments, reviews, author risk rating, or earlier review artifacts were read.

AUTHOR_GRADE: {"task":"bugfix","score":3,"difficulty":1,"rounds":1,"author_harness":"unknown","author_model":"unknown","note":"The small trait extension is consistent by inspection and its dependency API is public in both checked versions. Solver checks never passed resource admission, so functional correctness and regression coverage remain unverified; no runtime regression was established."}

Head link: ac1e6f5


🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol
Conversation: local session 01a1d256-8760-7033-a0d3-120ff6fda82a (no session URL)

@singhharsh1708

Copy link
Copy Markdown
Member Author

Interpolating stripped eager default solutions is what #4921 fixes and tests; on its own this PR only changes which solutions are allowed to strip. Merged master to refresh the stale downstream runs.

This branch has not been deployed

No deployments
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.

has_lazy_interpolation is false for composite algorithms with lazy Verner methods, e.g. AutoVern7

2 participants