Skip to content

Give the Newton-Krylov round-off test explicit tolerances - #4337

Closed
singhharsh1708 wants to merge 1 commit into
SciML:masterfrom
singhharsh1708:krylov-roundoff-test-tolerances
Closed

singhharsh1708 wants to merge 1 commit into
SciML:masterfrom
singhharsh1708:krylov-roundoff-test-tolerances

Conversation

@singhharsh1708

Copy link
Copy Markdown
Member

Fixes #4293. Test only, no library change, per @ChrisRackauckas on #4301.

newton_krylov_roundoff.jl called solve with no tolerances. The linear solve inherits
reltol, so the Krylov solve ran at the default 1e-3 and returned a Newton direction accurate
only to 1e-3, which cannot drive the stage to 1e-3. dt collapses and both methods return
Unstable.

The part worth checking is that the test had stopped discriminating. At the default tolerance it
fails identically whether the warm start is the guarded one that #4040 shipped or the
unpredictive reuse that #4034 reported, so it was not testing anything:

warm start default tolerance reltol = abstol = 1e-12
guarded Hegedüs, current default Unstable Success, drift 6.0e-07 and 4.6e-07
WarmStart.Previous, regression proxy Unstable Unstable

At 1e-12 the good configuration passes and the bad one still fails, so the gate protects what it
was written to protect.

On picking 1e-12, measured on this DAE with maxiters = 10_000 left as it was:

tolerance Hairer4 Hairer42
default 1e-3 Unstable Unstable
1e-7 drift 2.0e-04 drift 5.1e-05
1e-8 drift 3.1e-05 drift 3.4e-05
1e-9 drift 1.1e-06 drift 2.7e-05
1e-10, 1e-11 MaxIters MaxIters
1e-12 drift 6.0e-07, 1211 steps drift 4.6e-07, 1326 steps

1e-7 through 1e-9 complete but sit at or above the 1e-5 gate, so they would not be a working
test. 1e-12 clears the gate by a factor of 16 and uses 1211 and 1326 of the 10,000 step budget.
The non-monotonic MaxIters at 1e-10 and 1e-11 is the chaotic step sequence the file's comment
already describes.

The comment block is updated to say why the tolerances are explicit and to quote the drift
actually measured, since the old text described a 1e-15 to 1e-7 band that no longer matches.

Verified by running the file against unmodified master at 13da423: 3/3 and 3/3, exit 0.

AI Disclosure

Claude assisted with this work.

@singhharsh1708

Copy link
Copy Markdown
Member Author

Duplicate of #4335, which I missed before opening this. #4335's tolerances are also better: drift 2.9e-09 and 1.5e-09 against the 1e-5 gate, where mine sat at 6.0e-07.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hairer4/Hairer42 with KrylovJL_GMRES fail on an index-1 DAE (Regression_I)

1 participant