he-burn approximate rates need denominator guard
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Search the *_approx helpers in networks/he-burn/ase/reaclib_rates.H and networks/he-burn/cno-he-burn-33a/reaclib_rates.H for denominator calculations using r_pg + r_pa. Review the rate and derivative expressions together, then add the proposed low-temperature/high-screening stress coverage. Done means no inf/nan in rate or drate_dT and no regressions in standard burn trajectories.
Written by the indexing model from the issue text.
Description
Approximate effective-rate helpers divide by (r_pg + r_pa) without denominator floor
Summary
Multiple approximate-rate helper functions in he-burn reaclib_rates.H files compute:
dd = 1.0_rt / (r_pg + r_pa)
with no protection against near-zero or zero denominator. Under extreme conditions (very small screened rates), this can produce inf/nan and destabilize RHS/Jacobian evaluation.
Severity
Medium
Affected Code
networks/he-burn/*/reaclib_rates.H- families of functions named
*_approxusingdd = 1.0_rt / (r_pg + r_pa) - examples:
networks/he-burn/ase/reaclib_rates.H(e.g. around lines 1934, 1953, ...)networks/he-burn/cno-he-burn-33a/reaclib_rates.H(e.g. around lines 3824, 3843, ...)
- families of functions named
Why This Is a Bug
Even if uncommon, exact/underflow-zero denominator can occur in screened-rate arithmetic, and current code has no numerical guard. A single inf/nan can contaminate burn state and Jacobian entries.
Proposed Patch
Use a denominator floor (and derivative-consistent handling) in all affected helpers:
- amrex::Real dd = 1.0_rt / (r_pg + r_pa);
+ constexpr amrex::Real denom_floor = 1.0e-300_rt;
+ const amrex::Real denom = amrex::max(r_pg + r_pa, denom_floor);
+ amrex::Real dd = 1.0_rt / denom;
For derivative expressions containing dd * dd, reuse denom consistently.
Validation
- Add a stress test at low-temperature/high-screening conditions where both channel rates become tiny.
- Verify no inf/nan in
rateordrate_dTand no regressions in standard burn trajectories.
- Dominant language
- C++
- Stars
- 44
- Forks
- 46
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 10
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
-
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
-
ai-code-audit nse
Difficulty 3/5 1-2 days Newbie friendliness 68/100
AMReX-Astro/Microphysics#2075 ·
Maintainers usually reply within 1 day
All issues in AMReX-Astro/Microphysics
Similar issues
-
[Docs] CONTRIBUTING still says FreeType 2.14.3 and TabLabel.h says ImGui 1.92.9b after the bumpsPossibly taken @mgradwohl claimed this today. Openagent:WSL documentation LOW
Difficulty 1/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
cudf-polars feature request
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 2 days
-
(S1 - Need confirmation)
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CleverRaven/Cataclysm-DDA#89212 ·
Maintainers usually reply within 1 day
-
Status: Needs confirmation Status: Needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
a byte order mark at the start of a migration makes dbmate miss the up blockPossibly taken @Dem1241 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 2 days