Repository navigation
Fix floating-point traps found by the checked CPU build - #2516
Open
sbryngelson wants to merge 2 commits into
Open
sbryngelson wants to merge 2 commits into
sbryngelson wants to merge 2 commits into
Conversation
|
Claude Code Review Head SHA: 646cb70 No review was produced. Claude ran but wrote no review (Claude step: failure). Run and transcript: https://github.com/MFlowCode/MFC/actions/runs/45871204398 |
Member
Author
|
Closing for now; the remaining traps from #2510 will go in the same PR. |
sbryngelson
force-pushed
the
fix-runtime-traps
branch
2 times, most recently
from
November 26, 2026 18:03
86bacd4 to
9c6a927
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2516 +/- ##
=======================================
Coverage 66.59% 66.60%
=======================================
Files 112 112
Lines 31558 31572 +14
Branches 4856 4858 +2
=======================================
+ Hits 21015 21027 +12
Misses 6561 6561
- Partials 3982 3984 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
sbryngelson
added a commit
that referenced
this pull request
Nov 26, 2026
…submitting a copy (#2523) A timed-out sbatch can still queue the job. retry_sbatch then submitted it again, and on Phoenix both copies of shard 1 ran in the same checkout and deleted each other's test inputs (75 failures in #2516's gpu-acc run). Before retrying, look for a pending or running job of ours with the same name, from this directory, submitted since the first attempt.
- alpha_K normalisation touches only the fluids (it wrote past a 2-fluid caller's array with AMD flang). - Adaptive-dt Euler bubbles convert the interior only before the first RHS. - Lagrange drag computes the fluid temperature only when Sutherland needs it. - Acceleration probe time levels start zeroed. - Viscous face states start zeroed: the gradient's outer ghost cells read faces the reconstruction never writes. - s_ibm_correct_state: drop the hypoelastic mixture call that read an unset shear modulus for an unused result. - mpp_lim bubbles: skip the renormalisation in ghost cells whose fractions sum to zero before the first fill. - AMD flang checked CPU build at -O0; the weekly job builds once and runs two shards.
… traps) At a face whose two cells are both inside a body, the reconstructed states are replaced by the cells' own, in one loop in m_rhs before the Riemann solver. Only body cells see such a face and s_zero_rhs_at_body discards their RHS, but WENO across a two-cell sliver gave a negative density there (MFlowCode#2510, 39A3B369, B317404C, E5B66084).
sbryngelson
force-pushed
the
fix-runtime-traps
branch
from
November 27, 2026 00:55
9c6a927 to
8638a41
Compare
Lines of Code
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #2510. The checked CPU build (#2447) stops some of the suite's tests on a floating-point exception. This fixes the ones that are MFC's, and builds the AMD flang check at
-O0so the optimiser's speculated divisions stop counting as traps.Source fixes
None of these changes a golden file; most remove NaN or Inf computed in cells or faces whose results are never used.
m_variables_conversion.fpp:alpha_K = alpha_K/sumnormalised the whole dummy, which AMD flang without case optimisation declares with 3 elements, more than a 2-fluid caller passes. Nowalpha_K(1:num_fluids). A real out-of-bounds write; 52 tests trapped here.m_time_steppers.fpp:m_particles_EL.fpp: the Lagrange drag computes the fluid temperature (dividing bycv) only when a Sutherland constant needs it; the validator already requirescv > 0then.m_rhs.fpp:weno_Re_flux, the gradient's two outermost ghost cells are computed from faces the reconstruction never writes (±1.5e202 in2A6136EF), and the WENO pass over the gradient overflowed on them;mpp_limwith bubbles skips the volume-fraction renormalisation in ghost cells whose fractions sum to zero (unfilled before the first boundary fill).m_ibm.fpp(s_ibm_correct_state): drop the hypoelastic mixture call that read an unset shear-modulus array for aG_Knothing used; the same pattern Fix the floating-point traps the debug build hits in 8 AMR tests #2438 removed froms_compute_cell_state.m_rhs.fpp(s_body_faces_take_cell_states): before the Riemann solve, a face between two body cells takes its cells' own states. Only body cells see that face, ands_zero_rhs_at_bodydiscards their RHS, but WENO across a thin injecting body undershot to a negative density there.Build and CI
cmake/GPU.cmake: the AMD flang checked CPU build is-O0. At-O1this flang evaluates divisions guarded by anifbefore the test (seen in the machine code ofm_chemistry.fppandm_particles_EL.fpp), and it accepts no flag that forbids it. This took the count from 84 to 18 tests.checks.yml: at-O0the suite takes about 2 h, over the job's 1.5 h SLURM limit, so the weekly AMD job builds every variant once and runs two shards side by side.troubleshooting.md: the flags table says-O0.Fixed elsewhere
5334FF40,D7E7DE04): Batched fixes: serial old_ic restart, IB overlap-cell rank independence, IGR 1D, Taylor-Green pressure, moment of inertia, and 9 more #2514.07C33719,09623DE3): Cylindrical viscous operator: 1/r of the theta divergence and hoop terms, 2D axisymmetric stress, GPU face bounds (fixes #1910) #2515.Testing
On Frontier, AMD flang checked CPU build at
-O0, rebased on master5eadc8fa7(with #2515 and #2517): all 16 tests that trapped pass, against unchanged golden files.E5ACA113AA36F5D2,BA59123E,8DDB767E2A6136EF,304DAF95,5304E59F,A582B270,D3CF92B539A3B369,B317404C,E5B660845334FF40,D7E7DE0407C33719,09623DE3./mfc.sh precheckpasses.