Skip to content

Fix quadrature initialization in IDAS#888

Draft
Steven-Roberts wants to merge 3 commits intodevelopfrom
bugfix/quad-init
Draft

Fix quadrature initialization in IDAS#888
Steven-Roberts wants to merge 3 commits intodevelopfrom
bugfix/quad-init

Conversation

@Steven-Roberts
Copy link
Collaborator

@Steven-Roberts Steven-Roberts commented Mar 24, 2026

When IDAS takes its first time step, it calls the quadrature RHS' to fill in ida_phiQ[1] and ida_phiQS[1] vectors. When IDAS is reinitialized, it does not do this due to some logic errors. This caused a couple issues

  • On the first step after reinitialization, the quadrature predictor is incorrect, so the quadrature error estimate tended to be a significant overestimate. Since the first time step is quite conservative, this usually didn't matter.
  • When recomputing forward to fill in missing data between checkpoints, IDAS could produce very slightly different results than the original forward pass. This can cause a different number of time steps and eventually a segfault as found in a GridKit example (CC @pelesh)

@pelesh
Copy link
Contributor

pelesh commented Mar 24, 2026

Thank you, @Steven-Roberts, for tracing this issue down and identifying the root cause. This has been showing up in GridKit tests nondeterministically. See here, for example. Changes in simulation configuration would make these issues come and go.

Copy link
Contributor

@pelesh pelesh left a comment

Choose a reason for hiding this comment

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

I ran preliminary tests and this fix seems to address the issue we were seeing in GridKit. I need to run more tests to confirm.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants