Skip to content

The FAC patch block solver is LU; the smoother's measurement knobs are removed - #929

Merged
lmoresi merged 3 commits into
developmentfrom
feature/fac-block-solver-lu
Nov 3, 2026
Merged

lmoresi merged 3 commits into
developmentfrom
feature/fac-block-solver-lu

Conversation

@lmoresi

@lmoresi lmoresi commented Nov 2, 2026

Copy link
Copy Markdown
Member

Phase 1 item 2: the FAC patch block solver. The rule was that LU stays unless an inexact block solve comes within about 10 % of its time. None did, so LU stays, and the environment knobs that varied the FAC smoother for these measurements go.

Evidence

The add-on matrix's box (experiment 1; kaiju runs 3331 and 3332, np 4). Every inexact block solve matched LU's Newton count and slip, and none came near its solve time:

box arm LU solve fastest inexact (ILU(2), 5 steps)
S 0.004, cut 0 603 s 1299 s (2.15x)
S 0.004, cut 1 433 s 1404 s (3.2x)
S 0.015625, cut 0 516 s 766 s (1.48x)

At S 0.004, GAMG and hypre blocks took 1750-2981 s, and the arms driven by an rtol took 6578-12532 s.

Change

  • Removed knobs:
    • UW_FAC_SUB_PC (block solver);
    • UW_FAC_WHOLE (ASM without a block solve);
    • UW_FAC_MODE (blocks replacing the level SOR);
    • UW_FAC_ASM_TYPE (restricted ASM);
    • UW_FAC_OVERLAP;
    • UW_FAC_LEVELS.
  • The configuration that ships: composite SOR then basic ASM, one overlap layer, and LU blocks with the nonzero shift. Each measured answer is the comment beside the code that sets it.
  • _set_up_fac_smoothers reads the composite's ASM and the block keys unconditionally, since every FAC level now writes them.
  • Docstrings. _configure_pcmg describes the composite form and the keys it returns. _fac_patch_split says the patch sits on top of whole-level SOR.
  • Docs. fault-split-multigrid.md gains "The FAC patch smoother": the configuration, the reason for each part, and the table above.
  • A TODO(BUG) marks a gap that predates this branch: smoother="bulletproof" is not applied on FAC levels, whose composite's first member is always SOR.

Campaign drivers outside this repository that set the removed knobs now measure the shipped configuration in every arm, without a warning.

Tests

  • tests/parallel/test_1090_mg_live_configuration_parallel.py (tier B) solves each path twice: with no knob set, and with every removed knob set to a value the old code acted on. Both must give the configuration above. On development the old_knobs cases fail.
  • test_1022 drops the branch for the replacing form.

On kaiju (Linux, PETSc 3.25.0):

  • test_1090: 10 passed at np 1; 8 passed and 2 skipped at np 2 and at np 4.
  • test_1022: 28 passed.
  • tests/parallel at np 2 and 4: failures identical to the development baseline, with the same assertion values.
  • Tier A+B: only the host's known failures.

52d6d59 leaves the tier C test broken (a 3-argument call to a 2-argument helper) until 968b274 fixes it. A squash merge avoids that intermediate state.

No issue. Left open: #895 (LU blocks are exactly the 3-D cost it asks about; an inexact-block measurement in 3-D now needs code) and #629 (umbrella). #892 stays fixed-in-development.

Underworld development team with AI support from Claude Code

…obs say

test_1090 checked the live multigrid configuration in the composite and the
plain-ASM forms (UW_FAC_MODE). The FAC block solver is decided: LU stays, on
the add-on matrix's experiment 1, where the fastest inexact block solve on
the box took 1.48 to 3.2 times LU's solve time with the same Newton counts
and slip. The test now solves each path with no knob set and with every
measurement knob the smoother reads (UW_FAC_MODE, UW_FAC_SUB_PC,
UW_FAC_ASM_TYPE, UW_FAC_OVERLAP, UW_FAC_WHOLE, UW_FAC_LEVELS) set to a value
it acted on; both must give composite SOR + basic ASM, one overlap layer,
LU blocks with the nonzero shift. On development the four old_knobs cases
fail.

Underworld development team with AI support from Claude Code
Phase 1 item 2 (the patch block solver). On the add-on matrix's box
(experiment 1, kaiju runs 3331 and 3332, np 4), every inexact block solve
matched LU's Newton count and slip, and none came near its time:

| box arm | LU solve | fastest inexact (ILU(2), 5 steps) |
|---|---|---|
| S 0.004, cut 0 | 603 s | 1299 s (2.15x) |
| S 0.004, cut 1 | 433 s | 1404 s (3.2x) |
| S 0.015625, cut 0 | 516 s | 766 s (1.48x) |

GAMG and hypre blocks took 1750-2981 s at S 0.004, and the rtol-driven arms
6578-12532 s. The rule was LU unless an inexact solve came within about
10 % of its time, so LU stays, and the knobs that varied the FAC smoother
for these measurements go: UW_FAC_SUB_PC (block solver), UW_FAC_WHOLE (ASM
without a block solve), UW_FAC_MODE (blocks replacing the level SOR),
UW_FAC_ASM_TYPE (restricted ASM), UW_FAC_OVERLAP and UW_FAC_LEVELS. Each
measured answer stays as the comment beside the code that ships it:
composite SOR + basic ASM, one overlap layer, LU blocks with the nonzero
shift. _set_up_fac_smoothers reads the composite's ASM and the block keys
unconditionally, since every FAC level now writes them.

test_1090's tier C test still passed the removed mode argument to its
helper (52d6d59); fixed here.

Underworld development team with AI support from Claude Code
… ships

From the adversarial review of 968b274 (no correctness findings):
- _configure_pcmg's docstring still described the removed form (ASM with
  one subdomain replacing the level smoother, only the level keys
  returned); it now describes the composite SOR + basic ASM with LU blocks
  and the keys it returns. _fac_patch_split's docstring says the shipped
  smoother puts the patch on top of whole-level SOR. "In the composite
  form" wording is gone from comments and _set_up_fac_smoothers.
- fault-split-multigrid.md gains "The FAC patch smoother": the
  configuration, why each part, and the box's LU-against-inexact table that
  the code comment cites.
- test_1022's module docstring and _patch_pc no longer describe a replacing
  form, and the union test's branch for it is gone; test_1090's bare
  asserts carry messages and its long docstring line is wrapped.
- A TODO(BUG) marks a pre-existing gap: smoother="bulletproof" is not
  applied on FAC levels, whose composite's first member is always SOR.

Underworld development team with AI support from Claude Code
Copilot AI balanced review requested due to automatic review settings November 2, 2026 23:14
@lmoresi

lmoresi commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

Pre-PR adversarial review

One round on 968b274, and the doc fixes in 61233c8. No HIGH findings and no correctness defect.

Checks run

  • test_1090 tier B on the branch head: 8 of 8 pass.
  • The 25d6281 _configure_pcmg and _set_up_fac_smoothers, loaded against the new test: poisson-old_knobs and stokes_rotated-old_knobs fail at the FAC-levels assertion.
  • Each knob alone on the old code is caught by the test: MODE, SUB_PC, ASM_TYPE and OVERLAP fail it. WHOLE gives PETSc error 73, so that old knob was itself broken.
  • Each knob alone on the branch passes on poisson, stokes_rotated and sheet_rotated.

Findings

  • MEDIUM M1: the _configure_pcmg docstring still described the removed form. Fixed in 61233c8.
  • LOW L1: the old-code failure exercises only UW_FAC_LEVELS, which removes level 2's patch before the other knobs act. The per-knob probe shows each one is caught on its own. Fixed: the bare asserts carry messages.
  • LOW L2: drivers outside the repo go silently inert. Stated in the PR body.
  • LOW L3: stale text.
  • LOW L4: docs. Fixed: the governing doc, fault-split-multigrid.md, describes the smoother and carries the LU table. Left as they are: two dated design records, fault-parallel-placement-2026-09.md:837 and fault-patch-multigrid-2026-08.md:314.
  • LOW L5: a 132-character docstring line, fixed.
  • LOW L6: 52d6d59 breaks the tier C test until 968b274. A squash merge avoids it.
  • LOW L7: "in the composite form" wording, fixed.
  • LOW L8: smoother="bulletproof" is ignored on FAC levels. This predates the branch and is now marked with a TODO(BUG).
  • LOW L9: the owned half of (owned, subdomain) has no library reader left. A note for later.
  • Coordination: feature/fault-slip-coarse-space adds UW_FAC_ASM_LOCAL_TYPE in the hunk this branch rewrites, so expect a textual conflict when it rebases.

Attacks that failed

  • Every caller of _configure_pcmg and _set_up_fac_smoothers: top level, velocity block, the rotated saddle and vector paths, the adjoint, and the legacy path. No caller hits a KeyError or a wrong type, and none reads is_owns, restricted ASM or plain-ASM levels.
  • Prefix match for the block keys (mg_levels_<l>_sub_1_sub_).
  • Rank symmetry: allreduce(len(blocks), MAX) gives every rank an entry.

Issue verdicts

Underworld development team with AI support from Claude Code

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.

🟢 Approval recommended

No active review issues remain for the FAC smoother configuration simplification.

No open issues 🎉

What changed in this PR

This PR fixes the FAC patch smoother configuration to whole-level SOR followed by basic ASM with shifted LU blocks, based on measurements showing no competitive inexact alternative. It removes experimental controls while preserving the block setup behavior established by the #892 fix.

Changes:

  • Removes six environment knobs and simplifies FAC setup to the single supported configuration.
  • Updates regression tests to verify that retired knobs no longer change the live solver configuration.
  • Documents the benchmark evidence and the remaining structural-block size limitation tracked in #895.
File Description
tests/​test_1022_composed_ribbon_fmg.py Removes assertions for the retired ASM-only form and updates explanatory text.
tests/​parallel/​test_1090_mg_live_configuration_parallel.py Checks the fixed configuration with retired knobs unset and set.
src/​underworld3/​utilities/​custom_mg.py Removes experimental branches and standardizes composite SOR–ASM setup with shifted LU blocks.
docs/​developer/​subsystems/​fault-split-multigrid.md Documents the smoother configuration, supporting measurements, and block-size limitation.

Review effort: Balanced

@lmoresi
lmoresi merged commit 6321c71 into development Nov 3, 2026
9 checks passed
lmoresi pushed a commit that referenced this pull request Nov 3, 2026
…-selection

One conflict in scripts/test.sh, adjacent batch-4 lines (test_1133 from #928,
test_1138 from this branch); both kept.

Underworld development team with AI support from Claude Code
lmoresi added a commit that referenced this pull request Nov 3, 2026
…k solver (#929)

The cover gate's record (fac_gate) and the patch summary's reset sit side by
side at build; test.sh's batch 4 carries test_1133 and test_1134.

Underworld development team with AI support from Claude Code
lmoresi pushed a commit that referenced this pull request Nov 3, 2026
…k-919

One conflict in scripts/test.sh, adjacent batch-4 lines (test_1132 from this
branch, test_1133 from #928); both kept.

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.

2 participants