Repository navigation
#892: FAC patch blocks run the configured LU on the rotated route - #912
Merged
Merged
Conversation
…was configured with The test reads the live PC objects after the solve, not the options database, because the database held the right keys all along. It covers four paths: - the rotated saddle-point solve; - the rotated thin-sheet solve; - the standard Stokes velocity-block install; - a scalar top-level install. Each path runs in the composite and in the plain ASM FAC form. The fixture is a fault split in place over a welded base hierarchy. Every level is checked against what _configure_pcmg and the robust geometric bundle write: - the coarse level: preonly + redundant LU; - every other level: gmres/4 with no norm, SOR; - the FAC level: composite SOR + ASM (or the ASM alone), basic restriction, one overlap layer, and blocks solved by preonly + LU with the nonzero shift. The file has no min_size mark, so it also runs in the serial batch. Against 799ef02 it fails on the two rotated paths in the composite form, in serial and at np 2, and passes the other six cases. The FAC blocks there run ILU(0) with no shift where LU is configured. Underworld development team with AI support from Claude Code
_configure_pcmg writes the FAC block solver into the options database: LU with a nonzero shift. The block KSPs read those keys when the patch's ASM sets up. In the composite form, the default since 891c9bb, the ASM is the composite's second member, and it sets up at its first application. Both rotated call sites (the saddle-point solve and the thin sheet) set up only the level smoother and then drop their per-solve keys. The blocks then took PCASM's default, unshifted ILU(0). On UWTN 2026-022's linear fault fixture at band ratio 24 that is 344 velocity iterations against 67. The fix is one helper, custom_mg._set_up_fac_smoothers, called after the PCMG set-up while the keys are still there. It replaces the two rotated loops and is also called by the velocity-block install. It sets up each FAC level's smoother and its ASM, then sets the block PC type and factor shift from the database on the live block KSPs, so the block solver no longer depends on when the database is read or cleaned. The scalar top-level install does not call it: that PC sets up at the first solve, and its keys are never dropped. The comment above the block configuration now states the intent: FAC blocks are LU, and ILU there is a regression. It replaces the August note that the blocks were SOR. test_1090 passes in serial and at np 2 and 4 (8 of 8 on every rank). Before this change it failed the two rotated composite cases. Underworld development team with AI support from Claude Code
The live-configuration check is now one helper. It checks every level and returns the FAC levels. A second, serial test runs test_1022's composed stack, where the unsplit mid ribbon gets a coarse patch. It pins that the two installs disagree on keeping it: - the standard install keeps the rows of a level the orphan restriction leaves whole, so it patches levels 2 and 3; - the rotated path clears every coarse level's rows after the restriction (B's drop_orphans block in rotated_bc), so it patches level 3 only. The rule is not ruled on. The test makes a change to it deliberate. The rotated path rewrites the hierarchy's level_patch_rows in place. Measured on the same stack, that does not reach another solver given the same hierarchy: its build recomputes the rows, and it patches levels 2 and 3. Underworld development team with AI support from Claude Code
…haracterisation
From the adversarial review.
_set_up_fac_smoothers reads the block solver from the options database. The
docstring said the live set made the blocks independent of when the database
is read or cleaned, which it does not. It now says what the live set does: the
blocks run the configured solver even where the ASM had already set up, and
the keys must still be present when the helper runs.
The guard for a FAC level whose patch PC is not an ASM is removed. Every
configuration, UW_FAC_WHOLE included, leaves an ASM there.
test_which_levels_carry_a_fac_patch records a rule that has not been ruled
on (B's orphan rule on the rotated path), so it is tier C, a characterisation
that reports without gating. The kept-against-dropped measurement it rests
on is in its docstring. The tiers now sit on the tests and the level on the
module.
Design note rule 3 ("SOR subdomain solves are the safe default") is marked
superseded by 891c9bb's LU default.
Underworld development team with AI support from Claude Code
Development now carries #863's sharded CI, and #882, #889 and #890 (this branch's base). The one conflict was scripts/test.sh: test_1090's serial entry now takes the batch form, on shard 4 beside test_1069. All 382 test files are reachable (check_test_coverage). Underworld development team with AI support from Claude Code
The hierarchy counts in faults-in-convection.md were measured while the FAC patch blocks ran ILU(0) instead of the configured LU. Say so beside them, and point at the re-measurement (step 5 of #892's plan). Underworld development team with AI support from Claude Code
Member
Author
Adversarial review (fixes in a998181)Reviewed by a separate agent against Findings and what was done
After the merge of development (fc67b65, CI and test-script changes only), Issue verdicts
Underworld development team with AI support from Claude Code |
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Maintainer review is needed because the live PETSc ILU-to-LU change still lacks completed solver/MPI regression checks and verified 3-D factorization and memory costs.
No open issues 🎉
What changed in this PR
Fixes #892 by ensuring FAC patch blocks use the configured LU solver with a nonzero factor shift on rotated solve paths, rather than falling back to unshifted ILU(0).
Changes:
- Adds shared FAC setup logic and applies it before rotated paths remove their temporary options.
- Adds live solver-configuration tests covering four installation paths in composite and plain ASM modes, plus serial test-runner integration.
- Clarifies that earlier benchmark counts used ILU(0) and marks the old SOR-default guidance as superseded.
| File | Description |
|---|---|
tests/parallel/test_1090_mg_live_configuration_parallel.py |
Checks live multigrid settings and records FAC patch-level placement. |
src/underworld3/utilities/rotated_bc.py |
Sets up FAC blocks before temporary options are removed. |
src/underworld3/utilities/custom_mg.py |
Adds shared FAC setup and applies configured block solver settings. |
scripts/test.sh |
Includes the new regression tests in serial runs. |
docs/developer/guides/faults-in-convection.md |
Qualifies earlier iteration counts as ILU-based measurements. |
docs/developer/design/fault-patch-multigrid-2026-08.md |
Marks SOR-default guidance as superseded by shifted LU. |
Review effort: Balanced
lmoresi
added a commit
that referenced
this pull request
Oct 31, 2026
…patch on the split finest level (ruling of 2026-11-01) The fault-multigrid guide drops the chain as what production runs and states the ruled tail with its counts from the tail sweep on #912's build; its configuration rule on the blocks now says FAC blocks are LU and records that the rotated path ran them as ILU(0) from 2026-09-03 until #912 (#892). The split-level section says the library merged (#889, #890) and keeps the chain as the measured alternative. Mesh.multigrid_levels (#915) replaces the private accessor. The faults-in-convection guide's hierarchy section, code and table are rewritten to the welded tail, with the chain labelled as the alternative and the ILU-era table retired to the journal. The guide is added to the developer toctree it was missing from. Underworld development team with AI support from Claude Code
This was referenced Oct 31, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On the rotated route, the FAC patch blocks ran PCASM's default unshifted ILU(0) where LU was configured. That held for the saddle-point solve and the thin sheet alike. This PR makes them run the LU.
Closes #892
What was wrong
_configure_pcmgwrites the FAC block solver into the options database: LU with a nonzero shift. In the composite FAC form, the default since 891c9bb, the patch ASM is the composite's second member, and it sets up at its first application. Both rotated call sites set up only the level smoother, then dropped their per-solve keys. The blocks then took PCASM's default. The non-rotated installs always read the LU, because their keys are never dropped.The fix
custom_mg._set_up_fac_smoothersruns after the PCMG set-up, while the keys are still there. It replaces the two rotated loops and is also called by the velocity-block install. It sets up each FAC level's smoother and its ASM. It then sets the block PC type and factor shift on the live block KSPs, so the blocks run the configured solver even where the ASM had already set up.Measured
UWTN 2026-022's linear fault fixture, all-application velocity iterations:
On the box: 7 velocity iterations per Newton increment at band ratios 8, 16 and 25. The fixed build reproduces the earlier LU-block measurements exactly.
Tests
Docs
faults-in-convection.mdnow says its hierarchy counts were measured while the blocks ran ILU(0). They are to be re-measured after this merges (step 5 of #892's plan). Design note rule 3 ("SOR subdomain solves are the safe default") is marked superseded by 891c9bb's LU default.Review
The adversarial review (a998181) is in the first comment.
Issues
test_1063_constrained_freeslip_parallel[ti]misses its accuracy anchor (test_1063 [ti]: constrained free-slip topography 1.8% off its recorded anchor on the anchor's own mesh #826), on development too.Underworld development team with AI support from Claude Code