Repository navigation
Keep what the interpolant reads when stripping a solution - #4921
singhharsh1708 wants to merge 10 commits into
Conversation
Independent review (Codex CLI 0.163.0, model gpt-6.1-sol, reasoning effort high): CHANGES, risk medium-high (MH1). Reviewed head: Full reviewVERDICT: CHANGES Riskmedium-high (MH1: Changes post-solve interpolation behavior across OrdinaryDiffEq’s default, Rosenbrock, BDF, and composite paths.) Risk assessment
Blocking findings
Non-blocking findingsNone. What I ranAbsolute executable, worktree, and scratch locations are parameterized below to comply with the path restriction.
What I did not verify
AUTHOR_GRADE: {"task":"bugfix","score":3,"difficulty":3,"rounds":1,"author_harness":"unknown","author_model":"unknown","note":"The targeted regression fails on base and passes on head, but AdaptiveRadau stripping retains user functions through linear-solver parameters and the committed numerical tests lack an independent accuracy reference. Generic reconstruction across heterogeneous solver caches is a moderate integration task."} 🤖 Posted by an AI agent · harness: Claude Code · model: claude-opus-5-5 (coordinating gpt-6.1-sol reviewers) |
06f9e66 to
154ed77
Compare
154ed77 to
fb98277
Compare
PR: #4921 Reviewed head: fb98277 Risk assessment
Review reportVERDICT: CHANGES Riskmedium-low (ML8: changes retained solver-cache state and composite traversal on the optional solution-stripping path; execution evidence is missing). Blocking findings
Non-blocking findings
What I ran
What I did not verifyNo affected test suite or targeted probe executed. Interpolation equivalence, independent analytic accuracy, function/type erasure, serialization round trips, and failing-before/passing-after behavior remain unverified. The supplied Core4 downstream failure was not independently investigated. QA, docs, and other supported Julia versions were not run.
AUTHOR_GRADE: {"task": "bugfix", "score": 3, "difficulty": 3, "rounds": 1, "author_harness": "unknown", "author_model": "unknown", "note": "Focused cache-stripping change adds interpolation and retention assertions without weakening existing tests. Runtime correctness and serialization independence remain unverified because the reviewer could not obtain capacity within one hour; no code defect was confirmed."} Head link: fb98277 🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol |
|
Core4 has been green on master since 11-04 and the run here predates that; I merged master to re-run. On serialization: stripped Tsit5, default, Rodas5P and FBDF solutions deserialize and interpolate in a fresh process that defines neither the RHS nor p. |
@singhharsh1708 The PR body has no risk assessment. Please add this block, filled in for this change, so the review at Criteria: risk policy. The remaining red checks on this head also fail on the base branch (AD, GPU, Core, ProbNumDiffEq and the DiffEqDevTools downgrade job), so they do not block the review. 🤖 Posted by an AI agent — harness: Claude Code 2.1.325 · model: claude-sonnet-5-5 |
PR: #4921 Reviewed head: 9800dba Risk assessment
Review reportVERDICT: CHANGES Riskmedium-low (ML8: rewrites solver-cache stripping and retained cache/type state across generic, DefaultCache, and CompositeCache paths on the opt-in SciMLBase.strip_interpolation / SciMLBase.strip_solution path; regular solve and unstripped interpolation paths are untouched) Blocking findings
Non-blocking findings
What I ran
What I did not verify
AUTHOR_GRADE: {"task": "bugfix", "score": 3, "difficulty": 3, "rounds": 6, "author_harness": "unknown", "author_model": "unknown", "note": "Compact cache-stripping redesign fixes CompositeCache, DefaultCache, and non-nullable solver cache interpolation (69/69 in ode_strip_test.jl, 199/199 in OrdinaryDiffEqCore QA/interpolation, Runic and typos clean), but no code changes landed after round 1 beyond upstream merges and fresh-process deserialization confirms that DefaultCache and AdaptiveRadauCache still retain user function types in type parameters (regressing DefaultCache deserialization relative to origin/master) while the new holds helper masks the leak by skipping Type."} Head link: 9800dba 🤖 Posted by an AI agent — harness: Antigravity CLI 1.5.10 · model: gemini-4-carbon-high |
|
Fixed in 2fcc7a7 and b2e5556: sub-caches that were never created and per-stage arrays like linsolve2 now strip to Nothing types, ExplicitRK keeps B_interp, and a new subprocess test deserializes eight cases without the RHS or p defined. This corrects my 11-15 reply: it held for Tsit5, Rodas5P and FBDF, but with lazy = Val(false), in-place AdaptiveRadau and the in-place implicit extrapolation methods, deserializing failed before. |
strip_cachenow keeps what the interpolant reads instead of setting every field tonothing: the tableau (tab,tabs, ExplicitRK'sB_interp), number fields (d,interp_order,num_stages, BS5's and OwrenZen's coefficients), and fields whose declared type cannot holdnothing, together with the fields that share a type parameter with them.DefaultCacheandCompositeCachestrip each sub-cache and keepcurrent.Before, rebuilding a cache with
nothingeverywhere threw for every cache with a concretely typed field (#4926: FBDF, QNDF, NordsieckBDF, RadauIIA3/5/9, AdaptiveRadau, everyRosenbrockCachemethod, the AB/ABM caches,CompositeCachein #4907), left Rosenbrock23/32, BS5, OwrenZen3/4/5 andVern6/Vern8(lazy = false)throwing on interpolation after a successful strip, and replaced a default-solver cache by an empty one, sostripped(t)silently used the Hermite fallback on Tsit5's stages (#4927).Function and solver-state fields are still dropped (
f,uf,tf,jac_config,grad_config,linsolve,nlsolver,alg, limiters) where their declared type allowsnothing, and the existing assertions on them pass. Arrays of non-numbers whose element type is a parameter that admitsnothing(per-stage linear solvers and stage buffers in AdaptiveRadau, Rosenbrock, FBDF/QNDF and the extrapolation caches) become emptyArray{Nothing}, so no user function type stays in the stripped cache's type. On a 200-state problem with a function inp, the stripped in-place AdaptiveRadau, ImplicitEulerExtrapolation, Rodas5P and FBDF caches are 3.4 kB, 0.9 kB, 2.6 kB and 152 bytes, against 3.8 MB, 1.2 MB, 1.0 MB and 1.1 MB unstripped. All four threw on strip before.I stripped every algorithm exported by the sublibraries in the test environment, plus
DefaultODEAlgorithmand two composites, on Lorenz, in place and out of place (524 cases that solve), and comparedstripped(t)withsol(t)at 101 points. Master: 178 match, 269 throw on strip, 73 throw on interpolation and 4 differ (the default solver by 2.4). This branch: 362 match and none get worse. Still failing: 133 cases, mostly low-storage and SSP methods, that store nok, so their interpolation callsfthrough the generic_ode_addsteps!(63 of them failed that way on master, the other 70 threw on strip), 17 constant caches with no default constructor (same as master), and 12 lazyVern6-Vern9,BS5andRKV76IIadefaults, whichstrip_solutionrejects by design. In-place Tsit5 differs from the unstripped solution by 4.3e-14.The first new testset strips eleven algorithms (including two composites,
DefaultODEAlgorithm(lazy = Val(false))andExplicitRK), in place and out of place, and requiresstripped(t) ≈ sol(t); it fails on master. A second testset deserializes stripped solutions in a separate Julia process.Fixes #4907, fixes #4926, fixes #4927
Risk assessment
strip_cache, and sostrip_solution, keeps for every ODE cache type).DefaultCacheandCompositeCache, and their interpolation. Unstripped solves are untouched; function and solver-state fields are still dropped where their type allowsnothing. Stripped caches keep fields that share a type parameter with typed fields (Rodas5P 2.6 kB and FBDF 152 bytes against 1.0 MB and 1.1 MB unstripped on a 200-state problem with a function inp).strip_alg = trueand deserializes in a separate Julia process that defines neither the RHS nor the function inp. It coversDefaultODEAlgorithm(lazy = Val(false))(in-placeFullSpecializeand out-of-place),AdaptiveRadau,ImplicitEulerExtrapolation,RadauIIA5,Rodas5P,FBDFandTsit5, and checks that each interpolates like the unstripped solution. Of 524 algorithm and in-place/out-of-place cases on Lorenz, master matchessol(t)in 178, throws on strip in 269, throws on interpolation in 73 and differs in 4 (the default solver by 2.4); this branch matches in 362 and none get worse.AI Disclosure: Claude assisted with this change.