Skip to content

scaffold unified LowStorageRKTableau + generic perform_step (2N form)#3683

Open
singhharsh1708 wants to merge 1 commit into
SciML:masterfrom
singhharsh1708:lowstorage-generic-perform-step
Open

scaffold unified LowStorageRKTableau + generic perform_step (2N form)#3683
singhharsh1708 wants to merge 1 commit into
SciML:masterfrom
singhharsh1708:lowstorage-generic-perform-step

Conversation

@singhharsh1708

@singhharsh1708 singhharsh1708 commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Introduces LowStorageRKTableau{form,N,T,T2} <: OrdinaryDiffEqConstantCache in a new low_storage_tableaus.jl — a unified tableau struct parameterised on family tag (:two_n, :two_c, …).
  • Introduces generic_low_storage_perform_step.jl with plain-dispatch _perform_step_oop! / _perform_step_iip! methods (no @generated, following the pattern from Inline ESDIRK/IMEX perform_step stages; drop @generated and S type-param #3676).
  • Converts the 2N family (ORK256, CarpenterKennedy2N54, SHLDDRK64, DGLDDRK73_C, DGLDDRK84_C, DGLDDRK84_F, NDBLSRK124, NDBLSRK134, NDBLSRK144) to use LowStorageRKTableau{:two_n} in place of the deleted LowStorageRK2NConstantCache.
  • Thin wrappers in low_storage_rk_perform_step.jl delegate to the generic implementations.

This is the first in a series of stacked PRs (#3683#3684#3685#3686#3687#3688) that convert all LowStorageRK families family by family.

Test plan

  • OOP and IIP paths (williamson on/off) validated against master — step counts and solution values identical.
  • CI passes.

Comment thread lib/OrdinaryDiffEqLowStorageRK/src/generic_low_storage_perform_step.jl Outdated
@ChrisRackauckas

Copy link
Copy Markdown
Member

family by family would probably be easier, yes.

@singhharsh1708 singhharsh1708 force-pushed the lowstorage-generic-perform-step branch 2 times, most recently from 087bdb7 to eedc675 Compare May 27, 2026 05:38
@ChrisRackauckas

ChrisRackauckas commented May 27, 2026

Copy link
Copy Markdown
Member

Steps don't matter for non-adaptive methods, are the solutions identical?

Comment thread lib/OrdinaryDiffEqLowStorageRK/src/low_storage_tableaus.jl Outdated
@singhharsh1708

singhharsh1708 commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

@ChrisRackauckas Yes, solutions are identical — validated by running each algorithm on a Lorenz problem and comparing the final state vector between the branch and master.

Comment thread lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl Outdated
c5 = convert(T2, 0.8)
c2end = (c2, c3, c4, c5)

return LowStorageRK2NConstantCache(A2end, B1, B2end, c2end)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these all already hit the same code, so it's not a substantive change. Do any other caches hit the same form?

@singhharsh1708

Copy link
Copy Markdown
Contributor Author

Updated: helper indirection removed — perform_step! bodies are now directly in generic_low_storage_perform_step.jl with no intermediate _perform_step_oop!/_perform_step_iip! layer.

Re 'do any other caches hit the same form': yes — RK46NLConstantCache and SHLDDRK52ConstantCache both use the same 2N update formula (tmp = αᵢ * tmp + dt * f(u,...); u += βᵢ * tmp) but store coefficients as individual scalar fields rather than tuples. They could be folded into LowStorageRKTableau{TwoN} by converting those fields to (A2end, B1, B2end, c2end) tuples — that's planned for PR #6. SHLDDRK_2N has a different step structure (odd/even stage alternation) so it stays separate.

@singhharsh1708

Copy link
Copy Markdown
Contributor Author

@ChrisRackauckas i think once its merged we can do that then

@ChrisRackauckas

Copy link
Copy Markdown
Member

see the current comment.

@singhharsh1708 singhharsh1708 force-pushed the lowstorage-generic-perform-step branch from 19f1088 to 44cb756 Compare May 27, 2026 21:31
@singhharsh1708 singhharsh1708 force-pushed the lowstorage-generic-perform-step branch from 44cb756 to fd240f0 Compare May 27, 2026 21:48
@singhharsh1708

singhharsh1708 commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

@ChrisRackauckas ohh i see In previously merged #3590, we unified the 9 low-storage 2N methods under a shared LowStorageRK2NConstantCache, reducing alg_cache methods from 82 → 18
Would it make sense to fold RK46NL into the shared LowStorageRK2NConstantCache path as well? It follows the same 2N formulation; only SHLDDRK52 still seems special because of kshortsize = 2.

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.

2 participants