Fix the solution bookkeeping for save_everystep=false (#428) - #429
Open
nathanaelbosch wants to merge 1 commit into
Open
Fix the solution bookkeeping for save_everystep=false (#428)#429nathanaelbosch wants to merge 1 commit into
save_everystep=false (#428)#429nathanaelbosch wants to merge 1 commit into
Conversation
With `save_everystep=false`, `savevalues!` skips all of its ProbNumDiffEq-specific saving, so `sol.x_filt` was left with only the initial state and `sol.diffusions` was left empty. Two things broke as a result: - `calibrate_solution!` zips `sol.pu` (2 entries) against `sol.x_filt` (1 entry), so with a calibrated static diffusion the final `sol.pu[end].Σ` never got rescaled by the quasi-MLE sigma^2, and sigma^2 was not recoverable from the solution either. - Interpolating such a solution threw a `BoundsError`, since the interpolation indexes into the empty `sol.diffusions`. This is what the `WorkPrecisionSet` test with a dense `TestSolution` was marked broken for. `pn_solution_endpoint_match_cur_integrator!` now always saves the endpoint into `sol.x_filt`, and saves the last step's diffusion when nothing was saved during the solve. The endpoint used `integ.saveiter_dense` for `x_filt`, which stays at 1 whenever `dense=false`; it now uses `integ.saveiter` like `savevalues!` does. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #429 +/- ##
==========================================
+ Coverage 91.30% 91.31% +0.01%
==========================================
Files 44 44
Lines 2230 2235 +5
==========================================
+ Hits 2036 2041 +5
Misses 194 194 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
save_everystep=false,savevalues!skips all of its ProbNumDiffEq-specific saving, sosol.x_filtwas left with only the initial state andsol.diffusionswas left empty. Two things broke as a result:calibrate_solution!zipssol.pu(2 entries) againstsol.x_filt(1 entry), so with a calibrated static diffusion the finalsol.pu[end].Σnever got rescaled by the quasi-MLE sigma^2, and sigma^2 was not recoverable from the solution either.BoundsError, since the interpolation indexes into the emptysol.diffusions. This is what theWorkPrecisionSettest with a denseTestSolutionwas marked broken for.pn_solution_endpoint_match_cur_integrator!now always saves the endpoint intosol.x_filt, and saves the last step's diffusion when nothing was saved during the solve. The endpoint usedinteg.saveiter_denseforx_filt, which stays at 1 wheneverdense=false; it now usesinteg.saveiterlikesavevalues!does.