Repository navigation
custom_mg: merge coarse unknowns sharing one sole fine image when two levels are not nested (#1101) - #1104
Conversation
When the fine level moves far from coarse levels that did not move with it, two coarse unknowns can be left whose prolongation columns each have one entry, on the same fine row. Their Galerkin rows are proportional and the coarse operator is singular; in test_1152 (a mover after #1024) SOR's inode block met a zero pivot on 4 of 8 1e-13 coordinate perturbations. restrict_unreached and rotated_split_transfers now find such groups (collectively, columns with at most 4 fine images), keep the largest-weight column (ties to the lowest global column), drop the others, and fold each dropped unknown's row of the level below into its kept twin's, scaled by the signed weight ratio. The composite transfer is unchanged, so constants still reach the shared row at full weight. The repair warns; more columns than rows on a multi-row support is refused on every rank; with no such group the transfers are returned untouched. Test: the configuration built directly, the shared fine row on rank 0 and the columns on the last rank, at np 1, 2 and 3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mg-shared-sole-image # Conflicts: # scripts/test.sh
|
Verdict: READY at a508570 (the same library change as #1104's f285af2; the merge brings only development's changes), with two merge conditions: a signed-ratio test (M1) and a correction to the no-op claim (M2). Two items can follow in their own issue: the detection's scalability (M3) and the warning's visibility (L1). All runs used The fix's central claim: the fold is exact (condition 5). Confirmed.In what sense "exact". Column d of P_l is r times column k (both have a single entry on the same fine row). So:
On test_1152 [zone] I measured this with
Dirichlet / split / rotated DOFs.
rotated_split_transfers is covered.
Three or more columns, and chains.
Findings by severityM1 (MEDIUM, merge condition): test_1101 does not catch a dropped sign.
M2 (MEDIUM, merge condition: correct the claim): the repair is not a no-op on test_1152 itself.
M3 (MEDIUM, follow-up, not blocking at test sizes): the detection gathers most of the level, not "a few pairs".
L1 (LOW): the warning is rank-uniform but not once per install.
L2 (LOW, documented): detection limits. The chain and two-row proportional cases above, and the exact-zero test, as described under the central claim. Collective safety (condition 2). Pass.[read] Every collective is reached on every rank:
Constructed at np 1, 2, 3 and 4 (owners verified in the output); all ranks finished with no hang:
In every case the decision was identical on all ranks, the warning was on rank 0 only, and the composite was exact to 1e-15. For the tie, the lowest global column (12) was kept on every rank. The regression (condition 4): test_1152 [zone], serial, fixture perturbed by 1e-13, seeds 0–7"Pass" here means both solves converge at every move, and kept and fresh agree within the test's bounds. The probe does not check the test's iteration bound.
Neighbouring regressions (condition 7)All pass, on both branch and base:
Merge conditions
Artefacts are in runs/2026-11-12-1101/: Underworld development team with AI support from Claude Code |
The fold scales the dropped row by the signed weight ratio. With every fixture weight positive, dropping the sign (abs) went uncaught; the negative twin fails it at np 1, 2 and 3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR #1104 at c65d816: M1 is inc65d816 changes only
Logs: Underworld development team with AI support from Claude Code |
Louis's framing (#1104): the configuration is a coarse level and the level above it that are not nested (a placed, cut or add-on level over a base it was not refined from; any pair whose transfer locates one level's nodes in the other), an ordinary situation; a mesh move under unmoved coarse levels only makes it more likely. The docstring, the warning (which names the level and no longer suggests the mesh was moved wrongly), the refusal, the pc_fallbacks record and the test's docstring say so; the warning test now also checks for 'not nested'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hing On a fault cut into an adapt child that moved before the cut, #1104's guard refused groups of three coarse columns on one fine node's two component rows (the rotated transfer mixes components): "share fewer fine images than there are of them". The same solve converged in 6 velocity iterations before the guard (W1). Every group with the same small support is now reduced to as many columns as it spans: columns taken largest norm first (ties to the lowest global column), each one the kept ones span to a relative residual of 1e-10 dropped and written as their combination, and the level below folded with the same coefficients, so the composite transfer is unchanged, as in the pair case. Nothing is refused. W1's fixture at the amplitudes he measured (0.002 to 0.015, both axes): every case solves at np 1, 2 and 3, the 0.002 case at 6 iterations; development's code refuses 5 of the 7. The refusal test becomes a test of the exact reduction of three columns on two rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…; record each repair M3 (H1's review of underworldcode#1104). The detection gathered about 89 % of the finest transfer's columns to every rank and grouped them in a Python loop: 9 s per level at 1M coarse DOFs on hyperion, on every install, and Louis's refinement 4 and 5 runs install after every move. Each entry now goes to its column's owner (one alltoall), which finds the small columns; each small column's support goes to the owner of its first row (a second alltoall), which groups them with np.unique. Only the decisions are gathered. At 1M coarse DOFs: 1.4 s serially, 0.36 s at np 4. Same decisions, same tie-break. L1. The warning prints once per Python session. Each install that needed the merge is now also recorded in solver.pc_fallbacks ("custom_mg.dependent_columns", with the levels, the counts and the number of installs so far), so a run's report shows how often it fired. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes #1101. H1: READY at a508570 / f285af2, with conditions M1 (a signed-ratio test) and M2 (this text), both done.
What and why
A coarse level and the level above it need not be nested. The transfer between such a pair is built by locating one level's nodes in the other, not derived from a refinement. That is an ordinary, legitimate configuration:
In such a pair, two coarse unknowns can have the same single fine node as their only fine image. Their prolongation columns are then proportional, their Galerkin rows are too, and the coarse operator is singular. SOR's inode block over the two rows meets a zero pivot.
A mesh move under coarse levels that are not moved with it makes this more likely, and that is where it was seen: in test_1152, after #1024's mover, 4 of 8 coordinate perturbations of 1e-13 hit the zero pivot. Development also builds such levels in unperturbed test_1152 today (see Tests).
fault_mg.restrict_unreachedandrotated_split_transfersnow find such groups and merge them, at install.How a group is found:
How it is merged:
The composite transfer is unchanged, so constants still reach the shared fine row at full weight. A plain drop would lose the dropped weight there. The range of P is unchanged.
The repair warns. A support of s > 1 rows shared by more than s columns is refused on every rank. With no such group, the transfers are returned untouched.
Limits, stated in the docstring and the warning: columns with wider supports, or with different supports on too few rows, are not detected. In W1's scan every group was 2 columns on 1 row.
The guard does not depend on how the pair arose, so it stays correct for non-nested pairs once moves stop being a trigger.
Tests
tests/parallel/test_1101_custom_mg_dependent_columns_parallel.pybuilds the configuration directly. Rank 0 owns the shared fine row and the last rank owns the two columns, so at np 2 and 3 the shared row is on another rank. The file runs serially (batch 3) and in the parallel batches.Perturbed test_1152 (1e-13): all 8 seeds pass, and the repair fires in each. On f8c6014, 4 of 8 fail.
Existing tests, from H1's review:
[zone]at every move, serial[split], and np 4[zone]. The iteration counts are equal.So development already builds rank-deficient coarse levels in test_1152. SOR survives them on that CPU, and on some other inputs, or with another rounding, it meets the zero pivot (4 of 8 perturbed seeds). With the guard those levels are repaired; everywhere else the same Mats come back.
Development (01b06c9) is merged in, so this branch's CI should show test_1152
[zone]green with the guard.Checklist
level_1/tier_bmarkers (S8)Underworld development team with AI support from Claude Code
🤖 Generated with Claude Code