Repository navigation
Use the active member's autodiff in out-of-place calc_tderivative - #4957
singhharsh1708 wants to merge 4 commits into
Conversation
PR: #4957 Reviewed head: 7092400 Risk assessment
Review reportVERDICT: CHANGES Riskmedium (M2: previously working mixed-AD composite solves change sampled results by up to 1.55e-10; independent analytic probes pass). Blocking findings
Non-blocking findings
What I ranAI reviewer: Codex CLI 0.164.0, model gpt-6.1-sol. Review remained blind to PR bodies, comments, reviews, and author risk ratings.
What I did not verify
AUTHOR_GRADE: {"task":"bugfix","score":4,"difficulty":2,"rounds":1,"author_harness":"unknown","author_model":"unknown","note":"347 local assertions passed; the base method reproduces the original AD-option exception. The supplied downstream Core4 regression remains unverified and uncleared."} Head link: 7092400 🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol |
|
Made the RHS depend on t so calc_tderivative's value matters, checked against the exact solution, and added a finite-diff-first composite case. Both cases fail with the src change reverted. The resize paths that also read alg_autodiff(integrator.alg) are fixed in #4958. |
Out-of-place
calc_tderivativereadalgfrom the integrator, so inside aCompositeAlgorithmit took the autodiff of the last member. It now usesunwrap_alg(integrator, true), as the in-placecalc_tderivative!does.The repro in #4951 (
CompositeAlgorithm((Rosenbrock23(), Tsit5()), _ -> 1), out of place) threw on the first step and now returnsSuccesswith the same final state asRosenbrock23()alone. The new test incomposite_algorithm_test.jlfails on master.Fixes #4951
Risk assessment
calc_tderivativeis shared by every out-of-place Rosenbrock-type step, including the default solver's stiff branches).algnow comes fromunwrap_alg(integrator, true), as the in-placecalc_tderivative!already does. For a non-composite algorithm this returns the samealg, so standalone solves are unchanged; inside aCompositeAlgorithmthe autodiff setting now comes from the active member instead of the last one. In-place solves are not touched.CompositeAlgorithm((Rosenbrock23(), Tsit5()), _ -> 1), out of place) threw on the first step on master and now returnsSuccesswith the same final state asRosenbrock23()alone. The new test incomposite_algorithm_test.jlfails on master. The remaining red checks (SciMLSensitivity Core2, ProbNumDiffEq, AD lts, DiffEqDevTools downgrade, both GPU lanes, NonlinearSolve Core Julia 1) also fail on master.AI Disclosure: Claude assisted with this change.