Repository navigation
custom_mg #1101 guard: reduce any dependent group exactly (no refusal), distributed, recorded - #1111
Conversation
…repair M3 (H1's review of #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>
|
The serial custom-MG set (the 24 files from #1104 plus test_1022) gives 155 passed and 4 skipped on f99d870. 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>
|
933d1c9: the docstring, the warning, the refusal, the pc_fallbacks record and the test text now describe #1101 as a level pair that is not nested, following Louis's framing on #1104. A mesh move under unmoved coarse levels is described only as something that makes it more likely. The warning names the level, and the warning test also checks for "not nested". test_1101: 8 of 8 at np 1, 2 and 3. Underworld development team with AI support from Claude Code |
…-dependent-columns-distributed
…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>
|
Verdict: NOT READY at 3f3fc9e. Two small merge conditions: M1, a rank cap in the group reduction, with a test; M2, a correction to the "nonsingular" claim. Everything else the hub asked for checks out: the fix of W1's regression, unchanged behaviour where nothing merges, the pair repair, exactness, rank-uniform decisions, cost and the regression runs. Method
The headline claims: confirmedW1's fixture (test_1111, amp 0.002–0.015, both axes)
Velocity iterations, case by case:
Check 1: a hierarchy the guard leaves alone is unchanged. Confirmed.
Check 2: the pair repair on perturbed test_1152 seeds 0–7. Confirmed.
Check 3: exactness of the general reductionOn W1's fixture (
Constructed cases (
Threshold and residual behaviour (case f: two columns on 2 rows, the second off proportional by δ):
Near-dependent kept columns (case e) are M1 below. M1 (MEDIUM, merge condition): a group with more columns than rows can be kept whole, leaving a silently singular operator
M2 (MEDIUM, merge condition): "makes the Galerkin operator nonsingular" is false on W1's fixture
Check 4: determinism and collectives. Confirmed.
Check 5: the new effect (proportional multi-row groups). It fires and changes nothing else.Where transfers changed, br against base (identical outcome in every case):
Check 6: cost. Detection is distributed, and the repairs are recorded.Near-nested synthetic transfer (
Check 7: mutants
Check 8: regressions, br against base. No new failures.
LOW
Merge conditions
Recommended, not blocking:
Artifacts (
Underworld development team with AI support from Claude Code |
…QR (H1's M1-M3 on #1111) M1. With the two largest columns of a group nearly parallel (1e-9 to 1e-7), the greedy residual test kept all three columns on two rows (rounding in the fit exceeded its tolerance), leaving the operator exactly singular and silent. A pivoted QR now keeps the most independent columns, as many as the group's rank and never more than its rows, and writes the others in that well-conditioned basis (greedy by norm would write them with coefficients of 1/angle, which then swamp the level below's relative unreached test). Test: three columns on two rows with the largest two 1e-9, 1e-8, 1e-7 apart; one merged, composite exact to 1e-12. 3f3fc9e fails all three. M2. The guard removes the dependent groups with small support; it does not make the Galerkin operator nonsingular in general (H1: on W1's fixture, +-1-proportional pairs with 5 to 54 fine rows remain, as before the guard). The docstring and the warning say so. M3. A 1e-6 near-dependent pair must not merge; _DEPENDENT_REL = 1e-2 fails it. W1's fixture: the same merges and iterations as 3f3fc9e, 7/7 at np 1-3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-dependent-columns-distributed
…fallback
The merge is an exact change of basis and the hierarchy requested is the
one installed, so recording it in pc_fallbacks ("requested ... unavailable")
was wrong, and it broke every check that reads pc_fallbacks as "what I
asked for was not installed" (ptest_0865's assert not fallbacks, in CI).
Each install's merges are now kept on the solver and reported in
solve_report.config["multigrid_hierarchy"] (merged unknowns by coarse level
for the latest install; installs that merged any), on the standard and the
rotated report paths. No test asserting on fallbacks is changed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Verdict: READY at d76a70d. M1, M2 and the recommended δ = 1e-6 test (M3) are met. The repair is now a solve-report note, not a Method
1. M1, the pivoted-QR cap: metCase e (columns (1,1), (1,1+d), (0.5,0.7) on 2 rows; the columns are spread over ranks and the rows are on another rank):
Other shapes (np 1–4; "after" is λmin/λmax after the merge; it is −4e-18 to −4e-17 before the merge in every merged case):
Ties (np 1–4):
Determinism.
test_1101 passes 12/12 at np 1, 2, 3 and 4. 2. M3 and the M1 tests catch what they should
3. The note, not a fallback: met on both report paths, with one gap (L6)W1's fixture (test_1111), all 7 cases at np 1, 2, 3 and 4:
Standard path (test_1152 [zone], which reports through the SNES path):
The note is absent where nothing merges:
Elsewhere it is present when the reporting solve merged:
L6 (LOW, follow-up): a fault-contact solve has no SolveReport at all.
4. No development test that asserts on fallbacks was edited
5. Unchanged where it mattersW1's fixture. It passes 7/7 at np 1, 2, 3 and 4. Against my 3f3fc9e runs, every case at every np has:
The decisions differ only by 1–2 extra fold entries per case, with coefficients of 5e-17 to 2e-16 (L4, below). They do not change the transfers. Perturbed test_1152, seeds 0–7 (serial, eps 1e-13, 3 moves):
Regression runs:
The serial custom-MG set (53 files):
6. Cost: unchangedDetection time,
QR runs only on multi-row groups, which are rare, so it adds nothing measurable. LOW (none blocks the merge)
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
Follow-up to #1104 (#1101), now merged. It started as items M3 and L1 of the review of #1104 by H1 (review and parallel test runs on a 96-thread Linux workstation), and it now also fixes a regression #1104 introduced: the guard refused solves that had converged before it. Development (264400a) is merged in. The review (H1) is in progress.
The regression: no refusal
On a fault cut into an adapt child that moved before the cut, #1104 refused groups of three coarse columns on one fine node's two component rows ("share fewer fine images than there are of them"). The rotated transfer mixes a node's components, which is how such groups arise. Before the guard, the same solve converged in 6 velocity iterations (W1 (the convergence work; serial runs on macOS, 12-core Apple M4), on development e4076e5).
Every group of columns with the same small support (at most 4 fine rows) is now reduced exactly to as many columns as it spans:
What the guard does and does not do: it removes the dependent groups with small support. It does not make the Galerkin operator nonsingular in general. Dependent columns with different or wider supports are not detected and can remain. On W1's fixture, H1 found ±1-proportional pairs with 5 to 54 fine rows (3 to 64 null directions after the merge, 4 to 86 before), and the solve tolerates them as it did before the guard. Those pairs are a follow-up on the split transfer (W1).
Nothing is refused.
Evidence. W1's fixture (test_1176's
_split_level_stokes) moves the child byamp sin(pi x) sin(pi y)beforeadd_fault. The new test istests/parallel/test_1111_custom_mg_cut_of_a_moved_child_parallel.py:Velocity iterations, serial:
The guard now also finds dependent groups the pair-only check missed, such as two proportional columns on the same two rows. The unmoved child has one, and still solves in 5.
Other evidence on this branch:
test_1101's refusal test is now a test of the exact reduction of three columns on two rows;test_1101: 12 of 12 at np 1, 2 and 3. Added for H1's review: three columns on two rows whose two largest are 1e-9, 1e-8 and 1e-7 apart (one merged, composite exact to 1e-12; 3f3fc9e keeps all three, silently singular), and a pair independent by 1e-6 that must not merge (_DEPENDENT_REL = 1e-2fails it);test_1022: 155 passed, 4 skipped.The wording is in Louis's terms throughout: a level pair that is not nested, with a mesh move only making it more likely.
What and why
M3 and L1
M3, cost. #1104's detection of coarse columns sharing one sole fine image gathered most of the finest transfer's columns (about 89 %) to every rank and grouped them in a Python loop. That took 9 s per level per install at 1M coarse DOFs on a 96-thread Linux workstation (single system image; Intel Xeon Gold 6240R, AVX-512; MPICH), at np 1 and np 4 alike. Louis's refinement 4 and 5 runs install after every move.
It is now distributed:
np.unique.At 1M coarse DOFs this takes 1.4 s serially and 0.36 s at np 4. The decisions and the tie-break are the same.
L1, observability. The repair warning prints once per Python session. What each install merged is now kept on the solver and reported in
solver.solve_report.config["multigrid_hierarchy"], on the standard and the rotated solve paths. The note carries the merged unknowns by coarse level for the latest install, and the number of installs that merged any.It is a note of what the hierarchy build did, not a
pc_fallbacksrecord. The merge is an exact change of basis, and the hierarchy requested is the one installed. An earlier commit on this branch recorded it as a fallback, which brokeassert not fallbacksin ptest_0865 and would make every split-fault solve look degraded. That record is gone; no test that asserts on fallbacks was changed.Tests
Checklist
level_*/tier_*markers (S8)Underworld development team with AI support from Claude Code
🤖 Generated with Claude Code