Skip to content

AN5 returns Success with inaccurate state after an identity callback #4889

Open

Description

@ChrisRackauckas-Claude

🚧 UNREVIEWED — AI-generated issue draft; not reviewed by Chris Rackauckas.

AN5 returns Success with a large accuracy error after an identity callback on the tested default-branch snapshot. No resizing is performed.

Tested default-branch snapshot: b94e13a . Local source versions: OrdinaryDiffEqNordsieck 2.3.2, OrdinaryDiffEqCore 4.19.0, OrdinaryDiffEqTsit5 2.1.5, DiffEqBase 7.21.4; registered SciMLBase 3.58.0.

The exact solution supplies the reference independently of AN5. The assertion allows relative error 1e-6, much larger than the requested local tolerance 1e-10; the reported error is still orders of magnitude larger.

using OrdinaryDiffEqNordsieck, Test
import SciMLBase: successful_retcode
f!(du,u,p,t) = (du[1] = u[1])
@testset "AN5 same-size identity callback" begin
    for modified in (false,true)
        done = Ref(false)
        cb = DiscreteCallback((u,t,it) -> !done[] && t >= 0.2,
            it -> (done[] = true; u_modified!(it,modified));
            save_positions=(false,false))
        sol = solve(ODEProblem(f!,[1.],(0.,0.4)),AN5();
            dt=0.01, callback=cb, tstops=[0.2], reltol=1e-10, abstol=1e-12)
        println("modified=",modified," value=",sol.u[end][1]," exact=",exp(0.4),
            " error=",abs(sol.u[end][1]-exp(0.4))," rejected=",sol.stats.nreject,
            " retcode=",sol.retcode)
        @test successful_retcode(sol)
        @test sol.t[end] == 0.4
        @test isapprox(sol.u[end][1],exp(0.4);rtol=1e-6,atol=1e-9)
    end
end

Run this as mwe.jl with julia +1.12 --startup-file=no --project=lib/OrdinaryDiffEqNordsieck mwe.jl in a clone checked out at the tested commit after instantiating that sublibrary environment.

Observed output:

modified=false value=1.4918246977262013 exact=1.4918246976412703 error=8.493095116079985e-11 rejected=0 retcode=Success
modified=true value=1.6614276955317298 exact=1.4918246976412703 error=0.1696029978904594 rejected=23 retcode=Success
Test Summary:                   | Pass  Fail  Total  Time
AN5 same-size identity callback |    5     1      6  9.8s

Accuracy assertion failure (from the run):

Expression: isapprox((sol.u[end])[1], exp(0.4); rtol = 1.0e-6, atol = 1.0e-9)
Evaluated: isapprox(1.6614276955317298, 1.4918246976412703; rtol = 1.0e-6, atol = 1.0e-9)

Version information (versioninfo(); environment paths omitted):

Julia Version 1.12.7
Commit 6d172b025e4 (2026-08-15 08:05 UTC)
Build Info:
  Official https://julialang.org release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 128 × AMD EPYC 7502 32-Core Processor
  WORD_SIZE: 64
  LLVM: libLLVM-18.1.7 (ORCJIT, znver2)
  GC: Built with stock GC
Threads: 4 default, 1 interactive, 4 GC (on 128 virtual cores)

Environment: Julia 1.12.7, Linux x86_64, LLVM 18.1.7, four Julia worker threads, one BLAS thread, one precompile task. The unmodified default Core test group passed (Nordsieck 50/50; AN5 startup 6/6). Its QA group also passed: allocation 2 pass and 1 existing broken assertion, JET 1/1, Aqua 21/21.

Historical boundary investigation is incomplete. Unmodified source immediately before and at the startup-interpolation repair (33b43a7) reproduces the matrix-reference failures. No introducing commit is established, and no fix is claimed. The separate resize PR is not blamed.

A separate supported Julia 1.10.12 environment using the Nordsieck 1.1.0 source at a265106 and registered Core 1.36.0, Tsit5 1.5.0, DiffEqBase 6.213.0 and SciMLBase 2.153.1 passes the identity-callback matrix control (relative error 1.96e-10). This is a source/dependency epoch comparison, not a clean full-tree git-bisect result.

Two clean April source controls were unusable before the numerical probe: efda375 failed with UndefVarError: DEAlgorithm not defined in SciMLBase; 45fb3ad failed during Tsit5 precompilation with ArgumentError: Passing a Bool for verbose is no longer supported in OrdinaryDiffEq v7. Both used their local Core/Tsit5/DiffEqBase source and resolver-selected SciMLBase 3.58.0 on Julia 1.12.7. Neither failed environment is a numerical pass/fail classification.

Duplicate search: searched AN5 and Nordsieck issues and AN5 PRs. #4534 fixes the startup interpolation coordinate; #4758 targets JVODE; #4687 targets domain rejection in NordsieckBDF/FBDF. None establishes a repair for this AN5 reproduction.

At filing, default advanced to 71a9b35 . The compared commits change only DelayDiffEq files; the numerical runs reported above were not repeated on that newer commit.

Risk assessment

  • Risk: medium-low (ML2), describing the affected non-default AN5 numerical path; this issue makes no implementation change.
  • Blast radius: AN5 adaptive history/restart accuracy; separate from resizing. The two observed failures are not proven to share a cause.
  • Evidence: the executed scalar and matrix controls and exact errors above; no source fix or passing-after result claimed.
  • Independent review: separate Codex CLI 0.163.0 / gpt-6.1-sol baseline investigator, local session 01a1579a-6603-7c50-aa7e-4a749e59f043 (no session URL). This research is not a counted PR merge rating.
  • Merge: no PR proposed; a repair requires independent review and live regression checks.

Links:


🤖 Drafted by an AI agent — harness: Codex CLI 0.163.0 · model: gpt-6.1-sol
Conversation: local session 01a1579a-6603-7c50-aa7e-4a749e59f043 (no session URL)

Reviewed and posted by Codex CLI 0.163.0, model gpt-6.1-sol; local session 01a154f0-8986-78e1-8af2-1119e8cdea4a (no session URL).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions