Repository navigation
A move that keeps the topology keeps the custom multigrid transfers - #1119
Conversation
After mesh.deform or a mover the custom multigrid hierarchy rebuilt each transfer from the moved coordinates: a node of the moved level was located among the unmoved coarse nodes, and the weights followed the displacement. The relation between the levels had not changed. On a split-fault fixture the solve went from 5 velocity iterations to 13 at the first move. A simplex level that has moved since it was made is now read on the geometry it was made in (fault_mg.as_built_nodes), so the transfers after a move are those before it, to round-off, on the node-cloud, native refine-pair and cell-located routes. - Mesh._transfer_vertices holds the vertex coordinates the transfers are built on. A relax of a mesh that stands there is part of making the mesh and records the relaxed coordinates, inside adapt(relax=True) or in a call of its own; a relax of a mesh that has moved is one more move. - Whether a level has moved is read off its coordinates, collectively. Coordinates written and put back (ephemeral_coords, a restore) are not a move. - Only a level's own moves are undone. A mesh made on a moved one (a cut, a placement, an adapt child) is read where it is, and the base it was made from goes into its hierarchy where it stands, as before. - Quadrilateral, hexahedral and periodic levels are read on the moved coordinates, as before. The structural FAC patch is still dropped by a move (#1017). This is a mode for movers. The count is not lower on every move: under an interior mover it changes by one in either direction; where the boundary moves (a rising wall) it stays at the at-rest count against 5, 6, 7. Serial only so far; the parallel runs are still to come. tests/test_1176_custom_mg_transfer_after_a_move.py (tier B, 19 tests). Underworld development team with AI support from Claude Code
Underworld development team with AI support from Claude Code
With the dependent-column check merged from development, a fault cut into an adapt child that moved by 0.005 or more is refused: the split level under the new mesh is cut where the host's coarse level stands, and coarse unknowns are left with too few fine images. The refusal is the same with the transfers kept or built from the moved coordinates. The test moves its host by 0.002 (6 velocity iterations, as before) and the page says where the refusal starts on that fixture. Underworld development team with AI support from Claude Code
The as-built nodes of a moved level were its nodes at rest to round-off (2e-16). The node-cloud builder is not continuous in the nodes it is given: a node on a face of its triangulation is read in either neighbour. On 2, 4 and 8 ranks, where a native refine pair takes that builder, one weight of a tetrahedral pair changed by 1.4e-4 over a move. A node at a corner or on the degree lattice of its cell now takes the exact barycentric weights, so at degree 1 and 2 it lands on the built position exactly, and the transfer built on it is the one built at rest. The recorded pair of the add-on partition takes its nodes back the same way. test_1176 compares the transfers for equality (it allowed 1e-12), and has a companion for 2 ranks and more with the iteration counts measured on 2, 3, 4, 5 and 8 ranks. The companion has run at one rank only. The subsystem page states the limit that was measured: a redistribution that carries nodes about four cell widths costs one or two iterations a solve with the transfers kept. It also says how the structural patch comes back after a move. Underworld development team with AI support from Claude Code
Underworld development team with AI support from Claude Code
…n interpolation The nodes of a moved level were taken back through barycentric weights snapped to the node lattice within 1e-9. The snap lapsed on a badly conditioned cell, covered only the corner and edge-midpoint nodes of degree 1 and 2, and left a discontinuous space to round-off. Mesh._get_coords_for_basis now takes the vertices to read the nodes on. fault_mg.as_built_nodes hands it the recorded ones, so the nodes are the same interpolation matrix applied to the same vertex coordinates as before the move: bit for bit at any degree, continuous or not, with no tolerance. test_1176 asserts it at degree 1 to 3, both continuities, in 2-D and 3-D. The recorded route between add-on levels on several ranks goes back to the map through the node's own cell, to round-off, as it was measured. It locates nothing, so its transfer changes by round-off only; the claim of the previous commit that it is bit for bit was wrong where the record is held by an ancestor of the fine level. The parallel companion is tier C until it has been run: its counts were measured with the nodes recovered to round-off, and are asserted only at the rank counts they were measured on. Docs: the interpolation in place of the weights, the env flag behind the serial node-cloud counts, the zone patch across a move, and no account of why the rebuilt transfer does better under a strong redistribution. Underworld development team with AI support from Claude Code
The test_117* line of development covers test_1176, so this branch's own line for it is dropped. Underworld development team with AI support from Claude Code
Answers the review of 1410a48. The parallel split-level test compared the transfers before and after a move to 1e-10, on the reading that its finest pair might take the recorded route. It does not: both levels of that pair are split, a split coarse level is never recorded against, and the pair takes the cell-located transfer on the built nodes. The assertion is now equality, as on the other two routes. With the nodes recovered only to round-off this fixture's transfer changes by 6.7e-14 serially, which 1e-10 would have let through. The recorded route (provenance_transfer_parallel) is not changed by this branch, so its docstring goes back to development's wording, and the subsystem page no longer attributes a measured 8.5e-13 to it: that number was measured on the other routes with the nodes recovered to round-off. tests/test_1173_addon_record_after_a_move.py holds the recorded route after a move. The parallel file's docstring says when and on what the counts were measured (2026-11-13, a 96-thread Linux workstation, Intel Xeon Gold 6240R, MPICH, 2 to 8 ranks; the tetrahedral counts at 8 ranks only). The change of one tetrahedral weight is 1.4e-4 on 2 and 4 ranks and 1.1e-4 on 8 in all three places that quote it. The subsystem page says a fac_zone's rows stay in the patch across a move and are cut into blocks again from the moved coordinates. Not run on more than one rank. Underworld development team with AI support from Claude Code
…w refused The docs and two test docstrings said the faulted Stokes fixture takes 13 velocity iterations at the first move with the transfers rebuilt from the moved coordinates. That was measured before the dependent-column check of #1101. With the check, the rebuilt hierarchy is refused at the first move (7 groups of dependent coarse columns); the fixture takes 5 at rest and, with the transfers kept, 6 after each move. The text says both. Underworld development team with AI support from Claude Code
Adversarial review record (five rounds, before the PR opened)Each round was a fresh reviewer given the code and not our conclusions. All runs were serial, on macOS (12-core Apple M4); nothing below was run on more than one rank. Probes are kept by the author. Rounds 1 to 3: the change before its first commitThe first version took a moved level back through a per-cell barycentric map kept on the add-on record. What the rounds found and what came of it:
Round 4: the lattice snap (c1e23b0)That commit recovered the built nodes by snapping barycentric weights to the node lattice within 1e-9. The round rejected it: an absolute tolerance lapses on sliver cells, the degree-3 nodes are not on a k/degree lattice, a discontinuous space was left at round-off, the parallel companion claimed tier B on counts measured at other rank counts, and a docstring claimed bit-for-bit for the recorded route. Outcome: the snap was removed (1410a48). The nodes are read by the mesh's own interpolation on the recorded vertices, which needs no tolerance and holds at every degree; the companion went to tier C. Round 5: the interpolation read (1410a48)
Found sound in round 5: the serial tests fail under three mutants (round-off recovery: all 12 node cases and every transfer equality; the snap: degree 3 and every discontinuous space; kept transfer off: every transfer and count test fails or raises). The read is bit for bit beyond the tested cases: after one and two deforms, on a regular box, an annulus, relaxed then deformed, an adapt child, a reloaded annulus, a 3-D box and a surface submesh. By reading only: A check made after round 5: with the kept transfer off, the split-level fixture is refused at the first move by the dependent-column check of #1101 (7 groups). The docs said 13 iterations, measured before that check; corrected in 8179f35. Not checkedAnything on more than one rank: the parallel companion in full, the bit-for-bit read at 2 or more ranks including a rank that owns no vertex, and the route the split-level fixture's finest pair takes there (finding 1 is a reading of the code). Issue verdicts
Underworld development team with AI support from Claude Code |
#1119 kept custom-MG transfer under a move: parallel runs at 8179f35Runs by H1 (review and parallel test runs on a 96-thread Linux workstation (Intel Xeon Gold 6240R, AVX-512; MPICH)), 2026-11-13. Build: branch head 8179f35, which has development ba68af0 merged in. How the runs were made:
Summary
1. test_1176 parallel file, per test per np
Iteration counts measured: at rest, then after each move; "after" is a solver built on the moved mesh. They were identical on every rank.
2. Tet iteration counts for tier BMeasured, in TET_COUNTS form (at rest, then after each of the two moves): TET_COUNTS = {2: [3, 3, 3], 3: [3, 3, 3], 4: [3, 3, 3], 5: [3, 3, 3], 8: [3, 3, 3]}With 3. D3: why np 8 gets a FAC patch and np 5 does not (split-level fixture, at rest)The hierarchy
Per-rank FAC patch rows at np 8These are on the finest level, the only level with a patch. Coarse levels have none at either np.
At np 5 no rank has patch rows on any level. What decides itThe deciding step is
Answer: it is a partition-dependent threshold, but in the adapt's multigrid level selection (a per-rank percentile, MIN-reduced), not in the FAC cover gate. The gate's 0.98 is not near its margin at np 8 (48 % coverage), and at np 1-6 it never runs. That one lost level changes everything downstream:
The 8179f35 commit and D3"The rebuilt hierarchy on the split-level fixture is now refused" is about the transfers rebuilt from the moved coordinates at the first move. With the #1101 dependent-column check, that hierarchy is refused (7 groups of dependent coarse columns). It does not touch the at-rest hierarchy measured here. It also describes only the hierarchy with split coarse levels (np 1-6):
Defects and points to act on
Underworld development team with AI support from Claude Code |
Measured at 2, 3, 4, 5 and 8 ranks on a 96-thread Linux workstation (Intel Xeon Gold 6240R, MPICH), the node-cloud and split-level transfers after the moves equal those before them entry for entry, the tetrahedral pair included. The tetrahedral iteration counts are 3, 3, 3 at each of those rank counts, so the table has them all and the file moves from tier C to tier B. The faulted fixture asserted that the level under the fault is split. That holds at 1 to 6 ranks. At 7 and 8 the adapt keeps one add-on level instead of two (#865: a generation is sized by the smallest of the ranks' own cell-size percentiles), the level is welded, and the finest pair is the recorded route, which reads the moved coordinates and repeats its transfer to 3.4e-14. The test now reads which case it has and asserts each: zero change and the split counts, or round-off and the welded counts (3 at rest, 15 after a move, at 8 ranks). Underworld development team with AI support from Claude Code
#1119 at 2f1f33a: the parallel test file re-runRuns by H1 (review and parallel test runs on a 96-thread Linux workstation: Intel Xeon Gold 6240R, AVX-512; MPICH). 2f1f33a changes only
Result: 3 passed on every rank at np 8, 7 and 2. The split-level test's np 7 and 8 cases now take the welded branch.
CI. CI's parallel pass runs Underworld development team with AI support from Claude Code |
…ame mask The zone case asserted that the kept solver took at most one velocity iteration more than a fresh registration with the zone recomputed from the moved field. That compares two masks. The mover holds the zone field in space while the cells move, so the kept patch's cells hold 135 of the 330 weak cells after one move, 54 of 260 after two and 31 of 208 after three, and the gap is what that drift costs on the host's mesh: one iteration on macOS (12-core Apple M4), two at the second move on a GitHub-hosted Ubuntu runner (8 against 6), where the bound failed. The transfers and the four level operators of the kept solver equal those of a fresh registration to the last bit at every move; only the patch rows differ (1650 kept; 1630, 1398 and 1232 with the zone recomputed). The zone case now asserts what holds on any host: - a registration made after the move with the kept solver's mask takes the same velocity count as the kept solver (7 and 7 at each move); - the kept solver takes fewer than a registration with no zone, which installs no patch (12, 10, 9). The gap to the recomputed zone is printed at every move with the other counts, and is not bounded. The accuracy assertions against the recomputed zone are unchanged, and so is the split-level case. In-memory mutants, each failing at the first move: the kept patch killed (12 against 7), the kept solver alone rebuilding its transfers from the moved coordinates (8 against 7), the kept mask on other cells (12 against 7). The fault-multigrid guide and the subsystem page say that a kept zone patch stays on the cells it was given, and that registering again with the zone recomputed is the remedy. Run on one rank only. Underworld development team with AI support from Claude Code
The CI failure of
|
| Registration | Move 1 | Move 2 | Move 3 |
|---|---|---|---|
| kept (mask given at registration) | 7 | 7 | 7 |
| after the move, the kept solver's mask | 7 | 7 | 7 |
| after the move, the zone recomputed | 6 | 6 | 6 |
| after the move, no zone (no patch is installed) | 12 | 10 | 9 |
So the old bound compared a patch on drifting cells with a patch on the band, and the gap is what the drift costs on the host's mesh: one iteration on macOS, two at the second move on the GitHub-hosted Ubuntu runner (the meshes differ between hosts: q_min at the second move is 0.4275 on macOS, 0.4302 on the runner, 0.4341 there under mpirun). On development the same case ran 8 against 7 on macOS, with both solvers rebuilding their transfers from the moved coordinates.
09fbc36 (tests and docs only). On the zone case the test now asserts what holds on any host:
- a registration made after the move with the kept solver's mask takes the same velocity count as the kept solver;
- the kept solver takes fewer than a registration with no zone.
The gap to the recomputed zone is not bounded. The progress line of each move, printed on a green run too, carries all four counts, so each host's log records them. The accuracy assertions against the recomputed zone are unchanged. The split-level case is unchanged: there a move drops the structural rows by the ruling on #1017, and the kept solver may take one more (17 and 16, 17 and 17, 17 and 17 on macOS; 18, 18, 17 with no zone).
Mutants, in memory, each failing at the first move: the kept patch killed (12 against 7); the kept solver alone rebuilding its transfers from the moved coordinates (8 against 7); the kept mask on other cells (12 against 7).
The fault-multigrid guide and the subsystem page now say that a kept fac_zone patch stays on the cells it was given, that under a mover which holds the zone field in space the band leaves them, and that the remedy is to register again with the zone recomputed. This is the same on development and is not a change of this branch.
Not run: the new assertions on more than one rank. Nothing in the transfers or the blocks should depend on which solver built them, but the equality has been measured on one rank only. It needs 2 and 4 ranks on the Linux workstation before this merges; CI runs it under mpirun.
Underworld development team with AI support from Claude Code
#1119 at 09fbc36: test_1152 at np 1, 2 and 4Run by H1 (review and parallel test runs on a 96-thread Linux workstation: Intel Xeon Gold 6240R, AVX-512; MPICH). The file Result: both cases pass on every rank at np 1, 2 and 4. The progress lines (rank 0; the other ranks' tests passed identically): np 1 (2 passed, 466 s) np 2 (2 passed on each rank, 358 s) np 4 (2 passed on each rank, 311 s) The three things that only parallel runs could show:
One difference from the macOS figures: on this machine, kept and same-mask take 8 at move 2 (7 on macOS). The equality holds either way. Underworld development team with AI support from Claude Code |
… it is refused The docs and test_1176's docstrings said that transfers rebuilt from the moved coordinates were refused by the dependent-column check of #1101. Development now merges the dependent coarse unknowns (#1111), so nothing is refused. Measured on this branch merged with development 01dec8d, serial, macOS (12-core Apple M4): - split-level fixture, transfers rebuilt: 5 velocity iterations at rest and 13 after each of three moves, with 62 to 137 coarse unknowns of the level under the fault merged; kept: 5, 6, 6, 6, one merged - host moved before the cut by 0.002, 0.005, 0.01, 0.02: 6, 6, 7, 6 iterations, with 0, 2, 6, 62 merged on the split level No assertion changes; test_1176 and test_1152 pass on one rank (31). Underworld development team with AI support from Claude Code
#1119 at c1eebf0 (after development 01dec8d with #1111): the parallel runsRun by H1 (review and parallel test runs on a 96-thread Linux workstation: Intel Xeon Gold 6240R, AVX-512; MPICH), on a build of c1eebf0. All pass, and every number equals the pre-#1111 runs on 09fbc36. test_1176, parallel entry: 3 passed on every rank at np 2 and 4.
test_1152: 2 passed on every rank at np 2 and 4. The progress lines: np 2: np 4: The tests do not print merged-unknown counts. np 8 was not run this time; it passed at 2f1f33a. Underworld development team with AI support from Claude Code |
… level selection Underworld development team with AI support from Claude Code
What this does
mesh.deformand the movers (MMPDE,node_redistribution) change where the nodes of the finest level sit and nothing else: every cell keeps its vertices and every node keeps its parent cell on the level below. The custom multigrid transfer between two levels is a statement about that relation, so it should be the same before and after such a move. Until now the hierarchy was rebuilt from the moved coordinates at the first solve after a move, a moved node was located among the unmoved coarse nodes, and the weights followed the displacement.With this change
CustomMGHierarchy.buildreads a moved level on the geometry it was made in, and the transfers after a move equal those before it entry for entry.Mesh._transfer_vertices).fault_mg.as_built_nodesreads the nodes of any function space on those vertices through the same interpolation matrix that gives the mesh its nodes where it stands. The matrix holds the place of each node in its cell and no coordinate, so the result is the built positions bit for bit, at degree 1 to 3, continuous or not, in 2-D and 3-D. There is no tolerance.ephemeral_coords, a snapshot restore) are not a move. Arelax()of a mesh that stands where it was made is part of making it; arelax()after a move is one more move.Scope: a mode for movers
This applies to a move that keeps the topology. An adapt, a remesh, or a fault placed or moved makes a new mesh, and its hierarchy is built from that mesh as before. A mover does not replace refinement that adds nodes, and the limits below are part of the change.
set_custom_fmg; registering the old coarse levels again does not bring it back. Afac_zonepatch survives a move as before.provenance_transfer_parallel) is not changed.Measurements
Serial, on macOS (12-core Apple M4), held by
tests/test_1176_custom_mg_transfer_after_a_move.py(29 tests, tier B):preconditioner="fmg", deformed boxLargest change of any transfer entry across a move: 0 on every route (node cloud, native refine pair, cell-located between split levels, tetrahedra).
On 2, 3, 4, 5 and 8 ranks, on a 96-thread Linux workstation (Intel Xeon Gold 6240R, MPICH), measured at 8179f35 with the nodes read bit for bit (the record of those runs is in the comments below):
Largest change of any transfer entry across the moves, the same on every rank: exactly 0 for the wall fixture and the tetrahedra at all five rank counts, and for the faulted fixture at 2 to 5 ranks. On an earlier commit (0355851) that recovered the nodes to round-off, the tetrahedral pair changed by the 1.4e-4 quoted above; the bit-for-bit read answers that. With the transfers rebuilt, the wall fixture took 4, 6, 7, 8 at 5 and 8 ranks.
The faulted fixture has a different multigrid tail at 7 and 8 ranks.
adapt(max_levels=2)keeps two add-on levels at 1 to 6 ranks and one at 7 and 8, becauseMesh._subsample_mg_levelssizes a generation by the smallest of the ranks' own 5th-percentile cell diameters; at 8 ranks the 1208-cell generation misses the threshold by 3 % and is dropped. This is #865, it is the same ondevelopment, and this branch does not change it. With one add-on level the level under the fault is welded, not split, and the finest pair goes by the recorded route between add-on levels (provenance_transfer_parallel), which this branch does not change and which reads the moved coordinates: its transfer repeats to 3.4e-14, not to the bit. The finest level then carries a FAC patch at rest (3 iterations), and the move drops it (15), as #1017 has it. The parallel test reads which case it has: where the level is split it asserts zero change and the first row of the table; where it is welded, a change below 1e-12 and the second row.What has not been run
tests/parallel/test_1176_custom_mg_transfer_after_a_move_parallel.pyis now tier B and holds the second table. At 2f1f33a its faulted test has run on one rank only; the welded branch (7 and 8 ranks) was measured at 8179f35 with the old fixture assertion bypassed, and has not been run as written. 6 and 7 ranks assert the transfers only.tests/parallel/test_1152_fac_zone_survives_a_mover_parallel.pychanged at 09fbc36 after its zone case failed in CI at 2f1f33a (the comment of 2026-11-13 below has the measurements: the kept solver's transfers and level operators equal a fresh registration's, and the two differed only in the mask the test gave them). Its new assertions have since passed on 1, 2 and 4 ranks (the record is in the comments below) and in CI at 09fbc36, on a GitHub-hosted Ubuntu runner, where the kept solver and a registration with the same mask took 7, 8, 7 velocity iterations at the three moves against 12, 10, 10 with no zone. Those runs were before development 01dec8d was merged in.Two things seen on the way that are not this change
Both are the same on
development.relax=Truewas refused by the dependent-column check of 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 at 1 and 5 ranks. Since custom_mg #1101 guard: reduce any dependent group exactly (no refusal), distributed, recorded #1111 the check merges the dependent coarse unknowns and refuses nothing: on one rank that fixture now solves in 6 velocity iterations with 32 and 16 unknowns merged on two levels.Issues
This closes no issue. In the territory:
fixed-in-development): unchanged. A move still drops the structural patch.fixed-in-development): unchanged. Its repair (custom_mg #1101 guard: reduce any dependent group exactly (no refusal), distributed, recorded #1111) merges 62 to 137 dependent coarse unknowns of the level under the fault when the transfers of the split-level fixture are rebuilt after a move; with the transfers kept the hierarchy is the one it had at rest, and one is merged.fixed-in-development): unchanged;tests/test_1173_addon_record_after_a_move.pypasses.Tests
tests/test_1176_custom_mg_transfer_after_a_move.py: 29 passed (again at c1eebf0). Mutants, in memory: with the nodes recovered to round-off every equality test fails; with the kept transfer off every transfer and count test fails or raises.tests/parallel/test_1152_fac_zone_survives_a_mover_parallel.py: 2 passed on one rank at 09fbc36. On the zone the kept solver takes the count of a registration made after the move with the same mask (7 at each move) and fewer than one with no zone (12, 10, 9).scripts/check_test_coverage.py: all 447 files reachable. Docs build clean.Underworld development team with AI support from Claude Code