Skip to content

The structural FAC patch is one block per rank's faults, on the rank owning most of them (#895) - #1028

Merged
lmoresi merged 4 commits into
developmentfrom
feature/fac-blocks-per-fault-region
Nov 10, 2026
Merged

lmoresi merged 4 commits into
developmentfrom
feature/fac-blocks-per-fault-region

Conversation

@lmoresi

@lmoresi lmoresi commented Nov 9, 2026

Copy link
Copy Markdown
Member

With no fac_zone keyed, the parallel branch now cuts the structural FAC patch into connected pieces and sends each piece to the rank owning most of its rows. The pieces one rank receives are one block. A fault the add-on partition gave to one rank is factorised on that rank, and two faults on two ranks are factorised side by side, as Louis asked for #895 ("fault to its (majority) owning rank").

Before After Evidence
Structural patch, no zone keyed, np > 1 One block for all faults (#934, the fix for #925), on the rank owning most of its rows One block per rank that receives a piece; a piece is the patch rows joined by a shared coarse DOF or a shared node, with their halo #895 stage 1 (below); H1's review, two rounds

Why

The add-on partition gives each fault to its majority rank, so two faults apart sit on two ranks. The one block sent both to one rank. On #895's stage 1 (kaiju, 56 jobs, development b8367c4, the apart case), that rank did twice the factorisation and triangular-solve work:

h_b/S np Busiest rank's rows (one block → per rank) Busiest rank's LU flops First solve (s)
48.5 4 60230 → 30882 5.99e8 → 3.36e8 30.96 → 22.52 (−27 %)
48.5 8 60238 → 30882 6.32e8 → 3.44e8 32.20 → 23.05 (−28 %)
48.5 16 60238 → 30882 6.16e8 → 3.29e8 28.50 → 23.02 (−19 %)
24.3 4 30942 → 15642 2.65e8 → 1.43e8 12.49 → 10.29 (−18 %)
24.3 8, 16 30934 → 15642 2.59e8 → 1.38e8 no change
  • Velocity iterations were the same in every job, and the slip agreed to 5.2e-14.
  • The nodes were shared, so the times are indicative; the flop counts are exact.
  • The busiest rank's peak memory fell 7–8 %: with qmd ordering (FAC patch blocks factor in quotient minimum degree ordering #1022) the patch's LU is small in memory.
  • Full table and reading: uw3-campaigns addon-matrix-2026-11, addon_matrix_2026_11/results_895_stage1.md.

What changed (utilities/custom_mg.py)

  • _fac_patch_split_parallel also returns the links of each subdomain row (_patch_links):
    • for a patch row, the coarse DOFs of its interpolation stencil;
    • for a background or halo row, its coincident coarse DOF;
    • for every row, its node's first row.
  • _gathered_patch_blocks (rank 0, inside The finest level's FAC blocks are cut from every rank's rows (#925) #934's gather):
    • cuts the gathered subdomain into connected pieces (_connected_pieces, scipy csgraph);
    • sends each piece to its majority rank (_majority_rank);
    • concatenates the pieces each rank receives into one block.
  • Faults close enough to be coupled in the operator land on one rank and stay one block, as before. Splitting happens only where it moves work to another rank. There the coupling between the pieces is dropped, as between any two ASM blocks.
  • The zone path and the serial branch are unchanged.

Review

H1 (hyperion) reviewed adversarially in two rounds; the record is posted below.

  • Round 1 found a test lookup bug (fixed in 72d1012). Its one merge condition was M1: faults 0.12–0.20 apart came out as two coupled pieces on one rank, taking 4 velocity iterations against 3. That is fixed in dd9c22a.
  • Round 2 found the branch ready to merge:
    • Near pairs 0.12–0.20 apart: the branch builds base's block bitwise, at base's iterations.
    • Single faults, junction Ys and abutting pairs: bitwise base.
    • Two faults apart: two blocks on two ranks at np 2, 3 and 4, slip within 1e-13 of base.
    • Coverage: 33 fixture × np cases lose no row.
  • Not tested:
    • two coupled faults landing on two ranks (every coupled pair built landed on one);
    • a rank that receives only halo rows;
    • faults 0.02 apart, np > 4, and 3-D.

Tests

tests/parallel/test_1147_fac_structural_blocks_per_fault_parallel.py, tier B, in the parallel batches and serially (test.sh):

  • two faults apart are two blocks at np ≥ 2 (one at np 1), each row held once, each block on its majority rank, on two ranks;
  • two faults 0.12 apart stay one block at ≤ 3 velocity iterations;
  • _connected_pieces joins rows through shared keys.

On development the block-count, ownership and unit tests fail at np 2 and 4. test_1139 (#925), 1106, 1133, 1134 and 1135 pass at np 2 and 4.

Refs #895. Leaves open: #895's two-level coarse-space question, which is with Louis.

Underworld development team with AI support from Claude Code

…ning most of it (#895)

With no fac_zone keyed, the parallel branch gathered the structural patch from
every rank and made it one block for all faults (#934, the fix for #925), sent
to the rank owning most of its rows. The add-on partition gives each fault to
its own majority rank, so two faults apart sat on two ranks and were both
factorised on one: on #895's stage 1 that rank's factorisation and triangular
solves did twice the work, and the solve took 19 to 28 % longer at h_b/S 48,
np 4 to 16, than with a block per fault. The slip agreed to 5e-14 in the same
iterations.

The structural patch is now cut into its connected pieces inside the same
gather: rows that reference one coarse DOF, or are DOFs of one fine node, are
one piece (_patch_links, _connected_pieces). Faults apart are separate blocks,
each on its majority rank; a single fault, a junction or a touching pair stays
one block. Every patch row is still held by one block, so #925 holds. The
serial branch keeps one block.

tests/parallel/test_1147: two faults apart are one block at np 1 and two at
np 2 and above, each row held once, each block on its majority rank, the two
on two ranks; the velocity solve takes the serial iterations.

Underworld development team with AI support from Claude Code
…ierarchy

The split faults solve through the rotated workspace; the SNES's own fieldsplit is
never set up, and reading it raised PETSc error 73 on every rank (H1, np 2 and 4).

Underworld development team with AI support from Claude Code
The links join rows through coarse DOFs, not through the operator, so two faults
a coarse cell or two apart came out as two pieces that A couples. Cut apart, a
pair 0.12 apart took 4 velocity iterations against 3, and both pieces landed on
one rank, so the cut bought no distribution (H1's review). The pieces a rank
receives are now one block: the structural patch is split only where a piece goes
to another rank. The docstring says what is lost there: the coupling between
pieces on two ranks, as between any two ASM blocks; in stage 1 and the review,
pieces that reached two ranks were never coupled.

test_1147: a near pair (the problem A fault and a copy 0.12 below it) stays one
block, at 3 velocity iterations or fewer; it replaces an iteration bound on the
far pair that passed with or without the change (I1).

Underworld development team with AI support from Claude Code
…ment too

Underworld development team with AI support from Claude Code
Copilot AI balanced review requested due to automatic review settings November 9, 2026 23:09

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

Copy link
Copy Markdown
Member Author

Review record for #1028 (#895)

On 8b79367, the head: ready to merge, with no open merge condition. 8b79367 differs from dd9c22a, the tip of round 2, only by the near-pair test's docstring. The new lines say that development passes that test too, and that it guards against cutting the pieces one rank receives (N1 below). So the round-2 runs stand.

There were two rounds:

  • f16eb97: not ready. There was a test-lookup bug (B1, fixed in 72d1012), and faults close together were split into coupled pieces (M1).
  • dd9c22a: every finding fixed or resolved.

Paths under runs/2026-11-06/ are on hyperion.


Adversarial review: feature/fac-blocks-per-fault-region (#895)

Tip reviewed: f16eb97 (built as wt-pf). It is one commit on development b8367c4 (wt-b836), which is the base.
The ruling under review (Louis, relayed): each fault's structural block goes to the rank that owns most of it.

Probes and logs are in runs/2026-11-06/pf895/review/:

  • probe_pf.py solves one case. It wraps _gathered_patch_blocks to gather each rank's structural tuple to rank 0, and counts calls to _connected_pieces on every rank. It reads the live finest-level ASM blocks on every rank: rows after overlap, the live factor's nnz, and the LU flops of each block refactored offline with qmd. After the solve it gathers the finest operator A to rank 0, then:
    • rebuilds the pieces from the links (on base, from A's graph on the subdomain);
    • counts the nonzeros of A that couple two pieces;
    • extends each piece by one layer of A's graph, as PCASM overlap 1 does, and counts overlap and coupling between the extended pieces;
    • compares one LU of the union with the pieces' LUs summed (basic ASM), on random right-hand sides, with and without the overlap layer.
  • mut/mutplug.py: the mutations, as a pytest plugin (MUT=onepiece|nohalo).
  • run.sh, jobs1.sh, jobs2.sh (the case sweeps), test_mut.sh and test_fix.sh (test_1147 under a mutation, or with its PC lookup corrected).
  • summ.py and table.py summarise the runs; table.md is the full stage table (138 rows); the output is in logs/ and npz/.

Housekeeping:

  • git status is clean in both worktrees, and no __pycache__ appeared under either tests/. We ran with PYTHONDONTWRITEBYTECODE=1.
  • Test files ran from git archive into review/jobs/, which was deleted after each run, with -p no:cacheprovider.
  • We used at most 24 cores. We did not rerun test_1147, 1139, 1106 or 1133–1135 as plain pytest at np 2 or 4; for those we read the other job's logs (pf895/t-{pf,b836}-np{2,4}.log).
  • We pushed, posted and committed nothing.

[read] marks a finding that comes from reading code, with no run behind it.

Verdict

Not ready to merge. There is one blocker (B1) and one correctness-of-claim defect (M1).

The mechanism works where the faults really are apart:

  • The test_1147 fixture (apart). At np 2, 3 and 4 the patch is two pieces, one per fault, each on its majority rank.
    • The pieces are uncoupled in the operator: 0 cross nonzeros, and 0 overlap after the ASM's overlap layer.
    • One LU of both equals the two LUs to 0–2e-15.
    • Iterations and slip match base: 4 iterations, slip within 1e-13.
    • The busiest rank's block LU drops from 48 to 26 MF.
  • Single faults keep one block, identical to base to 1e-14 or bit for bit. We ran straight, kinked, arc, the test_1139 fixture spanning 2–3 ranks, an abutting pair on one spine, and a network-mesher Y.
  • The cut runs on rank 0 only (56 of 56 branch runs at np 2–4). Ranks that get no piece are handled, and nothing hung at np 2, 3 or 4.

But:

  • B1. test_1147's ownership test cannot pass, on the branch or anywhere. It errors with PETSc error 73 at np 2, 3 and 4, because it reads the SNES's fieldsplit while the rotated solve uses its own cached KSP. Merged as is, the parallel phase goes red. On base it fails with the same error, not with its assertion.
  • M1. The links are not the operator's graph. Two faults 0.12–0.14 apart become two pieces that are coupled in A: 337 and 16 nonzeros. Their ASM subdomains overlap by 186 and 78 rows.
    • The preconditioner changes: one LU against the pieces differs by 0.25–0.69 on random right-hand sides.
    • At 0.12 the velocity solve takes 4 iterations against base's 3, at np 2, 3 and 4.
    • At 0.16–0.20 the pieces are uncoupled in A[sub,sub], but the overlap layer still joins them (offline differences 4e-2 to 9e-2, and 2e-4 to 6e-4).
    • The docstring's "faults apart are not coupled in the operator, so one LU of them is their LUs side by side" holds here only from 0.24 apart.
    • In every coupled case both pieces landed on the same rank, so the split bought no distribution there.

Stage table

Key to the columns:

  • Blocks per rank are given as owned/subdomain rows → rows after the ASM overlap, live LU nnz, LU MFlop. The flops come from refactoring the live block operator offline with qmd.
  • vel its is the velocity iterations of the (single) Newton step.
  • The last column is the branch against base at the same np: the largest relative difference in slip, and in v_rms.

Cases:

case np build blocks per rank vel its slip v_rms pf vs b836
apart 1 b836 r0: 8354/8672→9356, 802k, 48 4 0.143534783, 0.143530273 0.2919214947
apart 1 pf r0: 8354/8672→9356, 802k, 48 4 same same 0, 0
apart 2 b836 r1: 8354/8672→9356, 798k, 48 4 0.143534784, 0.143530274 0.2919214941
apart 2 pf r0: 4092/4258→4610, 398k, 24 · r1: 4262/4414→4746, 414k, 26 4 0.143534784, 0.143530274 0.2919214941 9.7e-14, 7.6e-16
apart 3 b836 r1: 8354/8662→9320, 793k, 48 4 0.143534791, 0.143530283 0.2919214930
apart 3 pf r0: 4092/4254→4598, 384k, 22 · r1: 4262/4408→4722, 414k, 26 4 0.143534791, 0.143530283 0.2919214930 1.1e-13, 3.0e-15
apart 4 b836 r2: 8354/8664→9324, 781k, 45 4 0.143534796, 0.143530273 0.2919214924
apart 4 pf r0: 4092/4256→4602, 398k, 24 · r2: 4262/4408→4722, 397k, 23 4 0.143534796, 0.143530273 0.2919214924 2.8e-14, 0
single 1 b836 r0: 8054/8298→8698, 872k, 72 3 0.117866426 0.2892349696
single 1 pf identical 3 identical identical 0, 0
single 2 b836 / pf r0: 8054/8290→8686, 878k, 74 (both) 3 / 3 0.117866405 0.2892349685 0, 0
single 3 b836 / pf r2: 8054/8296→8696, 872k, 71 (both) 3 / 3 0.117866409 0.2892349671 0, 0
single 4 b836 / pf r1: 8054/8292→8688, 873k, 72 (both) 3 / 3 0.117866391 0.2892349677 1.0e-14, 3.8e-16
par 0.12 1 b836 / pf r0: 8478/8794→9312, 949k, 78 (both) 3 / 3 0.132286026, 0.132279555 0.2892482373 0, 0
par 0.12 2 b836 r1: 8478/8794→9312, 964k, 82 3 0.132286046, 0.132279589 0.2892482335
par 0.12 2 pf r1: 4230/4386→4734, 420k, 27; 4248/4408→4764, 405k, 24 4 0.132285979, 0.132279507 0.2892482321 6.2e-7, 4.6e-9
par 0.12 3 b836 r2: 8478/8794→9312, 943k, 77 3 0.132286053, 0.132279580 0.2892482336
par 0.12 3 pf r2: 4248/4408→4764, 407k, 25; 4230/4386→4734, 431k, 29 4 0.132285979, 0.132279508 0.2892482320 5.6e-7, 5.4e-9
par 0.12 4 b836 r3: 8478/8794→9312, 945k, 77 3 0.132286041, 0.132279593 0.2892482325
par 0.12 4 pf r3: 4248/4408→4764, 403k, 24; 4230/4386→4734, 413k, 25 4 0.132285984, 0.132279509 0.2892482326 6.3e-7, 2.0e-10
  • np 1 is the serial branch on both builds: one block, bit-identical.
  • The busiest rank's block LU. In apart it falls from 45–48 MF (one block of about 9 300 rows) to 23–26 MF. For par 0.12 the two pieces sit on one rank, so that rank does 49–54 MF against base's 77–82.
  • Wall time. It is not a useful measure on this fixture: 5–16 s, and dominated by the mesh build and the load from other jobs.

Findings

B1 (blocker). test_each_block_is_on_the_rank_owning_most_of_it errors on the branch at every rank count, and fails on base for the wrong reason

  • The defect. test_1147.py:105 reads stokes.snes.getKSP().getPC().getFieldSplitSubKSP(). A rotated-fault solve runs in _rotated_linear_cache["ctx"]["ksp"], so the SNES's fieldsplit is never set up and PETSc raises error 73 ("Must call KSPSetUp() or PCSetUp() before calling PCFieldSplitGetSubKSP()").
  • Measured on the branch.
    • np 2 and np 4, in the other job's combined run: 1 failed, 21 passed.
    • np 3, test_1147 alone (logs/pfr-t1147-pf-3-fix0.log): the same error on all 3 ranks.
    • The file is in scripts/test.sh shard 3, and the parallel phase takes tests/parallel/test_*.py [read], so CI's parallel phase would fail.
  • On base it fails with error 73 too, not with "both faults' blocks are on rank(s) …". So it does not demonstrate the bug.
  • Fix check, run (test_fix.sh, which replaces that line with stokes._rotated_linear_cache["ctx"]["ksp"].getPC().getFieldSplitSubKSP()[0].getPC()):
    • branch at np 2 and np 4: 4 of 4 pass;
    • base at np 2: fails with "both faults' blocks are on rank(s) [1]";
    • base at np 4: fails with "… [2]";
    • branch at np 2 with onepiece: fails with "… [1]".

M1 (medium; the docstring claim is false for nearby faults). The links join rows by shared coarse DOFs, but the operator also couples rows that share only fine cells

What the probe measured on par (two parallel faults, offset OFF). Columns:

  • "pieces" is the branch's count; base is always one block.
  • "cross nnz" counts the entries of A[sub,sub] that couple two pieces.
  • "ovl / cpl" are the rows shared by the pieces after the overlap-1 layer, and the pattern entries coupling them.
  • "one LU vs pieces" is ‖x₁−x₂‖/‖x₁‖ over 3 random right-hand sides, with the overlap layer, and without it in parentheses.
OFF pieces cross nnz (struct) ovl / cpl one LU vs pieces vel its b836 → pf (np 2, 3, 4) slip pf vs b836
0.04–0.10 1 (merged: shared coarse DOFs) – – 0 same 0
0.12 2 337 (352) 186 / 5024 0.25–0.69 (8–9e-3) 3 → 4, 3 → 4, 3 → 4 5.6e-7 to 6.3e-7
0.14 2 16 (16) 78 / 2208 0.28–0.63 (5e-4 to 1e-3) 3 → 3 (np 2, 4) 2.9e-6 to 3.1e-6
0.16 2 0 24 / 916 4e-2 to 9e-2 (2e-16) 4 → 4 8e-8
0.20 2 0 0 / 8 2e-4 to 6e-4 (2e-16) 4 → 4, np 4: 5 → 5 ≤ 3e-9
0.24, 0.30 2 0 0 / 0 ≤ 1.3e-15 4 → 4 ≤ 1e-14
  • Mechanism [read], consistent with the counts above:
    • A halo row joins only through its coincident coarse column, and a patch row through its P stencil.
    • Two subdomains that touch in the fine mesh, but whose rows reference disjoint coarse DOFs, become two pieces.
    • PCASM then grows each piece by one layer (setASMOverlap(1), custom_mg.py:1621). The grown pieces overlap, and BASIC ASM sums the overlapped corrections.
    • Base's single block factors the union exactly.
  • The docstring (custom_mg.py _gathered_patch_blocks) claims "Faults apart are not coupled in the operator, so one LU of them is their LUs side by side". That is true only when the pieces are more than about two overlap layers apart: from OFF 0.24 here. It also leaves the overlap out.
  • Answer. It stays within the solver tolerance; tol 1e-6 holds the slip to about 3e-6. At 0.14 the branch's np 2 and np 4 slips differ by 5e-6, where base's differ by 7e-8.
  • Cost.
    • At 0.12 there is one extra velocity iteration on every rank count, against the serial 3.
    • In all coupled cases (0.12, 0.14, 0.16 and 0.20) the two pieces went to the same rank: r1 at np 2, r2 at np 3, r3 at np 4. The ruling's gain, two faults factorised side by side, did not apply, so these cases paid the preconditioner change and got no distribution in return.
    • Only at 0.30 did the add-on partition give the faults to two ranks.
  • Fix options:
    • (a) Merge the pieces whose majority rank is the same. This restores base exactly in every coupled case here, and keeps the gain in apart.
    • (b) Link through fine cells, or the operator's sparsity, plus one overlap layer, so that pieces join when their ASM subdomains touch.
    • (c) At least correct the docstring.
    • Add a near-pair fixture, e.g. par 0.12, that asserts the base iteration count, or no coupling between blocks.

L1 (low). A piece with no owned rows is dropped silently

  • Unmutated, it never happened. There were 0 dropped pieces and 0 uncovered rows in all 56 branch runs at np 2–4. The union of the live block rows equals the gathered subdomain in every case, and equals the gate's subdomain_rows.
  • Under the nohalo mutation (links omit halo rows), 318 halo rows (np 2) and 310 (np 4) become 1-row pieces with no owned row. They are dropped with no message.
    • Velocity iterations: 4 at np 2, and 5 at np 4 against 4.
    • test_1147's first test catches it through the gate count.
  • A loss here is invisible at run time. An assert, or a debug log, that kept ∪ blocks == sub would cost nothing.

L2 (low) [read]. Rows with an empty P row, or with no local DOF, join only through their node

  • Patch rows from the w.size == 0 or li < 0 branch get no coarse link. With li < 0, node_of_row is -1, and lead[-1] indexes the last node. That indexing was already there for node_is_patch; it is not new.
  • We saw no stray pieces: the piece count equals the number of separate faults in every case run.
  • We did not build a case with such rows.

I1 (info). test_1147's iteration test cannot fail on its bug

test_the_velocity_solve_takes_the_serial_iterations (≤ 4) passes:

  • on base at np 2 and 4;
  • under onepiece at np 2;
  • under nohalo at np 2.

It would fail only under nohalo at np 4 (5 iterations). As written it guards a ceiling, not the change. A near-pair case (M1) would give it teeth.

Attack 1: can one fault's patch split?

Pieces from the links, against the fault count. "Ranks" is how many ranks own rows of the piece.

case faults pieces at np 2 / 3 / 4 ranks touched iterations pf = b836 answer pf vs b836
apart (tips, two faults) 2 2 / 2 / 2 1 each 4 = 4 ≤ 1.1e-13
single (test_1139; spans ranks) 1 1 / 1 / 1 2, 3, 3 3 = 3 ≤ 1e-14
kink (0.15,0.40)-(0.50,0.58)-(0.85,0.42) 1 1 / 1 / 1 1 4 = 4 ≤ 2.5e-14
arc (radius 0.3, 126°) 1 1 / 1 / 1 1 4 = 4 ≤ 2.6e-14
abut, one spine, gap 2/6/12/20/30 rungs 2 1 at every gap 1–3 3 = 3 ≤ 2.5e-14
ynet (network mesher, branch 0.02 off the main trace) 2 1 / 1 / 1 1 4 = 4 ≤ 3.4e-14
par 0.04–0.10 2 1 (merged) 1–3 same ≤ 1e-14
par 0.12–0.30 2 2 1 see M1 see M1
  • No single fault split: not at a tip, not at a kink or curve, and not across a partition boundary (single spans 2–3 ranks).
  • abut always merges, even at a 30-rung (0.15) gap. The shared spine's band is continuous through the gap, so its rows are patch rows.
  • Faults that touch or nearly touch merge, and stay correct.

Attack 2: rank asymmetry and collectives

  • _connected_pieces runs on rank 0 only. Its call counts are [1, 0, …] in all 56 branch runs at np 2–4.
  • Every rank receives its list. The scatter is unchanged. Ranks with no piece (apart np 4: ranks 1 and 3; par: every rank but one) install the empty pair as before (a 0-row ASM block) and do not hang.
  • No hang at np 2, 3 or 4, for any case that meshed.
  • Dropped pieces are decided on rank 0 alone, after the gather, so the decision is consistent by construction [read]. Only the mutation produced any.

Attack 3: dropped pieces

See L1:

  • Unmutated, the union of the branch's block rows equals base's single block's subdomain in every case: live_union_eq_sub True, and 0 uncovered rows.
  • Under nohalo, 318 rows are lost, and only test_1147's gate-count assertion notices.

Attack 4: the docstring claim

  • apart:
    • 0 nonzeros couple the two pieces in A[sub,sub], and A's graph on sub has 2 components.
    • The overlap-1 subdomains are disjoint and uncoupled.
    • One LU against the pieces side by side: 0.0 at np 2 and 1.7e-16 to 2.0e-15 at np 3 and 4, with or without the overlap.
    • The claim holds.
  • par 0.12–0.20: the claim fails (M1).

Attack 5: the tests

run test 1 (blocks) test 2 (owner) test 3 (its) test 4 (unit)
base, np 2 and 4 (other job) FAIL "expected 2" FAIL, error 73 (wrong reason) pass FAIL, no attribute
base, np 2 and 4, test 2 corrected FAIL FAIL "on rank(s) [1]" / "[2]" pass FAIL
branch, np 2 and 4 (other job); np 3 alone pass ERROR 73 pass pass
branch, np 2 and 4, test 2 corrected pass pass pass pass
onepiece (cut returns one piece), np 2 FAIL "blocks of [8672]" error 73; FAIL "[1]" when corrected pass FAIL
nohalo (links leave out halo rows), np 2 FAIL 8354 == 8672 error 73 pass pass

Both mutations are caught by test 1. Test 2 discriminates only once it is corrected (B1).

Attacks that failed

  • No single fault split into pieces, on any geometry we could mesh, at np 2–4.
  • Results were bit-identical to base, or within 1e-13, wherever the patch is one piece or the pieces are far apart: 9 cases × 4 rank counts.
  • The serial branch is unchanged: every np 1 run is identical to base.
  • No collective asymmetry and no hang. Ranks with no piece are handled.
  • No real loss of rows: the union of the blocks is the subdomain, and the gate count is unchanged.
  • The zone path is unchanged [read]. We did not rerun 1135 or 1139 here; in the other job they pass on the branch at np 2 and 4.

Merge conditions

  1. Fix B1. Read the velocity PC from the rotated cache, or take ownership from the hierarchy's layout. Show that test 2 fails on base by its assertion; we did that with the corrected line.
  2. Resolve M1. At minimum:
    • merge pieces that land on the same rank (a), which restores base wherever both faults sit on one rank;
    • or link through fine cells, or operator sparsity, plus the overlap layer (b).
    • Correct the docstring claim, which must mention the ASM overlap.
    • Add a near-pair fixture (par 0.12 measures it) asserting base's iterations, or no coupling between blocks.
  3. Optional:
    • guard ∪ blocks == subdomain (L1);
    • give test 3 a case it can fail (I1).

Could not test

  • par 0.02. gmsh generate() made no progress for 600 s on both builds, even at np 1, and the supervisor killed it. Two ladders 0.01 apart with bands 0.01 wide; the ladder mesher's docstring says to use "network" when bands are this close. This is not a branch issue.
  • zig. A tighter zig-zag fault: placement refused it ("the curved ladder inverts 6 of 792 triangles"). The single kink and the arc are covered.
  • A ladder fault cut by a partition boundary. The add-on partition put each placed fault on one rank, so only the test_1139 fixture spans ranks (2–3). It stayed one piece.
  • Scale.
  • A true fault junction that touches, rather than stopping short, under the ladder mesher: the ladder refuses touching bands. The network Y merged into one piece.
  • Rows with an empty P row (L2): we built no case.

Status of B1 at 72d1012 (H1)

B1 is fixed. 72d1012 changes only the test's lookup, to the rotated workspace's KSP. test_1147 at np 2 and np 4 gives 4 passed (see below). M1, L1 and I1 are still open.

H1 test runs: #895 per-fault structural blocks

Run separately from the adversarial review.

f16eb97, the branch's test files on both builds:

  • The files: tests/parallel test_1147, 1139, 1106, 1133, 1134 and 1135.
  • f16eb97: 21 passed and 1 failed, at np 2 and at np 4.
    • The failure is test_1147's test_each_block_is_on_the_rank_owning_most_of_it. It hit PETSc error 73 on the SNES fieldsplit lookup, which is a bug in the test: the fixture solves through the rotated workspace.
  • development b8367c4: 19 passed and 3 failed, at np 2 and at np 4.
    • All 3 failures are in test_1147: test_faults_apart_are_a_block_each_in_parallel ("blocks of [8672]; expected 2"), test_connected_pieces_join_rows_through_shared_keys and test_each_block_is_on_the_rank_owning_most_of_it.
  • test_1139, 1106, 1133, 1134 and 1135 pass on both builds.

72d1012, a test-only fix to the lookup (src is unchanged, so the f16eb97 build was reused, with the tests taken from git archive):

  • test_1147 at np 2: 4 passed.
  • test_1147 at np 4: 4 passed.

Round 2: dd9c22a

Tip: dd9c22a (wt-pf, rebuilt; clean). It is 72d1012 (test_1147 reads the rotated workspace) plus one commit: the pieces one rank receives are concatenated into one block, a block is dropped only if it holds no patch row, and the docstring is corrected. The tests gain test_faults_near_each_other_stay_one_block and lose the "≤ 4 iterations" test.
Base: b8367c4 (wt-b836).

Probes and logs are in runs/2026-11-06/pf895/review2/:

  • probe_pf.py is round 1's probe plus an analysis of the live blocks after the merge: their rows, the operator's coupling between them, their overlap-1 layers, and one LU of their union against the live blocks summed.
  • cmp.py compares branch and base per case and np: the block rows, and the coverage of base's rows by subdomain and after the overlap layer, by kind and by owning rank.
  • mut/mutplug.py has two mutations: unmerge execs f16eb97's _gathered_patch_blocks in-process, and onepiece makes the cut return one piece.
  • test_r2.sh runs test_1147 from dd9c22a through a git archive.
  • run.sh, jobs.sh, and the output in logs/ and npz/.

Both worktrees are clean. We used at most 18 cores at a time.

Verdict

Ready to merge as far as this review goes. Every round-1 finding is resolved or moot:

  • M1 is fixed. Every near pair (0.12–0.20) is again base's single block: the same rows, on the same rank, with the same iterations, and slip within 5e-14. The two-faults-apart case keeps its two blocks on two ranks, still decoupled.
  • No row base covers is missing on the branch, in any fixture, at np 2, 3 or 4, before or after the overlap layer.
  • test_1147 passes at np 2, 3 and 4, and catches both mutations.

One caveat on the new test (N1): it passes on base, by design. It guards against the f16eb97 split, not against base.

Status of the round-1 findings

finding status evidence
B1: test 2 errors (PETSc 73) fixed test_1147 at np 2, 3, 4 on dd9c22a: 4/4 pass. Under onepiece test 2 fails by its assertion ("both faults' blocks are on rank(s) [1]" / "[1]" / "[2]")
M1: coupled pieces split fixed par 0.12–0.20 at np 2–4: 1 block, rows bitwise equal to base's, on base's rank. The live blocks against one LU of their union: 0.0. Iterations equal base. Slip within ≤ 4.9e-14 (0.0 at np 2). Table below
L1: silent drop resolved as claimed Unmutated: 0 base rows missing anywhere (sub and overlap). Under nohalo the 318 / 310 halo-only 1-row pieces now merge into their majority rank's block; the live union is the full subdomain (8672 / 8664), and the slip is identical to unmutated. A row can now be lost only if a rank receives halo-only pieces and no patch row, as the author says; we never saw that [read]
L2: empty-P rows join only via their node unchanged, moot _patch_links is untouched [read]. Any stray piece now merges into its rank's block unless it is the only one there
I1: weak iteration test fixed removed; the near test asserts ≤ 3 iterations, and the unmerge version takes 4

Near pairs, branch against base (attack 3)

Two parallel copies of the 1147 trace, offset ±OFF/2 along the normal (the new test uses A and A + 0.12·n̂, the same geometry shifted). "One LU vs live" is the live blocks (overlap 1) summed, against one LU of their union.

OFF np pf blocks (rank, rows) b836 blocks rows == base vel its pf / b836 slip pf Δslip vs base one LU vs live
0.12 2 (1, 8794) (1, 8794) yes 3 / 3 0.132286046, 0.132279589 0 0.0
0.12 3 (2, 8794) (2, 8794) yes 3 / 3 0.132286053, 0.132279580 1.5e-14 0.0
0.12 4 (3, 8794) (3, 8794) yes 3 / 3 0.132286041, 0.132279593 8.0e-15 0.0
0.14 2 / 3 / 4 (1/2/3, 8790) same yes 3 / 3 0.138060545 (np 2) 0, 1.6e-14, 4.9e-14 0.0
0.16 2 / 3 / 4 (1/2/3, 8626) same yes 4 / 4 0.142731030 (np 2) 0, 3.1e-14, 4.7e-14 0.0
0.18 2 / 3 / 4 (1/2/3, 8806) same yes 5, 4, 4 / 5, 4, 4 0.146505869 (np 2) 0, 5.1e-15, 3.8e-14 0.0
0.20 2 / 3 / 4 (1/2/3, 8760) same yes 4, 5, 5 / 4, 5, 5 0.149504025 (np 2) 0, 1.3e-14, 1.7e-14 0.0
  • Since the rows and the rank are identical, the preconditioner is base's: one LU on the same operator and the same rows. The offline check gives exactly 0.0 on 3 random right-hand sides.
  • For contrast, the unmerge mutation (f16eb97's behaviour) on par 0.12 gives 2 blocks of 4386 and 4408 rows on one rank, 337 coupling nonzeros, 186 overlap rows, one LU vs live 0.67–0.73, 4 velocity iterations at np 2, 3 and 4, and slip 0.1322859789 (Δ 6e-7). That is the round-1 M1, reproduced.

Coverage (attack 4)

Base rows that are not in any branch block, over 11 fixtures × np 2, 3, 4 (33 comparisons): par 0.12/0.14/0.16/0.18/0.20, apart, single (test_1139), kink, arc, abut gap 6, ynet.

  • Subdomain rows missing: 0 in all 33, so there is nothing to classify by patch or halo, or by rank.
  • Rows missing after the overlap layer: 0 in all 33.
  • Rows the branch adds: 0 in all 33.
  • In 30 of 33 the branch block is bitwise base's block, on base's rank. The exceptions are apart at np 2, 3 and 4, which is two blocks by design: 4258 + 4414 = 8672 rows (np 2), 4254 + 4408 = 8662 (np 3), and 4256 + 4408 = 8664 (np 4). They hold exactly base's rows, on two ranks.

Round-1 cases re-run (attack 5)

  • apart:
    • np 2: blocks (r0, 4258) and (r1, 4414);
    • np 3: (r0, 4254) and (r1, 4408);
    • np 4: (r0, 4256) and (r2, 4408).
    • Coupling nonzeros 0, overlap 0, one LU vs live 0.0.
    • 4 iterations, as base. Slip within 9.7e-14 of base.
  • Single-fault shapes and test_1139's fixture (kink, arc, abut, ynet, single): one block, bitwise base's rows on base's rank, the same iterations (3 or 4), and slip within 4.4e-14.
  • Rank handling:
    • The cut runs on rank 0 only: _connected_pieces call counts are [≥ 1, 0, …] in 38 of 38 branch runs.
    • Ranks with no block (e.g. apart np 4: ranks 1 and 3; every near pair: all ranks but one) finished.
    • No hang at np 2, 3 or 4.

Tests and mutations (runs 1, 2, 6)

run np 2 np 3 np 4
test_1147 on dd9c22a 4 passed 4 passed 4 passed
near test on base passed (1 block, 3 its) passed passed
near test, unmerge FAIL: blocks of [4366, 4386] FAIL: [4370, 4386] FAIL: [4370, 4388]
test_1147, onepiece tests 1, 2, 4 FAIL; near passes same same
  • The onepiece failures: test 1 "blocks of [8672]", test 2 "rank(s) [1]", and the unit test.
  • Under unmerge, the near test fails on its block count, which comes first. Its ≤ 3-iteration assertion would also catch it on its own, since the probe measured 4 iterations under unmerge at np 2, 3 and 4.

New findings

N1 (info). The near-pair test cannot fail on base.

  • Base keeps the structural patch as one block at every np, and takes 3 iterations. So the test passes there at np 2, 3 and 4, against the coordinator's expectation that base would fail it.
  • That is correct for what it guards: a regression to f16eb97's split, which it catches at every np.
  • It is not a test that "fails on base"; the tests that do are test 1, test 2 (now that B1 is fixed), and the unit test.

N2 (info) [read].

  • A merged block's rank comes from _majority_rank on the concatenated rows. Because each piece's own majority is that rank, the merged block's majority is that rank too, so no block moves.
  • Ties between ranks resolve to the lower rank both times, so the choice is consistent.
  • None of the runs moved a block.

Could not test (round 2)

  • The case the docstring now leans on: two faults on two ranks that are coupled in the operator. In every coupled case we built, both pieces landed on one rank. Pieces that reached two ranks (apart, and par 0.30 in round 1) were never coupled.
  • A rank that receives only halo-only pieces (L1's remaining hole). We had no case for it.
  • The other round-1 gaps still stand: par 0.02 (gmsh hang), zig (placement refused), scale, np > 4, and 3-D.

Underworld development team with AI support from Claude Code

@lmoresi
lmoresi merged commit 42c4a79 into development Nov 10, 2026
10 checks passed
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.

2 participants