Skip to content

Unify error estimation under dispatched calculate_error_estimate!#3650

Merged
ChrisRackauckas merged 10 commits into
SciML:masterfrom
singhharsh1708:sdirk-unify-impliciteuler-trapezoid
May 19, 2026
Merged

Unify error estimation under dispatched calculate_error_estimate!#3650
ChrisRackauckas merged 10 commits into
SciML:masterfrom
singhharsh1708:sdirk-unify-impliciteuler-trapezoid

Conversation

@singhharsh1708
Copy link
Copy Markdown
Contributor

Generic IMEX/SDIRK uses btilde-based dispatch on ESDIRKIMEXCache; IE and Trapezoid get specialized dispatches doing divided-difference estimates.

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

Add any other context about the problem here.

Generic IMEX/SDIRK uses btilde-based dispatch on ESDIRKIMEXCache; IE and
Trapezoid get specialized dispatches doing divided-difference estimates.
@ChrisRackauckas
Copy link
Copy Markdown
Member

This is step 1, but then put it into the tableau form?

@singhharsh1708
Copy link
Copy Markdown
Contributor Author

singhharsh1708 commented May 18, 2026

sorry i misinterpreted message i am still doing it

Your Name added 8 commits May 18, 2026 21:10
ESDIRKIMEXTableau gains a 4th type parameter for error-estimate kind
(:standard / :ie_dd2 / :trap_dd3). calculate_error_estimate! dispatches
on it. ESDIRKIMEXCache absorbs IE/Trap-specific fields as optional.
The specialized IE/Trap cache types and perform_step methods are removed.
IE itself routes through ESDIRKIMEXCache via _PureSDIRKAlg alg_cache;
the legacy struct + perform_step methods are retained because BDF's
ABDF2 constructs and dispatches on ImplicitEulerCache directly.
alg_extrapolates algorithms (IE/Trap/SDIRK22) need integrator.uprev2
to track u's size. Holding it as an aliased cache field puts it in
full_cache so resize!() propagates.
@singhharsh1708
Copy link
Copy Markdown
Contributor Author

All 6 cases now match master bit-exactly:

Problem   Algorithm        naccept   nreject   nf       u_end_norm
---------------------------------------------------------------------------
VDP       ImplicitEuler    55441     27698     329937   3.629402868570291
VDP       Trapezoid         2030       138      12046   3.6283223033333662
Pollu     ImplicitEuler     1966       972      11197   0.13279014860586646
Pollu     Trapezoid          178         0       1307   0.1327954074032977
Rober     ImplicitEuler    14700      7341     114043   0.9999999436317444
Rober     Trapezoid         1400       179      10696   4.120956869066948e15

SDIRK convergence + DAE suites also pass cleanly (82 + 8, 0 failures). The uprev2 fix only adds resize tracking and does not affect numerics; behavior is preserved.

Fixes OOP IE error estimate which reads integrator.u.
@singhharsh1708
Copy link
Copy Markdown
Contributor Author

@ChrisRackauckas

@ChrisRackauckas ChrisRackauckas merged commit d6b0909 into SciML:master May 19, 2026
93 of 100 checks passed
@ChrisRackauckas
Copy link
Copy Markdown
Member

What was the next things you were planning on going for?

@singhharsh1708
Copy link
Copy Markdown
Contributor Author

Next up is migrating CFNLIRK3 — the one remaining SDIRK algorithm with its own cache + perform_step (everything else now routes through ESDIRKIMEXCache + the generic _perform_step_iip!/_oop!). I've already done the work on a separate branch — built CFNLIRK3ESDIRKIMEXTableau, added it to _PureSDIRKAlg, deleted the legacy CFNLIRK3Cache/CFNLIRK3ConstantCache + tableau + perform_step methods. Step counts on the split exponential test match master bit-exactly (naccept=64, nf=577, nf2=192 for both IIP and OOP). PR coming shortly.

@singhharsh1708 singhharsh1708 deleted the sdirk-unify-impliciteuler-trapezoid branch May 19, 2026 11:15
@singhharsh1708
Copy link
Copy Markdown
Contributor Author

After that the only non-generic thing left in the SDIRK package would be ImplicitEulerCache/ImplicitEulerConstantCache, which we keep as a compat shim because OrdinaryDiffEqBDF's ABDF2 imports and constructs them directly. Migrating that would need a coordinated change in BDF — happy to do it as a follow-up if you want.

@ChrisRackauckas
Copy link
Copy Markdown
Member

Do an update to ABDF2 so it uses the updated ImplicitEuler stuff. Also need to make sure that is well-tested to keep the same performance etc. since first order is the hardest to not add overhead.

Then make an issue for those step predictor things I mentioned. That's a good set of improvements to do to SDIRK once it's all in tableau form.

But on the other side, start looking at #2757 #3564.

Improving nonlinearsolvealg would be the most impactful direction.

@singhharsh1708
Copy link
Copy Markdown
Contributor Author

Sounds good will start with ABDF2.

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