Skip to content

Split-level transfer: the recorded parent's rows where a fault copy has no fine image (#1120) - #1206

Merged
lmoresi merged 4 commits into
developmentfrom
bugfix/split-transfer-parent-rows-1120
Nov 16, 2026
Merged

lmoresi merged 4 commits into
developmentfrom
bugfix/split-transfer-parent-rows-1120

Conversation

@lmoresi

@lmoresi lmoresi commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Fixes #1120. The fix is 2-D only: add_fault's 3-D sheet path (_add_fault_sheets) and label-embedded faults (cut=False) carry no record, and their split-level transfers are unchanged. Review: W1 (convergence and integration work) for the design, H1 (review and parallel test runs on a 96-thread Linux workstation) for the review.

The defect

On a fault cut into an adapt child, the transfer between two split levels (fault_mg.cell_located_prolongation, and cell_located_transfer_parallel in parallel) reads each fine node in the coarse cell that holds its fine cell's centroid.

Next to the fault, the coarse cut leaves thin pieces. A coarse fault copy on such a piece got no fine image on its own side, so its column was empty. After the pair rotation, the copy's mean and jump columns are then proportional, and the Galerkin level is singular. At rest the issue's fixture has 3 such pairs and 3 null directions.

The fix

  1. A record of each split cell's host cell.
    • fault_split.add_fault labels each cell of the mesh being cut with its own index (UW_HostCell). The cut's DMPlex transform and the split hand the label to every cell made from it.
    • The result keeps _cut_parent (the host's local cell for each cell) and _cut_host; then the label is removed.
    • The record is topological, so the snapping that moves vertices onto the trace doesn't affect it. On the fixture, 1470 split cells map onto all 1360 host cells.
  2. The recorded parent's rows, only where a fault copy is weak.
    • A copy column is weak if its norm is below _WEAK_COPY of the median copy column. For the rows that reach such a column, the transfer takes the recorded parent's row.
    • A fine node's candidate parents are the cut pieces of the coarse host cell that its fine host cell nests in. Pieces across the fault are excluded.
    • A fine cell left with no candidate borrows its face neighbours' candidates. A face neighbour is never across the split fault. W1's rule: no refusal.
    • The node takes, among the candidates of every fine cell in its star, the one that holds it best.
    • Every other row stays as located. W1 decided this after an A/B: the parent rule applied everywhere put about 70 nodes into thin cut pieces (worst quality 0.086), and that cost 9 to 28 % more velocity work for no gain.
  3. Hygiene. The label goes on a clone of the DM being cut, never on the live mesh's DM, so a cut or split that fails leaves nothing behind. Every rank-local step in the parallel repair sits inside a collective guard (the column-norm sums, the record read, the hosts' cell tables). The one collective step, the hosts' move check, runs on every rank before the guard.
  4. Parallel. The copy column norms are summed over every rank's owned rows: one allgather of the copies' global columns, then one allreduce. So every rank agrees which copies are weak. The record, the nesting and the parent rows are rank-local, because the add-on partition makes the fault region rank-interior. The collective steps run on every rank (the basis DM, the hosts' built geometry), and a rank-local failure is a CollectiveBuildError on every rank.

Tolerances

  • _WEAK_COPY = 0.1 is dimensionless and relative to the copies' own column norms. It bounds how little fine image a coarse fault copy may have before it is repaired. Measured on the fixture as a fraction of the median copy column, with the located rule alone:

    case copies flagged largest flagged smallest kept
    at rest 4 0 0.255
    every add-on level moved by 0.002 5 0 0.221
    every add-on level moved by 0.015 13 0.069 0.379
    • The gap: across these three cases it is 0.069 to 0.221, a factor of 3.2.
    • H1's wider check: 13 split pairs on 8 variants of the fixture (amplitudes 0.002 to 0.03, two other traces, a three-level add-on) give a pooled gap of 0.069 to 0.182. So 0.1 sits 1.45× above the lower edge and 1.8× below the upper edge.
    • Why not a topological test: every weak copy's rows come from its own side of the fault, so the side alone can't tell a weak copy from a sound one. A topological rule would need a vertex and edge record carried across the levels, which is not cheap.
    • The test that pins it: test_the_weak_copy_threshold_sits_in_the_measured_gap fails if the value leaves the gap. The mutants 0.06 and 0.25 each fail.
  • "Holds it best" means the largest smallest barycentric coordinate of the node in the candidate. There is no tolerance; equal scores keep the first in sort order.

  • The clamp is _clamp, unchanged. It clips negative barycentric coordinates to 0 and renormalises.

  • The nesting of the two host levels locates each fine host cell's centroid on the grids they were built on (locate_in_cells_exhaustive). A centroid more than _INSIDE_TOL (1e-8, barycentric, unchanged) outside every coarse host cell gets no nested parent. On the fixture none does.

  • "Reaches a weak copy" means a weight above 1e-13, the transfer's existing cutoff.

Coordinate matches

There are none for identity.

  • A fault copy's nodes come from the section offsets of the points in _fault_point_pairs.
  • A split cell's host comes from the label.
  • Sides come from the stars of the paired points.

The one geometric step is the nesting of the two unsplit host levels. That is a centroid, which is not a mesh entity, located on adapt levels that nest exactly in their built geometry.

What this PR does not do, and how it reports it

Full recovery needs the coarse levels to follow a move of the fine mesh. That is W1's design note on coarse levels following the fine mesh, which awaits Louis. Until then, only the finest add-on level moves in production, and the repair runs there too.

H1 measured that configuration serially on the issue's fixture: only the child moved, before the cut. "Weak copies" counts empty copy columns.

child moved pairs/null dev -> PR #1101 merges dev -> PR total vel its dev -> PR empty copies dev -> PR parent rows
y, 0.002 4/4 -> 0/0 0 -> 0 117 -> 117 4 -> 0 15
y, 0.005 13/13 -> 3/4 2 -> 7 129 -> 131 23 -> 6 53
y, 0.01 15/64 -> 7/51 6 -> 6 134 -> 131 33 -> 13 57
y, 0.015 13/55 -> 6/56 23 -> 22 123 -> 137 43 -> 20 32
x, 0.002 5/6 -> 0/0 2 -> 0 117 -> 116 11 -> 0 39
x, 0.005 8/16 -> 3/14 5 -> 4 153 -> 152 15 -> 5 30
x, 0.01 5/20 -> 5/19 19 -> 19 117 -> 117 10 -> 10 3
x, 0.015 8/45 -> 8/45 41 -> 41 133 -> 133 13 -> 13 0
  • Small moves are fixed outright.
  • y 0.015 costs 11 % more velocity work.
  • Larger moves keep weak copies that no recorded-parent row reaches.

No silent path. Copies the repair leaves weak are now reported:

The tests move every add-on level by hand, by the same field, before the cut, because production doesn't move the coarse levels yet.

Pre-existing, not touched by this PR: H1 found 15 fine nodes within 0.022 of the trace whose located rows change with the partition (default against seed-7 partition at np 3). They change identically on development. This may matter to #1166.

Tests

  • tests/test_1120_split_transfer_fault_copies.py (serial):
    • every coarse fault copy's column is at least a tenth of the median, at rest and with every add-on level moved by 0.002 and by 0.015;
    • the record maps every split cell to a host, covers every host cell, and leaves no label behind;
    • the threshold sits in the measured gap.
  • tests/parallel/test_1120_split_transfer_fault_copies_parallel.py (min_size 2): the same copy check on the parallel transfer of the partitioned fixture, with column norms over the global matrix.

The tests find the copy nodes with their own lookup, not the code under test.

Results on a 96-thread Linux workstation (single system image; Intel Xeon Gold 6240R, AVX-512; MPICH):

development this branch
serial, at rest 4 empty copy columns 7 passed
serial, every level moved by 0.015 12 empty and 1 weak (same 7)
parallel, np 2, 3, 4 8 empty reduced columns (4 copies × 2 components) passed
parallel, np 5 passed

Solver work on the issue's fixture, serially:

  • What is counted: outer iterations are 1 everywhere. The work figure is the total inner velocity iterations over the solve's velocity applications (17 to 18 per solve). "Last" is the recorded vel_its_last, which samples only the last application.
  • The moved cases have every add-on level moved by the same field.
case development: pairs/null, total (last) this branch: pairs/null, total (last)
at rest 3/3, 116 (5) 0/0, 116 (6)
moved 0.002 2/2, 132 (6) 0/0, 131 (6)
moved 0.015 7/8, 125 (6) 0/0, 129 (6)

Other runs:

  • Serial: 196 passed, 1 skipped. Files: test_1087, test_1174, test_1176, test_0844_line_cut, test_1111, test_0858_fault_network_realisations, test_1120 (8 tests now, including the unrepaired-copies report), test_0874_repair_drops_parent_maps, test_1096, test_1097, test_1173, the test_1022 files and test_1145. test_1111's skip is its own mesh-fingerprint check.
  • Parallel at np 2: 77 passed, 2 skipped (min_size). Files: all four test_0874 files, test_1089, test_1095, test_1096, both test_1097 files, test_1099, test_1101, test_1111, test_1120, test_1139, test_1147, test_1152, test_1173, test_1176.
  • Parallel at np 3 and 4: 50 passed each. Files: test_0874_fault_mg_collective_failures, test_0874_provenance_and_parent_collective, test_1089, test_1096, test_1101, test_1111, test_1120, test_1173, test_1176.
  • np 5: test_1111 and test_1176's split-level test pass, and so does test_1120 (np 2 to 5).
  • scripts/check_test_coverage.py: OK.

Changed expectations.

  • tests/parallel/test_1176_custom_mg_transfer_after_a_move_parallel.py, SPLIT_COUNTS: the at-rest last-application count goes 6 to 7 at np 2 to 5. The total barely moves (np 2: 141 to 144 over 18 applications; np 3: 149 to 153 over 19). This is the same effect as the serial file.

  • tests/parallel/test_1111_custom_mg_cut_of_a_moved_child_parallel.py: this test required a custom MG: two coarse DOFs whose only fine image is the same fine node make the Galerkin operator singular (zero pivot in level SOR) when a coarse level is not nested in the level above #1101 merge at every amplitude of at least 0.005. It now pins the fixed behaviour:

    • at 0.002, no merge and no unrepaired copy (development merges 1 there);
    • at 0.005 and above, the build must report unrepaired copies, since the coarse levels don't follow;
    • at axis 0, amplitude 0.005, no merge (development merges 4).

    Development fails all 7 cases at np 2. A copy that loses its fine images again fails here.

    • Its pinned count for axis 1, amplitude 0.002 becomes 7 at np 4 (6 elsewhere). That is the last application again: the total is 140 before and 142 after, over 18 applications.

Serial test_1176, test_a_split_level_solve_after_a_move_keeps_its_iterations:

  • The change: the expected counts go from [5, 6, 6, 6] to [6, 6, 6, 6].
  • Why it's not a regression: the at-rest count is the last velocity application's. The total over the solve is unchanged (116), and the last application now goes on to 4e-9, where it used to stop at 1.2e-8. The test's docstring says so.

Underworld development team with AI support from Claude Code

…as no fine image (#1120)

Between two split levels the cell-located transfer reads each fine node in
the coarse cell that holds its fine cell's centroid. Next to the fault the
coarse cut leaves thin pieces, and a coarse fault copy on such a piece got
no fine image on its own side: its column was empty, the rotated pair's mean
and jump columns were proportional, and the Galerkin level was singular (3
null directions at rest on the issue's fixture).

add_fault now records each split cell's host cell: a label on the host's
cells that the cut's DMPlex transform and the split carry to every cell
made from it (_cut_parent, _cut_host). In the transfer, a copy column whose
norm is below _WEAK_COPY (0.1) of the median copy column takes, for the rows
that reach it, the recorded parent's row: the cut pieces of the coarse host
cell its fine host cell nests in, less those across the fault (a cell with
none borrows its face neighbours'), the one that holds the node best. Every
other row stays as located: the parent rule everywhere put nodes in thin cut
pieces and cost 9 to 28 % more velocity work. Serial and parallel; in
parallel the copy column norms are summed over every rank's owned rows.

Tests: tests/test_1120_split_transfer_fault_copies.py (at rest, and with
every add-on level moved by 0.002 and 0.015; the threshold's measured gap)
and tests/parallel/test_1120_split_transfer_fault_copies_parallel.py.
test_1176's at-rest iteration count goes from 5 to 6 on the last velocity
application; the total over the solve is unchanged (116).

Underworld development team with AI support from Claude Code
Copilot AI balanced review requested due to automatic review settings November 16, 2026 02:29

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

Copy link
Copy Markdown
Member Author

Review from the Underworld development team with AI support from Claude Code (H1: review and parallel test runs on a 96-thread Linux workstation (Intel Xeon Gold 6240R, AVX-512; MPICH))
(H1 is the session that reviews pull requests and runs the parallel tests.)

Verdict on head f9dfb4a: changes requested. The hybrid transfer is correct and does what it claims. On the issue's fixture I reproduced every number in the PR body, and the fixed outcome does not depend on the partition. But two parallel tests that pass on development fail on this branch, because they pin the old behaviour. Both need their expectations updated in this PR. There is also one medium point on the production configuration, for the integration lead (W1, the session that owns the convergence and integration work) to rule on.

Findings

1. Blocking: tests/parallel/test_1176_custom_mg_transfer_after_a_move_parallel.py fails at np 2, 3 and 4

  • Failing test: test_a_split_level_keeps_the_transfers_and_the_velocity_iterations fails with assert [7, 7, 7, 7] == [6, 7, 7, 7] at np 2, 3 and 4. It passes on development (the merge base fafbecb) at np 2, 3 and 4.
  • Cause: the cause is the one the PR already explains for the serial file. The at-rest last-application count goes up by one, while the total velocity work barely moves. I measured it on the issue's fixture, development versus this branch:
    • np 2: total 141 vs 144 over 18 applications; last 6 vs 7.
    • np 3: total 149 vs 153 over 19 applications; last 6 vs 7.
  • What passes: with SPLIT_COUNTS at rest changed from 6 to 7 for np 2 to 4, the whole test passes, including the kept-transfer check, the moved counts (7) and the rebuilt solver's count (7).
  • Not checked: the np 5 entry needs the same review. I did not run np 5 (core budget).
  • Why it was missed: the PR's parallel list ("33 passed at np 2") does not include this file.

2. Blocking: tests/parallel/test_1111_custom_mg_cut_of_a_moved_child_parallel.py::test_a_cut_of_a_moved_child_solves[0-0.005] fails at np 2 and 3

  • Failing assertion: assert merged is not None and sum(merged["merged_coarse_unknowns"].values()) > 0 fails. With this PR, the custom MG: two coarse DOFs whose only fine image is the same fine node make the Galerkin operator singular (zero pivot in level SOR) when a coarse level is not nested in the level above #1101 dependent-column repair no longer has anything to merge in that case.
  • On development: it passes (np 2: 19 of 19 in this file together with test_1101).
  • What changed, np 2, axis 0, amplitude 0.005:
    • merged coarse unknowns: 4 on development, none on this branch;
    • velocity iterations: 9 and 9;
    • the hybrid flagged 40 copies and took 41 parent rows.
  • The neighbouring case [1-0.005] still passes, but goes the other way: merged unknowns 2 to 7, velocity iterations 6 to 7.
  • What to change: the test encodes the symptom this PR removes. Its expectation should change, for example to "no fallback, and pairs/null not worse than before", rather than requiring a merge.

3. Medium, for W1: the repair is active when only the finest level moves, and the effect there is mixed

The PR body says this configuration is out of scope, and that production does not move the coarse levels yet. But the code runs there: the child moves and the add-on levels stay at their built geometry. I measured it serially on the issue's fixture, development versus this branch.

The table shows level 2 (the coarse level below the finest) of the Galerkin hierarchy. That hierarchy was formed from the fine rotated velocity operator and the rotated transfers, both captured at the solve.

child moved (axis, amplitude) pairs/null dev -> PR #1101 merges dev -> PR total velocity its dev -> PR copies empty dev -> PR parent rows taken
y, 0.002 4/4 -> 0/0 0 -> 0 117 -> 117 4 -> 0 15
y, 0.005 13/13 -> 3/4 2 -> 7 129 -> 131 23 -> 6 53
y, 0.01 15/64 -> 7/51 6 -> 6 134 -> 131 33 -> 13 57
y, 0.015 13/55 -> 6/56 23 -> 22 123 -> 137 43 -> 20 32
x, 0.002 5/6 -> 0/0 2 -> 0 117 -> 116 11 -> 0 39
x, 0.005 8/16 -> 3/14 5 -> 4 153 -> 152 15 -> 5 30
x, 0.01 5/20 -> 5/19 19 -> 19 117 -> 117 10 -> 10 3
x, 0.015 8/45 -> 8/45 41 -> 41 133 -> 133 13 -> 13 0
  • Better: small moves are fixed outright (0.002 on either axis goes to 0/0).
  • Worse: y 0.015 costs 11 % more velocity work (123 to 137), and its null count goes up by one, as the PR body already notes (55 to 56).
  • Silent no-op: at x 0.015 the hybrid flags 13 weak copies but takes no rows (rows: 0), and nothing reports it.

Nothing here fails a solve. W1 should decide whether to ship the repair ungated, or to restrict it to split pairs whose coarse level sits where the fine level was built, until the coarse levels follow the fine mesh. Either way, the PR body should state the measured effect in this configuration.

4. Low: the host-cell label can be left on a live mesh

  • Where the label goes: _mark_host_cells(dm) labels the dm that _track_fault_records(mesh) returns. For a mesh with no earlier fault, that is mesh.dm itself, not a clone.
  • Where it is removed: only at the end of a successful add_fault.
  • What leaves it behind: any exception in between, such as the collective seam refusals or a failure in pull_vertex_onto or cut_along_lines. In split_tail_levels this is a normal path: a level the replay cannot carry stays welded, and the exception is caught, so UW_HostCell stays on a level that remains in the hierarchy.
  • Consequence: checkpoints then write the label, and refinement inherits it.
  • Fix: a try/finally around the cut, or marking a clone, closes this.

5. Low: the no-repair paths are silent

The repair does nothing, with no warning, in these cases:

  • there is no record (cut=False label-embedded faults, 3-D sheets, since _add_fault_sheets returns before the marking, and a mesh rebuilt without _cut_parent);
  • the record's length does not match;
  • no parent row reaches a weak copy (finding 3, x 0.015);
  • stranded cells leave a copy weak.

The only trace is the module global fault_mg.last_parent_rows, which each build overwrites. Suggestions:

6. Nit: two collective-hygiene gaps (in the #874 sense)

These sit in _recorded_rows_where_weak_parallel:

  • the per-rank norm accumulation, between the allgather and the Allreduce, is outside the try/_collective_raise pattern;
  • so is _built_cell_table, which holds an allreduce of its own (_moved_off_transfer_geometry).

Both are pure array work on arrays that have already been checked, so the risk is low. But a rank-local exception in either would leave the other ranks waiting. Moving them inside the guarded block keeps the function uniform.

Confirmed correct

  • Rows changed: parent rows replace only the rows whose recorded-parent row reaches a weak copy column, with weight above 1e-13. Every other row stays located.
    • At rest, 10 rows change (serial and every parallel run).
    • With every add-on level moved, 14 to 41 rows change, depending on the move.
    • After the repair, no fixture in which every add-on level moves together (or none moves) has an empty or weak copy. No sound copy dropped below the threshold: the lowest post-repair ratio is at or near the smallest kept located ratio in every such case. Finding 3 covers the finest-only moves, where weak copies remain.
  • The weak decision is collective:
    • the copies' global columns are allgathered, and the norms are summed by Allreduce over owned rows only;
    • the _split_record availability is reduced with MIN before the collective _built_cell_table;
    • every rank reached the same verdict (weak 8 columns, 10 rows, 0 stranded) in all 12 parallel runs below.
    • There is no rank-local early return before a collective in the new code. The two _collective_raise calls bracket the rank-local work, with CollectiveBuildError as the error class.
  • The label survives: it gets through the pull, the cut transform and the split on every rank, ghost cells included. The record had no -1 entry on any rank in any run, including the runs with an empty rank. In serial, every one of the 1470 split cells has a host, and the record covers every host cell (the PR's record test passes).
  • A cell with no recorded parent: it gets no candidates of its own and borrows its face neighbours'. A node with no candidate in its whole star keeps its located row. None occurred at rest; up to 3 stranded cells occurred in the moved and three-level cases, without leaving a weak copy.
  • Partition independence: I ran np 2, 3 and 4, each with the default partition, two random partitions (seeds 1 and 7) and an empty-band layout. At np 3 and 4 the empty-band layout left one rank with no cells on the split mesh. In every run:
    • located alone: 284 copy columns, 8 empty (4 copies × 2 components);
    • this branch: 0 empty, 0 weak;
    • pairs/null 0/0 on level 2, with smallest eigenvalue ratio 2.0073e-4 to 2.0077e-4 (serial: 2.0073e-4).
  • Repaired rows across partitions: the 10 repaired rows match to 1e-9 between the default and seed-7 partitions at np 3, by fine-node coordinates.
  • The PR's tables reproduce exactly:
    • development: pairs/null 3/3, 2/2 and 7/8, with totals 116, 132 and 125;
    • this branch: 0/0 throughout, with totals 116, 131 and 129;
    • copy columns: 4, 5 and 13 flagged, with largest flagged 0, 0 and 0.069, and smallest kept 0.255, 0.221 and 0.379.
  • Threshold on other fixtures: 13 split pairs on 8 fixtures. The variants were move amplitude 0.002, 0.005, 0.01, 0.015 and 0.03, two other traces (at rest and moved 0.015), and a three-level add-on.
    • The pooled gap is 0.069 (largest flagged, the PR's fixture moved 0.015) to 0.182 (smallest kept, the three-level add-on's lower split pair at rest).
    • So 0.1 still sits inside, at 1.45× above the lower edge and 1.8× below the upper edge. The upper edge is tighter than the PR's 0.221.
    • Three more variants did not split any coarse level, so they did not exercise this code: base cell size 0.08 or 0.12, and a near/far size ratio of 3.
  • The threshold mutants fail as claimed: 0.06 fails 2 tests (moved 0.015), and 0.25 fails 1 (moved 0.002).
  • test_1176 serial change: justified. The total is 116 on both, and the last application goes from 5 to 6. The test still separates a kept transfer (6) from a rebuilt one (13), so the change hides no regression. Applying it to the parallel file (finding 1) gives the same result.

What was run

The PR touches Python only. I ran it as an overlay of the PR head on a development build at 176958a, from which it differs only in .py files. Development is an overlay at the merge base fafbecb. Every parallel run went under scripts/mpi_supervisor.py. Logs kept by the reviewer.

The PR's own tests:

  • tests/test_1120_split_transfer_fault_copies.py (serial): 7 passed on the branch, 7 failed on development (4 empty at rest, 5 at 0.002, 12 empty and 1 weak at 0.015; record and threshold attributes missing).
  • tests/parallel/test_1120_..._parallel.py: passed at np 2, 3 and 4. It fails on development at np 2 (8 empty reduced columns).

Neighbour tests:

  • Serial: 162 passed and 1 skipped (test_1111 mesh fingerprint) over test_1087, 1174, 1176, 0844_line_cut, 1111, 0858_fault_network_realisations, 1120, 0874_repair_drops_parent_maps, 1096, 1097 and 1173. Also test_1022 and test_1145: 7 passed.
  • Parallel np 2: 40 passed, 2 skipped (min_size 4), 1 failed (finding 1). Files: all four test_0874 files, 1089, 1096, both 1097 files, 1099, 1173 and 1176_custom_mg.
  • Parallel np 3 and np 4: 30 passed and 1 failed each (finding 1). Files: 0874_fault_mg_collective_failures, 0874_provenance_and_parent_collective, 1089, 1173, 1176_custom_mg, 1096 and 1120.
  • Parallel np 3, more files: 22 passed, 1 failed (finding 2). Files: 1095, 1111_custom_mg_cut_of_a_moved_child, 1139, 1147 and 1152.
  • test_1111_custom_mg_cut_of_a_moved_child + test_1101, np 2: development 19 passed; this branch 18 passed, 1 failed (finding 2).
  • Parallel test_1176 split-level test: on development, passed at np 2, 3 and 4. On this branch with the at-rest count set to 7, also passed at np 2, 3 and 4.

Probes:

  • copy-column norms, located alone and hybrid;
  • the hybrid's record;
  • the Galerkin levels' null directions and proportional rotated-transfer column pairs;
  • total velocity iterations, counted with a monitor on the velocity sub-solve;
  • runs serial, and at np 2, 3 and 4 under the partitions above.

Not run:

  • np 5 and np 8;
  • the 3-D sheet path (not touched; no record there);
  • the full test suite;
  • the test_0874 mirrored-cut and nested-verdict files at np 3 and 4.

Underworld development team with AI support from Claude Code

…giene

H1's review of #1206:
- The repair's per-level record (fault_mg.last_parent_rows, now with the
  copies still weak afterwards) is kept on the hierarchy and carried by
  record_repairs to solve_report.config["multigrid_hierarchy"]
  ["unrepaired_fault_copies"], next to the #1101 merges, with a
  once-per-session warning. A pair with no record (3-D sheets,
  label-embedded faults) is reported the same way. Not pc_fallbacks: the
  hierarchy installed is the one requested, as for the #1101 merges.
- tests/parallel/test_1176: the at-rest count goes 6 to 7 at np 2 to 5
  (last application; totals barely move).
- tests/parallel/test_1111: the expectation pins the fixed behaviour (no
  merge and nothing weak at 0.002; unrepaired copies reported at 0.005 and
  up; no merge at axis 0, 0.005), so lost fine images fail it; the 0.002
  count is 7 at np 4 (total 140 to 142).
- The host-cell label goes on a clone, never on the live DM.
- The parallel repair's rank-local steps (the column sums, the record, the
  hosts' tables) are under the collective guard; the hosts' move check,
  which is collective, runs before it on every rank.
- The threshold's comment adds H1's pooled gap (0.069 to 0.182).

Underworld development team with AI support from Claude Code
@lmoresi

lmoresi commented Nov 16, 2026

Copy link
Copy Markdown
Member Author

Review from the Underworld development team with AI support from Claude Code (H1: review and parallel test runs on a 96-thread Linux workstation (Intel Xeon Gold 6240R, AVX-512; MPICH))
(H1 is the session that reviews pull requests and runs the parallel tests.)

Verdict on head d4f6120: ready to merge on green from this review. Both blocking items and all the lows from the first review are fixed. Two new points came up. Neither blocks, and both sit in the configuration the PR states it does not fully recover (only the finest level moved). I suggest a follow-up issue for them.

I tested a fresh build of d4f6120, since it touches a .pyx. Its merge base is still fafbecb. Development has moved on by about ten PRs, two of which touch fault_mg.py and petsc_generic_snes_solvers.pyx. git merge-tree merges it cleanly, but I tested the PR head, not the merged tree, so the merged CI run is the one that counts.

Item by item

Item from the first review Status Evidence
1. Parallel test_1176 at-rest count Fixed SPLIT_COUNTS is 7 at rest for np 2 to 5. The file passes at np 2, 3 and 4 (with test_1111: 10 of 10 each).
2. Parallel test_1111 pinned the old merge Fixed Rewritten to the fixed behaviour, with the (1, 0.002) count pinned per rank count. Passes at np 2, 3 and 4.
3. Finest-only moves: mixed effect, silent leftovers Addressed (reported) multigrid_hierarchy["unrepaired_fault_copies"] gives, per coarse level, the copies left weak. It matches my earlier table in every case: y 0.005/0.01/0.015 report 8/14/28, x 0.005/0.01/0.015 report 7/11/13, and the 0.002 moves report nothing. Exactly one warning per process across repeated builds. The entry is identical on every rank at np 3 (default and seed-7 partitions). Behaviour is unchanged from f9dfb4a: same velocity totals, for example y 0.015 still 137 against 123 on development. The body now says full recovery needs the coarse levels to follow.
4. Label left on the live DM Fixed The label goes on a clone. I forced a failure by monkeypatching cut_along_lines. With the finest cut failing, f9dfb4a left UW_HostCell on the child and d4f6120 leaves nothing. With the add-on replays failing (the welded fallback), f9dfb4a left it on one tail level and d4f6120 on none.
5. Silent no-repair paths, 2-D only Fixed The record-less path (serial and parallel) counts every weak copy as left over and warns. The body states 2-D only.
6. Guard coverage Fixed The norm accumulation (before and after the repair), the record read and _built_cell_table are now inside the try/_collective_raise blocks. The collective move check (_moved_off_build) runs unguarded on every rank first, which is correct.
Merge record "moved out of pc_fallbacks" Nothing to move This head does not move it: the #1101 record was already in config["multigrid_hierarchy"]["merged_coarse_unknowns"] at f9dfb4a. Across src, tests and docs, its only other readers are test_1101 (it reads _mg_merged_coarse_unknowns directly) and test_1111 (it reads the report). The one pc_fallbacks check is the negative "custom_mg.dependent_columns" not in s.pc_fallbacks. Nothing looks in an old place.
Partition independence Unchanged, holds At np 3, default and seed-7 partitions, at rest the result is the same as before: 8 empty columns with located rows alone, then 0 empty and 0 weak, 10 rows, 0 left over, pairs/null 0/0, smallest eigenvalue ratio 2.007e-4.

New, not blocking (follow-up)

  • A. Serial and parallel repair differ when only the child moved before the cut.
    • Cause: in parallel the fine host is the partition_addon copy of the child. That copy no longer counts as moved (_moved_off_build is False on it, True on the serial host). So the hosts are nested on the moved geometry in parallel, and on the built geometry in serial.
    • Effect, x 0.015, located rows the same:
      • serial: 13 weak copies, 0 rows taken, 13 left, pairs/null 8/45;
      • np 3: the same 13 copies (26 columns), 31 rows taken, 2 copies (4 columns) left, pairs/null 2/37 (default partition) and 2/35 (seed 7).
    • Age: the logic is the same at f9dfb4a.
    • Why it is not blocking: it only arises in the configuration the PR declares unrecovered, and the leftovers are now reported. Still, serial and parallel do not give the same answer there.
  • B. The two code paths count unrepaired_fault_copies in different units. Serial counts copy nodes. Parallel counts reduced columns, which is node times component. For the same copies the parallel figure is about twice the serial one (at rest, 4 weak copies serial against weak_copies 8 in parallel). Counting per node in parallel, or naming the unit, would make the entry comparable.

What was run (build of d4f6120; logs kept by the reviewer)

  • Serial: 170 passed, 1 skipped (the test_1111 mesh fingerprint). The files were test_1087, 1174, 1176, 0844_line_cut, 1111, 0858_fault_network_realisations, 1120 (8, including the new warning test), 0874_repair_drops_parent_maps, 1096, 1097, 1173, 1022 and 1145.
  • Parallel test_1176_custom_mg + test_1111_custom_mg_cut_of_a_moved_child: 10 passed at each of np 2, 3 and 4.
  • Parallel, the rest of the earlier set: the four test_0874 files, 1089, 1096, both 1097 files, 1099, 1173, 1120, 1095, 1139, 1147, 1152 and 1101.
    • np 2: 67 passed, 2 skipped (min_size 4).
    • np 3: 67 passed, 2 skipped (min_size 4).
    • np 4: 69 passed.
  • Probes:
    • eight finest-only cases, serial;
    • np 3 at rest and finest-only x 0.015, each under the default and seed-7 partitions;
    • the forced cut failures, on both heads;
    • the host-moved check, serial and np 3.
  • Not run: np 5 and np 8 (core budget), the full suite, and the merged tree.

Underworld development team with AI support from Claude Code

The file has no min_size mark, so CI also runs it serially, and there the
case gives 4 merged unknowns and 7 unrepaired copies (reproduced here; the
same on development's merges, not a regression). Serially the moved child is
its own host and is nested on its as-built geometry; in parallel the add-on
partition's copy, made after the move, is nested where it stands. That is
required case 2a of the coarse-levels design note. The other expectations
(nothing at 0.002, unrepaired copies reported at 0.005 and up) hold at every
rank count, serial included. Serial, np 2 and np 3: 7 passed.

Underworld development team with AI support from Claude Code
@lmoresi
lmoresi merged commit 0189b21 into development Nov 16, 2026
10 checks passed
lmoresi pushed a commit that referenced this pull request Nov 16, 2026
…t as nodes

H1's review of #1216 and point (B) of the #1206 review.

- provenance_transfer_parallel: every statement from the fetched parents to
  the weights (the reshapes, Xw, reference_vertices) is under one guard that
  every rank enters, a rank with no owned node too.
- cell_located_transfer_parallel: the opening reads under one guard, the
  node tables (collective) read first, as in the provenance transfer.
- level_pair_rotation: the guard catches any exception (an IndexError from an
  offset escaped it) and covers the CSR build ahead of createAIJ.
- level_wall_rotation: the per-node blocks and the CSR build are guarded.
- inherit_provenance and _base_parent_addresses: the host's record is checked
  (one entry per cell) and indexed under the guard, before the collectives.
- _carried_reference: a failure reading the table refuses on every rank.
- The parallel fault-copy repair counts copy NODES (by their global columns),
  as serial does, not node x component columns.
Every guard raises a CollectiveBuildError on every rank (addon_partition's
RuntimeError where its checks raise one).

Tests: a forced failure on the last rank at each site
(test_0874_provenance_and_parent_collective_parallel.py, now 24 cases, the
_resolve_parents ones over both records), and the node count checked against
the located transfer (test_1120 parallel). Development hangs or aborts on
every new case at np 2.

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