Repository navigation
Raise the provenance transfer's and the parent relation's rank-local failures on every rank (#874) - #1165
Conversation
…failures on every rank (#874) The rest of #874 after #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
Adversarial review of PR #1165 at c3c9f3fCross-review by W1 (the integration session, which owns the fault add-on and multigrid code this PR edits; it runs on one rank only), with a fresh reviewer. Measured on: macOS, 12-core Apple M4, one rank, conda-forge PETSc 3.25.3. Nothing below was run at more than one rank. Findings
Attacks that found nothing
Issue verdicts
No verdict here rests on a probe against Not checked
Underworld development team with AI support from Claude Code |
… transfers W1's review of #1165: 1. addon_partition.inherit_provenance (the recorded branch and the moved-host branch) and _base_parent_addresses locate cells rank-locally ahead of an allreduce. A failure on one rank is now raised on every rank, as in _parent_cells_local. These stay RuntimeError, as the unlocated-count checks beside them raise: they run while a mesh is made or partitioned, not inside a hierarchy build. 2. fault_contact._collective_raise takes the class to raise. The transfer builders' verdicts (provenance_transfer_parallel and cell_located_transfer_parallel) raise CollectiveBuildError with builder_failure=True, the class of the checks beside them, so the build retries or degrades on every rank together. It is a RuntimeError, so callers catching that are unchanged. 3. Tests for every guarded site, each forcing the failure on the last rank. Two sites today's routes do not reach (the transfer's record on another mesh, a level whose record is on its parent) are reached through a mesh that hides its record. The location path there is checked to give exactly what the record gives. Underworld development team with AI support from Claude Code
Adversarial review of PR #1165, round 2, at 6a8b354Cross-review by W1 (the integration session, which owns the fault add-on and multigrid code this PR touches). Round 1 was at c3c9f3f. This round is by reading the head and the diff against Round-1 findings
New findingsN1. Medium. N2. Low. The three cell-located sites from #1130 change from stopping the solve to degrading it, and no test goes through N3. Low. A rank-local raise before the new inner verdict can leave the ranks one verdict out of step inside N4. Low. The moved-host verdict is a new collective under N5. Low, tests. Two tests choose the branch of N6. Low, docs. N7. Note. The round-2 commit message opens "W1's review of #1165:" with no explanation of the code in that message. Checked and found nothing
Not checked by us
Issue state#874 stays open, as the body says: finding 4's statements and ConclusionReady with conditions:
N3 to N7 need no change to merge. Underworld development team with AI support from Claude Code |
… cells under the guard W1's round-2 conditions on #1165: - N1: the five transfer verdicts no longer pass builder_failure. Another builder cannot change a failed location or weight, so a retry under rbf would fail the same way; the build now degrades at once, like the count checks beside them. The test asserts the flag is off. - The stale "both checks below" comment in provenance_transfer_parallel is rewritten, and _collective_raise is imported once there. - N3: inherit_provenance reads the child's and the host's cell tables inside a guard raised on every rank, before any location. What runs above it reads attributes every rank holds alike. A one-rank exception there could otherwise leave the other ranks in a verdict that pairs with an enclosing one (split_tail_levels) on the same communicator. Underworld development team with AI support from Claude Code
Review of PR #1165, round 3, at ad18d6d: the N1 and N3 hunksCross-review by W1 (the integration session, which owns the fault add-on and multigrid code this PR touches). Scope: the diff from 6a8b354 to ad18d6d only, by reading. We ran nothing; the parallel passes at two to five ranks are the author's, and CI was still running when this was written. N1, cleared. N3, cleared. Left, no change needed to merge.
Issue state. #874 stays open, as the body says. No label change. Conclusion. The three round-2 conditions are met at ad18d6d. Ready on green CI. Underworld development team with AI support from Claude Code |
…reads it (underworldcode#874) Finding 4 of the underworldcode#1165 review. provenance_transfer_parallel read pre._addon_parent[pcell] and packed the coarse cells between two collective calls, unchecked. On one rank, a short record raised an IndexError and an address out of range gave a PETSc error or an MPI abort, while the other ranks waited (np 2). The record is now checked before the star forest is built on it: one entry per cell of pre, each a (rank, local cell) that exists (the coarse cell counts are allgathered). The check and the packing are under one guard, and a failure is a CollectiveBuildError on every rank. addon_partition. _parent_cells_local now reads its cell tables inside its guard as well. Tests (in test_0874_provenance_and_parent_collective_parallel.py): the record damaged on the last rank only (short, a rank that does not exist, a cell that does not exist), and a cell-table failure before the parent location. On development each fails at np 2: IndexError on one rank, a PETSc error on one rank and a hang, an MPI abort, a hang. Branch: 10 passed at np 2 to 5. Underworld development team with AI support from Claude Code
Addresses #874 for the location and weighting sites in the add-on partition and the split-level transfers. #874 stays open, with no label change, until every site is guarded.
add_fault's split is a separate item.The review on this PR has three findings still open: 4 (rank-local statements between collectives in
provenance_transfer_parallel, and the cell table read ahead of_parent_cells_local's guard), 5 (the message names neither the rank nor the level pair) and 6(b, c) (comment wording, the tier mark). Finding 6(a), the doubled import, is fixed.The defect
Each step below is rank-local and runs ahead of a collective call. A failure on one rank raised there alone, and the other ranks waited in the next allreduce until the job was killed.
fault_mg.provenance_transfer_parallel_barycentric,_node_weights)addon_partition._parent_cells_localaddon_partition.inherit_provenanceaddon_partition._base_parent_addressesThe fix
Every step is caught and handed to
fault_contact._collective_raise, so every rank raises the same error._collective_raisenow takes the exception class to raise.provenance_transfer_parallel, andcell_located_transfer_parallelfrom Collective failures in the split-level transfer, and a global winding vote in the line cut (#874) #1130) raiseCollectiveBuildErrorwithoutbuilder_failure. That is the class of the count checks beside them. In parallel,build_transfersdegrades the preconditioner on it at once, on every rank together.CollectiveBuildErroris aRuntimeError, so callers that catch that are unchanged.addon_partitionraisesRuntimeError, as its unlocated-count checks do. These run while a mesh is made or partitioned, not inside a hierarchy build, so there is nothing to retry or degrade.inherit_provenancereads the child's and the host's cell tables inside a guard raised on every rank, before any location.inherit_provenanceruns insidesplit_tail_levels, which has its own verdict on the same communicator. A one-rank exception could otherwise leave the other ranks in an inner verdict that pairs with the outer one.Test
tests/parallel/test_0874_provenance_and_parent_collective_parallel.py(min_size 2). Each case forces the failure on the last rank only, and asserts that every rank raises the same message and the expected class. In the transfer cases it also asserts thatbuilder_failureis off:_parent_cells_local;inherit_provenance, recorded branch (add_faulton the adapt child);inherit_provenance, moved-host branch (a ladder placed on a box moved bymesh.deform);_base_parent_addresses.Today's routes don't reach two of these sites, because every surgery inherits the record:
The tests reach them through a mesh that passes every attribute through to the real one but hides its record, so the location path runs on the real meshes. On that path, the transfer matrix equals the recorded path's exactly (difference norm 0), and so do the parent addresses.
Results on a 96-thread Linux workstation (single system image; Intel Xeon Gold 6240R, AVX-512; MPICH):
build_transfersfor a fault transfer. The tests call the transfer functions directly, so the degrade path is shown by readingcustom_mg, not by a run.test_1096,test_1089,test_1173,test_1097,test_1099).test_1173: 12 pass.scripts/check_test_coverage.py: OK.Underworld development team with AI support from Claude Code