Repository navigation
MMPDE node redistribution: empty ranks (#1082) and partition seams (#1086) - #1106
Conversation
_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>
…eam-1086 # Conflicts: # scripts/test.sh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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:
But #1082's F4 ("facet slip") is not fixed. Facet-surface slip still:
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]. MethodBuilds.
Tests.
Probes.
Mutants.
Logs and JSON are in Check 1: are the new collectives reached by every rank, and is it the right SF?
Check 2: rank independence against serial (
|
| 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_redistributionandrelaxwith 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
noemptymutant 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_metriccase passes, every cell on rank 0 at np 2.- [read] The fill now uses
global_evaluate, the routine global_evaluate returns a partition-dependent wrong value for interior points stranded at a seam (best-claim picks nearest centroid, not containing cell) #1093 shows to be partition-dependent at seams. The fill points are mesh nodes, which can sit on seams. - I did not measure an F2 layout with cells on more than one rank.
- [read] The fill now uses
- 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) |
- 1077d76 builds an empty facet surface on a rank with no local facets of a label. Its comment, "A rank holding none of a label's facets holds none of its vertices either", is measured false: a rank does own slip vertices of a label for which it holds no reference facets.
- The 4.9e-2 error is the same in dev and the branch at np 2 and np 4. Serial with sum noise gives 1e-12, so this is a seam effect, not rounding. Facet restore uses each rank's own reference facets, the same class of defect as MMPDE redistribution depends on the partition: seam vertices see only their own rank's edges (step cap) and facets (slip corners) #1086.
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
nominnorandfails 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=Trueat np 2 and 4, but does not compare against serial. - So only slip_corners_2d at np 2 depends on the mask reduction (
nomaskfails 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,
restoreraises 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_slipthat 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.
nominstill passes slip_corners_2d.- The parallel tests pass under
nominandand. - Ask: parametrize the box cases over np 2–4, as the annulus is.
F5 (low, [read]): latent edges of _reduce_over_sharing_ranks.
- It tests the world size rather than the DM's communicator.
- It does not guard against a point SF whose graph was never set.
- The F2 fill relies on
global_evaluate(global_evaluate returns a partition-dependent wrong value for interior points stranded at a seam (best-claim picks nearest centroid, not containing cell) #1093).
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
- 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.
- 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).
- 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>
Re-check: PR #1106 (#1086 seam fix, carrying #1082), delta c3e5260..a560311READY 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 What changed since c3e5260On the first-parent history there are four commits:
Library change. In The merge. Branch against development. Builds. The installed Check 1: the false invariant is gone, and the F4 claim is withdrawnThe comment now reads ( 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:
Other F4 references:
Condition 1: met (the withdraw-and-file option). Check 2: the new slip testsCoverage. test_1086 now parametrizes:
Does the scatter take effect? Yes. A probe that imports the test's 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:
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
The classification test (
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
Check 4: the #1093 noteIt is present in the PR body:
#1093 is OPEN. Condition 3: met. Check 5: regressions, branch a560311 against development 01b06c9
No regressions. Remaining notes (non-blocking)
Not re-tested in this delta
Artifacts are in
Underworld development team with AI support from Claude Code |
…eam-1086 # Conflicts: # scripts/test.sh
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_moverno longer returns early on a rank with no cells.redistribute_nodesuses the rank-agreedself.isSimplex. The DM's ownisSimplex()is False on an empty rank.boundary_slipdecides which slip labels are usable on all ranks together, and every rank makes the collective normal projection.global_evaluate, not a rank-local evaluate.h0is 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):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 usemetric_eval="sympy".Tests
tests/test_1082_mmpde_mover_empty_rank_matches_serial.py:redistribute_nodes,node_redistribution,relax, a frozen MeshVariable metric, facet slip), each with empty ranks against serial, to 1e-12;tests/test_1086_mmpde_seam_matches_serial.py, each case against serial, vertex by vertex:tests/parallel/test_1086_boundary_slip_classification_parallel.py:boundary_slipon boxes, natural and randomly scattered partitions, checked against the classification known from coordinates;check_test_coverage: OK. Development (01b06c9) is merged in.Checklist
level_*/tier_*markers (S8)mesh.X.coords(S7)Underworld development team with AI support from Claude Code
🤖 Generated with Claude Code