Repository navigation
Description
Tracking issue for the open problems and follow-up work for block-structured AMR, which landed in #2117 (merged as eb63cfa). Each item comes from that PR's Known limitations and follow-ups section, plus two caveats noted in the code (the finest-level dt warning and the coarse-only species-cleanup report). Each linked issue gives the current behaviour, the reason, code links pinned to eb63cfa, what is needed, and when it counts as done.
Everything listed is either rejected by the case validator with a message (toolchain/mfc/case_validator.py, check_amr) or documented as a caveat, so no unsupported input runs silently. User docs: docs/documentation/amr.md (Limitations); design and the grid-swap contract: docs/documentation/amr_implementation.md.
Open bug
- AMR: quartic prolongation (amr_prolong = 2) goes NaN after a regrid in a dense immersed-body cloud #2217 quartic prolongation (amr_prolong = 2) goes NaN after a regrid in a dense immersed-body cloud
Performance, memory and code structure
- AMR: regrid cost grows faster than the step beyond 512 GPUs (clustering and global block-table exchange) #2218 regrid cost grows faster than the step beyond 512 GPUs (clustering and global block-table exchange)
- AMR: solver work arrays are sized for the largest block, so every block pays for it (memory headroom) #2219 solver work arrays are sized for the largest block, so every block pays for it (memory headroom)
- AMR: pass the grid to the solver explicitly instead of swapping module-global grid state per block #2220 pass the grid to the solver explicitly instead of swapping module-global grid state per block
- AMR: replace m_amr_state's loose module variables with a block-table derived type #2221 replace m_amr_state's loose module variables with a block-table derived type
Refinement behaviour
- AMR: refinement never retracts when no cell is tagged (regrid keeps the old blocks) #2222 refinement never retracts when no cell is tagged (regrid keeps the old blocks)
- AMR: level-2 and deeper blocks are re-prolonged from their parent at every regrid (no carry-over) #2223 level-2 and deeper blocks are re-prolonged from their parent at every regrid (no carry-over): fix in AMR regrid: carry level-2 and deeper blocks over a regrid as level 1 is (fixes #2223) #2295
- AMR: fine blocks advance at the coarse dt; dt is not limited by the finest cell (multi-level / ratio 4 without subcycling) #2245 fine blocks advance at the coarse dt; dt is not limited by the finest cell (multi-level / ratio 4 without subcycling)
- AMR: refinement ratio 4 beyond one level, quartic with ratio 4, subcycling beyond two levels, static nesting beyond level 2 #2244 refinement ratio 4 beyond one level, quartic with ratio 4, subcycling beyond two levels, static nesting beyond level 2
Immersed boundaries under AMR
- AMR: integrate immersed-boundary forces (face-flux path) on the fine grid, not the coarse grid only #2224 integrate immersed-boundary forces (face-flux path) on the fine grid, not the coarse grid only
- AMR: moving immersed bodies with amr_max_level > 1 or with amr_subcycle #2225 moving immersed bodies with amr_max_level > 1 or with amr_subcycle
- AMR: validate IB thermal walls (thermal_bc = 1, 2) and surface reactions (surface_reaction, thermal_layer) #2226 validate IB thermal walls (thermal_bc = 1, 2) and surface reactions (surface_reaction, thermal_layer)
- AMR: lumped solid wall (patch_ib thermal_bc = 3) under AMR #2228 lumped solid wall (patch_ib thermal_bc = 3) under AMR
- AMR: support ib_heat_wrt (IB heat output) on refined blocks #2229 support ib_heat_wrt (IB heat output) on refined blocks
- AMR: support ib_surface_wrt (per-ghost-point surface output) on refined blocks #2227 support ib_surface_wrt (per-ghost-point surface output) on refined blocks
- AMR: support ib_flux_wall (HLLC wall-flux override) on refined blocks #2230 support ib_flux_wall (HLLC wall-flux override) on refined blocks
- AMR: STL-model immersed bodies #2240 STL-model immersed bodies
- AMR: moving bodies and dynamic regrid with ellipse, airfoil and other non-box geometries #2241 moving bodies and dynamic regrid with ellipse, airfoil and other non-box geometries
Other physics and options rejected under AMR
- AMR: bulk-flow controllers (mean_dpdx / mean_mflux, mean_qdot / mean_temp) average the coarse grid only #2231 bulk-flow controllers (mean_dpdx / mean_mflux, mean_qdot / mean_temp) average the coarse grid only
- AMR: subcycling (amr_subcycle) with IGR, chemistry or Lagrangian bubbles #2232 subcycling (amr_subcycle) with IGR, chemistry or Lagrangian bubbles
- AMR: Euler-Euler bubbles (bubbles_euler) and surface tension have no AMR validation #2233 Euler-Euler bubbles (bubbles_euler) and surface tension have no AMR validation
- AMR: QBMM and phase-change relaxation (relax) in the batched fine advance #2235 QBMM and phase-change relaxation (relax) in the batched fine advance
- AMR: operator-split reaction and burn substeps (chem_params%reaction_substeps, rburn%substeps) #2236 operator-split reaction and burn substeps (chem_params%reaction_substeps, rburn%substeps)
- AMR: synthetic_turbulence and bf_spatial_support source fields are built on the coarse grid only #2237 synthetic_turbulence and bf_spatial_support source fields are built on the coarse grid only
- AMR: MHD in 2D and 3D (divergence-preserving coarse-fine seam for B) #2242 MHD in 2D and 3D (divergence-preserving coarse-fine seam for B)
- AMR: cylindrical coordinates (cyl_coord) and stretched grids #2234 cylindrical coordinates (cyl_coord) and stretched grids
- AMR: Riemann-extrapolation boundary conditions (bc = -4) #2238 Riemann-extrapolation boundary conditions (bc = -4)
- AMR: characteristic boundary conditions (bc = -5 to -12) #2239 characteristic boundary conditions (bc = -5 to -12)
- AMR: MUSCL reconstruction and time steppers other than SSP-RK3 #2243 MUSCL reconstruction and time steppers other than SSP-RK3 (AMR: allow MUSCL reconstruction (work array sized for the fine frame) #2270, AMR: RK weight table and a recursive subcycle driver; allow RK1 and RK2 #2263)
Output
- AMR: species-cleanup report counts coarse cells only #2246 species-cleanup report counts coarse cells only
Testing and verification (added 2026-11-17)
-
Two-rank tests for subcycling and quartic prolongation: AMR tests: subcycling and quartic prolongation on two ranks #2277 (merged)
-
Rank-count sweep (2026-11-17, master f7a4f82, Frontier amdflang GPU): the 82 one-rank AMR tests rerun on two ranks. 52 agree with one rank to round-off (largest relative difference 4e-15); 3 (1D MHD and RMHD) start from a different initial state, because a cell centre lies exactly on the patch edge; 27 cannot run on two ranks and are refused with a message (grid too small to split, IB block larger than half a rank, IGR, multi-level IB) or, for 3 Lagrangian-bubble cases, failed for a reason not yet read
-
NVHPC GPU coverage for AMR pull requests: the Phoenix lanes run on master only (PRs need the
ci:phoenixlabel), and no master run has completed them since AMR merged; see Phoenix CI failing on master #2181 -
An AMR case in the benchmark suite: Benchmarks: an AMR case (spherical blast, dynamic regrid, subcycling) #2296
-
Run
./mfc.sh amr_checkover the switches not yet inAMR_VETTED_FLAGS:ib_slip_ccstandib_smooth_contactpass (AMR: allow ib_slip_ccst and ib_smooth_contact (amr_check passes) #2297);ib_visc_compactfails (AMR: ib_visc_compact differs from the uniform fine grid at the body (amr_check) #2294); the other 25 belong to physics with open issues above -
bc_[xyz]%isothermal_*AMR test;bf_spatial_supportwithamr_subcycle -
Two-rank tests for viscous, synthetic turbulence, Lagrangian bubbles and dynamic two-level subcycling; shorter 1D model-6 tests: AMR tests: two-rank coverage, shorter 1D model-6 tests; packer and hard-coded IC fixes found on the way #2293 (also fixes rank-dependent hard-coded ICs 275/299 and the packer for empty Lagrangian rank files)
-
1D MHD: pre_process wrote B/rho as the step-0 primitive B; AMR MHD tests had a cell centre on the patch edge: MHD 1D: pre_process writes the primitive B, not B/rho; AMR MHD tests put the patch edge on a cell face #2292
-
AMR: ib_visc_compact differs from the uniform fine grid at the body (amr_check) #2294
ib_visc_compactdiffers from the uniform fine grid at the body
Structure (added 2026-11-17)
- One step routine for every level, prototyped in Python first (with AMR: pass the grid to the solver explicitly instead of swapping module-global grid state per block #2220, makes most physics work on blocks by construction)
- The coarse-fine edge as a boundary code
- These two come before AMR: QBMM and phase-change relaxation (relax) in the batched fine advance #2235 (QBMM) and the other per-feature items above.
Dependencies
- AMR: integrate immersed-boundary forces (face-flux path) on the fine grid, not the coarse grid only #2224 (fine-grid face sums) comes before AMR: lumped solid wall (patch_ib thermal_bc = 3) under AMR #2228, AMR: support ib_heat_wrt (IB heat output) on refined blocks #2229 and AMR: support ib_flux_wall (HLLC wall-flux override) on refined blocks #2230.
- AMR: validate IB thermal walls (thermal_bc = 1, 2) and surface reactions (surface_reaction, thermal_layer) #2226 (thermal/reacting walls) comes before AMR: lumped solid wall (patch_ib thermal_bc = 3) under AMR #2228, AMR: support ib_surface_wrt (per-ghost-point surface output) on refined blocks #2227 and AMR: support ib_flux_wall (HLLC wall-flux override) on refined blocks #2230; until then those are moot under AMR.
- AMR: pass the grid to the solver explicitly instead of swapping module-global grid state per block #2220 (grid passed explicitly) would remove the root cause of most coarse-only caveats, and makes AMR: solver work arrays are sized for the largest block, so every block pays for it (memory headroom) #2219 and AMR: cylindrical coordinates (cyl_coord) and stretched grids #2234 easier.
- AMR: replace m_amr_state's loose module variables with a block-table derived type #2221 (block-table type) helps AMR: regrid cost grows faster than the step beyond 512 GPUs (clustering and global block-table exchange) #2218 (distributed block table).
Not planned
model_eqns = 1or4under AMR (AMR supports the 5- and 6-equation models only).
Keeping AMR in step with master
With amr = T, any logical switch not in AMR_VETTED_FLAGS is rejected, so new features stay off under AMR until checked against the grid-swap contract. Output switches (tagged output) are exempt and need a manual check in review: a new writer that reads solver state precomputed on the coarse grid must be gated under AMR, as ib_surface_wrt and ib_heat_wrt are.
Drafted with Claude Code.
Activity
sbryngelson commentedon Nov 13, 2026
Implementation plans posted
Each of the 30 issues above now has an implementation-plan comment (approach, steps with
path:lineat eb63cfa, validator and docs changes, tests, risks, size and order). Where reading the code contradicted the issue text, the plan starts with a Correction to the issue line.Suggested order
Small and independent (S), mostly guards, validation and tests
bf_spatial_supportalready works on fine blocks; synthetic turbulence needs a fine hook)bc = -4(fine-advance guards; review together)Medium
relaxLarge or measurement-first
Dependency changes found while planning
ib_flux_walladded toAMR_VETTED_FLAGS; narrowing the thermal gate in AMR: validate IB thermal walls (thermal_bc = 1, 2) and surface reactions (surface_reaction, thermal_layer) #2226 does not enable it.relaxhalf should share the hook from AMR: operator-split reaction and burn substeps (chem_params%reaction_substeps, rburn%substeps) #2236.m_amr_stage; land them in sequence.buff_sizecells inside the domain, so a block can never touch a boundary or the axis. The original "block touching the boundary" completion cases need that margin lifted first, which has no issue yet.Observations outside the 30 issues (from code reading, not verified by a run)
m_time_steppers.fpp:579,:587); the fine post-RK hooks relax first (m_amr_advance.fpp:250-252).s_compute_fd_gradientreplaces the gradient at index 0 andmby one-sided differences whenbc <= -3(m_viscous.fpp:1060on), with no fine-advance guard, so on a non-periodic domain it appears to act at fine block edges too (details in the AMR: characteristic boundary conditions (bc = -5 to -12) #2239 plan).s_amr_update_mib_fineruns insides_amr_stage_fine, befores_propagate_immersed_boundariesmoves the body for that stage (details in the AMR: integrate immersed-boundary forces (face-flux path) on the fine grid, not the coarse grid only #2224 plan).s_set_amr_fine_geometryuses a+ 1margin where the quartic patch needsf_amr_prolong_reach()(m_amr_transfer.fpp:358; details in the AMR: quartic prolongation (amr_prolong = 2) goes NaN after a regrid in a dense immersed-body cloud #2217 plan).Each of these needs a run to confirm before it is treated as a bug.
Drafted with Claude Code from a read of master at eb63cfa. Nothing here has been implemented or run.
sbryngelson commentedon Nov 13, 2026
Update on the four observations above, checked against the code and with before/after runs on Frontier:
s_compute_fd_gradientdoes apply the domain-boundary closure at fine-block edges, but its output is never used there: the viscous fluxes on that path take their face gradients from direct differences of the primitive state (m_viscous.fpp,s_get_viscous). The only reader of the cell-centred gradient is the cylindrical-axis stress, which AMR rejects. A viscous shock tube withweno_Re_flux = Fis bitwise identical with and without a guard, at 1 and at 2 ranks.s_set_amr_fine_geometry: not a bug. The level-1 fill takes every patch cell from the owning rank's interior (own rows) or point-to-point from the rank that holds it, so coarse cons ghosts at rank seams are never read by the fill.amr_xchg_coarse_ghoststherefore only gates a redundant halo exchange, and the+ 1vs.f_amr_prolong_reach()difference has no effect on results. The AMR: quartic prolongation (amr_prolong = 2) goes NaN after a regrid in a dense immersed-body cloud #2217 plan's suspect 3 is withdrawn accordingly.Checked with Claude Code.
sbryngelson commentedon Nov 14, 2026
Update: observations 1 and 3 from the comments above are fixed in #2249, which is now merged:
Both fixes were checked on Frontier (amdflang, OpenMP offload) and on wingtip (NVHPC 26.9, OpenACC, A100): the full suites passed on both. Observations 2 and 4 are not bugs (see the earlier comment), so nothing from that list is still open. None of the tracked issues above change.
Posted with Claude Code.
sbryngelson commentedon Nov 14, 2026
Progress update: a sweep, five draft PRs and one new issue
The sweep. I reran every non-AMR test in the suite with one static refined block added and the AMR validator gates turned into notes (Frontier, amdflang, OpenMP offload; two block placements, about 875 tests each). It is a list of leads, not verdicts: many failures were my block placement (too close to a boundary, or over an acoustic source), and a difference against the uniform-grid golden is unreliable at shocks. Each lead below was followed up separately.
Draft PRs
dtby the finest cells: CFL-baseddtfollows the blocks, a fixeddtabove the finest cells' limit aborts with the largest stable value. The sweep's "chemistry + HLL goes NaN with a block" was this.rank_time_wrt. Measurements from a 128-GPU run are posted on both issues.bf_spatial_support, with a coarse / coarse + block / fine comparison.What the measurements changed
amr_prolong = 2) once AMR IB: pack the ghost-point park (fixes device OOM with many bodies) #2253 lets it start.Gated features, from the three-way comparison in #2259
relax: accurate with a block in 1D, but the fine cells are never relaxed; needs the fine end-of-step hook (AMR: QBMM and phase-change relaxation (relax) in the batched fine advance #2235).bc = -4: spurious transverse momentum and volume-fraction error with a block; needs the guard (AMR: Riemann-extrapolation boundary conditions (bc = -4) #2238).dt; not diagnosed, possibly AMR: fine blocks advance at the coarse dt; dt is not limited by the finest cell (multi-level / ratio 4 without subcycling) #2245 (AMR: MUSCL reconstruction and time steppers other than SSP-RK3 #2243).New issue: #2255, Lagrangian particles: two-way coupling faults on the GPU or stalls with a block.
Open leads, not yet investigated. Three configurations that AMR allows today fail when a block is added, and they are not the time-step problem:
2D -> Example -> richtmyer_meshkov: "No valid time step" at a coarse cell beside the block corner, also atcfl_target = 0.1and with AMR: limit dt by the finest cells (fixes #2245) #2257.1D -> Chemistry -> Dual Isothermal Wall Gradient -> Transport-Limited dt: "No valid time step".2D -> Example -> poiseuille_thickening_nn: "Delta t has become too small".The first is confirmed not to be #2245; the other two have not been rerun with #2257.
Not started: the shared post-stage hook routine, the recursive stage driver, and fine-grid IB forces (#2224).
Posted with Claude Code.
sbryngelson commentedon Nov 15, 2026
Update: three more draft PRs, and NVHPC checks on the earlier ones
dtby the finest cellsbf_spatial_supportAll pass where listed.
NVHPC found three bugs that amdflang did not, all fixed in the PRs and described in their threads: #2257 hung in a kernel and changed a non-AMR result, #2263 hit a "not present" error on a scalar, and #2256's new test was too ill-conditioned for the single-precision CI lane.
CI. The only failing checks on these PRs are NVHPC 25.5 (cpu) and 26.9 (cpu), on one non-AMR test from #2254 (
B872F80B, 3D -> Chemistry -> IBM -> Hot Rod -> Face Bound). It fails on #2259 too, which changes no Fortran, and on #2254 itself.Results worth knowing
Found and not fixed
amr_max_grid_size(so it tiles) crashes at start-up on master withdouble free or corruption.s_ibm_alloc_fineallocates a host marker copy for every possible slot (about 30 GiB per rank in the 297-sphere case); see AMR: solver work arrays are sized for the largest block, so every block pays for it (memory headroom) #2219.Still gated, with what each needs:
relax(fine end-of-step hook, #2235),bc = -4(#2238), surface tension (#2233), MUSCL (#2243), subcycling beyond two levels (#2244; the recursive driver in #2263 is written for any depth but has not been run deeper).Posted with Claude Code.
sbryngelson commentedon Nov 15, 2026
Update, 2026-11-14 (late): three more gates lifted, two findings.
New since the last update:
bc = -4bc = -3. Frontier 65/65, wingtip NVHPC 62/62.relaxhalfFindings that keep gates in place:
dtcheck. A real defect in the MUSCL path on a block; not diagnosed.dtbelow the fine limit.Open and not yet filed as its own issue: in two plain 2D cases, a variable that is exactly zero on both uniform grids becomes nonzero (about 3e-3 to 5e-3 summed) when a block is added. Seen with
bc = -3andbc = -4, with and without surface tension. Not traced.CI: the NVHPC (cpu) failures on #2253, #2256, #2257, #2258, #2259 and #2263 were all the hot-rod chemistry test
B872F80B, fixed on master by #2260. Those six branches now have master merged in and are rerunning.Written with Claude Code.
sbryngelson commentedon Nov 15, 2026
Update, 2026-11-15: the open findings traced.
alpha*uflux but not thealpha*div(u)source, soalphadrifts 1 to 2 percent from 1 next to block faces a wave crosses, and that feeds the pressure. Filed as #2269 with a fix sketch; the fix changes every AMR golden.v_rs_ws_musclwas sized for the coarse subdomain and the stacked fine frame wrote past it. Block run now as much better than coarse as with WENO.mpp_lim, and not the capillary ghost fill (tried). Probably the level-dependent sharpness of the interface where it crosses a side face; needs a droplet-in-block comparison. Gate stays.Written with Claude Code.
sbryngelson commentedon Nov 18, 2026
New follow-ups from a fresh read of the docs, tests and code (2026-11-18):
Trust
amr_checkin CIFriction
dtconditions without a mid-run abortValue
Also open as PRs: #2300 (level-3 extent fix), #2295 (level>=2 carry-over, #2223), #2302 (dormant block, #2222).
AI-assisted (Claude Code).
sbryngelson commentedon Nov 19, 2026
Ledger of remaining AMR work (updated 2026-11-25, after the merges)
Size is S (hours), M (a day or two), L (more). Closed issues: #2305, #2306, #2308, #2313, #2323.
1. Wrong answers today
amr_snap: the derived regrid hysteresis let a level-2 shock outrun its box (Sod shock speed about 1% high, not converging). Merged as AMR: derive amr_snap only with one refined level (two-level shock-speed error) #2474:amr_snapis derived only for one level.ib_mass_relaxunder AMR: not planned; stays unsupported.2. Untested, so possibly broken
sim_datawith AMR is rejected (AMR: reject sim_data, which reads level 0 only (audit for #2314) #2456, merged). Follow-ups are AMR: Mie-Gruneisen compression abort checks level 0 only #2457, Pressure-relaxation cap count is printed for rank 0 only #2458 and AMR: fine-level probes, subcycled IB forces and derived fields in the block overlay #2459.-K trap=fp, plus hypoelastic): merged as Fix the floating-point traps the debug build hits in 8 AMR tests #2438.amr_check(AMR tests: amr_check on a reacting shock tube #2368), NVHPC/OpenACC in CI.3. Scaling and payoff (#2315)
cpu_time, which overstates GPU wall time 1.4-1.8x; the step timer moved tosystem_clock(Print step times from system_clock, not cpu_time (GPU runs read 1.4-1.8x wall time) #2479, merged). Subcycled over uniform-fine on one MI250X GCD: 1.77 (128^2 base), 1.04 (512^2), 0.32 (2048^2); 3D blast 0.87.4. Validation and examples
validation_amr.md): Sod against the exact solution, conservation in a periodic box, isentropic-vortex order, Sedov radius, cylinder wake Cd/St. Merged as AMR validation page: Sod, conservation, isentropic vortex, Sedov, cylinder wake #2483; every AMR number remeasured on master with AMR: do not reflux the volume fractions (fixes the static-block vortex error) #2482, AMR: derive amr_snap only with one refined level (two-level shock-speed error) #2474 and AMR regrid: tile level-1 boxes to one per rank, one cell at a time #2461. Follow-up (small):check_sedov.pyimports its reader from the vortex example.5. Follow-ups from the reviews of today's merges
amr_snapwith more than one level rejected; snap golden), Toolchain: hipfort rebuild after a compiler change reuses the stale CMake cache (keeps the old compiler) #2501 (interrupted dependency rebuilt from scratch), example EOS fix, and parts of AMR tiling after #2461: thin tiles below the seam halo, pool truncation, worse balance on non-cube rank counts, no test #2496 (tile halo and pool guards, golden), AMR memory table after #2460: unrecorded layouts, fill excludes ghost layers, rest of #2449 #2498 (per-level memory table) and AMR docs and tooling cleanups from the reviews of #2456, #2477, #2479, #2482, #2483 #2499 (docs, tooling).alpha*div(u)correction (water/air |dp|/p 1.6e-3 to 1.4e-10).alt_soundspeedK term and the 6-equationalpha_k p du(AMR, 6-equation model: internal-energy reflux omits the alpha_k p Δu source correction (seam error converges at first order) #2490), each taking the level-0 seam error from first to second order in a shear test; HLL Method 1's interface-alpha form; the per-level memory table; the rest of AMR memory table after #2460: unrecorded layouts, fill excludes ghost layers, rest of #2449 #2498; the Sedov blast on a uniform 256^3 octant: WENO5 with mp_weno goes NaN at t = 0.004 #2502 doc note (WENO5 Sedov NaN is the collapsing-centre positivity loss;face_boundruns through it); the AMR: resolve nesting and fixed-dt conditions without a mid-run abort #2312 oblique-disc test; the upstream merge. AMR quartic regrid + subcycle: Cray CPU and AMD CPU builds differ by 2e-3 in 40 steps #2500 closed: a round-off-decided branch in the quartic at an exactly symmetric extremum, test-only.6. Housekeeping
Done since 2026-11-19
Ledger kept with Claude Code (AI-assisted).