Skip to content

AMR follow-ups after #2117 (tracking issue) #2247

Open

Description

@sbryngelson

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

Performance, memory and code structure

Refinement behaviour

Immersed boundaries under AMR

Other physics and options rejected under AMR

Output

Testing and verification (added 2026-11-17)

Structure (added 2026-11-17)

Dependencies

Not planned

  • model_eqns = 1 or 4 under 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

  1. added
    enhancement
    on Nov 13, 2026
  2. sbryngelson commented on Nov 13, 2026

    @sbryngelson
    MemberAuthor

    Implementation plans posted

    Each of the 30 issues above now has an implementation-plan comment (approach, steps with path:line at 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

    Medium

    Large or measurement-first

    Dependency changes found while planning

    Observations outside the 30 issues (from code reading, not verified by a run)

    1. Hook order differs between levels. The coarse stage applies body forces before 6-equation pressure relaxation (m_time_steppers.fpp:579, :587); the fine post-RK hooks relax first (m_amr_advance.fpp:250-252).
    2. One-sided viscous gradients at fine block edges. s_compute_fd_gradient replaces the gradient at index 0 and m by one-sided differences when bc <= -3 (m_viscous.fpp:1060 on), 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).
    3. Fine IB markers may lag one RK stage for moving bodies. s_amr_update_mib_fine runs inside s_amr_stage_fine, before s_propagate_immersed_boundaries moves 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).
    4. Quartic margin. s_set_amr_fine_geometry uses a + 1 margin where the quartic patch needs f_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.

  3. sbryngelson commented on Nov 13, 2026

    @sbryngelson
    MemberAuthor

    Update on the four observations above, checked against the code and with before/after runs on Frontier:

    1. Hook order (body force vs. 6-equation pressure relaxation): real. A uniform two-fluid state under gravity in a periodic domain drifts by 1.2e-5 in the phase internal energies on master and stays exactly uniform with the fix. A fix PR is coming.
    2. One-sided viscous gradients at fine-block edges: not a bug. s_compute_fd_gradient does 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 with weno_Re_flux = F is bitwise identical with and without a guard, at 1 and at 2 ranks.
    3. Fine IB markers one RK stage behind: real. Fixed in the same PR. A circle moving at Mach ~0.3 on a static block is about 30% closer to a uniform fine-grid reference with the fix.
    4. Quartic margin in 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_ghosts therefore only gates a redundant halo exchange, and the + 1 vs. 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.

  4. sbryngelson commented on Nov 14, 2026

    @sbryngelson
    MemberAuthor

    Update: observations 1 and 3 from the comments above are fixed in #2249, which is now merged:

    1. Hook order: the fine post-RK hooks now apply the body force before the 6-equation pressure relaxation, the same order as the coarse stage. New test EC935FC5.
    2. IB markers one stage behind: under AMR, the bodies now move to the stage's pose before the fine stage runs. The fine IB rebuild and correction therefore use the same pose as the coarse grid. Goldens 13945217 and 43AF9F25 were regenerated.

    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.

  5. sbryngelson commented on Nov 14, 2026

    @sbryngelson
    MemberAuthor

    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

    PR issue what
    #2257 #2245 Limit dt by the finest cells: CFL-based dt follows the blocks, a fixed dt above the finest cells' limit aborts with the largest stable value. The sweep's "chemistry + HLL goes NaN with a block" was this.
    #2256 #2217 Quartic prolongation: no new extrema in monotone data. Root cause found with a 64-cell reproducer (NaN on master, also with the admissibility fallback; runs with the fix).
    #2253 #2219 Pack the fine IB ghost-point park. Master could not start the 297-sphere case (device allocation failure).
    #2258 #2218, #2219 End-of-run AMR memory table under rank_time_wrt. Measurements from a 128-GPU run are posted on both issues.
    #2259 #2237 Allow bf_spatial_support, with a coarse / coarse + block / fine comparison.

    What the measurements changed

    Gated features, from the three-way comparison in #2259

    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 at cfl_target = 0.1 and 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.

  6. sbryngelson commented on Nov 15, 2026

    @sbryngelson
    MemberAuthor

    Update: three more draft PRs, and NVHPC checks on the earlier ones

    PR issue what Frontier amdflang / OpenMP wingtip NVHPC 26.9 / OpenACC
    #2253 #2219 pack the fine IB ghost-point park AMR tests, 297-sphere case AMR tests
    #2256 #2217 quartic: no new extrema in monotone data AMR tests AMR tests
    #2257 #2245 limit dt by the finest cells AMR tests, non-AMR CFL tests, examples AMR tests, three non-AMR CFL tests
    #2258 #2218, #2219 end-of-run AMR memory table AMR tests, 128-GPU run AMR tests
    #2259 #2237 allow bf_spatial_support 4 tests AMR tests
    #2263 #2243 RK weight table, recursive subcycle driver, RK1 and RK2 AMR tests AMR tests
    #2264 (drift behind #2249) one list of post-RK stage hooks for both levels full suite AMR tests
    #2265 #2224 IB forces from the finest level covering each face (stacked on #2257) AMR and IB tests AMR tests, 40 non-AMR IB tests

    All 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

    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.

  7. sbryngelson commented on Nov 15, 2026

    @sbryngelson
    MemberAuthor

    Update, 2026-11-14 (late): three more gates lifted, two findings.

    New since the last update:

    issue PR state
    #2238, bc = -4 #2267 draft. Block runs give the same errors against a fine-grid run as bc = -3. Frontier 65/65, wingtip NVHPC 62/62.
    #2237, synthetic turbulence #2264 (added to the hooks PR) draft. Inside the block, momentum is 7 to 10 times closer to the fine-grid run. Frontier 72/72, wingtip NVHPC 72/72. Together with #2259 this closes #2237.
    #2235, relax half #2268 draft. Fine blocks are relaxed at the end of the step; a block over the active region matches the fine-grid run to round-off. Frontier 81/81; wingtip NVHPC running.
    #2217 #2256 the 297-sphere case reran to step 450 with the limiter fix, no NaN.

    Findings that keep gates in place:

    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 = -3 and bc = -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.

  8. sbryngelson commented on Nov 15, 2026

    @sbryngelson
    MemberAuthor

    Update, 2026-11-15: the open findings traced.

    finding result
    A variable that is zero on uniform grids becomes nonzero with a block (2D momentum) Expected, not a defect. It is the coarse-fine mismatch at the block's side faces where a wave runs along the face: located only there, antisymmetric, sums to 2e-10, peak 0.4% of the streamwise momentum.
    Same, for the volume fraction of a single fluid Real. The reflux corrects the alpha*u flux but not the alpha*div(u) source, so alpha drifts 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.
    MUSCL goes NaN with a block (#2243) Real, fixed in #2270 (draft). v_rs_ws_muscl was sized for the coarse subdomain and the stacked fine frame wrote past it. Block run now as much better than coarse as with WENO.
    Surface tension extra momentum (#2233) Same side-face location as the first row, 12 times larger. Not 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.
    #2268 on NVHPC 80 of 81; one new test missed by 1.1e-10 absolute. Tolerance set to 1e-8 for that test.

    Written with Claude Code.

  9. sbryngelson commented on Nov 18, 2026

    @sbryngelson
    MemberAuthor

    New follow-ups from a fresh read of the docs, tests and code (2026-11-18):

    Trust

    Friction

    Value

    Also open as PRs: #2300 (level-3 extent fix), #2295 (level>=2 carry-over, #2223), #2302 (dormant block, #2222).

    AI-assisted (Claude Code).

  10. sbryngelson commented on Nov 19, 2026

    @sbryngelson
    MemberAuthor

    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

    2. Untested, so possibly broken

    3. Scaling and payoff (#2315)

    4. Validation and examples

    5. Follow-ups from the reviews of today's merges

    6. Housekeeping

    Done since 2026-11-19


    Ledger kept with Claude Code (AI-assisted).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions