Skip to content

Rotated free slip takes its rotation modes from the mesh, while the walls stay put (#906, #877) - #964

Merged
lmoresi merged 19 commits into
developmentfrom
bugfix/rotated-nullspace-from-mesh-906
Nov 8, 2026
Merged

lmoresi merged 19 commits into
developmentfrom
bugfix/rotated-nullspace-from-mesh-906

Conversation

@lmoresi

@lmoresi lmoresi commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Rotated free slip takes its rigid-rotation modes from the mesh, mesh.nullspace_rotations, which the mesh factories fill and the standard Stokes path already reads (#906).

The bug

On a spherical shell with rotated free slip on both walls and the default normal, the answer carried an arbitrary rigid rotation. The rotated path built the Cartesian rotations and kept those that passed a 1e-8 test against the discrete constraints. On a faceted sphere the facet-averaged normal is not radial at the nodes. Every rotation failed the test by 0.0075 to 0.0164, so none was removed. On a 0.3 shell the answer carried a rotation of rate 4.66 in a v_rms of 3.93, against 1.81 under the analytic radial normal.

The change

  • Where the modes come from. The rotation modes are the ones the mesh declares. A declared mode has its constrained rows zeroed, so v·n = 0 stays exact when it is projected out. It is still tested against the assembled operator, so a no-slip wall rejects it.
  • When a declared mode skips the constraint test. Only where faceting is the one reason it could fail:
    • every rotated wall takes the default normal; a given normal is tested, and an exact one passes;
    • the declared modes rotate about one centre;
    • each wall's vertices are equidistant from that centre, to 1e-9 relative, reduced over all ranks.
      A deformed wall fails the check, as a free surface does after its first step; the mode then takes the constraint test, and the solve warns once. A rotation that is only near-null there is kept, not removed as a gauge: Louis's ruling, "the deformation may not eliminate the null space". rotated-freeslip.md says so and points to a post-solve projection for a model that wants it gone. Walls that mix given and default normals are refused with a warning (Rotated free slip: a mesh whose walls mix given and default normals keeps a rigid rotation in its answer #968 tracks a per-wall exemption). _rotated_freeslip_info["declared_modes_exempt"] records the verdict per mode on every route, the direct LU included. A move that slides wall vertices along their circles (MMPDE) keeps the exemption.
  • Derived meshes. Meshes adapted, cut, split, placed into or moved by the add-on partition inherit the declaration, rewritten in their own coordinate symbols. remesh works in place and keeps it.
  • The setter refuses a field that is not a rigid rotation. An empty declaration, nullspace_rotations = [], means the mesh has none, and nothing is warned.
  • Coordinates. The modes are built from coords_nd. In a units model the dimensional coordinates are a UnitAwareArray, and in 3-D np.zeros_like raised TypeError on it (Units-model rotated solve with cdim 3 fails in _rigid_rotation_modes (UnitAwareArray coordinates) #877).
  • The projection of exact modes (test_1064 annulus FMG solve runs past the CI supervisor at np 2 since eddab707; same tree passed on #947's PR run #963, Project exact rotations out of the rotated velocity preconditioner; fixes the shard-4 hang (#963) #967), where declared near-null modes now meet it. On the custom-FMG route an admitted rotation is projected out of the velocity preconditioner when its Jacobi-scaled residual, max |(D⁻¹ A m)ᵢ| / max |mᵢ|, is at most max(1e-10, min(1e-6, 100 tol)).
    • The measure is local: on hyperion's slid annulus it is 6.2e-4 at a viscosity contrast of 1 and 5.6e-4 at 1e8. The Frobenius ratio it replaces classed that mode as exact from a contrast of 1e5 up, and projected it at 2 to 4 times the cost.
    • The threshold follows the tolerance, because what projecting a near-null mode costs does (hyperion, round 4). At tol 1e-9 and np 2 projecting paid at 62 tol and cost at 180 tol, and at tol 1e-11 a projected mode at 6.2e-8 ran the velocity solve into its cap.
    • The record carries null_mode_threshold.
  • The cross-solve workspace. A tolerance change drops its KSP context, which the tolerance sets, and keeps the rotation, operator and prolongation.
  • Smaller fixes. The geometry cache key includes the declaration. The adjoint restores the forward solve's whole null-mode record.
  • Unchanged. A mesh that declares nothing keeps the old detection: a box finds no mode. A mesh reloaded from a file declares nothing, like a gmsh import, and declares its modes through the setter.

Evidence

Serial, macOS, at 01a82dc (31d47c5 merges development fe494b1, with #1002, and 5031aa2 is docs only; at 31d47c5 test_1131, test_1142 and test_0784: 52 passed, 1 skipped):

  • The serial rotated, custom-MG and fault set: every file that uses rotated free slip, the custom MG, nullspace_rotations or add_fault. That is 64 files, test_1131 and test_1142 among them, run with -m "not tier_c": 638 passed, 4 skipped, 0 failed, in 43 min.
  • The mutants in the round responses fail the tests. Among them: the Frobenius measure, fixed and mis-scaled thresholds, no Gram-Schmidt, one-sided projection, no tolerance in the cache key, no inheritance in _moved_wrap, no LU record, and the empty-declaration warning.

Parallel, Linux (hyperion):

  • At d7548b3: test_1131 and test_1142 pass at np 2 and 4. The np 4 0.3 shell is on the sphere, with L2 3.478931521 against 3.478931513 at np 2.
  • Round 4's cost table holds under the new threshold. Every case converges to the same L2.
  • At 01a82dc: RSS stays flat at 800 MB over 10 alternating-tolerance re-solves at np 2.

Reviews

  • Round 1, an independent agent on 3f76514, raised 12 items, including a HIGH: a declared mode was admitted on a deformed wall. All are resolved.
  • Hyperion, rounds 2 to 5. Each record and our response is a comment on this PR. Round 5 found the branch ready to merge with one Low, fixed in 01a82dc and checked by hyperion.

Issues

Underworld development team with AI support from Claude Code

Written first, against development 25d6281:
- a spherical shell with rotated free slip and the default normal must
  return no rigid rotation (fails: all three rotations are rejected at
  constraint violations 0.0140, 0.0164 and 0.0075, as #906 measured);
- a mesh without the metadata declares its rotations through a public
  setter, which validates the component count (fails: no setter).
Two controls, which pass now and must keep passing:
- a box finds no mode;
- a declared annulus rotation pinned by a no-slip inner wall is rejected.

Underworld development team with AI support from Claude Code

(cherry picked from commit fb4aeca)
The rotated path built every Cartesian rotation and kept those that passed a
1e-8 test against the discrete constraints. On a spherical shell with the
default (facet-averaged) normal all three failed (violations 0.0075-0.0164),
none was removed, and the answer carried a rigid rotation: rate 6.2e-3 in a
v_rms of 4.62e-3, against 1.81e-3 under the analytic radial normal.

The candidates are now the modes the mesh declares in
mesh.nullspace_rotations, which the standard Stokes path already reads. A
declared mode is not tested against the constraint rows; its constrained rows
are zeroed, in the null space and in the post-solve gauge removal, which makes
it exactly compatible with v.n = 0. It still takes the operator test, so a
no-slip wall that pins it rejects it. The mesh attribute is None until
declared, and a mesh that declares nothing keeps the old detection. A public
setter declares modes on a mesh built without them; [] declares none.

On the shell at cell size 0.5 the default normal now gives v_rms 1.885e-3
(+4.0% against the radial normal; development +155%), and at cell size 0.25
1.8067e-3 (+0.10%; development +19%).

test_1131 now bounds the residual rotation at round-off (development's 6.2e-3
passed the old 0.05 bound) and compares v_rms with the analytic-normal solve
on the same mesh.

Underworld development team with AI support from Claude Code

(cherry picked from commit fe50bf7)
The guard after the rotated Newton loop warns when the residual component
projected out along the rotation modes dominates the converged residual: a
forcing with a net torque. A declared mode that the faceted constraints satisfy
only to a violation s carries a component of a torque-free forcing too, so the
guard fired on every default-normal shell. Measured on #906's shell, the
component was 8.8e-5 of the forcing scale at s = 0.016 and 6.0e-6 at
s = 0.0042 (about s^2/3); a torque of 1% of the forcing gave 1.7e-2 under
either normal.

The null-space builder now records the largest violation of an admitted mode
(solver._rotated_null_mode_slack, 0 when every mode is exact), and the guard
warns above 10 s^2 of the convergence reference as well as above the converged
residual. For exact modes it is unchanged. The exact-mode tolerance is named
(_ROTATION_MODE_TOL).

test_1131: the radial-forcing shell stays quiet, a 1% torque still warns, and
the slack is bounded on the facet normal and zero on the analytic one.

Underworld development team with AI support from Claude Code

(cherry picked from commit c2fde47)
…lls stay put

A mesh's declared rotation modes were admitted without the constraint
test, which is wrong once a wall deforms: a free surface after its first
step is no longer a circle about the rotation's centre. A declared mode
now keeps its exemption only while every rotated wall's vertices are
equidistant from the rotation's centre, to 1e-9 relative, over all ranks.
Otherwise it takes the constraint test like an undeclared mode, the solve
warns once, and the verdict per mode is in `declared_modes_kept`. An
MMPDE-style move that slides wall vertices along their circles keeps the
exemption: on test_1131's moved annulus the detection route dropped the
mode (violation 0.0037) and the declared route keeps it.

From the review of 1ad35ba:
- meshes adapted, cut, split or placed into inherit the declaration
  (Mesh._inherit_rotation_modes, at every derived-mesh site);
- the setter refuses a field that is not a rigid rotation;
- the geometry cache key includes the declaration;
- the adjoint restores the whole forward null-mode record;
- the mode builders use coords_nd, so the modes are right under units;
- one helper for Q·m with the constrained rows zeroed;
- test_1131 reworked: the 0.3 shell on the custom FMG under both normals,
  exactness asserts (mode count, rotation at round-off, v·n zero on the
  constrained rows), both sides of the wall check, the setter, add_fault
  inheritance; in shard 3;
- docs: rotated-freeslip.md, free-surface-convection.md §3, custom_mg's
  near-null wording, the changelog.

Underworld development team with AI support from Claude Code
…l helpers are serial

The verdict on a declared mode reduces the wall distances over all ranks.
The parallel case deforms the outer wall only near (1, 0), so a rank can
hold an untouched part of the wall, and asserts that every rank drops the
mode, rank 0 warns, and v.n stays zero; the annulus as built keeps it on
every rank. test_1131's nodal helpers read local arrays, which carry
ghost copies at np > 1 (the MMPDE session's note), so they no longer
pretend to reduce over ranks; that file runs on one rank.

Underworld development team with AI support from Claude Code
… coordinates

Every mesh has its own coordinate symbols (each prints as N.x), so a child
that took its parent's mode expressions verbatim could not evaluate them:
a thin sheet on a faulted sphere raised NameError in _declared_mode_flags
(test_1079 x3, test_1092). The test that pinned inheritance compared the
child's modes with the parent's, which is exactly the bug; it now
evaluates the inherited mode on the child.

Underworld development team with AI support from Claude Code
Hyperion measured, at np 2 to 8, how many ranks hold no vertex of the
deformed patch (1, 2, 2, 3, 4, 6 at np 2, 3, 4, 5, 6, 8); with the wall
reduction made rank-local the solve hangs into the supervisor at np 2, 3,
4 and 8. The deformed case now asserts that some rank misses the patch at
those rank counts, so a partitioner change that removes the case says so.

Underworld development team with AI support from Claude Code
The rotation modes were built from the dimensional coordinates, a
UnitAwareArray in a units model, and in 3-D np.zeros_like raised TypeError
on it (rotated_bc.py:3023 on development eddab70). c6c2668 builds them
from coords_nd. Probe on a 2.0/1.0 spherical shell with reference length
1000 km: development raises; this branch converges with three modes kept.
This is the regression test.

Underworld development team with AI support from Claude Code
Copilot AI balanced review requested due to automatic review settings November 6, 2026 07:04
@lmoresi

lmoresi commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Adversarial review of #906, round 1, at 3f76514 (an independent agent), and how each finding was resolved

  1. HIGH: a declared mode was admitted wherever a rotated wall pinned it. The operator test is blind to the rotated rows (J is Cartesian, op_viol about 2e-16). Probes:

    • an annulus with its walls deformed 1 %: violation 0.0082, admitted; true residual 1.2e-3 of ref against a reported 2.5e-11; v 0.86 % off;
    • FreeSurface puts rotated u·n = 0 on its deformed surface;
    • a tolerance cannot separate the cases: 1 % topography gives 0.0082, faceting gives 0.0045-0.016.

    Resolved, c6c2668: a declared mode skips the constraint test only while every rotated wall's vertices are equidistant from its centre (1e-9 relative, reduced over all ranks). Otherwise it takes the test, the solve warns, and declared_modes_kept records it. Both sides are pinned in test_1131 (a 1e-6 deformation rejects; an MMPDE-style move admits). The parallel twin checks one verdict on every rank, and a rank-local reduction hangs at np 2, 3, 4 and 8 (hyperion).

  2. HIGH: test_1131 was not reachable from scripts/test.sh. Resolved: batch 3; check_test_coverage.py reports OK.

  3. MED-HIGH: the fixture was a folded shell (0.5, refinement 1; Refining a spherical shell folds cells at the inner wall: SphericalShell and CubedSphere snap new wall nodes outward through coarse cells that lie on the wall #946) that fell back to GAMG and had its ratio recorded on the folded mesh. Resolved: the 0.3 shell with set_custom_fmg, about 20 s a solve. The detection route gives 0 modes and rate 4.66; the branch gives 3 modes and 1.1e-15.

  4. MED: the constrained-row zeroing was untested (mutant M2 survived). Resolved: an exact v·n assertion on the constrained rows. M2 now fails on the shell (5.0e-3) and on the moved annulus (9.1e-7).

  5. MED: the v_rms ratio was not a hard baseline. Resolved: the mode count, a rotation at round-off, and exact v·n.

  6. MED: derived meshes lost the declaration. Resolved, c6c2668 and b703060: Mesh._inherit_rotation_modes runs at every derived-mesh site (adapt, _adopt_cut_child, the fault_split cut, sheet and split children, place_surface, fault_network). It rewrites the modes in the child's coordinate symbols. Our first version did not rewrite them, and the serial suite caught it (NameError on test_1079 x3 and test_1092). The test now evaluates the inherited mode on the child. remesh works in place and keeps the declaration. A reloaded mesh declares nothing; that is documented, and the setter is the route.

  7. MED: declared modes were evaluated on dimensional coordinates. Resolved: coords_nd.

  8. LOW-MED: Units-model rotated solve with cdim 3 fails in _rigid_rotation_modes (UnitAwareArray coordinates) #877 still raised in _rigid_rotation_fields. Resolved: coords_nd. Probe: development raises TypeError at rotated_bc.py:3023 on a units-model shell; the branch converges with three modes kept. That probe is test_1131's regression test.

  9. LOW: _rotated_geometry_signature omitted the declaration. Resolved.

  10. LOW: the adjoint did not restore _rotated_null_mode_slack. Resolved: it saves and restores the forward's whole null-mode record.

  11. LOW: stale docstrings and docs, and no zero-strain check in the setter. Resolved:

    • the docs: rotated-freeslip.md (null-space handling), free-surface-convection.md §3, custom_mg's near-null wording, and the docstrings;
    • the setter refuses a translation, a dilation and a non-affine field.
  12. LOW: "Q·m, then zero the constrained rows" appeared three times. Resolved: _rotated_compatible.

Verdicts at round 1: #906 live in part, #877 live. Now: both fixed by this branch, on the probes above.

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@lmoresi

lmoresi commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Adversarial review of #964 (hyperion)

Verdict: do not merge yet. The b703060 NameError fix holds, but four defects remain, and #906 is not fully fixed. #877 needs a check at the new tip.

Reviewed: code at b703060 plus test-only d992064, base eddab70. The PR's tip 5e6acca adds the #877 regression test after this pass: that test was not reviewed. Mutants ran against 6b471c8's code, which differs from the tip only in _inherit_rotation_modes, through an overlay. Probes are on hyperion in runs/2026-11-06/rev906/probes/. The missing inheritance in _moved_wrap was confirmed separately by reading addon_partition.py:562-584.

Findings

High

  1. The declaration is lost at np>1 when the add-on partition moves the mesh, so the answer depends on the rank count. addon_partition._moved_wrap does not call _inherit_rotation_modes, and add_fault, split_fault, add_conforming_sheet and FaultNetwork all inherit from the moved wrap. add_conforming_sheet on a 0.25 shell: np 1 decl=3, ortho=3, v_rms 1.79e-3; np 4 decl=None, ortho=0, v_rms 3.45e-3. Rotated solve on the moved shell itself: np 4 rate 3.33, v_rms 3.46; serial on the same fixture rate 1.3e-15, v_rms 1.79. At np 2 this partition returned the input mesh, so an np 2 CI run does not show it.
  2. The exemption looks only at wall geometry, not at the normal being constrained. A circular wall with a given non-radial normal skips the constraint test (_mode_satisfies_constraints, if viol >= tol and not declared). Normal offset by 0.1 on the annulus: viol 0.034, admitted, converged=False, v_rms 2e7 and 4e7 on two runs, no exception. Base: mode rejected, converged, v_rms 5.68e-3. Fix to consider: exempt only walls with normal=None.
  3. SegmentedSphericalShell, a factory that declares three modes, still shows the Rotated free slip on a spherical shell with the default normal: the rotations are rejected and the answer carries a rigid rotation #906 symptom. Its Upper stratum directly labels 190 vertices with r from 0.619 to 1.0, 26 of them off the sphere, while the face closure is on the sphere to 4e-16. _declared_mode_flags reads the helper's result, drops all three modes, and warns that the wall moved. Rate 0.84 in v_rms 0.77, the same as base. SegmentedSphericalBall has the same label spread; its solve was not run.

Medium
4. A cut that crosses a wall loses the mode, and the answer is mostly rotation. add_conforming_surface puts chord vertices on the walls (Upper spread 1.2e-4): kept=[False], viol 6.1e-4, rate 6.66e-3 in v_rms 7.2e-3 at np 1 and 4, the same as base, so not a regression. The rule is inconsistent: viol 6e-4 is dropped here while 3e-3 is admitted on a shell. The warning blames "a free-surface step".
5. A shell at one rank count has a wall vertex 1% off the sphere, pre-existing. SphericalShell(cellSize=0.3, refinement=1) at np 4 only: one Upper vertex at r = 0.989852, held on two ranks; base is identical. All three modes drop, and norm U is 1138 against 909 at np 1, 2, 8. 1 of 30 mesh and rank combinations scanned. This is test_1131's own serial fixture, and the branch has no parallel shell test. It needs its own issue; it is not #946.
6. The setter accepts a screw motion, and the screw is exempted. [-y, x, 1] is accepted, and _declared_mode_flags returns [True], because the lstsq residual is never checked.
7. A true mode is dropped for a sphere off the origin. The min-norm lstsq centre is not the sphere's centre. Sphere at (0, 0, 0.5) with all modes declared about its centre: flags [True, True, False].
8. A wall move at the 1e-9 threshold changes the answer sharply. Unmoved: rate 3.7e-15, v_rms 1.79. Perturbed by 5e-10: rate 5.6, v_rms 4.59, unchanged up to 1e-6. A deformed shell under the default normal keeps #906's rotation with only a warning. This needs an explicit decision.
9. coords_nd did not fix #877 for a unit-carrying velocity at d992064: see the issues below. A mutant removing it survived, with no test then covering it. Please check this against the new test at 5e6acca.

Low
10. -W error on a lost-mode warning at np 2: rank 0 raises alone and the job aborts with MPI truncation in the next allreduce. _warn_declared_modes_lost is rank-0-only.
11. declared_modes_kept goes stale on a warm-start exit at iteration 0: after a 3e-9 wall move, kept=[True], gauge keeps_walls=[False], no warning. Only the record is wrong.
12. declared_modes_kept does not report whether a mode was kept: [True] with ortho=0 on a pinned wall, [False] with ortho=1 under an analytic normal on a deformed wall. Rename it or document it.
13. Setter refusals of valid rotations: a float gradient with 7e-17 asymmetry, an unsimplified sin^2 + cos^2 coefficient. == on sympy forms is too strict.
14. Mesh(file.h5) reload and extract_surface have decl=None, so they use detection.

b703060 and derived meshes

The NameError is fixed: an add_fault child solves, and test_1092's fault-reaction test passes. Two generations work, the standard-path reader works on children, and nothing else was found that depends on the parent's symbols. Whether the declaration is still true at np 1:

child wall spread verdict
add_fault, interior, with and without add_fault_bc 3e-16 true: viol 6.7e-12, op 2e-16, matches base
adapt, interior and at the wall 3e-16 true: annulus matches base; shell v_rms 1.79e-3 against base 3.46e-3
place_fault_ribbon_2d 3e-16 true: viol 3e-12
FaultNetwork.build(base) 3e-16 true: viol 6.6e-12, matches base
add_conforming_sheet on a shell, unsplit and split 4e-16 true: viol 3.3e-3, as the unfaulted shell
add_conforming_surface crossing a wall 1.2e-4 not true: mode dropped, finding 4

At np 4, add_fault, the sheet and the network lose the declaration (finding 1); adapt keeps it.

Attacks that failed

  • Empty and uneven walls: a label empty everywhere, on rank 0 only, or absent gives one verdict at np 1, 3, 8. Four of 8 ranks with no Lower vertices at np 8: one verdict, norm U 2.57568 at np 2, 4, 8. No truly empty rank could be built.
  • Pinned and penalised walls are rejected by the operator test: x-pin op 4.1e-2, drag op 1.2, internal rotated wall with no-slip op 0.14, sector with no-slip sides op 0.17.
  • Real modes kept: lower wall stress-free, internal plus both walls, a sector with stress-free sides, a disc with r_inner 0.
  • Geometry rejected: a wrong centre (viol 8.7e-2), an ellipse (6.3e-2), a sector with all walls rotated (0.30). A translated annulus declared about its centre is kept.
  • Scale: radius 6371 keeps its mode (viol 4e-11); factory wall spreads at most 7e-16 for radii 1e-3 to 6371.
  • The MMPDE mover keeps walls at 4e-16. Cache: deform invalidates the workspace, and verdicts follow the wall out and back. Adjoint: forward record restored. Net-torque guard: warns at a torque of 1e-3 of the forcing, quiet at 1e-4.

Tests

  • Base eddab70: 8 of 9 serial tests fail, but 5 of those only with KeyError: declared_modes_kept before reaching their reason. The parallel file also stops at that KeyError at np 2.
  • Mutants killed for their reason: noexempt, nowall, noop, nozero (v.n 4e-3), noslack, nowarn, noinherit, rank_local (hangs at np 2, 3, 4, 8).
  • Survivors, no test: nosig (cache key without the declaration), coords (Units-model rotated solve with cdim 3 fails in _rigid_rotation_modes (UnitAwareArray coordinates) #877), wall tolerance at 1e-7 (the fixture moves 1e-6), and the adjoint's restore of slack and kept.
  • The parallel set at b703060: test_1131 2 passed at np 2, 4, 8; test_1064, 1066, 1068, 1112, 1116 pass at np 2, 4, 8; test_1140 passes at np 2 and 4, and aborts at np 8 on base too (Rotated free-slip solve aborts when a rank has no cells (mismatched Allreduce on cell-less ranks; test_1140 at np 8) #962). d992064's untouched >= 1: 1, 2, 2, 3, 4, 6 ranks at np 2, 3, 4, 5, 6, 8. That depends on gmsh and partition, as its message says.
  • CI reach: test_1131 is in batch 3, but its comment says "1 min" and we measured 194-207 s on this loaded host. The parallel file makes 73 files and 13 batches, so it moves batches and test_1140 runs alone in a new last batch.

Docs

  • rotated-freeslip.md and CHANGELOG, "a mesh adapted or cut ... inherits its modes": false at np>1 for cuts.
  • "A rotation leaves a wall in place only if the wall is a sphere": false in 3-D, since a surface of revolution about the axis also stays in place. Repeated in the _declared_mode_flags docstring.
  • free-surface-convection.md, "must pass the constraint test, which it fails": under an analytic normal it passes.
  • CHANGELOG and the test docstring quote v_rms 1.807, rate 4.66, violations 0.0075-0.0164; here the same 0.3 shell gives 1.792 and 0.0037-0.0054. Date them with their host.

Issues

Merge conditions

  • _moved_wrap inherits the declaration, with an np 4 test whose child actually moved and is solved on.
  • The exemption applies only to walls with normal=None, or an equivalent bound on viol.
  • _declared_mode_flags reads wall vertices from the facet closure so segmented meshes pass, or the segmented labels are fixed, with a test.
  • Refuse or do not exempt a screw, by checking the lstsq residual.
  • Pick the right centre for a sphere off the origin, or document the limit.
  • Fix Units-model rotated solve with cdim 3 fails in _rigid_rotation_modes (UnitAwareArray coordinates) #877 with a unit-carrying velocity test, or say the branch leaves it open.
  • File an issue for the np 4 off-sphere vertex.
  • Decide and document the wall-crossing cut and the threshold jump.
  • Add tests for the cache key and the adjoint record.
  • Correct the docs lines above and the test.sh timing comment.

Could not test

CI itself and macOS; a truly empty rank; solving with a declared screw (did not finish in 280 s under load); test_0022 and test_1092's tide test (neither finished in 570 s at load about 40, on tip or base); add_conforming_sheet reaching a wall; SegmentedSphericalBall's solve; DiscInternalBoundaries (NameError: refinement in the factory, not run on base).

Underworld development team with AI support from Claude Code

… one centre

Hyperion's review of b703060 (PR #964):
- addon_partition._moved_wrap now inherits the declaration, so a level the
  add-on partition moves keeps it at np > 1 (a conforming sheet on a shell
  gave v_rms 1.79e-3 at np 1 and 3.45e-3 at np 4). Parallel test: a solve on
  an add_fault child, one verdict on every rank.
- A declared mode is exempt only where faceting is the only reason it could
  fail the constraint test:
  - every rotated wall takes normal=None. A given normal is tested, and an
    exact one passes; a tilted normal had been exempted and diverged to v_rms 2e7.
  - the modes rotate about one centre, from all A c = -m0 at once (full rank,
    small misfit), so a sphere off the origin is exempt about its own centre;
    a screw, or a single 3-D rotation, is not.
  - each wall's vertices are read from the closure of its labelled facets, not
    from every point the label holds (Linux's gmsh labels interior vertices in
    SegmentedSphericalShell's Upper).
- The setter checks numerically (relative 1e-12) and refuses a screw; round-off
  asymmetry and unsimplified constants are accepted.
- #877 with a velocity that carries units: the modes are built in the
  velocity sub-DM's local vector, not written through the variable's .array.
- The record resets at each solve and is renamed declared_modes_exempt; the
  warning names the wall and the spread of its vertices.
- Tests for the cache key and the adjoint's restore of the forward record.
- Docs: the rule, the threshold jump past 1e-9, the free-surface wording, the
  changelog numbers with their host, and the test.sh timing.

Mutants, each caught by its test: walls from label points (hand-labelled
interior vertex), exemption under a given normal, per-mode min-norm centre,
modes through .array with a unit velocity. test_1131: 16 passed serially.

Underworld development team with AI support from Claude Code
@lmoresi

lmoresi commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Round 2, at a1095aa: how hyperion's merge conditions were met

Merge condition Done at a1095aa
_moved_wrap inherits the declaration, with an np 4 test whose child moved and is solved on addon_partition._moved_wrap calls _inherit_rotation_modes. tests/parallel/test_1131_..._parallel.py::test_an_add_fault_child_keeps_the_declaration_on_every_rank solves on an add_fault child and asserts one declaration and one verdict on every rank; its message says whether the partition moved the child. The rank counts at which the child moves are to be measured on hyperion and then pinned. The serial file also solves on the child.
Exempt only normal=None walls Yes. A wall with a given normal is tested, and an exact one passes. test_a_given_normal_is_tested_not_exempt puts a 0.1 tilt on the annulus and checks: converged, not exempt, mode rejected, v·n exact.
Wall vertices from the facet closure, or the segmented labels fixed _wall_vertex_rows reads the closure of the labelled facets. test_a_wall_is_read_from_its_facets_not_every_point_its_label_holds labels an interior vertex by hand, because macOS's gmsh builds the segmented shell with no off-sphere label points. The segmented-shell solve is also a test; it exercises the case on Linux.
Refuse or do not exempt a screw Both. The setter refuses [-y, x, 1]. _declared_centre needs one centre that solves every A c = -m0 (full rank, misfit at most 1e-10 relative), so a screw has no centre.
The right centre for a sphere off the origin The common centre of all declared axes. test_a_sphere_off_the_origin_is_exempt_about_its_own_centre translates a shell by (0, 0, 0.5) and gets the centre to 1e-12, with all three modes exempt. A single declared rotation in 3-D leaves a line of centres and is not exempt (documented).
#877 with a unit-carrying velocity The modes are built in the velocity sub-DM's local vector, not through .array. test_a_units_model_shell_solves_with_its_declared_modes[unit_velocity] fails on the .array version with Cannot assign plain array and passes now.
File an issue for the np 4 off-sphere vertex Not filed. Hyperion reran the fixture on #952's branch: every Upper vertex is on the sphere at np 4, so #952's reconciliation of callback copies covers it. Caveat: #952 also flips the walls, so the mesh differs.
Decide and document the wall-crossing cut and the threshold jump Documented in rotated-freeslip.md (null-space handling): past 1e-9 the rotation is not removed, and the answer carries a poorly determined rotation. On a deformed wall, remove it after the solve, as free-surface-convection.md §3 does. A cut that puts chord vertices on a wall is treated as a deformed wall. Both questions are with Louis through the Dev Hub; snapping cut vertices onto a wall belongs to the radius-variable design item.
Tests for the cache key and the adjoint record test_the_declaration_is_part_of_the_cached_geometry_and_the_adjoint_record. It changes the declaration between the forward solve and the adjoint, so the restore of the forward's record can be seen.
Docs lines and the test.sh timing Corrected: the rule (spheres about one centre, not surfaces of revolution), inheritance including moved meshes, the free-surface wording under an analytic normal, the changelog numbers with their host, and test.sh "3-4 min".

The lower findings:

  • 10, -W error: unchanged. The warning is rank 0 only, by the house pattern, so an -W error run aborts there.
  • 11, stale record: the record resets at each solve.
  • 12, the key: renamed declared_modes_exempt and documented; admission is in rotation_gauge.
  • 13, the setter: it checks numerically to 1e-12.
  • 14, reload and extract_surface: they declare nothing, which is documented.

Mutants, serial, each caught by its test:

  • walls read from the label's own points;
  • exemption under a given normal;
  • the per-mode min-norm centre;
  • modes written through .array with a unit velocity.

test_1131 gives 16 passed serially. The 40 rotated and fault serial files are rerunning on a1095aa.

#906: fixed for the factory meshes, derived meshes (with moved levels to be confirmed at np > 1), and the segmented shell (by the facet read). It stays live in one case: walls deformed past 1e-9 under the default normal, which waits on Louis's decision. #877: fixed, including a unit-carrying velocity, on the probes above.

Underworld development team with AI support from Claude Code

@lmoresi

lmoresi commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Adversarial review of #964, round 2 at a1095aa (hyperion)

Verdict: not ready yet. All round-1 High findings are fixed on our probes, but two small code defects and three weak tests remain. No new High. Probes on hyperion in runs/2026-11-06/rev906/round2/.

Round-1 merge conditions

condition status evidence
_moved_wrap inherits, with a test whose child moved and is solved on code met, test partly sheet on 0.25 shell: norm U 1.037795 at np 1 and 4. CI's np 2 does not move the child, and the test's moved flag is wrong
exempt only normal=None walls met, one gap annulus offset 0.1: converged, v_rms 5.679e-3, as base. Gap: mixed walls
walls read from the facet closure code met, one test does not exercise it segmented 0.3/6 shell: exempt, rate 1.4e-16, v_rms 0.22 (was 0.84, 0.77)
refuse or do not exempt a screw met, by reading and the new tests setter and _declared_centre
right centre for an off-origin sphere met centre to 1e-12
#877 with a unit-carrying velocity met norm U identical with and without velocity units: shell 1.50648785, annulus 1.98947341, 3-D box 1.61089649; sheet solves both ways
issue for the np 4 off-sphere vertex open at this tip still r = 0.989852 at np 4 here; all three modes refused, norm U 1138. #952's branch has none at np 4, on a different mesh (8184 cells against 8240). Land #952 first or file
wall-crossing cut and threshold jump documented, decision pending text in rotated-freeslip.md is accurate; cut unchanged at rate 6.66e-3 in v_rms 7.21e-3, warns and names the wall
tests for the cache key and adjoint record adjoint met; cache key not noadjrestore killed; nosig survives
docs and test.sh timing mostly met test.sh says 3-4 min; 483 s for 16 tests at load about 30

Findings

Medium

  1. A cached re-solve reports declared_modes_exempt=None. The reset at the top of solve_rotated_freeslip runs, but a reused workspace never calls _rotated_nullspace. Second solve: exempt None, rotation_reused True, ortho=1, gauge.exempt=[True]. The comment says None means "the mesh declares none", so every step of a time loop reports the wrong thing. Take it from the workspace, or read rotation_gauge.exempt.
  2. A mix of given and default normals silently restores the Rotated free slip on a spherical shell with the default normal: the rotations are rejected and the answer carries a rigid rotation #906 answer. any(normal is not None) refuses the whole mesh, returns no note, and the default wall then fails the test. Lower default, Upper analytic: 0 modes, rate 8.45, v_rms 7.09. Lower analytic, Upper default: 0, 9.64, 6.90. Both default: 3, 3.7e-15, 1.79. Both analytic: 3, 6.8e-17, 1.79. No worse than base, which removes no mode on a default-normal shell wall (the mix itself was not run on base), but no warning is given. Test the given-normal walls only, or warn.
  3. The cache-key test cannot fail. test_the_declaration_is_part_of_the_cached_geometry... takes before before the first solve, when the dm entry is 0; after it is a handle, so the signatures differ whatever the declaration, and nosig passes. Take before after the solve.
  4. test_a_segmented_shell_keeps_its_modes does not exercise the label spread on Linux. At cellSize 0.4 and numSegments 4, Upper runs r = 1 +- 2e-16. Our failing fixture was cellSize 0.3, numSegments 6, which spreads to 0.62. The hand-labelled test does carry the case; move the segmented test to 0.3/6.
  5. The add_fault parallel test has no power at CI's np 2, and its moved value is meaningless. With a spy on partition_addon, the output is a new mesh at np 3, 4, 5, 8; not at np 2 or 6. moved is true at every np including 1, because add_fault returns the split child, whose parent is the cut. Mutant nomoved: passes at np 2, fails at np 4 and 8. Replace the flag and pin a moving rank count in a run CI actually does.
  6. Mutant coords survives, including unit_velocity: declared origin-centred modes are proportional to the coordinates, so scale does not matter on the declared path. The route Units-model rotated solve with cdim 3 fails in _rigid_rotation_modes (UnitAwareArray coordinates) #877 actually broke is the undeclared Cartesian one: the mutant on a 3-D box in a units model gives TypeError: zeros_like, as base; the tip passes. Add an undeclared 3-D box in a units model.

Low
7. nullspace_rotations=[] with rotated walls warns "not rigid rotations about one point"; under -W error that aborts at np>1.
8. -W error still aborts at np 2 with MPI truncation. The author accepts this as the house pattern; we record it.
9. A single declared 3-D rotation gets the same misleading note.

Requested results

  • tests/parallel/test_1131: 3 passed at np 2, 4, 8. Serial tests/test_1131: 16 passed.
  • Rotated set at np 2, 4, 8: test_1064 6 passed, 3 skipped; test_1066 1 passed, 1 skipped; test_1068 2 passed; test_1112 1 passed; test_1116 1 passed; test_1140 12 passed at np 2, 11 passed, 1 skipped at np 4, aborts at np 8, exit 142, as on eddab70 (Rotated free-slip solve aborts when a rank has no cells (mismatched Allreduce on cell-less ranks; test_1140 at np 8) #962).
  • Moved shell at np 4: declared 3, ortho=3, v_rms 1.80 against 1.79 at np 1, where our v_rms counts ghost nodes twice (round 1: 3.46).
  • Mutants killed: noadjrestore, givenexempt. Surviving: nosig, coords, tolerance 1e-7.
  • A tolerance fixture is worth having. On the annulus, move 1e-9: exempt False, ortho 1; 1e-8 and 1e-7: exempt False, ortho 0. A 1e-8 fixture should catch the 1e-7 mutant, and one at 1e-9 asserting exempt == [False] pins it tighter, about a second each. Inferred from the table, not run against the mutant.
  • Regressions: test_1079 3 passed; test_1092 3 passed, with the tide test timing out at 900 s (it exceeded 570 s on base too).

Attacks that failed

Analytic normal on a shell, the case #906 first reported: both walls ortho=3, viol 2e-17, rate 6.8e-17. Sheet on a sphere: exempt False, ortho=3, viol 6e-17. Tilted and offset normals at 1e-6 to 0.3: same v_rms as base. Interior fault and network at np 1 and 4: declaration 1, viol 6.7e-12. Sheet and adapt on a shell at np 1 and 4: declaration 3, ortho=3. _wall_vertex_rows: 21 ms for 3090 vertices.

Issues

Merge conditions

  • Fix the cached re-solve record.
  • Warn or test per wall for mixed normals.
  • Do not warn on [].
  • Take the cache-key test's before after the solve, and show nosig fails.
  • Use the 0.3/6 segmented fixture.
  • Correct the moved indicator and run the moved test at a rank count that moves.
  • Add an undeclared 3-D units test.
  • Add a tolerance fixture at 1e-8 or tighter.
  • Land #946: refining a spherical mesh no longer folds cells; a missing label moves nothing (#903) #952 first or file the np 4 vertex.
  • Get the pending decision on deformed walls and cuts.

Could not test

CI and macOS; a truly empty rank; test_1092's tide test at this load; test_0022 in full this round; the author's 40-file serial rerun; a sheet reaching a wall; the SegmentedSphericalBall solve.

Underworld development team with AI support from Claude Code

…re branching

From hyperion's round-2 review of a1095aa:
- A re-solve that reuses the cached workspace reports the verdict it was
  built with (it reported None); the record is set when the cached context is
  adopted, so a solve that exits at its first residual check has it too.
- Rotated walls that mix a given normal with the facet-averaged one refuse
  the exemption with a warning that says the rotation is not removed and how
  to avoid it (rate 8.45 in v_rms 7.09, silently, before). Exempting per wall
  is a follow-up.
- _declared_mode_flags reduces every wall's distances before any verdict:
  test_0052's collective-guard scan flagged the early return inside the loop.
- Tests that could not fail now can:
  - the cache-key check compares the signature after the solve (nosig);
  - an undeclared 3-D box in a units model is offered the Cartesian
    rotations (coords: TypeError on np.zeros_like);
  - the deformed annulus at 1e-6, 1e-8 (refused) and 1e-10 (exempt) pins the
    1e-9 tolerance from both sides (a 1e-7 tolerance fails the 1e-8 case);
  - the mixed-normal warning;
  - the parallel add_fault test spies on _moved_wrap and asserts the move at
    np 3, 4, 5 and 8, where hyperion measured it (not at np 2 or 6).

test_1131: 21 passed serially; test_0052 passes.

Underworld development team with AI support from Claude Code
…from-mesh-906

Underworld development team with AI support from Claude Code

# Conflicts:
#	scripts/test.sh
With development merged in (#967), the shell under the analytic normal
has three exact modes, which the velocity preconditioner projects out
(ratio below 1e-14). Under the facet-averaged normal its three declared
modes are near-null, exempt and admitted, but left to the multigrid
(ratio above 1e-8, against the 1e-10 at which a mode is projected). This
is the near-null case #967's review noted would arrive with #906.

Underworld development team with AI support from Claude Code
@lmoresi

lmoresi commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Adversarial review of #964, round 3 at 1bc3a12 (hyperion)

Verdict: not ready yet, but close. #967's projection and this branch's declared modes mostly work together. On the test fixtures they do what test_1131 claims: the analytic normal projects 3 exact modes, and the facet-averaged normal admits 3 near-null modes and projects none. Leaving those near-null modes to the multigrid is right; forcing them into the projection stalls. One new Medium comes from the auto-merge: the "exact" test is scaled by |A_vv|_F, so a viscosity contrast reclassifies a near-null mode as exact and projects it, and the solve then runs 2-4x slower. Three round-2 conditions are still open: the [] warning, the segmented fixture, and the np 4 vertex while #952 is open. Probes and logs are in runs/2026-11-06/rev906/round3/. Base is development 37aa2a1, run as a PYTHONPATH overlay (ovdev) of its 7 differing .py files over this build. Mutants are an env-gated overlay (ov).

No note on the PR says how round 2's conditions were met at 2bd82ef. The PR's last comment is our round-2 record, so the conditions below were checked against the 2bd82ef commit message and the code.

Findings

Medium

  1. The test that decides whether a mode is exact depends on viscosity, so a near-null declared mode gets projected. _exact_velocity_null_modes tests |A m| / (|A_vv|_F |m|) <= 1e-10. The Frobenius norm comes from the stiffest region, while A m for a declared rotation on a faceted or moved wall comes from the wall cells. Fixture (p50.py): factory annulus, refinement 2, default normal, walls slid 0.1 rad along their circles (MMPDE-style), so it is exempt with viol 2.7e-4. Viscosity is exp(ln C sin^2(pi(r-0.5)/0.5)), so the walls are 1 and the interior is C. As C goes 1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e8, the ratio goes 1.0e-6, 2.5e-8, 2.9e-9, 3.3e-10, 3.7e-11, 4.1e-12, 5.1e-14: the mode is projected from 1e5 up. Cost at np 1:
    case tip not projected (REV_PROJ_TOL=0) dev 37aa2a1
    C=1e5, tol 1e-6 305 s, 515853 GMRES orthogonalisations 80 s, 144929 -
    C=1e6, tol 1e-6 236 s, 402428 69 s, 126153 62 s, 126153 (mode rejected)
    C=1e8, tol 1e-6 65 s, 119601 31 s, 55826 -
    C=1e6, tol 1e-8 no finish in 900 s 430 s, L2 1.27177e-4 (LU 1.27155e-4) -
    Forcing the projection on the isoviscous mesh shows the mechanism: ratio 1e-6 does not finish in 250 s; 1e-7 costs 14x (28161 against 2061); 1e-8 and below are fine. This happens only after the merge. Dev rejects the mode, and Project exact rotations out of the rotated velocity preconditioner; fixes the shard-4 hang (#963) #967 alone never met a near-null mode. On the 0.3 shell the ratio barely moves at this resolution (4.2e-6 at C=1e6, np 2, 1089 s on tip, the same 113898 orthogonalisations as not projected), so the shell did not reproduce it. A finer shell was not run. A fix that does not depend on viscosity worked in the overlay (REV_MUT=viol): project only when the admitted mode's constraint violation is below 1e-6. That gave 72.5 s and 126153 at C=1e6, the unprojected count. Decide exactness from viol, or with a local scale, not from A _F.
  2. The np 4 off-sphere vertex is still open, on test_1131's own shell. At np 4 the 0.3/refinement-1 shell has Upper running r 0.989852 to 1.0. All three modes are refused with a warning (exempt False, ortho 0), and L2 is 11.512 against 3.4726 at np 2, the same under Nehalem, Zen and SkylakeX. This was the only bad case among 24 (cellSize 0.25/0.3/0.35/0.4 x np 1,2,3,4,5,8; p90.py). #946: refining a spherical mesh no longer folds cells; a missing label moves nothing (#903) #952 (open) is meant to fix it via petsc_dm_find_labeled_points_local returns [0] for a missing label; refinement callbacks then move vertex 0 #903; no issue names this case.

Low
3. nullspace_rotations = [] still warns "the rotation modes the mesh declares are not rigid rotations about one point" (p60.py, annulus). Round-2 condition not met.
4. test_a_segmented_shell_keeps_its_modes still uses cellSize 0.4 and numSegments 4. Mutant labelpts, which reads the label's own points, passes it. The hand-labelled test kills the mutant. Round-2 condition not met, but the case is covered.
5. The mixed-normal warning says "the rotation is not removed" on a mesh where it is removed. On the annulus with Lower given and Upper default, and the reverse: exempt False, the mode passes the test, ortho 1. test_mixed_... uses that annulus and asserts only that it warned.
6. The moved add_fault test has no power in CI. nomoved fails at np 4 (declared [None]*4) and passes at np 2. CI runs --p 2, and --full-parallel is not in the workflow.
7. The projection's own tests leave the threshold and the projector loose. Mutant REV_PROJ_TOL=3e-6 passes test_1131's shell test; the assertions bound the threshold only between 1.4e-18 and 4.4e-6. noorth (no Gram-Schmidt), inonly and outonly (project on one side only) pass both test_1131's shell test and test_1142, including the Nehalem child.
8. On the LU route, declared_modes_exempt is None while rotation_gauge.exempt is [True] (a6_lu.out). _rotated_nullspace is not called there. This is the same class as round 2's finding 1.
9. projected_null_modes is None on the vector route, and null_mode_ratios is [] on the GAMG route with a mode admitted. The docs say "that ratio for each admitted rotation".
10. Docs. test_1142's "the default normal admits no rotation and projects none" holds only for its wrapped meshes, which declare nothing. A factory annulus under the default normal admits its mode and projects it (viol 7.1e-12, ratio 2.45e-14). In rotated-freeslip.md, "a declared rotation on a faceted wall [is near-null]" holds in 3-D only.

Seen on base too (not this PR)

  • The custom FMG's inner velocity solve hits its 200 cap on a SphericalShell at cellSize 0.35 and 0.5, refinement 1, on dev and tip, under both normals (d35_*.log, dbg_*.log). Worth an issue.
  • RSS grows about 15 MB per rebuilt workspace at np 2 (30 wall-keeping deforms: 792 to 1241 MB). The growth is the same on tip, on tip without the projection, and on dev.
  • With a mode unprojected at ratio 1e-10 to 1e-9 (walls slid 1.2e-5 to 1e-4 rad, tol 1e-9), the iteration count depends on the kernel: up to 135540 orthogonalisations against 3389 (Nehalem and Sandybridge at np 2, pressure at its cap). Dev, which does not even admit the mode, does the same: Nehalem np 4 99690 against 64460 on tip, and its L2 of 0.82 carries the rotation against 0.29. All runs converge.

Which modes the projection gets (measured)

route modes projected
FMG, declared and exempt, shell, default normal 0 of 3, ratios 2.4e-6 to 7.5e-6 (np 1, 2, 4)
FMG, declared and exempt, factory annulus, default normal 1, ratio 2.45e-14
FMG, given normal tested, analytic normal shell 3 (1.1e-18 to 2.5e-18), annulus 1 (1.6e-18)
FMG, given normal shifted 1e-11 to 1e-8 admitted with viol 2.5e-12 to 2.5e-9, projected with ratio about viol/240; no stall
FMG with coarse GAMG the same as FMG
GAMG velocity route never projected. The moved annulus admits its mode: velocity iterations 125 to 176 (same as dev), but pressure at its 200 cap at np 4, 32 s against 4.5 s on dev
vector route (ThinSheet, FMG and GAMG) none; 3 modes admitted; converges with identical counts under Nehalem, Zen and default at np 1 and 2
add_fault child (the mesh's own FMG tail) 1 on every rank at np 1 and 4; radial 1.5e-18, default 2.2e-14
rebuilt workspace (30 deforms) rebuilt and projected each step; destroyed with the workspace (same RSS as without it)
viscosity change on re-solve ratios recomputed (5.1e-14, projected, then 1.0e-6, not); L2 0.02045442656, as dev

The test_1131 shell claims

  • Analytic normal: 3 projected, ratio below 1e-14 (1.3e-18 to 2.5e-18), at np 1, 2 and 4.
  • Default normal: 0 projected, ratios 4.4e-6 to 7.5e-6, above 1e-8.
  • Admitting but not projecting is right. Forcing the projection (REV_PROJ_TOL=1e-5 or 1) makes the shell test run past 600 s, against 122 s.
  • The outer iteration does not stall under Nehalem, Zen or SkylakeX:
    • 0.3 shell at np 2: velocity 14 and 16 iterations, 1841 and 2899 orthogonalisations at tol 1e-6 and 1e-9; L2 3.4726404 on every kernel.
    • 0.25 shell at np 4: velocity 12, 1707 orthogonalisations, 33 s, L2 3.5159766 on every kernel. The 0.3 shell cannot be used at np 4 (finding 2), and the 0.35 shell stalls on dev too.
  • Can the tests fail? Killed: REV_PROJ_TOL=0 and firstonly (assert projected_null_modes == 3), and the forced projection (timeout). REV_PROJ_TOL=0 also fails test_1142's Nehalem child at 240 s. Survivors are in finding 7.
  • Serial test_1131 and test_1142: 25 passed in 458 s.

Round-2 conditions

condition status evidence
cached re-solve record met second solve: exempt [True], reused True; mutant norecord killed (test_an_annulus_as_built..., line 179)
warn or test per wall for mixed normals met (warns) warns on both mixes; nomixwarn killed; wording wrong on the annulus (finding 5)
no warning on [] not met finding 3
cache-key before taken after the solve, nosig fails met nosig killed at line 461
0.3/6 segmented fixture not met finding 4
right moved indicator, run at a rank count that moves partly spy on _moved_wrap is right; nomoved killed at np 4, survives at CI's np 2 (finding 6)
undeclared 3-D units test met coords killed (TypeError in np.zeros_like)
tolerance fixture at 1e-8 or tighter met 1e-6, 1e-8, 1e-10 fixture; mutants with the tolerance at 1e-7 and at 1e-11 both killed
land #952 first, or file the np 4 vertex open #952 is open; finding 2
decision on deformed walls and cuts not shown no decision recorded on the PR (read only)

Attacks that failed

Kernel matrix on the near-null shell (above). The vector route under three kernels. The add_fault child at np 4. Rebuilt workspaces, both for leaks and for whether the projection is rebuilt. Stale ratios after a viscosity change. A re-solve with changed viscosity under the projection (L2 equal to dev's). Given normals near radial (always projected below 1e-10, no stall). Mixed normals, refused consistently. The wall spread scan: 23 of 24 clean.

Issues

Merge conditions

  • Decide exactness independently of viscosity (from viol, or with a local scale), or show finding 1 is acceptable. Add a viscosity-contrast fixture.
  • Stop warning on []; use the 0.3/6 segmented fixture; correct the mixed-normal wording or pick a fixture where it is true.
  • Pin the projection threshold from both sides (a fixture between 1e-10 and 4e-6) and the two-sided projection, or say why one side suffices.
  • Give the LU route's record the verdict, or document None.
  • Land #946: refining a spherical mesh no longer folds cells; a missing label moves nothing (#903) #952 first, or file the np 4 vertex on the 0.3 shell.
  • Get the moved add_fault case into a run CI does, or record that it is checked off CI only.
  • Record the decision on deformed walls and cuts.

Could not test

CI and macOS arm64. A finer shell with a viscosity contrast, to show finding 1 in 3-D. The adjoint under the projection with a non-symmetric Jacobian (reading only: it projects with J^T's ratios). Haswell, Core2 and Prescott on the shell (run only on the annulus). The other process's parallel set (not repeated). From reading only: the CI reach of test_1142 (batch 3), and the single declared 3-D rotation note, unchanged.

Parallel set at 1bc3a12 (run separately, through the supervisor)

file np 2 np 4 np 8
test_1064 6 passed, 3 skipped same same
test_1066 1 passed, 1 skipped same same
test_1068 2 passed 2 2
test_1112 1 1 1
test_1116 1 1 1
test_1131 parallel 3 3 3
test_1140 12 11, 1 skipped exit 142, "Message truncated", 3 of 3 runs
test_1142 parallel 1 1 1

test_1140 at np 8 aborts the same way on development 37aa2a1 and on eddab70: #962, not this PR.

Underworld development team with AI support from Claude Code

…964 r3)

An admitted rotation is projected out of the velocity preconditioner when
its Jacobi-scaled residual, max |(D^-1 A m)_i| / max |m_i|, is at most 1e-6.
The Frobenius scale it replaces took its size from the stiffest cells: on an
annulus whose walls slide along their circles, a viscosity contrast of 1e5
put the faceted rotation below 1e-10, projected it, and the solve ran 2 to 4
times longer (hyperion, round 3). The local measure is 6.2e-4 at contrast 1
and 5.6e-4 at 1e8 on that mesh, and tracks the constraint violation. The
threshold sits between where projecting costs (6e-5: 14x; 6e-4: no finish)
and where leaving a mode unprojected makes the count kernel-dependent
(7e-8 to 6e-7).

Also, from rounds 2 and 3:
- a mesh declaring nullspace_rotations = [] is not warned about;
- the mixed-normal warning says when the rotation is not removed, and its
  test uses a slid annulus, where that is true (the annulus as built has
  equal edges and passes);
- the direct-LU route records its verdict on the declared modes;
- the segmented shell is the 0.3 / 6-segment fixture;
- docs: the measure, the threshold, which routes record what, and that a
  2-D rotation is near-null only on unequal edges.

Tests: test_1142 pins the threshold from both sides on the slid annulus at
contrasts 1 and 1e6, and checks the projection on both sides of the
multigrid with orthonormalised modes. The Frobenius measure and thresholds
3e-6 and 5e-7 fail the first; the no-Gram-Schmidt, input-only and
output-only mutants fail the second. test_1131 checks the add-on partition's
_moved_wrap inheritance on one rank, since CI's np 2 never moves the level;
without the inheritance it fails.

Underworld development team with AI support from Claude Code
Hyperion's round 3, finding 8: the LU route builds no null space, so
declared_modes_exempt was None while rotation_gauge.exempt was [True]. The
test fails without 59828ca's gauge record (None == [True]); the test of
an empty declaration fails without its early return (the #906 warning).

Underworld development team with AI support from Claude Code
@lmoresi

lmoresi commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Adversarial review of #964, round 4 at 99c8b05 (hyperion)

Verdict: not ready yet. The new Jacobi-scaled measure fixes round 3's Medium: a viscosity contrast no longer moves it, and the C=1e5 to 1e8 cases are no longer projected and cost the same as leaving them. Every other round-3 Low is met with a test that fails without its fix. Two things remain.

Build: build.sh 906b exit 0; git status clean. The installed .py files match src/ (one stray test file in site-packages). Probes and logs are in runs/2026-11-06/rev906/round4/; mutants are an env-gated overlay (ov, ovpatch4.py). The same mesh as round 3 (p50.py): factory annulus, refinement 2, default normal, walls slid along their circles. Orth is the count of GMRES orthogonalisations, the solve's total work.

Findings

Medium

  1. Whether projecting a near-null mode is safe depends on tol and np, and the 1e-6 threshold uses neither. All runs below use the default kernel; "never" is REV_PROJ_TOL=0, "forced" is REV_PROJ_TOL=1 (cost.out, cost2.out).

    slide (measure) np tol tip never forced
    1e-5 (6.2e-8) 2 1e-9 projected, 19464 orth, 6 s 140115, 39 s = tip
    3e-5 (1.8e-7) 2 1e-9 projected, 49014, 13 s 10528, 3.5 s = tip
    1e-4 (6.2e-7) 1 1e-9 projected, 1486, 1.9 s 13935, 7.6 s = tip
    1e-4 (6.2e-7) 2 1e-9 projected, 65264, 18 s 32209, 9.4 s = tip
    1e-4 (6.2e-7) 4 1e-9 projected, 34189, 5.2 s 7528, 1.5 s = tip
    3e-4 (1.8e-6) 2 / 4 1e-9 not projected, 3389, 1.6 / 1.0 s = tip 65264 / 53664
    1e-3 (6.2e-6) 1 1e-9 not projected, 2336 = tip 1461
    1e-3 (6.2e-6) 2 / 4 1e-9 not projected, 3064 / 3039 = tip 1089340 / 1096740, velocity at its 200 cap, 275 / 151 s
    1e-5 (6.2e-8) 2 1e-11 projected: velocity at its cap, 1103092, 289 s 210317, 54 s = tip
    1e-4 (6.2e-7) 2 1e-11 projected: 1115517, 297 s 148467, 38 s = tip
    1e-4 to 1e-3 2 1e-6 1110 to 1835, about 1 s, either way

    So the measure is right for whether a mode is near-null, but what projecting costs scales with the inner tolerance (0.033 x tol) and grows with the rank count. At tol 1e-9 projecting pays below about 1e-7 and costs above it; at tol 1e-11 it stalls at 6e-8. Whether it projects or not, every run converged to the same L2 (0.2937835156). Make the threshold scale with tol, for example min(1e-6, c x tol) with c measured at np 2 and 4: our tol 1e-9 points put c between 60 and 180, but they are sparse. Keep the exact modes (4e-11 for gmsh's circle) above the bottom of that range. Correct the docs' 6e-6 line, or tie it to np 1.

  2. The np 4 off-sphere vertex is still live at 99c8b05. gh pr view 952: OPEN, not merged, not an ancestor of the tip. Here the 0.3/refinement-1 shell at np 4 still has Upper r 0.989852 to 1.0. It warns, refuses all three modes, and gives L2 11.512 against 3.4726 at np 2 (meshes.out). The author's L2 of 3.4789 at np 2 and 4 must come from a build with #946: refining a spherical mesh no longer folds cells; a missing label moves nothing (#903) #952 underneath, which this tip is not. The cause is petsc_dm_find_labeled_points_local returns [0] for a missing label; refinement callbacks then move vertex 0 #903's, as they say, but the case is open on this branch until #946: refining a spherical mesh no longer folds cells; a missing label moves nothing (#903) #952 lands or it is merged in.

Low
3. One run was not reproducible. On the slid annulus at C=1e6, tol 1e-6, np 1, two runs on the same code path (neither projects) gave 126128 and 126153 orth, and L2 1.4286698e-4 and 1.4286370e-4 (csweep.out). Seen once; the cause is not identified.

What was asked

1. C=1e5 to 1e8 under the new rule. The slid annulus (0.1 rad), tol 1e-6, np 1. Now never projected: measure 5.78e-4, 5.70e-4, 5.56e-4.

C tip not projected round 3 tip
1e5 144929, 82.7 s 144929, 82.1 s 515853, 305 s
1e6 126128, 65.6 s 126153, 71.9 s 402428, 236 s
1e8 55751, 30.7 s 55751, 34.0 s 119601, 65 s

Round 3's Medium is fixed.

2. The slid band across kernels, tol 1e-9. These cases are now projected (band.out). Most of the kernel dependence has gone, but the cost has not.

slide (measure) np 2: orth over Nehalem, Sandybridge, Zen, default np 4 round 3, unprojected, np 2
1.2e-5 (7.4e-8) 15914 to 21939 2989 to 3089 14703 to 135540
3e-5 (1.8e-7) 42289 to 60189 11514 to 15039 8453 to 23725
1e-4 (6.2e-7) 61339 to 65264 32464 to 39839 7253 to 45115

All converge with the same L2. At 1e-4 the spread across kernels is now 1.06x, against 6x in round 3, but every kernel costs what round 3's worst kernel cost or more: about 19x a clean solve (3389) at np 2. Projected near-null modes do not stall like #963 at tol 1e-9 with the measure at or below 1e-6. They do stall at tol 1e-11 (finding 1), and when forced at 6e-6 at np 2 and 4.

3. The threshold on other meshes.

  • 0.3 shell, np 2: 7.5e-3, 1.63e-2, 1.70e-2. Not projected, far above 1e-6, as the test says.
  • Annulus, refinement 3: 1.9e-11 as built (projected); slid 1e-5, 1e-4, 1e-3 gives 1.6e-8, 1.6e-7, 1.6e-6, about 3.3x viol, against 2.3x at refinement 2. The measure-to-viol ratio depends on the mesh. At slide 1e-4 the projection is about neutral: 29217 against 36427 unprojected, np 2.
  • 3-D box (p95.py), rotated Top and Bottom, sides natural: the z rotation is admitted by detection (op viol 3e-16), measure 2.4e-15, projected; the x and y rotations are rejected by the constraint.

On every mesh tried, the measure agrees with how near-null the mode is. What it does not predict is what projecting costs, which depends on tol and np (finding 1). Not found: a mesh where the measure is small while the mode is far from null.

Round-2 and round-3 conditions, by commit

condition commit status evidence
r2: cached re-solve record 2bd82ef met (r3) norecord killed
r2: mixed normals warn 2bd82ef, wording 59828ca met nomixwarn killed (r3); the test now uses the slid annulus and asserts ortho 0; the wording says when the rotation stays
r2: no warning on [] 59828ca met emptywarn killed (test_a_mesh_that_declares_no_rotation..., line 262)
r2: cache key before after the solve 2bd82ef met (r3) nosig killed
r2: 0.3/6 segmented fixture 59828ca met labelpts now killed by the segmented test itself (exempt [False]*3, line 479)
r2: moved indicator, a rank count that moves 2bd82ef + 59828ca met serial _moved_wrap test kills nomoved at np 1 (line 395). The parallel twin still has no power at CI's np 2, but the serial test runs everywhere
r2: undeclared 3-D units 2bd82ef met (r3) coords killed
r2: wall tolerance fixture 2bd82ef met (r3) 1e-7 and 1e-11 killed
r2/r3: #952 or file the np 4 vertex none open finding 2
r2: decision on deformed walls and cuts none not shown no record on the PR (read only)
r3-1: exactness independent of viscosity 59828ca met for viscosity frob killed (5 of 6 SLID cases); costs above; tol and np are open (finding 1)
r3-7: threshold pinned on both sides; two-sided, orthonormal projection 59828ca met 3e-6 and 5e-7 killed; 1.5e-6 and 7e-7 survive (inside the pinned band, 6.2e-7 to 1.84e-6); noorth, inonly, outonly killed
r3-8: LU record 59828ca, test 99c8b05 met nolurec killed (line 247)
r3-5: mixed wording 59828ca met above
r3-9, r3-10: docs 59828ca met, one line wrong routes and measure documented; "cost nothing at 6e-6" is np 1 only (finding 1)

Tests at tip: serial test_1131 24 passed (442 s); test_1142 11 passed (33 s). Parallel test_1131 3 passed and test_1142 1 passed, each at np 2 and 4.

Attacks that failed

  • Viscosity contrast 1e5 to 1e8 against the new measure.
  • Kernel spread on the projected band (now 1.06x at slide 1e-4).
  • A refined annulus, the shell, and a 3-D box with rotated walls: the measure agrees with how near-null the mode is.
  • Exact modes stay projected: annulus as built, refinement 2 and 3; the box.

Issues

Merge conditions

Could not test

CI and macOS arm64 (the author's numbers for the SLID bands come from there; ours agree to 3 digits). Tolerance scans at np 4 and on other kernels at tol 1e-11. A finer threshold scan to fit c. A finer shell. Why the one run in finding 3 did not reproduce.

Underworld development team with AI support from Claude Code

@lmoresi

lmoresi commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

How rounds 2 and 3 are met, at 99c8b05

Round 2 was met at 2bd82ef without a note here. This note covers both rounds. Round-3 fixes are in 59828ca and 99c8b05.

Round 3

finding change evidence
1, Medium: exactness scaled by |A|_F 59828ca. A mode is projected when its Jacobi-scaled residual, max |(D⁻¹ A m)ᵢ| / max |mᵢ|, is at most 1e-6. Each row is scaled by its own diagonal. Table below.
2: np 4 vertex on the 0.3 shell #952 fixes it (#903). This PR merges after #952. Hyperion, on #952's 4f634b0 with this branch merged on top: Upper is 1.000000 to 1.000000 at np 2 and 4, exempt, ortho 3, L2 3.4789315 at both rank counts. On this branch alone at np 4: 0.989852, refused, L2 11.512. The merge with #952 conflicts in discretisation_mesh.py and the CHANGELOG, two additions at one spot; both are kept.
3: [] warns 59828ca: an empty declaration returns before any check test_a_mesh_that_declares_no_rotation_is_not_warned_about. It fails without the early return.
4: segmented fixture 59828ca: cellSize 0.3, 6 segments 3.4 s serially
5: mixed-normal wording 59828ca The warning now says the rotation is not removed only where a facet-averaged wall is faceted unevenly. The test uses the slid annulus, where that holds, and asserts orthonormal == 0.
6: moved add_fault case has no power at np 2 59828ca: a serial test calls addon_partition._moved_wrap over a copy of the DM Without _inherit_rotation_modes it fails on one rank (0 == 1). The parallel spy stays for np 3, 4, 5 and 8.
7: loose projection tests 59828ca, test_1142 Mutants killed: the Frobenius measure; thresholds 3e-6 and 5e-7; no Gram-Schmidt; input-only and output-only projection.
8: LU route records None 59828ca: the gauge's verdict is recorded when no null space was built test_the_direct_lu_route_records_its_verdict_on_the_declared_mode fails without it (None == [True])
9, 10: docs 59828ca rotated-freeslip.md now covers the measure, the threshold and which route records what. A 2-D rotation is near-null only on unequal edges: the gmsh annulus as built is exact (4e-11) and projected. test_1142's default-normal test is renamed for the undeclared meshes it uses.

Each exactness measure on each fixture, measured on macOS. The annulus is the factory one, cellSize 0.2, refinement 2, custom FMG. "Slide a" moves every vertex along its circle by a·sin 3θ. Viscosity is 1 at both walls and C at mid-shell.

fixture constraint violation |A m| / (|A|_F |m|) Jacobi-scaled residual
annulus as built 7.1e-12 2.5e-14 3.8e-11
annulus, analytic normal 2.0e-17 2.1e-18 1.1e-15
slide 1e-4, C 1 / 1e6 2.7e-7 1.0e-9 / 4.2e-15 6.2e-7 / 5.7e-7
slide 1e-3, C 1 / 1e6 2.7e-6 1.0e-8 / 4.2e-14 6.2e-6 / 5.7e-6
slide 0.1, C 1 / 1e4 / 1e6 / 1e8 2.7e-4 1.0e-6 / 3.3e-10 / 4.1e-12 / 5.1e-14 6.2e-4 / 5.9e-4 / 5.7e-4 / 5.6e-4
shell 0.3, default normal 3.3e-3 to 4.5e-3 3.8e-6 to 5.4e-6 6.1e-3 to 1.7e-2
shell 0.3, analytic normal 2e-17 to 4e-17 1.3e-18 1.5e-15 to 1.6e-15

The threshold of 1e-6 comes from round 3's isoviscous costs. The Jacobi-scaled residual is about 600 times the Frobenius ratio there.

  • Forcing the projection cost nothing at 6e-6, 14 times the iterations at 6e-5, and did not finish at 6e-4.
  • Leaving a mode unprojected at 7e-8 to 6e-7 (walls slid 1.2e-5 to 1e-4 rad) made the count depend on the BLAS kernel.

The new rule therefore also projects round 3's "seen on base" kernel-dependent cases. test_1142 pins the threshold between 6.2e-7 (projected) and 1.8e-6 (not), at contrasts 1 and 1e6. The C=1e6, slide-0.1 case solves in 2 s at tolerance 1e-5, unprojected.

Round 2, condition by condition

condition commit
cached re-solve record 2bd82ef
warn on mixed normals 2bd82ef; wording in 59828ca
no warning on [] 59828ca
cache-key before after the solve 2bd82ef
0.3/6 segmented fixture 59828ca
moved indicator at a rank count that moves 2bd82ef (parallel spy); 59828ca (serial _moved_wrap)
undeclared 3-D units test 2bd82ef
tolerance fixture at 1e-8 or tighter 2bd82ef
#952 first, or file the np 4 vertex #952 first; finding 2 above
decision on deformed walls and cuts below, for a ruling

Deformed walls and cuts: what the branch does

  • A wall deformed off its sphere (vertex distances from the centre spread by more than 1e-9 of the radius, as a free surface does after its first step): the declared modes lose their exemption, rank 0 warns, and the modes take the constraint test. Under the facet-averaged normal they fail it, so the answer keeps a rigid rotation, as it did before this branch. Under a given analytic normal they pass only if that normal is exact. The board's radius-variable item is the alternative: a radius field that the free surface updates, against which the exemption would test.
  • A cut that crosses a wall: untested. The exemption tests only the wall vertices' distances from the centre, so a cut that leaves them on the sphere keeps it. We have not measured whether the rotation is then still a null mode of the cut operator.

This PR fixes #906 for factory meshes and meshes derived from them whose walls stay on their spheres. Deformed walls and wall-crossing cuts stay live on #906.

Verification at 59828ca

  • Serial test_1131 and test_1142: 32 passed, 1 skipped (the x86-only kernel child), in 156 s.
  • The serial rotated, custom-MG and fault set is running.

Underworld development team with AI support from Claude Code

An admitted rotation is projected when its Jacobi-scaled residual is at
most max(1e-10, min(1e-6, 100 tol)). Hyperion's round 4 measured what
projecting a near-null mode costs, on walls slid along their circles: at
tol 1e-9, np 2, it paid at 62 tol (19464 GMRES orthogonalisations against
140115 left) and cost at 180 tol (49014 against 10528); at 620 tol it cost
2x at np 2 and 4.5x at np 4; at tol 1e-11 a mode at 6.2e-8 ran the
velocity solve into its cap. The fixed 1e-6 ignored all of that; round 3's
"cost nothing at 6e-6" held at np 1 only (docs corrected). The floor keeps
a mode exact to rounding (4e-11 on gmsh's circle) projected at any
tolerance. The record carries null_mode_threshold.

The cross-solve workspace is now rebuilt when the tolerance changes: its
KSP tolerances and its projection were both set for the one it was built
with, and a re-solve at a new tolerance kept them.

Tests (test_1142): the threshold's values; at tol 1e-9 a 6.2e-8 mode is
projected and a 1.8e-7 one is not; a re-solve at a new tolerance rebuilds
the workspace and re-decides. Killed: a fixed 1e-6, c = 50 and c = 200,
and a cache key without the tolerance.

Underworld development team with AI support from Claude Code
…from-mesh-906

Underworld development team with AI support from Claude Code

# Conflicts:
#	docs/developer/CHANGELOG.md
#	src/underworld3/discretisation/discretisation_mesh.py
@lmoresi

lmoresi commented Nov 8, 2026

Copy link
Copy Markdown
Member Author

Adversarial review of #964, round 5 at d7548b3 (hyperion)

Verdict: ready to merge, with one Low to fix or file. The threshold now follows the tolerance: on every case of our round-4 cost table it picks the cheaper choice or a converging one, and nothing stalls. The np 4 shell is on the sphere now that #952 is underneath. The merge keeps both sides correctly. All four mutants the author names are killed. The one new defect: a tolerance change on a warm, already-converged re-solve throws the workspace away without rebuilding it. That leaks about 10 MB per re-solve at np 2 and records None for the projection.

Build: fetched, git checkout --detach d7548b3c, build.sh 906b exit 0; git status clean. The installed .py files match src/ (one stray test file in site-packages, as before). #952 is MERGED and its merge commit, 15f13d0, is the merged parent. Probes and logs are in runs/2026-11-06/rev906/round5/; mutants are an env-gated overlay (ov). Orth is GMRES orthogonalisations, the solve's total work.

What was asked

1. The np 4 0.3/refinement-1 shell. Upper is 1.000000 to 1.000000 at np 2 and 4 (p90.py), and exempt [True]*3 at both, so the spread is below 1e-9. ortho 3, measures 9.6e-3, 8.8e-3, 7.3e-3, none projected. L2 is 3.478931521 at np 4 against 3.478931513 at np 2 (round 4, without #952: 11.512 against 3.4726). Round 4's finding 2 is closed on this branch.

2. Round 4's cost table under the new rule. Annulus, refinement 2, walls slid along their circles, default kernel. The threshold is 1e-7 at tol 1e-9 and 1e-9 at tol 1e-11. Round-4 columns are from round4/cost*.out.

slide (measure) np tol rule now tip round 4 projected round 4 never
1e-5 (6.2e-8) 2 1e-9 projects 19464, 9.4 s 19464 140115
1e-5 (6.2e-8) 4 1e-9 projects 2664, 0.9 s 2664 107490
3e-5 (1.8e-7) 2 1e-9 not 10528, 9.3 s 49014 10528
3e-5 (1.8e-7) 4 1e-9 not 8378, 1.6 s 11514 8378
1e-4 (6.2e-7) 2 1e-9 not 32209, 10.9 s 65264 32209
1e-4 (6.2e-7) 4 1e-9 not 7528, 1.5 s 34189 7528
1e-5 (6.2e-8) 2 1e-11 not 210317, 52 s 1103092, 289 s, velocity at its cap 210317
1e-5 (6.2e-8) 4 1e-11 not 203893, 27 s forced now: 74392, 10 s 203893
1e-4 (6.2e-7) 2 1e-11 not 148467, 39 s 1115517, 297 s 148467
1e-4 (6.2e-7) 4 1e-11 not 11967, 2.1 s - -

Every run converges, to L2 0.2937835156. At tol 1e-9 the rule picks the cheaper side on all six rows. At tol 1e-11 it avoids the np 2 stall. The cost: at np 4, slide 1e-5, projecting would have been 2.7x cheaper (74392 against 203893), so the cheaper side still depends on the rank count. Not a defect, since both converge; worth a line in the docs.

3. Parallel tests. test_1131 3 passed and test_1142 1 passed, each at np 2 and 4. Serial: test_1131 24 passed (424 s), test_1142 15 passed (43 s).

The merge

git show --remerge-diff d7548b3c: two conflicts, both resolved by keeping both sides.

The named mutants (test_1142)

mutant result
fixed 1e-6 killed: 4 tests (threshold values, tight tolerance x2, re-solve)
c=50 killed: 3 (threshold values, tight tolerance x2)
c=200 killed: 4
cache key without the tolerance killed: test_a_re_solve_at_a_new_tolerance_re_decides_the_projection

The tolerance-change rebuild

p85.py and p86.py: slid annulus at 1e-5, FMG, np 2, 10 re-solves per phase.

  • Same tolerance, warm and already converged: reused True, the same workspace object, 0.05 s, RSS flat at 784 MB. It does not rebuild every solve.
  • Changed RHS each solve, same tolerance: reused False every solve, about 4 s, RSS up about 14 MB per solve. Identical on 99c8b05 (795 to 851 MB over 6, against 787 to 856 here). Not this change.
  • Alternating tolerance (1e-8/1e-9), warm and already converged: see finding 1.
  • Alternating tolerance (1e-11/1e-9), with work each time: rebuilt each time, as intended. The threshold and the decision follow (1e-9: not projected, 49 s; 1e-7: projected, 4 s), and RSS rises about 14 MB per solve, the same per-rebuild growth as the RHS case.

Findings

Low

  1. A tolerance change on a warm re-solve that is already converged drops the workspace and builds nothing.

    • Tip, alternating tolerance (alt): from the second solve on, reused False, null_mode_threshold None, projected_null_modes None, no cached ctx, 0.20 s each.
    • RSS grows about 10 MB per re-solve at np 2: 776 to 813 MB over 8, 780 to 846 over 10.
    • The same loop on 99c8b05: reused True, record kept, 0.05 s, RSS flat at 780 MB.

    The geometry tier (Q, the rotated prolongation) is rebuilt only for the solve to stop at its first residual check. That rebuild path is where _build_rotated_custom_Pl leaks, as its own comment says. A time loop with an adaptive tolerance pays this every step. The new test sidesteps it with zero_init_guess=True. Suggest invalidating only the KSP context (the projection and its tolerances) on a tolerance change, not the geometry, or keep the record when the solve exits early.

Attacks that failed

  • The cost table at np 2 and 4, at tol 1e-9 and 1e-11.
  • The four named mutants.
  • A same-tolerance re-solve: no rebuild, no growth.
  • The merge: both sides intact.
  • The np 4 shell.

Issues

Merge conditions

  • Fix finding 1, or file it and say so in the PR.

Could not test

CI and macOS arm64. Kernels other than the default in this round (round 4 showed the projected band uniform across kernels). Tolerances other than 1e-9 and 1e-11 at np 4. Why a 1e-8 to 1e-9 tightening on a converged state does no iterations on both tips; seen, not investigated.

Underworld development team with AI support from Claude Code

…geometry (#964 r5)

Hyperion's round 5: a tolerance change dropped the whole cross-solve
workspace. A warm re-solve already inside the new tolerance then built
nothing, recorded None, and left no workspace, so the next solve rebuilt
the custom prolongation: RSS grew about 10 MB a re-solve at np 2 (776 to
846 MB over 10), against flat at 99c8b05.

A tolerance change now drops only the KSP context, whose tolerances and
projection follow it. The rotation, the operator and the prolongation are
kept, and a workspace whose solve built no context persists without one.
The verdict joins the collective cache verdict.

Tests (test_1142): a re-solve at a new tolerance reuses the rotation and
re-decides the projection; a warm, converged re-solve at a looser
tolerance keeps the workspace and the next solve projects at the new
threshold. Both fail under the round-4 rule. Docs: what a tolerance change
keeps, and that the cheaper side still depends on the rank count (np 4,
tol 1e-11, slide 1e-5: projecting 74392 against 203893).

Underworld development team with AI support from Claude Code
…-from-mesh-906

Underworld development team with AI support from Claude Code
…ng 2026-11-08)

A deformed wall's rotation is kept as a near-null mode, not removed as a gauge,
because the deformation may not eliminate the null space. The subsystem page and the
changelog say so, and point to the post-solve projection for a model that wants the
rotation removed.

Underworld development team with AI support from Claude Code
@lmoresi
lmoresi merged commit 40e9a86 into development Nov 8, 2026
9 checks passed
gthyagi pushed a commit to gthyagi/underworld3 that referenced this pull request Nov 10, 2026
On a Xeon 8370C runner, underworldcode#964's shard 4 serial phase took 55:38, mostly
test_0022, and the job hit the 70-minute cap. Development's took 27:50 on an
EPYC 7763. test_0022 is deselected from shard 4's band and runs alone on
shard 6. --deselect, because pytest collects a file named on the command line
even under --ignore.

Underworld development team with AI support from Claude Code
gthyagi pushed a commit to gthyagi/underworld3 that referenced this pull request Nov 10, 2026
…e#1008) into feature/convergence-reference-policy

Underworld development team with AI support from Claude Code
gthyagi pushed a commit to gthyagi/underworld3 that referenced this pull request Nov 10, 2026
…rworldcode#911)

test_0022's forward problem at the parameter its finite difference takes, a
transversely isotropic power law in an annulus under rotated free slip at tolerance
1e-11. With the increment floor its linear iterations are [1, 2, 1, 1, 1, 1] and it
passes in 7.6 s; with the floor removed at run time it ends with SNES reason -6
after 96 s. The design note records the rotated stage, and that underworldcode#964's projection
threshold keyed on the tolerance is the per-call one while the rotated atol is fixed.

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