AMReX-Astro / AMReX-Astro/Castro
Newton subdivision silently changes the equation being solved
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 340
- Forks
- 105
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 8
Description
Locations: Source/sdc/sdc_newton_solve.H:238-307 and
Source/sdc/Castro_sdc_util.H:181-199.
Finding
After a failed full-interval solve, sdc_newton_subdivide successively solves
backward-Euler equations on intervals h/nsub, advancing U_begin after each
success and reusing C. Successful substeps solve a sequence of different
nonlinear equations, not the original equation U - h R(U) = U_old + h C.
The driver accepts this endpoint as a successful solution of the original
problem. The SDC caller then evaluates its endpoint reaction rate and
reconstructs a full-interval update. That can discard the stability and
admissibility of the substepped solution. The reported Newton error describes
only the last substep, not the original residual.
Reproducible numerical evidence
For R(u)=-u, u_old=1, h=1, and C=0, the required root is 1/2. Two exact
half-step backward-Euler solves return 4/9. Its full-interval residual is -1/9.
The caller's reconstruction gives 5/9. Thus even perfect substep solves cannot
satisfy the caller's contract.
This checks the fallback's algebra once subdivision is entered; it does not
claim that Newton fails on this linear example. A nonlinear stiff case is needed
to exercise the automatic failure trigger.
Proposed fix
Use subdivision to construct a better initial guess, then solve and verify the
original full-interval equation. If that still fails, return failure or abort
with the full residual. A damped Newton or line search can improve robustness
without changing the equation. True SDC currently disables timestep retry, so do
not assume a caller can silently retry unless that support is implemented.
Validation after fixing
Force the fallback in a dedicated nonlinear-solver test. Check the returned
endpoint against the original residual at h, not the residual at h/nsub. Test
positivity, conservation, and temporal order on stiff reacting_convergence runs
using solver 1 and solver 3.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in Source/sdc/sdc_newton_solve.H:238-307 and Source/sdc/Castro_sdc_util.H:181-199 to trace subdivision, endpoint reconstruction, and residual reporting. Add a dedicated nonlinear-solver test that forces the fallback and verifies the original full-interval residual, then run stiff reacting_convergence cases with solver 1 and solver 3 to check positivity, conservation, and temporal order.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend, testing-qa
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100