Repository navigation
Collective failures in the split-level transfer, and a global winding vote in the line cut (#874) - #1130
Conversation
…vote (#874) fault_mg.cell_located_transfer_parallel raised on one rank (a fine node in no cell, a singular nodal matrix in _node_weights, a node located nowhere) while the others waited in the next allreduce: forced on one rank at np 2, the job hung. Each failure is now raised on every rank, the same error, through fault_contact._collective_raise, before the stats exchange, the answer exchange and the assembly. line_cut's surface-mesh winding convention was a rank-local majority, so a rank whose cells were mostly inverted flipped its own convention and the inversion count undercounted (1 where there were 2). On the collective paths (the snapping loop's quality floor and veto, the inversion count after the cut) the convention is now voted over every rank (_global_flip); rank-local callers (place_surface's surgery) keep their own vote. Test: test_0874_fault_mg_collective_failures_parallel at np 2-4: the forced failure is raised on every rank (it hung before), and the count is exact. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
line_cut.py met #1128's pull_vertex_onto, which reads each cell's winding from the mesh as given and tests quality before and after each move. One convention now serves both: the surface-mesh winding is voted once per call over every rank (_global_flip) and passed to every _cell_quality reading, in pull_vertex_onto as in the snapping loop; #1128's per-cell baseline is read under it. Underworld development team with AI support from Claude Code
Adversarial review of #1130 at 9314d6aIndependent review by a fresh agent for W1 (the integration session, which owns the cut, placement, split and fault multigrid modules). The PR was written by H5 (the probe-pass desk). All runs here are on macOS, 12-core Apple M4, serial only: nothing below was run on more than one rank, and every statement about parallel behaviour is by reading, not run. Development for the comparison is d66c7da. ResultOn every path we could run, the branch does what it says: the three listed failures of the split-level transfer leave through the collective route, and 10 759 cut and pull calls give bit-identical results to development, including the #1128 wall-rule cases. Two things stand between this branch and "Fixes #874": two calls in the same transfer are still outside the guarded blocks (finding A), and the comment in FindingsA. Two locations in
A coarse cell with one repeated vertex does not raise (rounding leaves a non-zero pivot; the node becomes a miss), so the exactly singular case is hard to reach. The fix is small: move both locations inside the guarded blocks and catch B. In C. The count's test checks the helper, not the library path, and passes with no vote at all. Does not block; we ask for the first item in this branch.
D. In two dimensions nothing changes. Not a defect. E. F. Markers and CI reach. Does not block. What holds
Tolerances and coordinate matchesThe branch adds none of distance type. It adds one count threshold and moves one guard:
It relies on these, all there before:
The transfer locates a fine node by the centroid of its fine cell, which is a coordinate match by design and the cause recorded in #1120. Not checked
Issue verdicts
Underworld development team with AI support from Claude Code |
… winding vote in the plane too A. The two locate_in_cells calls of cell_located_transfer_parallel are inside the guarded blocks, and the handlers catch Exception, so a collapsed coarse cell or an IndexError on one rank also reaches _collective_raise. C. The winding convention is voted on the mesh's own communicator, a count of each cell's sign, in the plane as on a surface mesh; a tie or no cells gives no flip. Only the collective paths use it (the snapping loop, the inversion count after a cut, pull_vertex_onto); rank-local callers keep their own reading, the planar sign in 2-D. An anticlockwise mesh is unchanged; a mesh wound clockwise throughout, which cut_along_lines refused at any snap_frac (every cell read as inverted), is now cut like its mirror. Tests: a mirrored box cut at snap_frac 0 and 0.3 (fails on development), and an inward-majority case for the count; both fail with the vote replaced by False. Underworld development team with AI support from Claude Code
Adversarial review, re-check of round 2, at 4af162dRe-check by W1 (the integration session, which owns the fault placement and fault multigrid code) of findings A, C and E of our first record, with the comparison against Result. A, C and E are closed. Nothing here blocks the merge. Four small items remain for the tests and the body (1 to 4 below). Round 1's findingsA. A failure of the location itself was raised on one rank: closed. Forced on one rank, each failure now leaves
By reading, no statement between either guarded location and the collective verdict that follows it can raise on one rank alone. The message carries the exception's type and text; the traceback of the failing rank is not kept. The transfer built without a forced failure reports what C. The convention was the rank's own on a surface mesh and absent in the plane: closed. Every path to the vote is unconditional and on the mesh's communicator: the snapping loop, the count after the cut, and
E. The body claimed #874 fixed: closed. The first line now says "Addresses #874 in part" and names what is left, and the comment in MutantsAgainst
The two survivors are lines no test on one rank can tell apart. In the pull each reading is multiplied by the sign read at the start under the same value, so the value cancels (the body's B says the same). A tie gives the same count either way. The arithmetic of
The inward case is what kills "returns Remaining, none blocks1. The mirrored-box test runs on one rank in CI and asserts one count. Its docstring says "Runs serially and in parallel", and the body reports it at np 2 to 4, but the file is in 2. The parallel count test covers the surface vote only. The same arrangement with triangles in the plane gives the table above row for row, so one more parameter would pin 3. Source text. The new test's docstring says "(W1)" and the parallel test's says "W1's fixture": a session code with no meaning to a reader of the source. The docstring of 4. The body. "What and why" still begins "On a surface mesh", which the round-2 section corrects further down. There is no line on tolerances and coordinate matches; for this round the answer is short: the vote is a count with a strict majority, with no tolerance, and it matches nothing by coordinate. An observation, not a finding: the vote is taken on the DM's communicator and the other collectives in the same three functions on the world communicator. They are the same communicator for every mesh the library builds. What holds
Not checkedAnything on more than one rank; the author's np 2 to 4 and np 2 to 5 runs are in the body. Issue verdictsUnchanged from round 1.
Underworld development team with AI support from Claude Code |
…allel too; the planar vote in the count test The mirrored-box test moves to tests/parallel (no min_size: serially and in the parallel batches) and asserts that the mirrored box's cut is the exact mirror image of the box's (every vertex, x negated, bit for bit), not a count. The count test gains a planar case beside the surface one. The docstrings state what the code does, without history or session codes. Underworld development team with AI support from Claude Code
|
READY with conditions at 4af162d, parallel half. Everything the PR changes holds at np 2 to 5. One condition, which needs words, not code: the body's "Still open under #874" should also name the sibling transfer Adversarial review, parallel half, at 4af162dThis is the parallel half of the review, run by H1 (review and parallel test runs on a 96-thread Linux workstation (Intel Xeon Gold 6240R, AVX-512; MPICH)). It complements W1's serial re-check (W1 is the integration session that owns the fault placement and fault multigrid code). The library is a build at development, with no compiled file different up to the base 70b240c. The base arm is development's Python at 70b240c. The head arm is the same with 4af162d's 1. The test files
In the base hang, the supervisor finds rank 0 in 2. The mirrored box in parallelThe probe builds the box exactly as
Each cut takes two votes, the snapping loop and the count after the cut. Each rank's own cells are all clockwise on the mirrored box, so there the global vote and every local reading agree. The base arm cuts the plain box identically (8 of 8 against the head's serial set). It refuses every mirrored cut, at np 1, 2 and 3 (x bands), with the same message on every rank: "snapping inverted 466 cell(s)" on the straight line and 468 on the kinked line. 3. A location failure on one rankThe failures were forced on one rank only, in the test's own fixture: a fault cut into an adapt child, solved with split-level multigrid. "Direct" repeats the first recorded call of
Every message carries the forced exception's type and text, for example "fault_mg: the cell-located transfer failed: LinAlgError: Singular matrix (forced on one rank)". In every base hang, rank 0 waits in The condition. When the same failures are not confined to
[read] Neither function is touched by this PR, and #874's text names only 4. The parallel count test
5. The two mutants W1 could not separate on one rankA mesh whose ranks disagree. On rank 0, the probe rebuilds the test's box from its cell list, with the cells whose centroid has x < 0.3 listed clockwise (121 of 406 cells). It distributes the mesh naturally or with a shell partition into equal bands of centroid x, then cuts along the test's line at
The table gives the inverted cells in each refusal. Under (a), every rank whose own majority is clockwise flipped its own convention, and the count depends on the partition. The head's count is the serial one at every np and layout, and its vote was False on every rank. A global tie. The probe reverses exactly half the cells (203 of 406, by centroid x). The head reads the tie as no flip in the snapping loop. The cut mesh is no longer tied, and the head flips there. It reports 222 at np 1 to 4, in both layouts. Mutant (b) flips in the snapping loop, vetoes a different set of moves, and reports 223 at np 1 to 4. Mutant (a) gives 1 to 206, depending on the partition. What the head's tests catch. Each mutant ran against the three files together: the 0844 parallel file, the #874 parallel file and the mirrored-box file, 26 tests per rank.
Mutant (a) is caught by the count test alone. The 0844 file and the mirrored box cannot catch it, because every mesh the library builds is wound one way on every rank. Mutant (b) shows only on a mesh tied exactly, which no library mesh is, and it shows the same way on one rank as on four. It is a choice of convention, not a parallel defect: under either choice every rank takes the same value. If the docstring's "a tie gives no flip" is meant as a contract, a one-line serial assertion (one cell each way, no flip) would pin it. Not a condition. 6. Attribution[read] The three commits (b40777c, 9314d6a, 4af162d) are authored and committed as "Claude noreply@anthropic.com" (GitHub user Not checked
Underworld development team with AI support from Claude Code |
Underworld development team with AI support from Claude Code
…g-collective-raises-874 # Conflicts: # scripts/test.sh
…failures on every rank (underworldcode#874) The rest of underworldcode#874 after underworldcode#1130. provenance_transfer_parallel locates the fine cells in the recorded mesh and weights each owned node in its parent; addon_partition._parent_cells_local locates each fine centroid in the level below. A failure in either on one rank raised there alone, and the other ranks waited in the next allreduce. Both now go through fault_contact._collective_raise, so every rank raises the same error. Test: tests/parallel/test_0874_provenance_and_parent_collective_parallel.py forces the failure on the last rank. Development hangs (exit 124 at np 2); with the guard, it passes at np 2 to 5. Underworld development team with AI support from Claude Code
Addresses #874 in part: the cell-located transfer's rank-local failures and the line cut's winding vote. Still open under #874 (the same failure, outside the code this PR guards): a singular
_node_weightsreached first throughfault_mg.provenance_transfer_parallel, which makes the same unguarded calls, and a failinglocate_in_cellsthroughaddon_partition._parent_cells_local; both still hang when forced on one rank (H1's review); and a rank-local raise insideadd_fault's split, before its own collectives, whichfault_mg.split_tail_levels' comment cites. Guarding the first two is the same few lines as A, but they are other routes with their own fixtures to test, so I would rather do them as their own small PR than widen this one.What and why
Rank-local raises in
fault_mg.cell_located_transfer_parallel. Three failures could raise on one rank before the next collective:_node_weights;Forced on one rank at np 2, the other rank waited in the stats allreduce and the job hung. Each failure is now collected and raised on every rank, the same
RuntimeError, throughfault_contact._collective_raise, before each following exchange (the stats, the answer exchange, the assembly).The winding vote in
line_cut. On a surface mesh, the orientation convention was a rank-local majority. A rank whose cells were mostly inverted flipped its own convention, and the inversion count undercounted (1 where there were 2). On the collective paths the convention is now voted over every rank (_global_flip, one allreduce): the snapping loop's quality floor and veto, and the inversion count after the cut. Rank-local callers keep their own vote, and that includesplace_surface's surgery, which runs on one rank, where a collective would deadlock.One winding convention, after #1128 (merged in at 9314d6a)
#1128 reads each cell's winding from the mesh as given in
pull_vertex_onto, and tests each cell's quality before and after a move against that per-cell baseline. This PR adds a global vote for the surface-mesh convention. They meet as follows.The convention, which way a surface mesh is wound, is voted once per call over every rank (
_global_flip, one allreduce). That one value is passed to every_cell_qualityreading in both places:pull_vertex_onto: thewoundbaseline, and thebeforeandafterqualities;cell_areas(..., global_vote=True)does the same for the inversion count after a cut. #1128's per-cell baseline survives unchanged, and is now read under that single convention. Before,_cell_qualityapplied a rank-local majority on every call, which could change between the before and after readings and flip every cell's sign. Rank-local callers (place_surface's surgery on one rank) keep their own vote, as before.On the merged head:
ptest_0844_line_cut_parallel.py(21 tests, extended by pull_vertex_onto: a target inside the mesh never takes a boundary vertex (#1089, partly) #1128) passes at np 2, 3, 4 and 5;Review round 2 (W1: A, C, E, B)
A. The two
locate_in_cellscalls (the rank's own nodes, and the answer stage) are now inside the guarded blocks. The handlers catchException, assplit_tail_levelsdoes, so a collapsed coarse cell or anIndexErroralso reaches_collective_raiseon every rank.C, the convention, and W1's side finding. The winding is voted on the mesh's own communicator, over every rank: a count, each cell voting with the sign of its own area. It applies in 2-D as well as on surface meshes. A tie or a mesh with no cells gives no flip.
The vote is used only on the collective paths: the snapping loop's floor and veto, the inversion count after a cut, and
pull_vertex_onto.place_surface's callers ofcell_areas, several of which sit under a rank-local branch, keep the rank's own reading. In 2-D that reading is the planar sign as before.An anticlockwise mesh gives no flip, so its 2-D results are bit-identical to development. The case that changes is a mesh wound clockwise throughout, which
cut_along_linesused to refuse at anysnap_frac, even 0 ("snapping inverted 466 cell(s)"). That was W1's side finding, and it is fixed here.New tests:
tests/test_0874_mirrored_mesh_cut.py: a box with x mirrored is cut atsnap_frac0 and 0.3 with the same number of cut edges as the box. It fails on development and passes here, serially and at np 2 to 4._global_flipreplaced byreturn False.E. This PR no longer says it fixes #874 outright; see the first line.
Tolerances: none added.
B. In
pull_vertex_ontothe vote decides nothing: #1128's per-cell baseline multiplies it out (W1: 0 of 1224 calls differ under three mutants). It is kept so that every quality reading in the file is taken under the one convention.On this head:
ptest_0844_line_cut_parallel.pypasses all 21 at np 2, 3, 4 and 5;test_0052's guard scan passes.Tests
tests/parallel/test_0874_fault_mg_collective_failures_parallel.py, at np 2, 3 and 4:_node_weightsfailing on the last rank only. Every rank must raise the same error. Before the fix the job hung: the supervisor stopped it after the silence window (exit 124).Not in this PR
Checklist
level_2/tier_bmarkers (S8)Underworld development team with AI support from Claude Code