Skip to content

MMPDE node redistribution: empty ranks (#1082) and partition seams (#1086) - #1106

Merged
lmoresi merged 10 commits into
developmentfrom
bugfix/mmpde-seam-1086-on-dev
Nov 12, 2026
Merged

lmoresi merged 10 commits into
developmentfrom
bugfix/mmpde-seam-1086-on-dev

Conversation

@lmoresi

@lmoresi lmoresi commented Nov 12, 2026

Copy link
Copy Markdown
Member

Fixes #1086 and #1082. H1 has reviewed this branch at c3e5260; round 2 (below) answers that review, and H1 re-checks only what changed.

What and why

#1082, empty ranks. Every step of the MMPDE mover is collective, and a rank holding no cells used to leave early. The fixes:

  • _mmpde_mover no longer returns early on a rank with no cells.
  • redistribute_nodes uses the rank-agreed self.isSimplex. The DM's own isSimplex() is False on an empty rank.
  • boundary_slip decides which slip labels are usable on all ranks together, and every rank makes the collective normal projection.
  • The frozen copy of a MeshVariable metric is filled through global_evaluate, not a rank-local evaluate.
  • The stop test's h0 is an owner-weighted mean. Before, an empty rank contributed 1.0.

#1086, seams. A seam vertex sees only its own rank's cells. Two per-vertex quantities in the redistribution are now combined over every rank holding the vertex, through a point-SF reduce and broadcast (graph._reduce_over_sharing_ranks):

  • the step cap, with MIN;
  • the boundary-label masks, with OR.

Not fixed here: facet-surface slip in general (#1103). That is slip on boundaries with no registered analytic surface. Only the empty-rank layout is fixed. On partitions where several ranks hold cells it is still 3e-2 to 5e-2 off serial. A rank can also own slip vertices of a label without any of its facets; its restore then raises alone and the job hangs. #1103 stays open.

#1093: the frozen fill above goes through global_evaluate, which is partition-dependent at seams until #1093 is fixed. So the default frozen metric is not yet rank-independent there. The tests use metric_eval="sympy".

Tests

tests/test_1082_mmpde_mover_empty_rank_matches_serial.py:

  • six routes (the mover, redistribute_nodes, node_redistribution, relax, a frozen MeshVariable metric, facet slip), each with empty ranks against serial, to 1e-12;
  • 6 passed.

tests/test_1086_mmpde_seam_matches_serial.py, each case against serial, vertex by vertex:

  • boxes in 2D and 3D, pinned and slipping:
    • the slip cases at np 2, 3 and 4;
    • a random scatter of the cells at np 3 and 4;
    • to 1e-10;
  • H1's cavity annulus, pinned, at np 2–5, to 1e-6 (measured 3e-8 to 7e-8; this is rounding);
  • the cavity annulus with slipping walls, at np 2–5, bounded at 2e-5.
    • Measured 1.0e-6 to 7.7e-6. This is not rounding: serial runs whose metric amplitude differs by 1e-14 differ by only 1.2e-7 to 1.4e-7.
    • So a small partition dependence remains in the slip path, unexplained. It is 1000× below the seam effects fixed here.
  • 20 passed with test_1082, in 431 s.

tests/parallel/test_1086_boundary_slip_classification_parallel.py:

  • boundary_slip on boxes, natural and randomly scattered partitions, checked against the classification known from coordinates;
  • 6 passed at np 1–4, also with the parallel test_1082;
  • it catches the mask reduction done with AND (2 of 6 fail at np 2–4) and with no reduction (4 of 6 fail).

check_test_coverage: OK. Development (01b06c9) is merged in.

Checklist

  • Style Charter followed (S2)
  • No drive-by changes (S9)
  • Regression tests, with level_* / tier_* markers (S8)
  • No hedging names or commented-out code (S3, S4)
  • No exception swallows
  • Data access through mesh.X.coords (S7)
  • Parallel: np 2–5 and scattered partitions (S11)
  • No dependency changes
  • AI attribution below

Underworld development team with AI support from Claude Code

🤖 Generated with Claude Code

_mmpde_mover returned [] on a rank whose cell list was None while the
other ranks went on into collective reductions, so a partition with an
empty rank aborted the job (UnstructuredSimplexBox(cellSize=1) at np 4:
cells per rank [2, 0, 2, 0], "Message truncated"). The cell list is None
for two reasons, now told apart and decided collectively: a rank with no
cells takes part with an empty cell array, and if any rank's cells are not
all simplices every rank returns [] together.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1082)

The defect was already filed as #1082; references move there from the
duplicate #1085.

H2's point: a collective return on every rank would avoid the abort but
skip the move. The fix has empty ranks take part with zero contributions,
and the tests now show the mesh moves. The metric is off the four-cell
box's centre, so its interior vertex moves (0.031), and the parallel test
asserts it. A new serial test runs the mover serially and at np 4
([2, 0, 2, 0]) in subprocesses and requires the same energies and final
coordinates. It fails against both the old rank-local return and a
one-line collective return.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…facet slip

H1's review of 6190ed3. The mover itself was right; the routes into it,
and two effects inside it, were not.

F1: Mesh.redistribute_nodes (behind node_redistribution and Mesh.relax)
asked the DM, rank by rank, whether the mesh is simplicial. A rank with no
cells answered no and raised while the others waited in the mover. It
now uses self.isSimplex, which the constructor agrees across ranks.

F2: with a MeshVariable metric and metric_eval="frozen", Mesh() can
repartition the frozen copy, and its field was filled by a rank-local
evaluate on ranks whose nodes lie elsewhere: energies 1e3-1e4 too large.
It is filled with global_evaluate in parallel.

F3: the stop test's h0 was a mean of per-rank means, to which an empty
rank contributed 1.0. It is the mean over every owned edge.

F4 (pre-existing): Mesh.boundary_slip returned early on a rank with no
slip vertices, and skipped labels it held no vertices of, so a facet
surface's collective normal projection hung. Usable labels are agreed
across ranks, and every rank calls normals() for every one of them.

The serial-match test now runs six cases through the public entry points
(redistribute_nodes, node_redistribution, relax, a frozen MeshVariable
metric, facet slip) and the direct mover, with every cell on rank 0 or the
box's natural [2, 0, 2, 0]. Each must give the serial coordinates to
1e-12. Reverting any one of F1-F4, or the mover's own return, fails it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…em (#1086)

A volume mesh is distributed without overlap, so a vertex on a partition
seam sees only its own rank's cells. Two per-vertex quantities on the
MMPDE redistribution path were read from those cells alone:

- the step cap, from the shortest incident edge: a seam vertex missed
  edges, took a longer first step, and the mesh drifted from serial by
  3e-3 on a 42-cell box (1.3e-2 measured by H1);
- which boundaries a vertex lies on, in Mesh.boundary_slip: a box corner
  whose two edges are on different ranks counted one boundary on each,
  was classed as a slip vertex, and slid off the domain (by up to 0.37).

graph._reduce_over_sharing_ranks combines a per-vertex value over every
rank holding the vertex through the point SF (each owner reduces its
leaves' values, then broadcasts the result). The cap takes the MIN, and
boundary_slip's boundary and per-label masks take the OR; the rank's own
masks still pick its reference facets. 2D and 3D boxes, pinned and
slipping, now match serial to 4e-12 at np 2, 3 and 4, and no corner moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A refinement-2 annulus moved by node_redistribution towards a dipping
fault trace (metric amplitude 20), as in H1's cavity case. With the metric
read exactly, np 2-5 match serial within 7e-8 (rounding accumulated over
the full redistribution); without the fix they were 7e-3 to 2.4e-2 off.
The default frozen metric read goes through global_evaluate, which is
partition-dependent at seams on its own (#1093), so this case reads the
metric exactly until that is fixed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… widen the seam tests

- The comment on the facet-surface decision claimed a rank without a label's
  facets holds none of its vertices. H1 measured that false. The comment now
  says what holds: the empty-rank layout is fixed, while facet slip in
  general is partition-dependent and can fail on one rank (#1103, its own
  issue).
- test_1086: the box slip cases at np 2, 3 and 4; a random scatter of the
  cells at np 3 and 4; the cavity annulus with slipping walls at np 2-5,
  bounded at a measured 2e-5 (1e-6 to 7.7e-6 measured; not rounding, which
  gives 1.2e-7 to 1.4e-7: a small partition dependence in the slip path
  remains, unexplained).
- test_1086_boundary_slip_classification_parallel: boundary_slip on boxes,
  natural and scattered partitions, checked from coordinates. It catches AND
  for OR in the mask reduction (2 of 6 fail at np 2-4) and no reduction
  (4 of 6 fail); serially, and in the parallel batches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 09:59

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 12, 2026

Copy link
Copy Markdown
Member Author

This review record was written for c3e5260, the branch head before this PR was opened. The PR is now at bc9d67c; a re-check of the changes since then will follow.

Review: bugfix/mmpde-seam-1086-on-dev at c3e5260 (#1086, carrying #1082)

NOT READY at c3e5260.

The seam fix works:

  • the point-SF MIN on the step cap, and the mask reduction in boundary_slip;
  • boxes match serial to about 1e-11 at np 2, 3, 4 and 5;
  • the cavity annulus matches serial to rounding, and I measured that it is rounding.

But #1082's F4 ("facet slip") is not fixed. Facet-surface slip still:

  • dies at the natural np 5 partition of a 42-cell box: a rank-local ValueError on two ranks, then a hang until the supervisor kills it;
  • dies on a scattered np 4 partition in the same way;
  • differs from serial by 4.9e-2 whenever more than one rank holds cells.

The code comment added for F4 states an invariant that is measured false.

Reviewer: H1 worker, for H1. Requested by H5 (mail/H1/2026-11-12-H5-1086-1082-recheck.md). Everything below was measured unless marked [read].

Method

Builds.

  • Branch: wt-1086 at c3e5260, built here (BUILD EXIT 0). The installed mmpde.py, graph.py and discretisation_mesh.py are byte-identical to the worktree.
  • Base: wt-devf8c at f8c6014, the existing build.

Tests.

  • Taken from git archive (c3e5260 into br/, f8c6014 into base/).
  • Run with PYTHONDONTWRITEBYTECODE=1 and -p no:cacheprovider, plus --with-mpi for parallel runs.
  • MPI ran under scripts/mpi_supervisor.py.
  • Runners: run_t.sh (tests), run_p.sh (probes), regress.sh.
  • At most 4 cores at a time; np 5 only ran alone.

Probes.

  • p86.py runs redistribution on:
    • a 2D box, pinned or with slip;
    • facet slip (the registered plane surfaces removed);
    • corners at cs 1.0 and 0.5;
    • 3D boxes, pinned and with slip;
    • H1's cavity annulus, pinned (as in test_1086), with slip, and with the default frozen metric.
  • It records coordinates at every outer iteration, taken from each boundary_slip call. --layout forces a SHELL partition: every cell on rank 0, an x-split, or a seeded random scatter.
  • cmp86.py compares runs vertex by vertex, matched by starting position.
  • p_sf.py checks the SF directly. On every local vertex, owned and ghost, it compares the reduced value against a ghost-complete one from allgathered cells. It does the same for the reduced masks against masks built from every rank's labelled facets.

Mutants.

  • Injected by mut/sitecustomize.py through UW_MUTANT. No worktree was edited.
  • They reach test_1082's and test_1086's subprocess workers through PYTHONPATH; the probe logs confirm the injection line.
  • Modes:
    • nomin: the local cap;
    • and: BOR becomes BAND;
    • noempty: d70df7c reverted;
    • nomask: no mask reduction, added to tell AND apart from no reduction;
    • noise: a control, not a mutant. It applies one-ulp random relative noise to every _global_sum, in serial.

Logs and JSON are in logs/.

Check 1: are the new collectives reached by every rank, and is it the right SF?

  • Reached by every rank [read, then measured].
    • The MIN call is unconditional, once per outer iteration (mmpde.py:658).
    • shared_mask runs for is_bnd and for each label in slip_labels, which is rank-uniform. Both calls come before any rank-dependent branch.
    • Measured with no hang:
      • an empty rank in every layout tried: [42, 0, 0], [22, 0, 20, 0], [2, 0, 2, 0], [0, 2, 2], [0, 0, 0, 0, 4], and [4, 3, 4, 3, 0];
      • ranks with no slip vertices, at np 5 box slip.
  • It is the right SF. p_sf.py at np 3 and 4 measured, on every local vertex including ghosts:
Mesh Reduced cap against the ghost-complete cap Rank-local cap against it (the bug)
fresh box2d (cs 0.1) 1.4e-17 1.4e-2
fresh annulus 1.4e-17 2.6e-2
fresh box3d 5.6e-17 1.8e-3
annulus adapt(max_levels=1) child, np 3 1.4e-17 2.6e-2
box written at np 1 and reloaded at np 3 1.4e-17 1.4e-2
annulus written at np 3 and reloaded at np 4 1.4e-17 2.3e-2
  • Masks. The reduced masks match the global masks everywhere: 0 mismatches.
    • The local masks are almost always complete already. The only mismatch found was 1 vertex on box3d at np 3, rank 1, which was a ghost.
    • So the mask reduction changes a result only through the corner count. See F3 below.
  • Not tested: box adapt (the probe's box has no refinement hierarchy), and a re-distribution of a live mesh.
  • Latent [read]:
    • the serial shortcut tests uw.mpi.size, not the DM's communicator;
    • unlike _owned_vertex_mask, there is no guard for a point SF whose graph was never set.

Check 2: rank independence against serial (metric_eval="sympy")

Each entry is the largest |x_np − x_serial| at the end of the run.

Case np 2 np 3 np 4 np 5 dev f8c6014, np 2
box2d, pinned, cs 0.25 3.8e-12 1.7e-12 1.6e-12 9.1e-13 3.1e-3
box2d, plane slip 1.9e-12 1.0e-12 8.0e-13 1.9e-12 3.1e-3
box2d, corners, cs 1.0, slip 0 0 [0, 2, 2] 0 [2, 0, 2, 0] 0 [0, 0, 0, 0, 4] 0.226, 2 vertices outside the box
box2d, corners, cs 0.5, slip 1.6e-11 5.7e-12 8.9e-12 3.4e-12 0.231, 1 outside
box3d, pinned 1.4e-12 1.1e-12 0 1.1e-12 7.6e-5
box3d, slip 3.9e-12 1.8e-12 3.9e-12 2.8e-12 5.6e-3
annulus, pinned (test_1086's case) 4.2e-8 5.7e-8 6.7e-8 2.8e-8 8.6e-3
annulus, slip 1.3e-6 4.0e-6 1.0e-6 7.7e-6 6.7e-3
annulus, frozen (the default) 7.0e-3 9.6e-3 1.5e-5 3.1e-6 1.4e-2
box2d, facet slip 4.9e-2 3.2e-2 4.9e-2 hang 4.9e-2 (np 4 the same; np 5 hangs)

Further layouts, all within 1e-11 or identical:

  • every cell on rank 0: [42, 0, 0] with slip and with facet slip;
  • [22, 0, 20, 0] pinned;
  • an x-split, and two random scatters at np 2, with slip.

Tolerances.

  • At H5's atol of 1e-6: the pinned annulus passes at every np, with a 15× margin. The slip annulus would fail at np 2, 3 and 5 (1.3e-6 to 7.7e-6), but test_1086 has no slip annulus case.
  • At a tighter 1e-8: every box passes, and every annulus case fails.

Is the 7e-8 explained? Yes, for the pinned annulus.

  • The per-iteration trace grows smoothly, by about 2.5× per iteration: from 1e-17 at iteration 1, to 3e-13 at iteration 3, to 5e-8 at iteration 22. There is no jump at any iteration. A seam defect shows up as about 1e-3 at iteration 1; on development it is 1.2e-3.
  • The divergence is in the interior and diffuse. The boundary vertices agree to 0.
  • Control: serial runs with one-ulp noise on every global sum give 2.3e-8 and 7.5e-8, for two seeds. That brackets the parallel 2.8e-8 to 6.7e-8. A 5e-14 relative change in the metric amplitude gives 5e-7.

The slip annulus is less fully explained (low severity).

  • Iterations 1 to 3 agree to at most 1e-13, so there is no seam step.
  • The divergence is in the interior, not on the boundary or the seams: boundary vertices at 4e-13 against 6e-12 in the interior, at iteration 4.
  • It grows to 1e-6 to 8e-6, but the sum-noise control gives only 1.8e-9, and np 2 against np 4 differ by 2.3e-6.
  • So the trajectory is more sensitive than the sums-only control. The likely extra source is the rounding of the velocity assembly order, which the control does not perturb. This is inference: I found no seam-shaped signature.

Frozen. The frozen-metric results reproduce H5's #1093 numbers at np 2 and 3. That is not this PR's defect.

Check 3: H1's earlier findings F1–F4

  • F1, fixed.
    • mesh.redistribute_nodes, node_redistribution and relax with every cell on rank 0 at np 2 match serial to 1e-12 (test_1082: 6 passed).
    • The probe gives the same at [42, 0, 0] with slip (dx 0) and at [22, 0, 20, 0] pinned (2.4e-12).
    • The noempty mutant hangs or fails all 6 cases, and the np 4 parallel test aborts (exit 142).
  • F2, fixed for the tested layout. test_1082's frozen_meshvariable_metric case passes, every cell on rank 0 at np 2.
  • F3, fixed. With an ownership-weighted h0 and stol=0, empty-rank layouts match serial to 0 (test_1082's redistribution cases, and the probe's [42, 0, 0]).
  • F4, fixed only for the empty-rank layout. NOT fixed in general.
Facet slip, branch Result
[42, 0, 0] np 3 matches serial, dx 0 (the original F4 hang is gone)
[22, 0, 20, 0] np 4 completes; 4.9e-2 off serial
natural np 5, cs 0.25 ValueError: attempt to get argmin of an empty sequence on 2 ranks (BoundingSurface.restore, then _nearest_on_facets_2d, graph.py:769); the others then hang; exit 124
random scatter np 4 (rand3) the same ValueError and hang
the same scatter with nomask (no #1086 mask reduction) the same ValueError, so the crash is not caused by 91be43b
dev f8c6014: np 5 natural, np 4 scatter hangs (exit 124)

Check 4: mutants

Mutant test_1086 (serial driver; its workers run np 2–5) test_1082 (serial driver, np 2/4 workers) parallel 1082, 0855, 0766 at np 2 at np 4
nomin (the local cap) 7 of 8 fail (slip_corners_2d passes) 6 pass 8 pass, 1 skipped 9 pass
and (AND instead of OR) 8 of 8 pass: not caught 6 pass 8 pass, 1 skipped not run
noempty (#1082 reverted) 8 pass 6 of 6 fail not run fails, exit 142
nomask (no mask reduction) slip_corners_2d fails (the other 3 box cases pass) not run not run not run
  • The AND mutant is equivalent on every case I measured:
    • every check-2 box at np 2;
    • an x-split;
    • two random scatters;
    • 3D slip at np 3 and 4.
  • Why: a corner seen as one label on each of two ranks gets a count of 0 under AND and 2 under OR, and is pinned either way. The case where AND and OR differ is an owner lacking a facet that a non-owner has. p_sf found no such vertex: the only incomplete local mask was on a ghost. So BOR is right, but nothing distinguishes it from BAND.
  • The parallel tests catch neither the cap nor the masks. No parallel test compares against serial, so neither nomin nor and fails them.

Check 5: regressions, branch against base

Set Branch Base
serial movers and slip (0751, 0752, 0764, 0765, 0766, 0845 ×2, 0855 slip, 0773) 43 passed 43 passed
+ test_1082 and test_1086 on the branch 6 passed, 8 passed n/a
parallel 0766, 1152, 0855, 0773 and 1086 (rotated fault rows), plus 1082 on the branch, at np 2 14 passed, 1 skipped 13 passed
the same at np 4 15 passed 13 passed

There are no regressions.

Check 6: is test_1086 sensitive? Does it fail on development?

  • On development: with the build at f8c6014, the branch's test_1086 fails 8 of 8.
  • The annulus margin is good. The pinned annulus is 2.8e-8 to 6.7e-8 against atol 1e-6, and dev is at 8.6e-3, so there are about 4 decades of discrimination.
  • The OR masks at more than one rank count: no test covers them.
    • test_1086's annulus never slips (node_redistribution defaults to no slip; the annulus runs have no slip_surfaces).
    • The box slip cases each run at one rank count: slip_2d at np 3, slip_corners_2d at np 2, slip_3d at np 2.
    • test_1082's facet_slip puts every cell on rank 0, so it has no seams.
    • Parallel test_0766 uses slip_surfaces=True at np 2 and 4, but does not compare against serial.
    • So only slip_corners_2d at np 2 depends on the mask reduction (nomask fails it), and nothing pins OR against AND.

Findings

F1 (medium-high, blocks): facet-surface slip is still broken in parallel, despite the #1082 F4 claim.

  • The crash. At the natural np 5 partition, and at a scattered np 4 partition, of a cs 0.25 box with unregistered boundary surfaces, restore raises a rank-local ValueError on an empty reference set. The other ranks hang until the supervisor kills the job.
  • Pre-existing: development hangs on the same layouts.
  • But the branch states a false invariant. The comment in boundary_slip that a rank with no facets of a label has none of its vertices is measured false, and the commit message claims F4 fixed.
  • Even when it runs, facet slip is 3e-2 to 5e-2 off serial at np 2–4, the same as on development.
  • Affected: loaded meshes, internal boundaries, custom geometry, and released surfaces.
  • Fix. Give every rank the reference facets it needs, for example by allgathering each facet label's reference facets, which are small. That cures both the empty-set crash and the seam error.
  • Test. Add facet slip at np 2 and np 5, compared against serial, to test_1086.

F2 (low-medium): the slip annulus diverges from serial by 1e-6 to 8e-6, above test_1086's own 1e-6 bar.

  • It is not seam-shaped: iterations 1–3 agree to rounding, and the divergence is in the interior.
  • It is not reproduced by the sums-only rounding control (1.8e-9).
  • Most likely it is velocity-assembly rounding, amplified by the slip trajectory.
  • Ask: either add a slip annulus case at a justified tolerance, or record the measured bound in the test's docstring.

F3 (low): nothing tells OR from AND. The AND mutant passes every test and every probe. BOR is the correct choice, but no measured configuration depends on it. Add a scattered-partition slip case (a seeded SHELL scatter, as p86.py --layout rand) or a targeted unit test of _reduce_over_sharing_ranks with BOR on a vertex that only a non-owner sees as labelled.

F4 (low): test_1086 runs each box case at one rank count.

  • nomin still passes slip_corners_2d.
  • The parallel tests pass under nomin and and.
  • Ask: parametrize the box cases over np 2–4, as the annulus is.

F5 (low, [read]): latent edges of _reduce_over_sharing_ranks.

Confirmed claims.

  • The seam fix itself (91be43b): the MIN cap and the mask reduction are correct.
  • Fresh, adapted and reloaded meshes: the SF reduction is ghost-complete to 1e-17.
  • Boxes in 2D and 3D, pinned and plane slip, match serial to at most 1.6e-11 at np 2–5. Corners stay in the box.
  • The 7e-8 on the pinned annulus is rounding: the noise control brackets it.
  • F1 and F3 are fixed, and F2 is fixed for the tested layout.
  • test_1086 fails 8 of 8 on development.
  • No regressions, serially or at np 2 and 4.

Merge conditions

  1. F1 (facet slip). Either fix facet-surface reference facets across ranks here (the empty-set crash and the seam error) with a parallel facet-slip test against serial, or remove the false invariant comment, retract the F4 claim in the PR text, and file facet-slip parallelism as its own issue referenced from the PR. One of the two is required.
  2. Add slip coverage at more than one rank count to test_1086: box slip at np 2–4, and a scattered layout if feasible. Either add a slip annulus case at a measured tolerance, or note its bound (F2–F4).
  3. global_evaluate returns a partition-dependent wrong value for interior points stranded at a seam (best-claim picks nearest centroid, not containing cell) #1093 stays a separate issue. The default frozen metric is not rank-independent until it is fixed. Say so in the PR.

Not tested

  • Adapt of a box (the probe's box lacks the refinement hierarchy), and re-distribution of a live mesh.
  • F2 on layouts with cells on more than one rank.
  • 3D facet slip.
  • Faults: W1's move-fault, re-refine and add-patch cycle.
  • Accelerators other than cg.
  • H5's direct six-step mover figure of 2.6e-12.

Underworld development team with AI support from Claude Code

…outs

The natural partition is the platform's (test_0858 failed its precondition
on macOS for this reason). The scattered layouts are a seeded shell
partition, the same everywhere, and they are where the AND and
no-reduction mutants are caught.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lmoresi

lmoresi commented Nov 12, 2026

Copy link
Copy Markdown
Member Author

Re-check: PR #1106 (#1086 seam fix, carrying #1082), delta c3e5260..a560311

READY at a560311. All three merge conditions from H1's 2026-11-12 review are met. Nothing blocks; two low notes follow.

Reviewer: H1 worker, for H1. This is a delta re-check against runs/2026-11-12-1086/1086-review.md. Everything is measured unless marked [read].

What changed since c3e5260

On the first-parent history there are four commits:

Commit What it changes
b66f7ad the comment fix; widened test_1086; new tests/parallel/test_1086_boundary_slip_classification_parallel.py; a scripts/test.sh batch line
07f4bca merges development 01b06c9
bc9d67c test_1086 docstring only
a560311 the classification test asserts its held-not-owned precondition only on the seeded scattered layouts

Library change. In src/, the PR's own change is one comment in discretisation_mesh.py (boundary_slip, about line 4321). Nothing executable changed.

The merge. git show --remerge-diff 07f4bca3 shows one conflict, in scripts/test.sh. It was resolved by keeping both batch lines (test_1086 classification and test_1175), which is correct. The rest of the merge is development.

Branch against development. git diff 01b06c91 a560311f touches only the PR's files: mmpde.py, graph.py, discretisation_mesh.py, the four tests, and test.sh.

Builds. The installed mmpde.py, graph.py and discretisation_mesh.py are byte-identical to their worktrees for wt-1106 (a560311), wt-dev01b (01b06c9) and wt-1086 (c3e5260).

Check 1: the false invariant is gone, and the F4 claim is withdrawn

The comment now reads (discretisation_mesh.py, at a560311):

        # same calls. A rank holding none of a label's facets gets an empty facet
        # surface. That is enough when such a rank also holds none of the
        # label's vertices (every cell on one rank), but not in general: a rank
        # can own slip vertices of a label without any of its facets, and its
        # restore then fails alone. Each rank also restores onto its own facets
        # only, so facet slip is partition-dependent. Both are #1103.

The removed line was "A rank holding none of a label's facets holds none of its vertices either, and gets an empty facet surface that is never asked to restore anything." The new text matches what I measured on 2026-11-12.

The PR body now says:

Not fixed here: facet-surface slip in general (#1103). ... Only the empty-rank layout is fixed. On partitions where several ranks hold cells it is still 3e-2 to 5e-2 off serial. A rank can also own slip vertices of a label without any of its facets; its restore then raises alone and the job hangs. #1103 stays open.

Other F4 references:

Condition 1: met (the withdraw-and-file option).

Check 2: the new slip tests

Coverage. test_1086 now parametrizes:

  • slip_2d, slip_corners_2d and slip_3d at np 2, 3 and 4;
  • slip_2d_scattered (a seeded random SHELL partition) at np 3 and 4;
  • the pinned annulus at np 2–5, to 1e-6;
  • a new slip annulus at np 2–5, to 2e-5.

Does the scatter take effect? Yes. A probe that imports the test's _scatter_cells gives cells per rank at np 4 of [10, 11, 11, 10] on the natural partition and [8, 9, 13, 12] scattered. The nomask mutant also fails the scattered case but not the natural slip_2d, so the two layouts behave differently.

Branch results. test_1086 and test_1082 together: 26 passed (20 + 6) in 279 s. The measured largest |x_np − x_serial|, from the test's own worker:

Case np 2 np 3 np 4 np 5 Tolerance
slip_2d 1.9e-12 1.0e-12 8.0e-13 1e-10
slip_corners_2d 5.6e-17 5.6e-17 0 1e-10
slip_3d 3.9e-12 1.8e-12 3.9e-12 1e-10
slip_2d_scattered 6.7e-13 8.4e-13 1e-10
cavity annulus, slip 1.3e-6 4.0e-6 1.0e-6 7.7e-6 2e-5

The slip annulus reproduces H1's 2026-11-12 figures exactly. Its tolerance of 2e-5 gives a 2.6× margin over the worst case (np 5). The test's comment records the measured range, and the fact that it is not rounding and is unexplained. That is the "recorded bound" option.

Does the test catch the faults? test_1086 runs a serial driver whose workers run at np 2–5. The test sources are from a560311. Mutants are injected into the a560311 build: its mmpde.py and graph.py are identical to c3e5260, so nomin here is the seam fix reverted.

Build or mutant test_1086 (20 cases) Failing cases
development 01b06c9 20 of 20 fail Every case. Box errors are 9e-4 to 3.5e-2, and 3 cases have vertices leaving the box. slip_corners_2d at np 3 and 4 crash on the #1082 empty-rank path (NotImplementedError from isSimplex being False, and a PetscInt overflow).
nomin (the seam cap reverted) 17 of 20 fail Everything except slip_corners_2d at np 2–4. That mesh has 5 vertices and one free vertex, so the cap cannot bite there.
and (BAND for BOR) 20 of 20 pass none
nomask (no mask reduction) 5 of 20 fail slip_corners_2d at np 2–4, slip_2d_scattered at np 3 and 4

The classification test (tests/parallel/test_1086_boundary_slip_classification_parallel.py, 6 cases):

np 1 np 2 np 3 np 4
branch 6 passed 6 passed 6 passed 6 passed
development 4 of 6 fail 4 of 6 fail 4 of 6 fail
and 2 of 6 fail (3D, seeds 1086 and 1087) 2 of 6 fail 2 of 6 fail
nomask 4 of 6 fail 4 of 6 fail 4 of 6 fail
  • The failures are real classification mismatches, not the precondition. Under and, 12 to 69 vertices per rank are wrong-pinned or off their wall.
  • The injection line appears once per rank in every mutant log.

H1's F3 gap (OR against AND) is closed. The AND mutant fails at every np from 2 to 4. It is caught by the classification test, not by test_1086's trajectories, which is enough.

H1's F4 (one rank count per case) is closed.

Condition 2: met.

Check 3: library change and rank independence

  • The only library change is a comment, so there are no new collectives to review.
  • Development code arrives through the merge. Re-measured with p86.py on the a560311 build against serial; every result matches the 2026-11-12 figures:
Case Cells per rank Largest |x_np − x_serial| Vertices outside the box
box2d slip, np 4 natural [10, 11, 11, 10] 8.0e-13 0
box2d slip, np 4 rand1 scatter [10, 13, 5, 14] 1.2e-12 0
box3d slip, np 3 1.8e-12 0
box2d corners cs 0.5 slip, np 2 1.6e-11 0
annulus pinned, np 2 4.2e-8
annulus pinned, np 4 6.7e-8

Check 4: the #1093 note

It is present in the PR body:

#1093: the frozen fill above goes through global_evaluate, which is partition-dependent at seams until #1093 is fixed. So the default frozen metric is not yet rank-independent there. The tests use metric_eval="sympy".

#1093 is OPEN. Condition 3: met.

Check 5: regressions, branch a560311 against development 01b06c9

Set Branch Development
test_1086 and test_1082 (serial drivers, np 2–5 workers) 26 passed test_1086: 20 of 20 fail
serial movers and slip: 0751, 0752, 0764, 0765, 0766, 0845 ×2, 0855, 0773 43 passed 43 passed
np 2: parallel 0766, 1152, 0855, 0773 and 1086 rotated-fault rows (+ 1082 and 1086 classification on the branch) 20 passed, 1 skipped 13 passed
np 4: the same 21 passed 13 passed
  • The skip is test_1082's parallel case at np 2: "no rank is empty at np 2 (cells per rank [2, 2])". That is its precondition, and it was the same in round 1.
  • The np 4 warnings are "Mean of empty slice" in test_0766's empty-rank case. They also appear on development and predate this PR.

No regressions.

Remaining notes (non-blocking)

  1. (Low) The slip-annulus margin is 2.6× (7.7e-6 against 2e-5 at np 5). The source is unexplained trajectory sensitivity in the slip path. Another platform or BLAS could move it, so if it flakes, look there first. It sits 3 decades below the 6.7e-3 seam error on development, so it still discriminates.
  2. (Low, carried from round 1, [read]) _reduce_over_sharing_ranks has two latent edges. It tests the world size rather than the DM's communicator, and it has no guard for a point SF whose graph was never set. Neither is exercised by any current path. They need not block, but are worth an issue or a line in a later PR.

Not re-tested in this delta

Artifacts are in runs/2026-11-13-1106/:

  • logs/t86_*.log: test_1086 on the branch, development and the mutants;
  • logs/cls_*.log: the classification test;
  • logs/w_*.json and logs/w_*.log: the test worker measurements;
  • logs/reg_*.log: the regressions;
  • logs/*_np*.json: the p86 runs;
  • cmpj.py, run_t.sh, run_p.sh, run_w.sh, regress.sh: the runners.

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