Repository navigation
Clear QNDF's difference history when the state is resized - #4938
singhharsh1708 wants to merge 2 commits into
Conversation
Independent review (Codex CLI 0.163.0, model gpt-6.1-sol, reasoning effort high): MERGE, risk medium-low (ML2). Reviewed head: Full reviewVERDICT: MERGE Riskmedium-low (ML2: localized restart-history correction for the non-default QNDF solver, verified failing-before/passing-after with matrix-exponential accuracy coverage.) Risk assessment
Blocking findingsNone. Non-blocking findingsNone. What I ranRunner paths are abbreviated as Git inspection commands, all exit 0: git rev-parse HEAD
git diff origin/master...HEAD
git merge-base origin/master HEAD
git diff --check origin/master...HEAD
git log -1 --no-merges --format=%B
git status --shortHEAD and merge-base matched the specified SHAs. The diff check produced no output. The newest non-merge commit contains no agent trailers. From the head worktree: jrun --project=lib/OrdinaryDiffEqBDF -e 'using TestEnv; TestEnv.activate(); using Test, SafeTestsets; println("Julia ", VERSION); include("lib/OrdinaryDiffEqBDF/test/resize_tests.jl")'Exit 0; output tail: I copied the PR’s changed Exit 1; output tail: This confirms the regression by running. The matrix-exponential accuracy assertion passed on both revisions in these runs; the deterministic fail-before evidence is the cache invariant. Resolved dependency versions matched between worktrees apart from OrdinaryDiffEqBDF’s version bump. Final status showed a clean head and only the copied test changed on base. Inspected the supplied check results and failed-log excerpts:
What I did not verify
AUTHOR_GRADE: {"task":"bugfix","score":5,"difficulty":2,"rounds":1,"author_harness":"unknown","author_model":"unknown","note":"Narrow history-reset fix with a deterministic regression that fails on base and passes on head, plus independent matrix-exponential accuracy checks. The implementation is small and reuses the solver's existing history-clearing operation."} 🤖 Posted by an AI agent · harness: Claude Code · model: claude-opus-5-5 (coordinating gpt-6.1-sol reviewers) |
7cf1742 to
15f7b53
Compare
QNDF's
resize_non_user_cache!now zeroesDandprevD, so the step after a resize starts from an empty difference history whether or not the callback then callsderivative_discontinuity!(integrator, false).The resize sets
derivative_discontinuity = trueso that the next step clears the history, but thedisc = falsecases inresize_tests.jlclear that flag again right after resizing. The grown entries ofDthen hold whatever memoryresize!returned, and the predictoru₀ = uprev + D[1]and the order-raising estimate read them. That is the intermittentBDF state resizingfailure on CI (seen on #4931 and on #4920's downgrade lane: dt below eps at t = 0.5).With a stale 1e200 planted in the slot
resize!reuses, master stops withUnstable(error 0.30) fordisc = false, and this branch matches thedisc = truerun exactly (141 steps, error 1.9e-10). Repeating the resize test with a scribbled heap, master failed once in 400 rounds (QNDF,disc = false) and this branch did not fail in 1000. The new testset checks that the history is zero right after the resize, which fails on master on every run. BDF Core passes.FBDF already restarts from
uprevafter a resize (iters_from_event = 0), so it is unchanged. #4809 moves this function as it is. BDF goes to 2.4.15.AI Disclosure: Claude assisted with this change.