The default energy inversion does not report iteration exhaustion
Maintainers usually reply within 1 day
@zhichen3 is already working on this.
Since Sep 7, 2026.
Assessment
This issue has not been assessed yet.
Description
Suggested priority: Medium
Reviewed commit: 3ac0bda4f00da3eed0446beadfc1cd5c51b99a40
Affected code: nse_solver.H:449–452, nse_solver.H:507–516, nse_solver.H:539–561.
nse_T_from_e() stops after 100 iterations but returns void without checking converged after the loop. In the default nse.solve_nse_e_mode = 1, its caller proceeds to compute the NSE composition at the last temperature and returns it. It copies the requested energy into the result without verifying that the EOS energy at the returned temperature and composition matches it.
Impact: If the outer temperature solve exhausts its iterations while the inner composition solves succeed, the interface returns an unconverged thermodynamic state without an error indication.
Validation limit: Confirmed by control-flow inspection; the standard input converged, and no physical input reaching this exhaustion path was reproduced.
Suggested fix: Propagate a convergence status or raise the established solver error on exhaustion. Validate the final energy residual and add an exhaustion-path regression test.
Validation and regression coverage
This finding is based on inspection of the iteration limit, loop exit, and caller behavior at the reviewed commit. No executable reproduction of iteration exhaustion is claimed.
The existing unit_test/nse_net_cell test was built with ccache disabled and run with inputs_ase. It completed successfully and recovered the requested perturbed energy in both energy modes; it does not exercise this failure path. See captured cell-test output.
Validation used GNU C++20, double precision, CPU, no MPI/OpenMP, simplified SDC, the ase network, Helmholtz EOS, and Chabrier screening. AMReX revision: 3c3bbaa34cd3.
A regression test should force the outer temperature iteration to exhaust its budget while allowing the inner composition solves to succeed, then verify that the caller receives failure instead of a thermodynamic state reported as solved.
- Dominant language
- C++
- Stars
- 44
- Forks
- 46
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 9
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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.
More from AMReX-Astro/Microphysics
-
bug GPU
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
AMReX-Astro/Microphysics#2115 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
AMReX-Astro/Microphysics#2104 · 3 comments ·
Maintainers usually reply within 1 day
-
ai-code-audit screening
Difficulty 4/5 3-5 days Newbie friendliness 55/100
AMReX-Astro/Microphysics#2097 · 1 comment ·
Maintainers usually reply within 1 day
-
ai-code-audit screening
Difficulty 4/5 3-5 days Newbie friendliness 72/100
AMReX-Astro/Microphysics#2096 ·
Maintainers usually reply within 1 day
-
ai-code-audit screening
Difficulty 4/5 3-5 days Newbie friendliness 66/100
AMReX-Astro/Microphysics#2095 · 1 comment ·
Maintainers usually reply within 1 day
All issues in AMReX-Astro/Microphysics
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ROCm/rocm-libraries#14027 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Qiskit/qiskit-aer#2487 ·
Maintainers usually reply within 1 day
-
GUI
Difficulty 1/5 Under an hour Newbie friendliness 78/100
qbittorrent/qBittorrent#25104 ·
Maintainers usually reply within 2 days
-
P2: A timed rotation maneuver does nothing on a ship that had an earlier timed lateral maneuverOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
scp-fs2open/fs2open.github.com#7914 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 2 days