Repository navigation
Rotated free slip, direct LU: one pressure pin over all ranks, kept in the operator's pattern, zeroed after the gauge projection (#348, #899) - #1054
Conversation
The opt-in direct path (solver._rotated_use_lu) has no null space and fixes the pressure gauge by pinning one pressure DOF. _naive_pressure_pin took the first pressure DOF of each rank's own chart, so at np > 1 every rank pinned one: the gauge was over-constrained and the answer depended on the partition. _global_pressure_pin offers each rank's lowest owned pressure row and takes the minimum over the ranks: exactly one row, at any rank count. It returns the row on its owner and None elsewhere, with a pinned flag that is the same on every rank, so the collective zeroRows (forward solve and rotated adjoint) is called by every rank or by none; before, a rank with no pin would have skipped it. The doc's "serial diagnostic, TODO(BUG)" note is replaced. tests/parallel/test_1156 (np > 1 in CI's MPI phase, and serial): exactly one row pinned across the ranks; the direct solve matches the iterative one in velocity and in pressure up to its constant. Serial: test_1156 2 passed; the LU-route and rotated-adjoint files 88 passed. Underworld development team with AI support from Claude Code
…essure row - The pin's zeroRows compressed the pinned row out of the rotated operator's pattern, and the next Newton increment's in-place PtAP wrote into it: a malloc error on the owning rank at np > 1 while the others waited in a collective. KEEP_NONZERO_PATTERN is set before the pin. - The pin candidates skip constrained pressure DOFs, which have no row. - test_1156 asserts the pinned row is the lowest pressure row (an off-by-one pin, an eliminated velocity row, passed before), and that a nonlinear direct solve takes a second increment and matches the iterative one. - The docstring and the subsystem doc say the pin is a valid gauge only where constant pressure is an exact null mode (#899). Underworld development team with AI support from Claude Code
Underworld development team with AI support from Claude Code
…se reads as one - The iterative wrong-given-normal test asserts exactly one warning, as the LU route's test does (H1's #1053 review, N3). - With one declared mode the warning says "The declared rotation mode is not removed", not "1 of the 1 declared rotation modes are not removed". Underworld development team with AI support from Claude Code
…projection (#899) The residual zeroed the pinned pressure row and then projected out the pressure mean, so the mean of the pinned row's residual was spread over every other pressure row and the direct solve solved a shifted problem. An interior pin has no residual to spread; a pin beside a Dirichlet wall does, because the lifted velocity has divergence there. That is #899: on test_1088's fault box the lowest pressure row is a wall corner, and the solve stalled at 2e-5 with the slip 4-6 % off. Pinning pressure rows 40 or 100 instead converged in one increment; zeroing after the projection converges in one increment at any pin, to the multigrid slip to 1e-12. Constant pressure is an exact null mode of that operator (left and right, to 1e-17 with the interface tangent; dense SVD: one singular value at 1e-14, the next at 2.9e-5), so the split fault is not a case where the pin replaces a real equation. The docstring and the subsystem doc no longer say it is. test_1088's direct-LU case loses its xfail and asserts convergence; with the old order it fails at that assertion. Underworld development team with AI support from Claude Code
…ollectives before asserts - A pressure Dirichlet condition already fixes the gauge. With round 1's filter on constrained DOFs, the pin moved onto a real pressure row and the direct solve was 0.9-3.6 % off in velocity (N4). Before round 1 it landed on a constrained DOF and was right by luck. Now nothing is pinned when any pressure DOF is constrained. test_1156 adds the case: velocity and pressure match the iterative solve to 1e-6. With the pin restored it fails at 0.86 %. - test_1156's pin assertions run their collectives first, so a pin that fails on one rank fails the test instead of hanging the others (N3). Underworld development team with AI support from Claude Code
… wording - test_1156 adds a pin beside a Dirichlet wall: a box with the lifted wall velocity (y - 1/2, 0) on three sides and rotated free slip on the fourth. With the old order (pin zeroed before the pressure-mean projection) the direct solve is 10.6 % off in velocity and the test fails. Before this, only test_1088's fault case guarded the order. - With one rejected mode the warning ends "keeps that rotation". Underworld development team with AI support from Claude Code
Review record, round 1 of 3: 26c11aa (pre-PR)Its F2 conclusion, that the pin causes #899, was narrowed in round 2: #899 was the residual ordering, fixed at dccb83d. Paths under Pre-PR review: #348, one global pressure pin on the rotated direct-LU routeBranch Verdict. Mergeable with conditions. The change does what it says. It pins exactly one pressure row at any rank count. On a closed box, the LU answer at np 2 and 4 matches serial to 1e-15 in velocity, where development's was 1.2-1.6% off and still reported itself converged. The adjoint now matches serial at np 2. But there are three problems:
Method
All paths below are relative to Check 1: does test_1156 guard the fix?test_1156 (
On development, the first test fails with an The test's own timeout did not fire. It has Box probe, LU against iterative (
Against serial (the branch at np 1 is the reference):
What these show:
Check 2: is the pinned row correct?Global section offsets. The pin is read with
Edge cases:
What these show:
Check 3: collectives[read] Both call sites gate Measured: the M2 mutant (owner-only Residual exclusion. Check 4: the adjoint on the LU routeClosed box, all walls rotated free slip, viscosity
What these show:
Check 5: #899 and test_1088test_1088:
#899 fixture (
The Diagnosis. #899 is caused by the pressure pin.
Same mechanism on the closed box. There, removing the pin changes nothing: velocity matches the iterative solve to 6.8e-13 and the pressure differs only by a constant. M3, the off-by-one mutant, behaves identically to no pin, because row 3 is an already-eliminated normal row. That is why M3 survives test_1156. Check 6: regressionsParallel, np 2, branch ( Serial, branch. No regressions in the rotated, LU and adjoint files.
Mutants:
Check A (#968 round 3): rotation left in the answer on the LU routeSlid annulus, Lower given and tilted by 1e-2, Upper default (
Pin location against MUMPS ordering:
The ICNTL(7) runs set the option through Verdict on A.
Check B (#968 round 3): malloc crash on lu, it, lu
Where it comes from. The failing call is
Fix, in rotated_bc's LU branch. Set Findings, by severity
Merge conditions
Issue verdicts
What I could not test
Underworld development team with AI support from Claude Code |
Review record, round 2 of 3: 4263cc6Paths under #348 review, round 2: 4263cc6Branch Verdict. F1 and F5 are fixed. F4 is half fixed. F2, re-scoped onto #348 and #899, still stands, and is larger than round 1 said.
So the pin is safe only on straight-walled closed domains. Removing the pin and letting MUMPS factor, or keeping it only where the null mode is verified exact, is the policy question for Louis. The MUMPS section below gives the evidence. MethodAs in round 1.
F1: the KEEP_NONZERO_PATTERN fixtest_1156 (
The new test passes with the option and fails without it at np 2 and 4. The adjoint. [read]
The linear LU adjoint at np 2 is unchanged from round 1 (6.0130997633e-06). Reruns:
F4: test strength
The cause is at test_1156:73-75: if row is not None:
assert row in owned # raises on the owner only
assert uw.mpi.comm.allreduce(...) == lowest # the other ranks wait hereFix: reduce first and assert after, for example F5: skipping constrained pressure DOFs
Pressure Dirichlet cases (
The filter now does exactly what it says. But in these two cases the round-1 code was right by luck: it pinned an already-eliminated velocity row, which was in effect no pin. The fixed code pins a real pressure row in a problem whose gauge the Dirichlet BC already fixes, so the answer is now 1-4% wrong in velocity. That is F2 (pin unconditionally); F5's fix only exposes it. Nothing on development or the branch guards pressure-Dirichlet plus LU. MUMPS: does the no-pin system look singular to MUMPS?How I measured it. The
All runs are serial (
In every case:
Answer for W1 and Louis.
On #899, narrowing round 1. My data agree with W1. #899's operator has an exact null mode and a compatible right-hand side, so the pin there is a legitimate gauge; "the pin replaces a real equation" was wrong for #899. The stall comes from where the pinned row is zeroed:
Round 1's F2 still holds for the curved-wall case. There the null mode is not exact, and moving the zeroing does not help:
On the annulus the forcing is mostly balanced by pressure (v_rms 5e-3 against |p| about 1.7). A 3e-6 inconsistency at the pinned continuity row is therefore a 30-40% error in the small velocity, and the run reports converged because that row is excluded from the residual. New findings
Status
Regressions (4263cc6)
For round 3 (dccb83d)
Could not test
Underworld development team with AI support from Claude Code |
Review record, round 3 of 3: 660e35b7f13db3's new test is checked in a separate comment. Paths under #348 review, round 3: 660e35bBranch
Between the two heads, rotated_bc.py changes only inside Verdict. This PR is mergeable. F1, F4, F5, F6, N1, N3, N4 and #899 are fixed and guarded. Two items stay open and are not part of this PR:
Both belong to the verified-pin policy PR for Louis. MethodAs in rounds 1 and 2. Variants are exec'd over the module at runtime ( Variants on dccb83d (
Variants on 660e35b (
Is dccb83d's ordering change my round-2 660e35b checkstest_1156, 4 tests (
On dccb83d, before the N3 fix, M3 at np 2 still hung (rc 124). The new ordering, both allreduces before any assert, fixes it. Pressure Dirichlet cases on 660e35b (
Is the constraint-count allreduce reached on every rank? [read] Yes. The loop over the chart runs on every rank, including ranks with no pressure DOFs (their count stays 0), and the allreduce follows unconditionally. The mock cases from round 1 cover empty ranks for the second allreduce. Can a pressure constraint exist that does not fix the gauge, so the pin is wrongly skipped? [read, brief] I found no source of one.
N1 and #899 on the real commit (dccb83d)#899 fixture (
test_1088, with the xfail removed: 13 passed at np 1, 2 and 4. lu, it, lu on the slid annulus, tilted:
The old-order mutant (
The ordering is guarded, but by one test on one fixture. A cheap second guard would be a warm-started or Dirichlet-walled LU solve in test_1156 (suggestion). Pin-row sweep on the #899 fixture (linear, LU)W1's rows 0, 5, 40, 100 and 200 are indices into the pressure IS. In global numbering they are rows 0, 5, 58, 238 and 522. Global row 200 is a velocity row, so I ran it as a "wrong row" control and also ran the five pressure rows.
What this shows:
N2 and W1's question about the check-A residue (dccb83d)Slid annulus, fresh solvers, tolerance 1e-10 (
The answer to W1, plainly. The no-pin rotation of 6.6e-3 v_rms is genuine to the discrete problem. It is not an artefact of the ordering bug. The iterative route, converged to 1e-10 from a cold start, gives the same 6.573e-3 and agrees with no-pin LU to 2e-12 in velocity. The tilted given normal makes rotation not a null mode, and the warning says so, so the answer legitimately keeps some rotation. Why round 1's "iterative 5.40e-3" was misleading. That figure came from a solve at tolerance 1e-6, warm-started from the pinned-LU answer, which it accepted in 0-1 increments. The pinned answer's residual sits below the 1e-6 test even though its velocity is 30% off: the operator is ill-conditioned along the near-null constant-pressure mode, whose relative residual is 3e-6. What the ordering fix did and did not do. It changed the pinned value from 5.45e-3 to 5.38e-3, but the pinned LU is still 30-40% off. N2 is the pin on an inexact null mode, not the ordering, and is unchanged on dccb83d. 61bd202 (#1053 follow-ups), on dccb83d
Regressions (dccb83d)
Status
Merge conditionsThis PR (#348), merge as it stands. Optional before merge:
Verified-pin policy PR (Louis). Separate, and carrying N2, F3 and the open-boundary case. The round-2 MUMPS evidence holds:
The policy options are:
Each needs an annulus test such as Could not test
Underworld development team with AI support from Claude Code |
Check of 7f13db3The new residual-order guard works.
Before this commit, only test_1088's LU test caught that mutant. The The logs and the mutant source are on hyperion, in Underworld development team with AI support from Claude Code |
The opt-in direct-LU rotated path (
solver._rotated_use_lu = True) fixes the pressure gauge by pinning one pressure row. This branch fixes three bugs in that pin.One pin, not one per rank (#348). Each rank pinned the first pressure DOF of its own chart, so at np > 1 the gauge was over-constrained and the answer depended on the partition.
_global_pressure_pintakes the lowest global pressure row over all ranks (one allreduce). The owner gets the row, and every rank gets the samepinnedflag, so the collectivezeroRowsis called by all ranks or by none. A pressure Dirichlet condition already fixes the gauge, so then nothing is pinned. The adjoint pins the same row as the forward solve.The pinned row keeps its pattern.
zeroRowscompressed the pinned row out of the rotated operator's pattern, and the next increment's in-placeptap(result=Ahat)wrote into it. That was a malloc error on the owning rank at np ≥ 2, with the other ranks waiting in a collective. It hit any direct solve with a second Newton increment, not only an LU → iterative → LU switch.KEEP_NONZERO_PATTERNis set before the pin.The pinned row is zeroed after the pressure-mean projection (#899). The residual zeroed the pinned row and then subtracted the pressure-residual mean, so the pinned row's residual became a shift on every other pressure equation. An interior pin has no residual to spread. A pin beside a Dirichlet wall does, because the lifted velocity has divergence there, and on test_1088's fault box the lowest pressure row is a wall corner. Constant pressure is an exact null mode of that operator (left and right to 1e-17; one singular value at 1.4e-14, the next at 2.9e-5), so the pin itself is valid there.
Also from #1053's review: the iterative wrong-given-normal test asserts exactly one warning, and with one declared mode the warning reads "The declared rotation mode is not removed".
Tests
tests/parallel/test_1156_rotated_lu_pressure_pin_parallel.py(new, tier B):tests/parallel/test_1088_rotated_interface_operator_parallel.py: the direct-LU fault case loses its Direct-LU rotated path does not converge on a split-fault contact solve (slip 4-5% off) #899 xfail and asserts convergence. With the old order it fails at that assertion.tests/test_1131_rotated_nullspace_from_mesh.py: N3 and the wording.Issues
rotated_bc opt-in LU path: pressure-datum pin is partition-dependent at np>1 #348: fixed-in-PR for the per-rank pin. The issue stays open for the second part: pin only where constant pressure is a true null mode. Where it is not, the pin replaces a real equation. Three cases are measured:
That is a solver-behaviour change and goes to Louis in its own PR. This branch documents the limitation in the docstring and in
rotated-freeslip.md.Direct-LU rotated path does not converge on a split-fault contact solve (slip 4-5% off) #899: fixed-in-PR.
Underworld development team with AI support from Claude Code