Repository navigation
Give RKV76IIa's k8 and k10 their own storage - #4358
Merged
ChrisRackauckas merged 3 commits intoAug 26, 2026
Merged
Conversation
singhharsh1708
force-pushed
the
fix-rkv76iia-aliasing
branch
from
August 24, 2026 07:43
7777b37 to
093ce5b
Compare
Member
|
@singhharsh1708 no retroactive comments. |
Member
Author
I think it broke one of my rules. I need to fix that. Won’t happen again. |
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.
RKV76IIareturns garbage in place while the out-of-place path is correct, and itreports
retcode = Successwhile doing it.On
u'' = -sin(u),u0 = [2.0, 0.0],tspan = (0.0, 20.0), fixed steps, against atight
Vern9reference:On the linear
u' = [u2, -u1]over(0, 1)the in-place answers come out around1e9-1e12where the exact value is0.54, withretcode = Successat everystep size.
Cause
lib/OrdinaryDiffEqVerner/src/verner_caches.jl, theRKV76IIain-place cache:Vern7Cachehask3 = k2and allocates the rest. The two extra aliases were addedhere, and RKV76IIa's tableau does not permit them:
f(k8, ...)overwritesk3,which stages 9 and 10 then use with
a93 = -459.7anda103 = -493.2, andk10overwrites
k4whileb4 != 0. Vern7 gets away withk3 = k2becausea_i2 == 0for
i >= 4andb2 == 0; that argument does not extend to the other two.Fix
Give
k8andk10their own storage.k3 = k2is kept -- it is valid here for thesame reason it is valid in
Vern7Cache.After the change the two paths agree to
4.3e-12acrossdt = 20/2^5 ... 20/2^9,and both measure the expected order.
Testing
The
RKV76IIablock inlib/OrdinaryDiffEqVerner/test/ode_verner_tests.jlonly rancheck_convergence(dts, prob_oop, ...).prob_iipis defined at the top of thatfile and was never used, so the in-place path of this method had no coverage at all
-- every other algorithm in the file exercises in-place through
probbig.Added the matching
check_convergence(dts, prob_iip, RKV76IIa(), 7)and an explicitin-place vs out-of-place agreement assertion. Both fail on master and pass here.
Bumps
OrdinaryDiffEqVernerone patch from master.AI Disclosure
Claude assisted with this change.