Skip to content

After a mesh move, solves see the remapped field; a move is decided over all ranks - #959

Merged
lmoresi merged 7 commits into
developmentfrom
bugfix/mover-stale-mesh-vector
Nov 10, 2026
Merged

lmoresi merged 7 commits into
developmentfrom
bugfix/mover-stale-mesh-vector

Conversation

@lmoresi

@lmoresi lmoresi commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

After a mesh move, a solve used the field values from before the move, on the moved nodes. This fixes that, and a hang when some ranks' nodes don't move.

The bug

remesh_with_field_transfer writes the remapped values through np.asarray(var.data)[...]. That is a plain view, so the callback that sets mesh._stale_lvec doesn't fire. The remap's own global_evaluate calls have just refreshed the mesh vector from the old values and cleared the flag. So T.array holds the remapped field, while kernels and integrals read mesh.lvec, which holds the old one.

This has been present since the remesh redesign of 2026-05-28 (c52201b8). It affects the first solve after each move whose kernels read a REMAP variable; any solve that writes its unknown raises the flag, so later readers see fresh values. In a loop that moves every step and solves Stokes first, that is every Stokes solve. A variable under semi-Lagrangian ALE is CARRY by design, so its own values are not remapped, and this doesn't change that.

Measured

Annulus, radii 0.5-1, cell size 1/8, 3 levels, a sharp thermal layer, slip mover with R=5, rotated free slip with normal=unit_e_0, custom FMG. v_rms is 1.62238 before any move.

move 1, before move 1, after T reset from its formula
np 1 1.67325 1.62263 1.62256
np 4 1.68670 1.62267 1.62262

That first solve after a move was 3% high at np 1 and 4% high at np 4. Rewriting T with its own values gave the same 1.62263 at np 1, which is how the cause was found. Velocity iterations stayed at 4 throughout.

Earlier moving-mesh results with T-dependent forcing or viscosity may carry this error in the first solve after each move. I haven't re-measured any of them.

Also fixed

  • The move decision was per rank. A rank whose nodes stayed put returned while the others entered the collective remap, and the job hung. It is now an allreduce.
  • An empty rank skipped global_evaluate in remap_var_set. The job hung at np 2 and np 4 on a 1 x 2 box, and completes with the fix, with T identical to serial.

Tests that relied on the stale value

The flag exposed two tests that passed only because they read pre-move values:

  • test_0057 asserted that T stays monotone along a bulged surface. That held for a remapped field only through the stale vector. The test is about point location, so T is now carry.
  • test_1070 measured the strong constraint's flux after advance had deformed the mesh and remapped the velocity. The constraint is identical either way (1.27e-4 on its own geometry, against the bound of 1e-3). It now measures just before the deform.

Not in this PR

Tests

  • tests/test_0766_mover_refreshes_mesh_vector.py (tier B): the remap, and a snapshot restored across a move. Without the flag a solve's integral reads 1.897 against 1.769.
  • tests/parallel/test_0766_mover_refreshes_mesh_vector_parallel.py (tier B): the remap, a rank whose nodes don't move, and a rank with no cells. 3 passed at np 2, 4 and 8. Without the flag all three fail at np 2. With the decision per rank, the non-moving-rank test hangs at np 2, 4 and 8.
  • Every test file that moves a mesh (29 files): 262 passed, 4 skipped. The 2 fixture errors in that run were in my test_1070 change, which is corrected; those two tests pass now. Serial.

No test exercises a solver directly: the tests read an Integral, which uses the same vector. The table above is the solver evidence, from scripts/sessions/mmpde_annulus/probe_state.py on feature/mmpde-annulus-fmg, which also carries an unfinished mover restart, so those numbers won't reproduce exactly here.

Checklist (UW3 Style Charter)

  • Read the Style Charter and followed it over the surrounding code
  • No drive-by refactors, renames or cleanups
  • Bug fixes ship the regression test, written first, with level_* and tier_* markers
  • No hedging names and no commented-out code
  • No new exception swallows
  • New data access uses .array / mesh.X.coords
  • Parallel safety checked at np 2 and np 4
  • No dependency changes
  • AI-assisted work carries the attribution line

Underworld development team with AI support from Claude Code

…ver all ranks

remesh_with_field_transfer writes the remapped values through a plain view of
var.data, which does not set _stale_lvec, and the remap's own evaluations have
just refreshed the mesh vector from the values before the write. Kernels and
integrals read that vector, so they saw the old field on the moved nodes, since
the remesh redesign of 2026-05-28.

The move test was per rank: a rank whose own nodes stayed put returned before the
collective remap while the others entered it, and hung. It is now agreed over all
ranks, which also lets the new flag be set on every rank.

Underworld development team with AI support from Claude Code
Copilot AI balanced review requested due to automatic review settings November 6, 2026 06:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@lmoresi

lmoresi commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Correction to the table in the description: those runs were on feature/mmpde-annulus-fmg, which also carries an unfinished conjugate-gradient restart in the mover. The move path differs slightly from this branch, so the numbers won't reproduce exactly here. Development's own before value at move 1 with the stale vector was 1.67106 at np 1 and 1.68670 at np 4. The mechanism and its size don't depend on the restart. I have not run the v_rms comparison on this exact branch.

Adversarial review

An independent reviewer read an earlier version of this branch (the flag only). This was by reading code; it ran nothing. The commit here was squashed after the review, and it adds the fixes below.

Fixed here

  1. remesh.py: the np.array_equal(new_X, old_X) move test was per rank. A non-moving rank skipped the collective remap, and with the new flag also the next update_lvec. Now an allreduce, with a parallel test that fails without it (three ranks report no move, rank 0 ends in an MPI error).
  2. The tests could pass if the mover did nothing. Both now assert that T changed.
  3. The parallel test's rel=1e-6 had no reason behind it. Now 1e-12, and it passes at np 2 and 4.
  4. The docstring's numbered steps now include the flag, and the parallel test has a timeout mark.

Not fixed here, filed separately
2. remap_var_set can skip global_evaluate on one rank (target.size == 0, and a broad except).
5. _write_var_data doesn't synchronise var.vec ghosts. mesh.lvec should be clean through update_lvec, but direct var._lvec readers (gradient_evaluation.py, field_projection.py:582) may disagree across ranks.

Attacks that found nothing

  • Other write paths: nested calls, hook-driven remap_var_set, extra_zero, raising hooks, and deform, follow_metric, relax, redistribute_nodes. All pass through this transaction before the flag, or write with var.data[...].
  • Rebuild after a move: dropped fields are matched by name and zeroed.
  • Readers of mesh.lvec: the sites spot-checked call update_lvec first, so a stale state can't raise.
  • Old-frame semi-Lagrangian: it samples only CARRY history, so it doesn't rely on the stale values.
  • CI reach: test_07* and tests/parallel/test_*.py both match.

Open issues in this territory
None is fixed by this branch: #909, #879, #866, #898, #296, #531, #694, #551 are still live, from reading only. #423 is worth re-measuring, since this stale vector also reached solves on moving meshes, though it hasn't been shown to be the cause.

Not re-reviewed since these fixes: the post-review change is seven lines of source plus tests.

Underworld development team with AI support from Claude Code

@lmoresi

lmoresi commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Adversarial review of #959 at add5ea7

We reviewed bugfix/mover-stale-mesh-vector at add5ea7 against development eddab70, with the branch built in its own worktree (uw.__file__ in that worktree's env). All runs are serial, on macOS. Mutants are edits to the installed remesh.py: M1 removes mesh._stale_lvec = True; M2 makes the move decision rank-local again (moved = not np.array_equal(new_X, old_X)); M3 is both, which behaves like development.

Must fix

  1. (high) The comment promises that an empty rank joins the collective transfer. It does not. remesh.py:382-384 says a rank whose nodes stayed put because it is "pinned, empty, or outside a local deformation" must still enter the collective transfer. After the allreduce an empty rank does enter remap_var_set, but remesh.py:516 (if target is None or target.size == 0: continue) then skips global_evaluate on that rank only. The populated ranks block inside it: _function.pyx:561 builds a Swarm on the mesh and :619 migrates, and both are collective. The trigger is a rank that owns no cells: test_0774's 1x2 quad box at np 2 or 4, or any mesh at np above its cell count. Before this branch the populated ranks hung at the same call, because the empty rank took the early return. We read this; we have not run it (no MPI here; see S4). The fix is one of two:

  2. (medium) Both new test files are tier_a, but a proven regression test starts at tier B. The marks are at tests/test_0766_mover_refreshes_mesh_vector.py:16 and tests/parallel/test_0766_mover_refreshes_mesh_vector_parallel.py:12. CLAUDE.md "Tests" says a bug-fix test "shown to fail ... starts at tier B, so it gates" (the ruling on PR Docs: a proven new test starts at tier B; tier C is for unproven tests #840).

Should fix

  1. (high) After a mover move, solves read a swarm proxy that is still evaluated at the pre-move node positions, and writing the swarm variable does not correct it. Only deform bumps _mesh_version (discretisation_mesh.py:4158). remesh_with_field_transfer never bumps it, so the movers (smooth_mesh_interior, follow_metric, node_redistribution) leave it unchanged. The proxy interpolation cache is keyed on _mesh_version (swarm.py:3696), so it keeps the operator it built for the old nodes. A proxied swarm variable's remesh callback never runs: it is set on the wrapper, and remesh reads the base #866 adds to this: the REINIT callback sits on the wrapper (swarm.py:1379), so _proxy_stale is never set. The probe was probe_swarm_proxy_after_move.py: an annulus with cellSize 1/8, s = x of each particle, proxy_degree=1, and the move from test_0766.

    max node displacement 1.039e-01; _mesh_version 0 -> 0; s._proxy_stale=False; base callback=False; wrapper callback=True
    after move   rms(proxy - x at current nodes) = 3.372e-02   rms(proxy - x at PRE-move nodes) = 1.037e-16
    after s=2x   rms(proxy - 2x at current nodes) = 6.744e-02  rms(proxy - 2x at PRE-move nodes) = 2.075e-16
    

    With the same node motion applied through mesh.deform, _mesh_version goes 0 -> 1 and the error against the current nodes is 8.9e-17. This predates the branch. Now that moved is collective, the one place a bump is rank-symmetric is next to the new flag: mesh._mesh_version += 1 there, with the bump in deform removed. Otherwise file it; no open issue covers it.

  2. (medium) follow_metric still decides "moved" per rank and puts collectives behind that decision. meshing/smoothing/api.py:778 sets _state["moved"] = not np.allclose(_new_X, _old_X) inside do_move. _polish (:798) then runs _global_min (:826, an allreduce) and smooth_mesh_interior only on ranks where it is True. :837 returns the rank-local value. Two kinds of rank skip the polish while the others wait in _global_min: a rank whose nodes moved less than allclose tolerates (atol 1e-8 plus rtol 1e-5 times the coordinate), and a rank with no vertices. This is the asymmetry the branch fixes one level up, on the path follow_metric → remesh_with_field_transfer → do_move. Reduce the flag with _global_max. Then q.min() at :826 also needs an empty-array guard: on an empty rank it raises once that rank enters the loop. We read this; we did not reproduce it (see S6).

Notes

  1. Each post-review source line, checked:

    • :41: from mpi4py import MPI duplicates uw.MPI. The library writes uw.mpi.comm.allreduce(..., op=uw.MPI.MAX) (swarm.py:3623, :3640), and CLAUDE.md says to avoid direct mpi4py.
    • :382-384: Must fix 1.
    • :385: correct. Every rank that returns from do_move reaches it. A do_move that raises on one rank leaves the others waiting here, where before they waited in the remap's collectives, so the failure class is unchanged.
    • :386: correct.
    • :441: "Every rank reaches this line" holds unless something raises. Before this line, the per-variable except Exception: continue in remap_var_set (:529-534) can still desync the collectives (Mesh-move field transfer: remap_var_set can skip a collective on one rank, and ghosts are not synchronised #960).
    • :442: correct. It comes after the hooks, the REINIT pass and extra_zero, so it covers their writes too.
    • The docstring at :323 still says "compares mesh.X.coords before and after do_move". It now means on any rank.
  2. The bug reached only the first reader of the mesh vector after each move. Any solve that writes its unknown raises the flag, and every later reader then sees fresh values. Probe probe_solver_after_move.py: a Poisson solver (source T) and a Stokes solver (buoyancy T r̂), both created and solved before the move. We compared each first solve after the move with a solve after rewriting T with its own values:

    build Poisson, solved first Stokes, solved second
    development (M3) 5.39e-2 3.1e-14
    add5ea7 1.9e-16 3.1e-14

    So an earlier moving-mesh result carries the error only in the first solve after each move.

  3. The tests assert mesh._stale_lvec (parallel :40, :59), which is an implementation detail. An equally correct fix, an eager mesh.update_lvec() at the end of the transaction, would fail them. Test 2 asserts no value at all: a remap that wrote garbage on rank 0's moved nodes would pass it. The integral check from test 1 would make test 2 behavioural.

  4. Whether test 2 can see M2 depends on how shared vertices are owned. Rank 0 also scales its ghost copies of vertices that other ranks own. The coordinate rebuild goes through the global vector (petsc_compat.h, UW_DMPlexCreateCoordinateSpaceWithinPlex: DMGetCoordinates then DMSetCoordinates), so the owner's value wins and those edits are dropped. Test 2 catches M2 only if no other rank holds a ghost copy of a vertex that rank 0 owns. PETSc's default ownership vote gives each shared point to the highest rank, so we expect that to hold at any np, but we have not confirmed it (S2). A fixture that does not depend on this would move only those rank-0 vertices that appear nowhere in the point SF.

  5. CI reach and batches. check_test_coverage.py: "OK: all 391 test files are reachable". The serial file runs in batch 2 (tests/test_07*py, -m "not tier_c"). The parallel file is number 16 of 73 in the mpirun phase, which shifts every later file by one. Its own batch becomes 0765_internal, 0765_swarm_advect, 0766_box_internal, 0766_mover, 0766_swarm_substep, 0767. Batch 6 becomes 1062_forward_stress_history, 1063, 1064, 1065, 1066, 1068, which is the composition of A rebuild-memory test on the rotated free-slip + custom-FMG + split-fault path (refs #948) #951's failed shard 4 (run 42130702511). That failure does not come from the shift. Development's own run at eddab70 (42095953261, 72 files, batch 6 starting at 1063) hangs in test_1064 with the same supervisor diagnosis ("every rank is in _solve_rotated_iterative()", np 2). Shard 4 will therefore be red for a reason that predates this PR. This file runs in batch 2, before the hang, so its result is readable in that log. CI was still running at the time of review.

  6. Attacks that found nothing:

    • The serial test fails on M1 and on M3 (assert 1.8965371888173845 == 1.7687890219164744 ± 1.8e-12) and passes on add5ea7, in 30 s with a cold JIT cache and 5 s warm.
    • All 13 readers of mesh.lvec call update_lvec() first, so the raised flag cannot make lvec raise.
    • The two update_lvec(swarm_sync=False) calls that only some ranks reach (_function.pyx:1562, :1633) come after the all-ranks call at :1229.
    • deform's refreshes of the boundary normals and cell size write through the .data callback.
    • A solver's initial guess comes from localToGlobal(u.vec) with INSERT, which takes the owners' values. stats() and write sync _gvec first.
    • The rotated-BC operator cache is keyed on _state, which the plain-view write does not bump, but _deform_mesh resets the solver (is_setup=False), so no stale operator survives the move.
    • Old-frame semi-Lagrangian samples only CARRY psi_star under the old geometry (ddt.py:3877-3885), so a fresh vector does not change it.
    • The move decision compares two copies of mesh.X.coords, so both are in the same frame. It is an exact compare reduced with a boolean OR, so it is deterministic.
    • No capability guide names the remesh transaction.
    • Territory tests on add5ea7 (test_1071_slcn_moving_mesh, test_0764, test_0750_meshing_follow_metric, test_0855_oldframe_sl_traceback, test_0763): 33 passed.

Issue verdicts

Not checked, and what the Linux server should run

Use a build of add5ea7 and OMP_NUM_THREADS=1. Set SP=$(python -c "import underworld3,os;print(os.path.dirname(underworld3.__file__))")/discretisation. Make each mutant with sed -i on $SP/remesh.py, delete $SP/__pycache__/remesh*, and restore afterwards with git show add5ea77:src/underworld3/discretisation/remesh.py > $SP/remesh.py.

  • S1, the branch at np 2, 4, 8: timeout 600 mpirun -n N python -m pytest --with-mpi -v tests/parallel/test_0766_mover_refreshes_mesh_vector_parallel.py. Expect 2 passed at each np. Then run CI's batch 2 together at np 2 (the six files listed in Note 5) to check for interactions between files.
  • S2, M2 (rank-local decision) at np 2, 4, 8: sed -i 's/^ moved = uw\.mpi\.comm\.allreduce(not np\.array_equal(new_X, old_X), op=MPI\.LOR)$/ moved = not np.array_equal(new_X, old_X)/' $SP/remesh.py, then the S1 command. Expect test 2 to fail: an AssertionError on ranks 1 and up, with rank 0 stuck until the 120 s timeout. If test 2 passes at np 2, it cannot see its bug at the rank count CI runs. To see which ranks register a local move, run on the branch:
    import numpy as np, underworld3 as uw
    mesh = uw.meshing.Annulus(radiusOuter=1.0, radiusInner=0.5, cellSize=1/8, qdegree=3)
    T = uw.discretisation.MeshVariable("T", mesh, 1, degree=2)
    X0 = np.array(mesh.X.coords); X = X0.copy()
    if uw.mpi.rank == 0:
        rr = np.linalg.norm(X, axis=1); X[(rr > 0.6) & (rr < 0.9)] *= 1.01
    with mesh._coord_mutation():
        mesh._deform_mesh(X)
    print(uw.mpi.rank, "local move:", not np.array_equal(np.array(mesh.X.coords), X0), flush=True)
    Expected: True on rank 0 only. True on any other rank means that rank holds ghosts of vertices rank 0 owns, and M2 can pass there.
  • S3, M1 (no flag) at np 2: sed -i 's/^ mesh\._stale_lvec = True$/ pass/' $SP/remesh.py. Expect both parallel tests to fail at the _stale_lvec allgather.
  • S4, empty rank (Must fix 1, Mesh-move field transfer: remap_var_set can skip a collective on one rank, and ghosts are not synchronised #960 part 1), np 2 and 4:
    import numpy as np, underworld3 as uw
    mesh = uw.meshing.StructuredQuadBox(elementRes=(1, 2))
    T = uw.discretisation.MeshVariable("T", mesh, 1, degree=1)
    T.array[...] = 1.0
    c0, c1 = mesh.dm.getHeightStratum(0)
    uw.pprint("cells per rank", uw.mpi.comm.allgather(c1 - c0))
    X = np.array(mesh.X.coords); X[:, 1] *= 1.0 + 0.05 * X[:, 0]
    print(uw.mpi.rank, "deform returned", mesh.deform(X), flush=True)
    timeout 180 mpirun -n N python probe_empty_rank_deform.py. Expected on add5ea7: exit 124, with the populated ranks inside global_evaluate under remap_var_set (py-spy dump or the supervisor's stacks). Then apply sed -i 's/if target is None or target.size == 0:/if target is None:/' $SP/remesh.py and rerun. "deform returned True" on every rank shows that the one-line fix is enough.
  • S5, ghost disagreement (Mesh-move field transfer: remap_var_set can skip a collective on one rank, and ghosts are not synchronised #960 part 2), np 2, 4, 8, run once with REMESH_MONOTONE=clamp (the default) and once with REMESH_MONOTONE=off. Use the test_0766 fixture (annulus, tanh layer T, the same node_redistribution call), then:
    local = np.array(T.vec.array)
    iset, subdm = mesh.dm.createSubDM(T.field_id)
    g = subdm.createGlobalVector(); l = subdm.createLocalVector()
    subdm.localToGlobal(T.vec, g, addv=False); subdm.globalToLocal(g, l, addv=False)
    gap = float(np.abs(local - l.array).max()) if local.size else 0.0
    uw.pprint("max |ghost - owner|:", uw.mpi.comm.allreduce(gap, op=uw.MPI.MAX))
    A nonzero gap confirms part 2. Compare its size with T's change across the move (about 0.5) to judge whether gradient_evaluation.py and field_projection.py:582 see it.
  • S6, follow_metric (Should fix 2), np 2, 4, 8: add print(uw.mpi.rank, _state["moved"], flush=True) after api.py:778. Run uw.meshing.follow_metric(mesh, T, refinement=2.0, skip_threshold=None) on the test_0750 annulus fixture, with T a sharp front confined to one sector (for example tanh((atan2(y, x) - 0.2) / 0.02)), under timeout 300. A run where the printed flags differ across ranks, or that times out in _global_min, reproduces the finding.
  • S7, the proxy probe (Should fix 1) at np 2: the swarm probe from Should fix 1, under mpirun. Expect the same "PRE-move nodes ~1e-16" result.

Underworld development team with AI support from Claude Code

…mesh version, follow_metric agrees

- remap_var_set no longer skips global_evaluate on a rank with no DOFs.
- remesh_with_field_transfer bumps _mesh_version, so a swarm proxy follows every
  mover, not only Mesh.deform.
- follow_metric decides whether the mesh moved over all ranks.
- The tests are tier B and read values rather than the flag, and the non-moving
  rank fixture moves only vertices no other rank holds.

Underworld development team with AI support from Claude Code
Neither a sector front nor a local bump makes ranks disagree, so the change had no
test that fails without it, and an empty rank meets the mover's own early return
first. Recorded on #960.

Underworld development team with AI support from Claude Code
@lmoresi

lmoresi commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Second review's findings, all at 9fb2d91, with the server runs it asked for (Linux, MPI).

Must fix

  1. Empty rank: fixed by dropping or target.size == 0, with a 1 x 2 box test. S4 before the fix: exit 124 at np 2 and np 4 (cells per rank [0, 2] and [0, 0, 0, 2]). After: deform returned True on every rank.
  2. Both test files are now tier B.

Should fix

  1. Swarm proxy: fixed, with the version bump moved into the transaction and removed from deform. Serial test added; it fails without the bump (0.10). S7 at np 2 and np 4: 3.3e-16 against the moved nodes, 9.9e-2 and 9.7e-2 against the pre-move nodes.
  2. follow_metric: not fixed here. I tried it and took it back out. The test I wrote passed with the fix removed, and a local bump on a 4 x 1 box at np 4 moved every rank's nodes by at least 2e-3, so ranks never disagreed. An empty rank meets the mover's own early return first. With no test that can fail, it goes to Mesh-move field transfer: remap_var_set can skip a collective on one rank, and ghosts are not synchronised #960.

Notes

  • Note 1: uw.MPI used, and the docstring updated.
  • Note 2 is right, and it corrects my description: the error reaches the first solve after each move only. Description updated.
  • Note 3: the tests no longer read _stale_lvec, and all three parallel tests check values.
  • Note 4: the non-moving-rank fixture now moves only vertices no other rank holds, and asserts at least one exists.

Runs

Run Result
S1 branch, np 2, 4, 8 passed at each np (run before follow_metric came out; 3 passed at each after)
S1 CI batch 2 together, np 2 13 passed, 4 skipped
S2 decision per rank, non-moving-rank test hangs at np 2, 4, 8 (exit 124), so the test sees it
S3 no flag, np 2 fails: 1.895 against 1.768, and 1.772 against 1.770
S3 no flag, serial fails: 1.897 against 1.769
S4 see Must fix 1
S5 ghost gap, clamp, np 2, 4, 8 1.1e-3, 1.4e-3, 6.6e-2
S5 ghost gap, clamp off 0.0 at each np
S6 replaced by the follow_metric attempt above
S7 see Should fix 1

I ran S2 and the other mutants by editing the installed copies, and restored them from git afterwards.

Underworld development team with AI support from Claude Code

@lmoresi

lmoresi commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Adversarial review of #959 at 9fb2d91 (round 2)

We reviewed the two new commits, e3337ff and 9fb2d91, against add5ea7, and went back over each round-1 item. The branch was rebuilt in its own worktree; uw.__file__ resolves into that worktree's env, and the installed remesh.py and discretisation_mesh.py match 9fb2d91.

All runs are serial, on macOS. Mutants are edits to the installed remesh.py, restored after each run:

  • R1 removes mesh._stale_lvec = True (:441).
  • R2 removes mesh._mesh_version += 1 (:447).
  • R3 applies R1 and R2 together and restores the size-0 skip.
  • R4 restores the size-0 skip alone.

Where a row says "development", we installed development's own remesh.py and discretisation_mesh.py (eddab70).

Must fix

  1. (high) A snapshot taken before a mover move can no longer be restored. The bump at remesh.py:447 moves _mesh_version on every mover, and Mesh.apply_snapshot_payload (discretisation_mesh.py:5360-5367) refuses a restore whenever that version has moved. Development did not bump it on movers, and the restore worked. model.load_state, model.rewind() and TranscriptAdjoint._linearise_at (adjoint.py:647) all go through this check, so a run that moves its mesh with a mover loses rewind and the adjoint. Probe probe_snapshot_after_mover.py: annulus with cellSize 1/8, T a tanh layer, then save_state, the move, load_state.

    development  mover:  _mesh_version 0 -> 0; restore OK; coords back True; T back True
    development  deform: _mesh_version 0 -> 1; restore raised SnapshotInvalidatedError
    9fb2d913     mover:  _mesh_version 0 -> 1; restore raised SnapshotInvalidatedError: ... _mesh_version moved from 0 to 1 since snapshot
    9fb2d913     deform: _mesh_version 0 -> 1; restore raised SnapshotInvalidatedError
    

    The comment at :443-446 names exactly this hazard as its reason for not bumping inside _deform_mesh. Moving the bump into the transaction applies the same refusal to every mover.

    No test covers save, move and restore across a mover, so nothing failed. Fix: give the swarm side a counter that the snapshot check does not read. That means a dedicated counter, bumped next to the flag, read by:

    • the migration trigger (swarm.py:3632);
    • the proxy cache (swarm.py:3695);
    • the cell projectors (swarm.py:1487, swarm.py:3063, _function.pyx:944).

    The alternative is to move the snapshot check onto topology (Snapshot restore: split geometry vs topology mesh version (deform should not invalidate) #296). Add a test that runs save_state, node_redistribution, load_state and checks that coordinates and fields come back.

  2. (high) test_0057 (tier A) fails at add5ea7 and at 9fb2d91: in CI on Linux, and serially here. It passes with R1. CI shard 4 at add5ea7 (run 42173486825, job 127746587908) fails:

    FAILED tests/test_0057_deformed_domain_membership.py::test_membership_and_eval_track_bulged_surface - AssertionError: evaluate not monotone along the carried-T crest
    

    Serially, at 9fb2d91: Tev = [0.964 0.978 0.989 0.999 1.005 1.010 1.0115 1.0109 1.0079 1.0024], failing at :76. With R1 it gives 1 passed. T is REMAP by default. The test's comment ("T is carried Lagrangian-ly") and its monotonicity assertion held only because evaluate read the pre-move nodal values through the stale vector. With the remap, the nodes on the bulge carry the clamped extrapolation (about 1.0), and the P2 interpolant overshoots past the crest. The test is about point location, so set T.remesh_policy = "carry" there, which makes the carried values hold by design. The other route is to assert what a REMAP field should give. Adjudicate it in this PR.

  3. (high) test_1070's strong-constraint flux test (tier B) fails at add5ea7 and e3337ff in CI, and at 9fb2d91 here. It passes with R1. CI shard 1 failed with strong constraint leaks net volume flux 4.19e-03, the same at add5ea7 (run 42173486825) and e3337ff (job 127756729320). Development's shard 1 passed (run 42095953261). Serially, at 9fb2d91: 1.59e-3 at the tip and 8.73e-4 with R1, against a bound of 1e-3 (:303). The PR does not change what the constraint does. Probe probe_1070_leak_timing.py measures net/gross flux on test_1070's fixture right after the consistent solve, before _carry_and_deform, and again after it:

    step after the consistent solve, 9fb2d91 after the consistent solve, R1 after deform, 9fb2d91 after deform, R1
    0 3.09e-14 3.09e-14 1.21e-2 4.70e-3
    1 5.88e-5 5.88e-5 1.60e-3 3.41e-3
    2 9.52e-5 9.52e-5 1.56e-3 1.54e-3
    3 1.28e-4 1.28e-4 1.59e-3 8.73e-4

    The constraint's flux is identical with and without the flag. The test measures after advance has deformed the mesh, so it reads the velocity transported onto the moved surface. That number exceeds 1e-3 at several steps under either build; the test passed only because step 3 under the stale vector came in at 8.7e-4. Measure the contract before the deform, on the geometry the consistent solve ran on.

Should fix

  1. (medium) The no-cells test's value check cannot fail, because T is constant. In tests/parallel/test_0766_mover_refreshes_mesh_vector_parallel.py:73, T = 1 survives any remap exactly, so the integral matches with or without the flag. Probe probe_test3_body.py runs the test's body serially:
    9fb2d913  const:  rel 0.00e+00   linear (T = x + 2y): rel 0.00e+00
    R1        const:  rel 0.00e+00   linear (T = x + 2y): rel 1.97e-03
    
    Make T linear. Also assert the premise that some rank owns no cells, as test_0774 does. The docstring only says "at np 2 the partition can do the same", and CI runs np 2.

Notes

  1. Round-1 items:

    • Must fix 1 (empty rank): resolved. The skip is gone (remesh.py:521-523). On a populated rank target.size > 0, so the code path is unchanged. The empty rank now enters global_evaluate with no points: it contributes nothing to the migrate, and its clamp returns early (functions_unit_system.py:712). It cannot win the best-claim for an extrapolated point, because an empty kd-tree returns infinite distance (probe: KDTree(zeros((0,2))).query(...) -> [inf inf]). That hang-before, completes-after result is the author's server run (S4); we did not run MPI.
    • Must fix 2 (tiers): resolved. Both files are tier_b, and check_test_coverage.py reports "OK: all 391 test files are reachable".
    • Should fix 1 (proxy): resolved for proxies, at the cost of Must fix 1 above. Round 1's probe at 9fb2d91: _mesh_version 0 -> 1. The proxy against the moved nodes is 8.9e-17 without a rewrite of the swarm variable and 1.8e-16 after one. The new serial test fails under R2 (0.10384352608312963 < 1e-06).
    • Should fix 2 (follow_metric): moved to Mesh-move field transfer: remap_var_set can skip a collective on one rank, and ghosts are not synchronised #960 part 3. It is unreproduced, and on an empty rank the mover's own rank-local return (mmpde.py:259, TODO(BUG)) comes first. We accept that move. The PR body should say it leaves Mesh-move field transfer: remap_var_set can skip a collective on one rank, and ghosts are not synchronised #960 open: the except Exception: continue at remesh.py:535, the ghost gap, and follow_metric.
    • Round-1 Notes 1-4: resolved (uw.MPI.LOR, the docstring, value checks in place of _stale_lvec, a fixture with unshared vertices). Test 2 states that the other ranks' coordinates are "bitwise unchanged" but does not assert it. An np.array_equal on ranks other than 0 after the deform would pin that premise.
  2. The version bump is rank-symmetric. It comes after the allreduce at :384 and runs once per outer transaction: nested calls return before it, and deform no longer bumps on its own, so deform still bumps exactly once. It invalidates:

    • swarm migration at the next update_lvec;
    • the proxy cache and the cell projectors;
    • per-variable kd-trees (discretisation_mesh_variables.py:910);
    • the domain kd-tree (discretisation_mesh.py:7089, a collective gather);
    • the owned-cell mask (:6050) and the location-capability cache (:6951);
    • the snapshot check (Must fix 1).

    None of these is the JIT or solver setup. _deform_mesh resets is_setup on every call regardless of the version. All but the snapshot check were stale after a mover on development, so the bump corrects them.

  3. Serial mutants on the new tests: test_0766 gives 2 passed at the tip. R1 fails the remap test (1.8965371888173845 == 1.7687890219164744 ± 1.8e-12). R2 fails the proxy test (0.104). R3 fails both. The R4 mutant (the size-0 skip) can only show in parallel.

  4. Corrections to round 1:

  5. CI at the time of review: e3337ff shard 1 failed with test_1070, and its shards 3 and 4 were still running. 9fb2d91 was running. The PR comment does not mention either test failure.

Issue verdicts

Not checked, and what the Linux server should run

Use a build of 9fb2d91 with OMP_NUM_THREADS=1, and build mutants by sed on the installed remesh.py as in round 1.

  • S8, the populated ranks' result with an empty rank present. Use test 3's fixture (the 1x2 StructuredQuadBox), with T.array[:, 0, 0] = x + 2y from T.coords and the same deform. Run at np 2 and 4. Print the cells per rank and the integral. The serial value at 9fb2d91 is 1.538636668773204. Gather (coords, T) from the populated ranks and compare with a serial run by coordinate: max |ΔT| at or below 1e-12 shows that the empty rank's participation changes nothing.
  • S9, Must fix 1 in parallel after the fix: save, node_redistribution, load at np 2. Coordinates and T come back bitwise on every rank.
  • S10, Must fixes 2 and 3 after the test changes: CI covers these on Linux. Check that test_1070's revised measurement stays below 1e-3 at np 1 on the Linux runner, where the post-deform figure was 4.19e-3.
  • S11, from Mesh-move field transfer: remap_var_set can skip a collective on one rank, and ghosts are not synchronised #960 part 2: whether the clamped owner value is itself partition-dependent. Take T's owned values after the test_0766 move at np 1, 2, 4 and 8, keyed by DOF coordinate (rounded to 12 digits), and report the max difference against np 1, with the clamp on and off.
  • Author's results we did not re-run (accepted as their runs on the server): the parallel file at np 2, 4 and 8 (3 passed each); the per-rank-decision mutant hanging at np 2, 4 and 8; R1 failing at np 2.

Underworld development team with AI support from Claude Code

…on; tests that read the stale value

- The _mesh_version bump comes back out: it made every mover invalidate snapshots.
  The swarm proxy problem it addressed goes to its own issue. A save, move, restore
  test holds the line.
- test_0057 carries T, because it is about point location and asserted a property
  only the stale vector gave a remapped field.
- test_1070 measures the constraint's flux on the geometry its solve ran on.
- The no-cells parallel test uses a linear T and asserts a rank has no cells.

Underworld development team with AI support from Claude Code
@lmoresi

lmoresi commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Round 2 answered at a41f225.

Must fix

  1. Snapshot restore: the _mesh_version bump is out, and discretisation_mesh.py matches development again. I did not add a dedicated counter here, because that is a design change for its own PR: A swarm proxy stays at the pre-move nodes after a mover: only Mesh.deform bumps _mesh_version #966, with your measurements. New test: save, move, restore. S9 at np 2: coordinates and T back bitwise on both ranks.
  2. test_0057: T is carry, as you suggested.
  3. test_1070: measures just before _carry_and_deform through a small helper, since the velocity is only set inside advance. Strong constraint 1.27e-4.

Should fix: the no-cells test uses a linear T and asserts a rank has no cells. With the flag removed, all three parallel tests fail at np 2.

Also: the non-moving-rank test now asserts the other ranks' coordinates are unchanged. The description says this leaves #960 open. #296 is still live, as you say, and #966 points at it.

Runs

Run Result
S8 empty rank integral 1.538636668773205 at np 1, 2, 4 (cells [2], [0, 2], [0, 0, 0, 2]); max dT against serial 0.0
S9 see Must fix 1
S10 test_1070 strong constraint on Linux, serial: 1.27e-4. CI to confirm
S11 running, will post on #960
Parallel file 3 passed at np 2, 4, 8
Every test file that moves a mesh (29) 262 passed, 4 skipped, and 2 fixture errors from a bug in my test_1070 edit, now fixed and passing

My own miss to note: my earlier "mover and free-surface suites" run didn't include test_0057 or those test_1070 tests, which is why CI found them first.

Underworld development team with AI support from Claude Code

@lmoresi

lmoresi commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Adversarial review of #959 at a41f225 (round 3)

We reviewed a41f225 against 9fb2d91 and checked each round-2 item. The branch was rebuilt in its own worktree. uw.__file__ resolves into that worktree's env, and the installed remesh.py and discretisation_mesh.py match a41f225. Against development (eddab70), git diff --stat -- src/ shows only remesh.py.

All runs are serial, on macOS. Mutants are edits to the installed remesh.py, restored after each run:

  • R1 removes mesh._stale_lvec = True.
  • R5 adds back round 2's mesh._mesh_version += 1 after the flag.

Must fix

None.

Should fix

  1. (medium) test_1070's datum-error test still measures after the deform, and its bound is far looser than what the constraint delivers. test_freesurface_strong_constraint_tracks_the_prescribed_rate reads errors["strong"] from the same fixture. That fixture still computes it after the last advance (tests/test_1070_free_surface_plume.py:296-302), so it reads the velocity transported onto the moved surface. Probe probe_1070_datum_point.py measures the same quantity just before each deform:

    a41f2250  before each deform: 1.07e-15  8.83e-16  8.39e-16  1.06e-15   after the last advance (as the test measures): 1.74e-02
    R1        before each deform: 1.07e-15  8.83e-16  8.39e-16  1.06e-15   after the last advance (as the test measures): 1.11e-02
    

    On the geometry its solve ran on, the strong constraint meets the datum to round-off. The test's 5e-2 bound only covers the post-deform transport, so it would let the constraint degrade by thirteen orders of magnitude before failing (Charter §8).

    The docstring's recorded numbers (1.06e-2 on macOS, 1.73e-2 on Linux, measured 2026-09-14) were taken through the stale vector. This PR moves the macOS figure to 1.74e-2. Record this error in _record_flux_before_each_deform next to the flux reading. Then tighten the bound to something like 1e-10 and update the docstring.

Notes

  1. Round-2 items:

    • Must fix 1 (snapshot): resolved. The bump is gone, and deform bumps once again, as on development. Probe probe_snapshot_after_mover.py (a mover move, then save_state and load_state): mover: _mesh_version 0 -> 0; restore OK; coords back True; T back True. The new serial test test_a_snapshot_taken_before_a_move_restores_after_it passes at a41f225 and fails under R5 (SnapshotInvalidatedError: ... _mesh_version moved from 0 to 1).

    • Must fix 2 (test_0057): resolved. T.remesh_policy = "carry". It passes at a41f225 and under R1, so it no longer depends on the flag.

    • Must fix 3 (test_1070 flux): resolved. The test now measures just before each deform; the strong constraint reads 1.28e-4 at a41f225 and under R1. The measurement can still fail. Probe probe_1070_new_point_can_fail.py uses the same helper and point for three cases:

      case net/gross flux before each deform
      strong 3.09e-14, 5.88e-5, 9.52e-5, 1.28e-4
      penalty 5.70e-8, 9.79e-3, 1.57e-2, 2.69e-2
      strong, with the directed-mean datum correction disabled 2.83e-17, 1.08e-7, 5.21e-7, 1.28e-6

      A leak the size of the weak constraint's is 27 times over the bound. Disabling the directed-mean correction does not raise the flux, so that correction is not what this measurement guards.

    • Should fix 1 (no-cells test): resolved. T is now x + 2y, written on every rank before a collective update_lvec(). The test asserts 0 in allgather(cells per rank). Its serial body gives a relative difference of 1.97e-3 under R1 (round-2 probe). The author's S8: integral 1.538636668773205 at np 1, 2 and 4, max dT against serial 0.0. Our serial run gives 1.538636668773204.

    • Round-2 note on test 2's premise: resolved. The other ranks now assert that their coordinates are bitwise unchanged.

  2. Dropping the bump leaves one coordinate-dependent cache stale after a mover. It reaches evaluate and the remap itself. This is development's behaviour, and A swarm proxy stays at the pre-move nodes after a mover: only Mesh.deform bumps _mesh_version #966 names the cache "from reading only". These are measurements for A swarm proxy stays at the pre-move nodes after a mover: only Mesh.deform bumps _mesh_version #966, not a finding against this branch.

    • Per-variable kd-tree (discretisation_mesh_variables.py:910, keyed on _mesh_version). Probe probe_var_kdtree_after_mover.py brings two meshes to identical node positions, one through node_redistribution and one through mesh.deform. T.rbf_interpolate at the current nodes is off by up to 0.203 after the mover and 3.9e-12 after the deform. evaluate at exterior points (r = 1.01) differs between the two routes: 4.64e-2 against 4.82e-2, which is inside that path's own error here.
    • The remap on the second mover move. Probe probe_second_move_remap.py runs two successive node_redistribution calls, with and without a manual bump between them. T differs by up to 1.73e-3 at 86 of 890 DOFs. In serial, the only _mesh_version-keyed cache the remap reads is this kd-tree, through the RBF rung for points outside the old mesh. So solves after the second mover move see a remap whose boundary-adjacent values carry this error.
    • Other readers of the per-variable kd-tree: _function.pyx:1647 (the unlocated fallback) and :1816 (rbf_evaluate, which the parallel best-claim also uses); integration-point variables (discretisation_mesh_variables.py:4202); the IndexSwarmVariable level-set update (swarm.py:3126); adaptivity.py:903.
    • The owned-cell mask (discretisation_mesh.py:6050) depends only on the point SF, so node motion cannot make it stale.
    • The location-capability cache (:6951) is keyed with _topology_version, which _deform_mesh bumps on every call, so it is fresh after a mover.
    • The domain kd-tree (:7089) holds per-rank centroids that swarm.py:3765 and :4341 use for routing. It matters only in parallel; not measured.

    A fix that does not touch the snapshot check: key the per-variable kd-tree on _geometry_version, which nuke_coords_and_rebuild bumps on every coordinate change.

  3. A failing premise assert in test 2 would hang rather than fail. The bitwise check in tests/parallel/test_0766_mover_refreshes_mesh_vector_parallel.py runs on ranks other than 0 only, before the collective Integral. If it fails on one rank, that rank leaves the test while rank 0 enters the integral, and the failure shows as a hang until the 120 s timeout. assert all(uw.mpi.comm.allgather(...)) keeps it symmetric.

  4. The tests can fail. Under R1 the serial test_0766 remap test fails (1.8965371888173845 == 1.7687890219164744 ± 1.8e-12). The author reports that all three parallel tests fail at np 2 under R1. test_0057 and test_1070 pass under R1, so neither depends on the flag any more. Tiers: both test_0766 files are tier_b and test_0057 stays tier_a. check_test_coverage.py: "OK: all 391 test files are reachable". Serial run at a41f225 (test_0766 ×2, test_0057, the three test_1070 contract tests): 6 passed.

  5. CI. At e3337ff, shard 1 failed test_1070 and shard 4 failed test_0057; both are addressed here. Shard 4 also hit the intermittent test_1064 hang ("every rank is in _solve_rotated_iterative()"), the same failure as development's run 42095953261. The parallel file passed in that run: 13 passed in its batch, and the no-cells test passed at np 2. A "Mean of empty slice" warning from the empty rank's centroids (discretisation_mesh.py:5836) is harmless. The a41f225 run was still in progress at the time of review.

Issue verdicts

Not checked, and what the Linux server should run

  • S13: test_1070's revised contract tests on the Linux runner. CI covers this; read the flux and the datum error from the a41f225 shard 1 log once it finishes.
  • S14, the domain kd-tree after a mover, at np 4. Populate a swarm on the annulus, run node_redistribution, then swarm.migrate(). Compare every rank's particle ownership with the same final coordinates reached through mesh.deform. A difference means the stale centroids misroute particles; add it to A swarm proxy stays at the pre-move nodes after a mover: only Mesh.deform bumps _mesh_version #966.
  • S15, the second-move remap at np 2 and 4. Run probe_second_move_remap.py under mpirun: two node_redistribution calls, with and without a bump between them. Report max |ΔT| over ranks. In parallel the best-claim path also reads the stale kd-tree.

Underworld development team with AI support from Claude Code

@lmoresi

lmoresi commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

CI at a41f225: shards 1, 2 and 3 pass. Shard 4 fails because test_1064_rotated_freeslip_parallel is killed mid-file (signal 15). That file is outside this PR's change, and it is the hang the review predicted from development's own run at eddab70 (42095953261). No test in the log reports a failure.

Underworld development team with AI support from Claude Code

lmoresi pushed a commit that referenced this pull request Nov 6, 2026
Underworld development team with AI support from Claude Code
There the strong constraint meets the datum to round-off, so the bound can be 1e-10.
Read after the deform, 1.7e-2 was the velocity remapped onto the moved surface.

Underworld development team with AI support from Claude Code
@lmoresi

lmoresi commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Round 3's should-fix is done at 98c0ab8. test_1070 records the datum error just before each deform, next to the flux, and the bound is now 1e-10. On Linux, serial: strong 1.06e-15, penalty 1.87e-2. The docstring is updated. Only that test file changed since a41f225.

Underworld development team with AI support from Claude Code

Underworld development team with AI support from Claude Code
lmoresi pushed a commit that referenced this pull request Nov 7, 2026
Underworld development team with AI support from Claude Code
@lmoresi

lmoresi commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Wider than an empty rank: a rank whose nodes don't move also hangs. mesh.deform at np 3 with cells [1, 8, 7], where rank 0's nodes stay put, hangs on eddab70 and on the #909 branch alike (exit 124). Ranks 1 and 2 wait in nuke_coords_and_rebuild while rank 0 has gone on, because the move decision in remesh_with_field_transfer is rank-local (p10_sup).

Also on both builds: an empty rank at np 3 gives exit 142, scalar and MATRIX (p03_deform_empty.py). The first read after a deform sees stale values: |evaluate - .data| = 0.148 at np 1 (p29, case s).

From the third review of the #909 branch; probes on hyperion in runs/2026-11-06/review909r3/probes/.

Underworld development team with AI support from Claude Code

@lmoresi

lmoresi commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

np 3 checked, passes, at 7bfda64. This answers the review of #909, which found a rank whose nodes don't move hanging at np 3 on development.

Probe: an annulus with cell size 1/8 and a P2 T. Only one rank moves, and only vertices no other rank holds, by 0.1 %. The other ranks' coordinates are bitwise unchanged. Natural partition, cells per rank 135 / 141 / 130.

Only this rank moves This head Development-equivalent remesh.py (eddab70)
rank 0 completes on all ranks; integral 1.7705015 not run
rank 1 completes; integral 1.7702748 hangs, killed at the 60 s timeout
rank 2 completes; integral 1.7703418 not run

tests/parallel/test_0766_mover_refreshes_mesh_vector_parallel.py at np 3: 3 passed.

I did not override the partitioner, so a "forced partition" in the strict sense was not run. Each rank was forced to be the only mover instead.

Underworld development team with AI support from Claude Code

lmoresi added a commit that referenced this pull request Nov 10, 2026
…apshot restorable

H1's review of bundle A, round 2. d22d225 moved the _mesh_version bump
from mesh.deform into remesh_with_field_transfer so that movers would kill
the FAC patch. Snapshot restore refuses a moved _mesh_version, so a
snapshot taken before smoothing or an MMPDE step became unrestorable,
which development allows (the case #966 records for #959).

_mesh_version is back to development's meaning. A new Mesh._move_version
counts committed moves: remesh_with_field_transfer bumps it (mesh.deform
and every mover), and snapshot restore bumps it when it moved the nodes.
_deform_mesh does not, so the trial moves inside ephemeral_coords do not
count. The kill keys on it (solver._fac_patch_move_version). This is the
dedicated counter #966 proposes; only the patch reads it here.

New test: a snapshot taken before a mover restores (fails if the helper
bumps _mesh_version). Serial: 1057 passed over the bundle files, every
mover and deform test, and every snapshot test.

Underworld development team with AI support from Claude Code
lmoresi added a commit that referenced this pull request Nov 10, 2026
The previous commit set T on the deformed mesh. #959 (open, H2), which has
the same stale-vector fix, makes the test carry T instead
(remesh_policy="carry"), so the field along the crest is known; this takes
its hunk verbatim, so the two branches agree on the file.

Underworld development team with AI support from Claude Code
@lmoresi

lmoresi commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

Empty rank at np 3 passes at 7bfda64. p03_deform_empty.py (cells [8, 8, 0], a bubble mesh.deform) completes with exit 0 for both the scalar and the MATRIX variable. On development (eddab70) this case gave exit 142. Together with the non-moving-rank probe above, the np 3 hang is fixed on this branch.

The stale-mesh-vector line will also arrive with #1036 (the hub's call). Once #1036 merges I'll merge development in here and drop the duplicate.

Underworld development team with AI support from Claude Code

lmoresi added a commit that referenced this pull request Nov 10, 2026
H1's review of e57ad72.

- Merge condition: test_1152's bounds equalled the solve tolerance, so
  kept and fresh differed by convergence noise alone (1.46e-6 velocity,
  1.19e-5 slip at np 2). It now solves at 1e-8 and bounds velocity at
  100x and pressure and slip at 1000x the tolerance; hyperion measured
  kept against fresh at ~4e-9 there, and a stale patch costs only
  iterations, which the iteration guard catches.
- L2: test_1149 tests _topology_signature itself (the same after a move
  and a new field, different on other cells); a constant signature fails.
- L3: after a move on a split level the zone patch's gate verdict is None
  (the structural rows are dropped, not found again and declined); keeping
  them fails.
- M1: the stale mark's comment said every rank reaches it; only a rank that
  moved does (#960). #959's all-rank move decision carries the same mark
  and replaces this one at its merge.

Serial: test_1149 and test_1152, 15 passed; test_1151, 2 passed.

Underworld development team with AI support from Claude Code
@lmoresi
lmoresi merged commit 526edb9 into development Nov 10, 2026
10 checks passed
lmoresi added a commit that referenced this pull request Nov 10, 2026
#959 carries the same stale-mesh-vector mark, after an all-rank move
decision; its copy is kept and this branch's is dropped, which also makes the
_move_version bump collective (H1's M1). test_a_mover_leaves_a_snapshot_
restorable is dropped as a duplicate of #959's test_0766 snapshot test.
test_1151 stays: it covers mesh.deform and a Stokes assembly against a solver
built after the move, which test_0766 (a mover, read through an integral)
does not.

Underworld development team with AI support from Claude Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants