Skip to content

Rotated free slip: walls mixing given and default normals remove the rigid rotation (#968) - #1052

Merged
lmoresi merged 2 commits into
developmentfrom
bugfix/rotated-mixed-normal-modes-968
Nov 10, 2026
Merged

lmoresi merged 2 commits into
developmentfrom
bugfix/rotated-mixed-normal-modes-968

Conversation

@lmoresi

@lmoresi lmoresi commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Rotated free slip on a mesh whose walls mix a given normal and the facet-averaged one now removes the rigid rotation from the answer (#968). This is sub-bundle C2 of the rotated-territory sweep.

The defect

A mesh that declares its rotation modes (#906) exempts a declared mode from the test against the constraint rows when faceting is the only reason it could fail it: on a faceted sphere the facet-averaged normal is not radial at the nodes, so a true rotation fails the test by the faceting error. The exemption needed every rotated wall on the facet-averaged normal. A mix refused it for every wall, the faceted wall then failed the test, the rotation was not removed, and the answer carried it. On a spherical shell (cell size 0.35) with the analytic radial normal on Lower and the default on Upper, development leaves a rotation rate of 0.084 in a v_rms of 0.105 (1.4 times v_rms measured on hyperion), and warns.

The rule now

  • The exemption covers the walls that take the facet-averaged normal, which must still be spheres about the modes' common centre, as before.
  • A wall with a given normal is tested against that normal at its own nodes: n . mode, from the rows and normals build_rotation records per given wall. Where a given wall meets a facet-averaged one the node's frame averages both normals, so the given wall is not tested on the frame (that rejected a genuine rotation at the seam, review F1).
  • An exact given normal passes to round-off; a wrong one rejects the mode, with rejected_by: "given_wall" in the solve's rotation_gauge, and a warning naming the walls.
  • When every wall takes a given normal nothing changes: the modes take the whole constraint test.

The same shell now leaves a rotation rate of 3e-17 (v_rms 0.058, as with the default normal on both walls), at np 1, 2, 4 and 8 (hyperion). The solve's report gains declared_modes_tested_walls, and each mode's report a given_viol. docs/developer/subsystems/rotated-freeslip.md states the rule.

Tests

tests/test_1131_rotated_nullspace_from_mesh.py (level_2, tier_b), on an annulus whose vertices have slid along their circles, so the default wall is faceted unevenly:

  • an exact given normal beside a default wall removes the rotation (development: exempt [False], no mode removed);
  • a tilted given normal beside a default wall rejects it, on the given wall, and warns;
  • a given radial normal on a wall pushed off its circle by 1e-6 still removes it: the sphere test covers the facet-averaged walls only;
  • a seam between a given and a default part of one circle keeps the mode (given_viol 7.8e-18).

tests/parallel/test_1131_rotated_nullspace_from_mesh_parallel.py adds the mixed and tilted cases, with the verdict and the given-wall violation compared across ranks and the rotation measured on the global vector.

The new serial tests fail with development's rotated_bc.py; mutants that apply the sphere test to the given walls too, or test the given walls on the frame rows, are each caught. 53 rotated test files on wombat (serial, not level_3): 512 passed, 0 failed.

Also in this PR

tests/parallel/test_1152 prints one line per mesh move past pytest's capture. At np 2 on a loaded host (hyperion at load 60) its two cases take 157 s and 254 s, against 109 s for both on CI, and the MPI supervisor kills a job silent for 300 s. Test-only.

Issue verdicts

Underworld development team with AI support from Claude Code

…tation exemption (#968)

On a mesh that declares its rotation modes (#906), a declared mode is
exempt from the constraint-row test when faceting is the only reason it
could fail it. The exemption needed every rotated wall on the
facet-averaged normal; a mix refused it for the whole set, so a faceted
default-normal wall failed the test by its faceting error, the rotation
was not removed, and the answer carried it (spherical shell, cell size
0.35, Lower given the radial normal: rate 0.084 in a v_rms of 0.105).

The exemption now covers the facet-averaged walls, with the sphere test
about the common centre as before, and a given-normal wall is tested on
its own constrained rows: an exact normal passes to round-off, a wrong
one rejects the mode. build_rotation groups the constrained rows by the
wall they came from (_rotated_normal_rows_by_wall);
_declared_mode_test_rows gives the given walls' rows to
_mode_satisfies_constraints (declared_rows), and the report records
their violation (given_viol). When every wall takes a given normal
nothing changes.

The same shell now leaves a rate of 3e-17 (v_rms 0.058, as with the
default normal on both walls). test_1131: the mixed case on the slid
annulus removes the rotation (development: exempt [False], no mode); a
tilted given normal beside a default wall rejects it on its own rows.
Both fail with development's rotated_bc; a mutant that skips the given
walls' test is caught. 53 rotated test files (serial): 510 passed.

Underworld development team with AI support from Claude Code
…en it rejects

- F1: the given walls' test read the constrained rows, and where a given
  wall meets a facet-averaged one the node's frame averages both normals,
  so a genuine rotation was rejected at the seam (given_viol 0.096 on a
  split annulus wall, 0.15-0.19 on the shell). build_rotation now records
  each given wall's owned velocity rows with its own normal there
  (_rotated_given_wall_dofs), and the mode is tested by n . mode
  (_given_normal_violation): 7.8e-18 on the same seam.
- F2: a mode the given-wall test rejects warns once, naming the walls and
  the violation; the rotation stays in the answer, as on development.
- F3: rejected_by "given_wall"; the solve reports the walls tested
  against their own normal (declared_modes_tested_walls); the exemption
  comment says what it covers.
- F4: test_1131 adds a given radial normal on a wall pushed off its
  circle beside the slid default wall (kills the sphere test applied to
  every wall) and a split-wall seam (kills the frame-row test); the
  parallel file adds the mixed and tilted cases, measured on the global
  vector, with the verdict compared across ranks.

Also: test_1152 prints one line per MMPDE move past pytest's capture. At
load 60 on hyperion its two cases take 157 s and 254 s at np 2, against
109 s for both on CI, and the MPI supervisor kills a job silent for 300 s.

53 rotated test files (serial): 512 passed. test_1152 serial: 2 passed.

Underworld development team with AI support from Claude Code
Copilot AI balanced review requested due to automatic review settings November 10, 2026 23:08

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 10, 2026

Copy link
Copy Markdown
Member Author

Review record, round 1 of 2: 9b67509

This is the pre-PR round, on the branch's first commit. 7a70b2e answers F1–F4; round 2 follows in a separate comment. Paths under review/ are on hyperion, in runs/2026-11-11-968/.


Review of the #968 fix (bugfix/rotated-mixed-normal-modes-968, 9b67509)

Verdict: the fix is correct for the case #968 describes and is safe to merge, with conditions: a given-normal wall that meets a facet-averaged wall at a corner is still wrongly rejected, and it is rejected silently (F1). A rejection on the given walls now raises no warning (F2). Two of the three mutants survive the test file (F4).

Hyperion, 2026-11-11. The branch build is wt-968 at 9b67509. The base build is wt-1051 at bbdc7c7, whose src matches f562bdf. I checked that the installed rotated_bc.py in each environment is byte-identical to its revision. No worktree was modified, and nothing was written outside review/.

Method

  • Probes. They are in review/probes/, and every log is in review/logs/.
    • shell.py is a SphericalShell (1.0 / 0.5) at cellSize 0.35, P2/P1, isoviscous. The forcing is 36 cos(4θ)(z/r) sin(π(r−0.5)/0.5) r̂, the test_1131 shell forcing rescaled so that v_rms is near 0.058. Rotated free slip is applied on both walls and the solver default is used (GAMG; there is no FMG tail).
    • annulus.py is an Annulus (1.0 / 0.5), either as built or with test_1131's MMPDE-style slide (--slid). It can give a wall a tilted normal (tilt:eps, n ∝ (x/r+eps, y/r)) or an off-centre one (offset:d). It can also split Upper into two labels, UpperE (x>0) and UpperW (x≤0), which creates two given-to-default corners.
    • mutants.py patches rotated_bc in-process.
  • Measures. The rigid rotation rate is a least-squares fit about the origin. Both it and v_rms are computed from global PETSc vectors: the final U is dotted with the Cartesian rotation modes, and the velocity sub-vector comes from createFieldDecomposition. They are therefore partition-independent and count no ghost twice.
    • "rate" below is |ω|. viol and given_viol come from rotation_gauge["modes"].
    • Every probe allgathers its JSON result and checks that it is the same on every rank ("uniform"). The only field that ever differed is the warning list, which is recorded only on rank 0.
  • Tests. They run from git archive copies, with PYTHONDONTWRITEBYTECODE=1 and -p no:cacheprovider, and MPI runs go through mpi_supervisor.py --silence 300. No more than 16 cores were in use at once.

1. Reproduction

3-D SphericalShell, cellSize 0.35

build case np rate v_rms rate / v_rms n_rot exempt viol given_viol warns
base Lower given, Upper default 1 0.473 0.3325 1.4 0 False 0.011–0.014 – yes
base Lower given, Upper default 2 0.473 0.3326 1.4 0 False 0.011–0.014 – yes
base Upper given, Lower default 1 0.665 0.4683 1.4 0 False 0.0077–0.012 – yes
base all default 1 7.3e-17 0.05802 1.3e-15 3 True 0.014–0.019 – no
base all given 1 6.5e-19 0.05755 1.1e-17 3 False ≤5.8e-17 – no
branch Lower given, Upper default 1 5.1e-17 0.05768 8.8e-16 3 True 0.011–0.014 8.1e-18–1.3e-17 no
branch Lower given, Upper default 2 1.1e-17 0.05768 1.9e-16 3 True same same no
branch Lower given, Upper default 4 6.7e-17 0.05768 1.2e-15 3 True same same no
branch Lower given, Upper default 8 4.0e-17 0.05768 7.0e-16 3 True same same no
branch Upper given, Lower default 1 / 2 6.2e-17 / 5.4e-17 0.05776 ~1e-15 3 True 0.0077–0.012 3.4e-17–5.7e-17 no
branch all default 1 5.0e-17 0.05802 8.5e-16 3 True 0.014–0.019 – no
branch all given 1 1.2e-18 0.05755 2.2e-17 3 False ≤5.8e-17 – no
  • The defect and the fix reproduce. Development leaves a rotation larger than the flow, and the branch removes it to round-off. The branch's v_rms (0.05768) sits between the all-default value (0.05802) and the all-given value (0.05755), as expected.
  • My numbers differ from W1's in size. W1 measured 0.0835 in 0.105 and I measured 0.473 in 0.333. The forcing is not the same, and the rotation that remains is undetermined, so its size is arbitrary.
  • The branch decision is partition-independent. given_viol agrees to the last digits at np 1, 2, 4 and 8.

2-D Annulus, Lower radial given, Upper default

mesh build rate v_rms rate / v_rms n_rot default-wall viol given_viol warns
as built, cellSize 0.2 base 0 5.018e-3 0 1 7.3e-11 – yes, falsely
as built, cellSize 0.35 base 3.9e-20 5.135e-3 7.5e-18 1 1.7e-10 – yes, falsely
as built, cellSize 0.5 base 7.3e-20 5.296e-3 1.4e-17 1 2.9e-10 – yes, falsely
as built, 0.2 / 0.35 / 0.5 branch ≤2.6e-19 same ≤5e-17 1 same ≤2.2e-17 no
slid base 3.64e-5 3.836e-3 9.5e-3 0 2.29e-3 – yes
slid branch 4.0e-20 3.836e-3 1.0e-17 1 2.29e-3 1.1e-17 no
slid, Upper given and Lower default base 1.37e-6 2.745e-3 5.0e-4 0 2.96e-3 – yes
slid, Upper given and Lower default branch 1.6e-20 2.745e-3 5.8e-18 1 2.96e-3 3.6e-17 no
  • The annulus as built does not reproduce at any cell size. Its default normal passes the 1e-8 test outright, with viol at most 2.9e-10, even at cellSize 0.5. Development warns about the mixed walls there anyway, although the mode is kept. The branch drops that false warning.
  • The slid annulus does reproduce in 2-D. This is the test_1131 fixture: development leaves a rotation of 0.95 % of v_rms, and the branch removes it to round-off.

2. Parallel

  • Every rank calls _row_violation, including ranks that own no rows [read, then run]. given_viol is computed only when declared_rows is not None and declared. declared_rows is None exactly when no wall has a given normal, which is registration state and the same on every rank. declared comes from _declared_mode_flags, which reduces over the ranks. A rank that owns no rows of the given wall passes an empty list, which is a valid local index array, and still takes part in the collective norm.
  • Empty-rank partition. I used an annulus with ri 0.2, cellSize 0.1, the slid mesh and np 8. Ranks 1, 4 and 7 have no "Lower" key at all in _rotated_normal_rows_by_wall; the per-rank counts are [{L:1,U:11},{U:26},{L:4,U:12},{L:8,U:10},{U:22},{L:10,U:8},{L:5,U:16},{U:23}].
case np rate / v_rms n_rot given_viol uniform hang
Lower radial 1 1.5e-17 1 2.42e-18 – –
Lower radial 8 2.5e-17 1 2.42e-18 yes no
Lower tilt 1e-3 1 1.71e-2 0 2.44e-5 – –
Lower tilt 1e-3 8 1.70e-2 0 2.44e-5 yes no
base, Lower radial 1 1.84e-2 0 – – –

The decision matches serial and is the same on every rank, both for accepting and for rejecting. The slid annulus also agrees at np 4, under both the default and the simple partitioners (n_rot 1, given_viol 1.08e-17), and the split fixture agrees at np 4. Nothing hung.

3. Cache path

  • Changing the normal on the same solver gives a fresh build [read]. The geometry signature (_rotated_geometry_signature) includes (name, repr(normal)) for every wall. A change of normal or of wall set therefore misses the cache and reruns build_rotation, which rewrites _rotated_normal_rows_by_wall. add_rotated_freeslip_bc also sets is_setup = False, which tears the cache down.
  • Measured. In each case below I re-registered Upper on the same slid-annulus solver, solved again, and compared with a fresh solver.
change re-solve verdict fresh verdict max|v_re − v_fresh|
mixed → all given exempt False, accepted same 1.9e-13
all given → mixed exempt True, given_viol 1.1e-17 same 2.8e-12
mixed → Upper tilt 1e-2 (np 1) rejected same 0
mixed → Upper tilt 1e-2 (np 2) rejected same 0
Upper tilt 1e-2 → mixed accepted same 3.7e-12
  • No stale state found. A cached re-solve reads the attribute that was written with the cached Q, and the LU and datum paths rebuild on every solve.
  • One gap remains, and it is not new [read]. A normal whose value depends on a UWexpression that changes in place keeps the same repr, so the stale part would be the cached Q, not the row grouping. This predates the branch.

4. Given wall meeting a default wall at a corner

The rotation is a genuine mode only when every wall is a circle or sphere about the centre. A corner between a given wall and a default wall therefore exists only when one sphere carries two labels. I split Upper into UpperE and UpperW.

At the seam node, a given radial normal and the one-sided facet normal of the default side differ. The SVD therefore constrains 2 rows; in 2-D the node is fully pinned. Those rows sit in the given wall's test set.

fixture build / mutant rate / v_rms n_rot viol given_viol verdict warns
annulus, split, E given and W, Lower default branch 2.2e-8 0 9.6e-2 9.6e-2 rejected no
slid annulus, same split branch 9.2e-4 0 9.6e-2 9.6e-2 rejected no
slid annulus, same split base 9.2e-4 0 9.6e-2 – rejected yes
annulus, split, all default branch 1.2e-17 1 9.6e-2 – accepted (exempt) no
annulus, split, all given branch 2.7e-17 1 4.2e-17 – accepted no
slid annulus split, mutant M3 (corners excluded) branch 6.2e-18 1 9.6e-2 2.6e-17 accepted no
shell, split, E given and W, Lower default branch 7.5e-2 (rate 4.2e-3 in 0.0569) 0 0.15–0.19 0.15–0.19 all 3 rejected no
shell, split, all default branch 6.7e-17 3 0.15–0.19 – accepted no
shell, split, all given branch 2.6e-17 3 ~0 – accepted no
  • The genuine mode is falsely rejected. Away from the seam the given wall's rows pass to round-off (M3 measures 2.6e-17). The whole given_viol comes from the default wall's faceting, entering through the merged corner frame. That is exactly the error the exemption is meant to forgive. All-default and all-given both remove the mode, but the mixed split leaves a rotation of 7.5 % of v_rms on the shell and 0.09 % on the slid annulus, with no warning.
  • No false admission found. Excluding the corners (M3) would admit a wrong mode only when the given wall's error is confined to its corners. None of my fixtures did that.

5. Exemption semantics in the report

  • What a reader sees in the mixed case. declared_modes_exempt reads [True] while the mode can still come back rejected_by: "constraint"; that happens in the tilted case and in the split case.
  • The comment at rotated_bc.py:1992 is now wrong. It says the entry records "whether it kept every rotated wall in place and so its exemption from the constraint test". In the mixed case the exemption covers only the default walls.
  • The viol column misleads. It is still the whole-row violation, which did not decide anything in the mixed case.
  • Where the field lives [read]. declared_modes_exempt is in _rotated_freeslip_info; systems/solve_report.py does not carry it.

I recommend replacing the bare flag with a per-wall statement, for example:

  • declared_exemption = {"exempt_walls": ["Upper"], "tested_walls": ["Lower"], "modes_exempt": [True]}. It is equally acceptable to keep declared_modes_exempt and add declared_modes_tested_walls.
  • Set rejected_by: "given_wall" when given_viol decided the rejection, so that it is distinct from "constraint".
  • Fix the line 1992 comment and the docs to read "exempt on the facet-averaged walls; tested on the given-normal walls".

6. Tests and mutants

Test runs

run result
test_1131 serial file, branch build, branch tests, np 1 25 passed
test_1131 serial file, base build, branch tests, np 1 2 failed (the two new mixed tests), 23 passed
test_1131 serial file, base build, base tests, np 1 24 passed
test_1131 parallel twin, branch, np 2 / np 4 3 passed / 3 passed
test_1131 parallel twin, base, np 2 3 passed
the two new mixed tests, branch, np 2 wrong_given passes; mixed_..._remove_the_rotation fails its nodal rate assert (5.0e-4 against 1e-10·v_rms). The file is serial-only: _rotation_rate_2d sums one rank's sector of local arrays. My global measure gives round-off at np 2, 4 and 8.
rotated serial files (69 files: grep for rotated / free slip / rotated_bc, -m "not level_3"), branch 618 passed, 2 skipped, 2 failed. Both failures are in test_0052 and are a harness artifact: the archive copy had no src/. With src/ added, test_0052 has 5 passed.
rotated parallel files (28), branch, np 2 27 files pass, 107 tests. test_1152 (fac zone with a mover) stalls past the supervisor's 300 s of silence. It stalls identically on the base build (re-run), so it is not this change.

Mutants on test_1131 (branch build, in-process)

mutant test_1131 distinguishing probe
M1: skip the given-wall test caught, 2 failed Lower tilt 1e-2 is wrongly accepted: the rotation is projected out of a problem where it is not null.
M2: sphere test on every wall, given walls included survives, 25 passed A given radial normal on a Lower wall deformed by 1e-6: the branch keeps the mode (given_viol 1.1e-17, rate 1.7e-17 of v_rms). M2 refuses it, leaving 9.5e-3 of v_rms and a warning.
M3: corner rows excluded from the test set survives, 25 passed The split corner: M3 accepts and the branch rejects (section 4). Here M3 is arguably the better behaviour.

Tilt and offset threshold (slid annulus, Lower given, Upper default, branch)

given normal given_viol verdict rate / v_rms
tilt 1e-10 / 1e-9 / 1e-8 / 3e-8 1.3e-11 / 1.3e-10 / 1.3e-9 / 4.0e-9 accepted ~1e-17
tilt 1e-7 / 1e-5 / 1e-2 1.3e-8 / 1.3e-6 / 1.3e-3 rejected 9.5e-3 / 9.5e-3 / 6.0e-3
offset 1e-7 / 1e-3 (#969) 2.7e-8 / 2.7e-4 rejected 9.5e-3 / 9.1e-3

given_viol is linear in the error, about 0.134·eps, and the cut falls at eps ≈ 7.5e-8.

Findings

  • F1 (medium; affects contrived topologies only). The given walls are tested on rows of Q's merged frame. At a node shared with a facet-averaged wall, those rows carry the default wall's faceting error, so a genuine declared mode is rejected.
    • Measured: given_viol 0.096 (2-D) and 0.15–0.19 (shell), against the 1e-17 that the given rows show away from the seam. The answer keeps 0.09 % (slid annulus) or 7.5 % (shell) of v_rms as rotation, while all-default and all-given both remove it.
    • No shipped mesh has such a corner. A user who splits a wall label to give part of it a normal does get one.
    • Fix: test a given wall directly against its own normal (n_given·tg at that wall's nodes) instead of the merged rows. Alternatively, drop the rows of nodes shared with a facet-averaged wall from the test set (M3), which fixes this case.
  • F2 (medium). The branch deletes development's warning and adds none.
    • What happens: a declared, exempt mode rejected on the given walls (given_viol ≥ tol) leaves an undetermined rotation in the answer with no message.
    • Where this happens: the corner case (F1), and a slightly wrong given normal. A tilt of 1e-7 leaves 0.95 % of v_rms; an offset centre (Rotated free slip: an exact rotation off the origin is rejected, and FMG reports converged on a rigid rotation #969) does the same.
    • What development did: it warned in every mixed case. It also warned falsely on the annulus as built, which the branch correctly stops.
    • Fix: warn once, naming the given walls and given_viol against tol, whenever the exemption applies but the given-wall test rejects a mode.
  • F3 (low). The reporting is misleading in the mixed case. declared_modes_exempt: [True] sits beside rejected_by: "constraint", and the comment at rotated_bc.py:1992 is stale. Wording is proposed in section 5.
  • F4 (low). The tests do not pin the new rule completely.
    • M2 (sphere test on given walls too) and M3 (corners excluded) both pass test_1131.
    • Fix: add a given exact normal on a deformed wall beside a default wall (kills M2), and a split-label corner whose expected verdict follows from the F1 decision (kills M3, or the current code, depending on that decision).
    • The new mixed tests have no parallel twin. An np ≥ 2 verdict test like the existing twin, ideally on the ri 0.2 / np 8 empty-rank partition, would cover the collective path.
  • F5 (low, existing before this change, [read]). _wall_vertex_rows returns no rows when the per-name DM label is absent. The sphere test then passes vacuously: lo is inf, hi is −inf, and rel becomes 0. The docstring of _boundary_stratum_is says per-boundary labels do not survive adaptation. I could not test this: removing the label made the solve segfault elsewhere. The branch does not widen this; it now applies only to the default walls.

Merge conditions

  1. Add the F2 warning when the given-wall test rejects an exempt declared mode.
  2. Decide F1. Either test the given walls against their own normal (preferred), or exclude the mixed corner rows. Alternatively, document the split-label limitation and file it as an issue.
  3. Fix the line 1992 comment and the solve-info wording (F3).
  4. Add the M2-killing test (F4); add the corner and parallel tests if time allows.

Without items 2 and 4 the change is still a strict improvement on development in every case I measured, except the warning loss in F2.

Issue verdicts

Not tested

  • Forced-BLAS or Zen kernels, the FMG path on the shell (no tail registered), and the LU route on mixed walls. The LU route shares _finalize_rotated_solution, which passes the rows [read].
  • Faults or a thin sheet combined with mixed walls. Fault pair rows are in normal_rows but in no wall group, so they are never tested in the mixed case [read].
  • W1's exact probe and forcing, which are on another machine.
  • Whether test_1152's stall is slowness or a hang. It is identical on the base build.

Underworld development team with AI support from Claude Code

@lmoresi

lmoresi commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

Review record, round 2: 7a70b2e

Paths under review2/ are on hyperion, in runs/2026-11-11-968/.


Review of PR #1052 (#968), round 2, at 7a70b2e

Verdict: ready to merge. Every round-1 finding is resolved or reduced to wording, and I found no regression. The one new gap: a given-wall rejection on the direct-LU route records rejected_by: "given_wall" but does not warn (N1, low).

Hyperion, 2026-11-11. The branch build is wt-968 at 7a70b2e; its installed rotated_bc.py matches the worktree. The base build is wt-1051 (bbdc7c7, whose src is f562bdf). At most 14 cores were used, and everything was written under review2/.

Method

  • Probes. The round-1 probes were carried over in review2/probes/.
    • The 3-D shell is a SphericalShell at cellSize 0.35 with the forcing scaled by 36. The 2-D annulus is either as built or slid.
    • The split-label fixture moves Upper's x>0 facets to UpperE; the x≤0 facets become UpperW.
    • Rates and v_rms are computed on the global vectors, and each result is allgathered and compared across ranks.
  • New to this round.
    • The probe reports declared_modes_tested_walls and the number of given-wall nodes each rank holds.
    • There are --lu and --twice options (a second solve on the same solver).
    • The mutants were rewritten for the new code in mutants.py:
      • M1 skips the given-wall test;
      • M2 runs the sphere test on every wall;
      • M3 drops given-wall nodes that have two or more constrained rows;
      • M4 is round 1's rule, testing Q·mode on the constrained rows of the given-wall nodes.
  • Tests. They run from git archive 7a70b2e1 tests src with PYTHONDONTWRITEBYTECODE=1 and -p no:cacheprovider, and MPI runs go through mpi_supervisor.py --silence 300.

Round-1 findings: status

F1: a given wall meeting a default wall at a seam (fixed)

The given walls are now tested as n·mode against their own normals (_given_normal_violation). "rate/v" in the tables below is the rotation rate divided by v_rms.

fixture round 1 (9b67509) round 2 (7a70b2e)
2-D split seam, as built given_viol 9.6e-2, rejected, rate/v 2.2e-8, no warning given_viol 8.5e-18, accepted, rate/v 3.2e-17
2-D split seam, slid 9.6e-2, rejected, rate/v 9.2e-4 9.4e-18, accepted, rate/v 2.2e-17
2-D split seam, slid, np 2 / 4 – 9.4e-18 at both, accepted, rate/v 1.7e-17, same on every rank
shell split seam 0.15–0.19, all 3 rejected, rate/v 7.5e-2 1.5e-17–1.7e-17, 3 accepted, rate/v 3.4e-17
shell split seam, np 2 / 4 – identical given_viol (1.74e-17, 1.54e-17, 1.63e-17); rates 2.2e-18 / 9.7e-19
2-D split seam, LU route – 9.4e-18, accepted

Adversarial checks.

  • Two given walls at one seam node, with different normals [read, then run].
    • node_given[q] keeps one entry per given wall, so the node is tested against each wall's normal separately.
    • UpperE radial with UpperW tilted by 1e-2 gives given_viol 2.77e-3, rejected_by: "given_wall", a warning, and rate/v 3.7e-4.
    • UpperE tilted with UpperW default gives given_viol 2.81e-3, rejected and warned.
    • All three walls radial is not exempt; the mode is accepted with viol 3.7e-17.
  • Can the given-normal test alone admit a false mode? No case found.
    • At a node on one wall, the frame is that wall's normal.
    • At a multi-wall node, the other normals come from:
      • a default wall, which is exempt by design and is still covered by the sphere test;
      • another given wall, which is tested on its own normal;
      • an essential wall, which pins the mode, and the operator test rejects it [read; covered by test_1131's no-slip test].
    • A given radial normal on a wall pushed 1e-6 off its circle is admitted (given_viol 6.3e-18, rate/v 4.2e-18). That mode is a genuine discrete null mode: the constraint uses the given normal, to which the mode is exactly tangent, and a rigid rotation has zero strain.
    • Observation, not new. At a 2-D seam node the merged frame pins both components. The compatible mode, zeroed on the constrained rows, is then not exactly null near the seam. The all-default split was already treated this way in round 1, and the effect is the 9e-4 of v_rms that round 1 left in the answer.
  • Ghost and owned rows. Only owned nodes enter given_dofs, because the ownership check comes before the append on both the full and the partial branch. Constrained components appear as negative rows and are masked.
    • The global count of given-wall nodes is the same at every rank count, so no node is lost and none is counted twice.
    • Given-node counts by rank:
      • split UpperE: 33 at np 1; 4 + 29 at np 2; 6 + 0 + 14 + 13 at np 4;
      • Lower on the ri 0.2 annulus: 28 at np 1; 1 + 0 + 4 + 8 + 0 + 10 + 5 + 0 at np 8, so three ranks hold none.
    • given_viol is identical to the last digit at np 1, 2, 4 and 8 for the slid case (5.07e-18), the seam case (9.42e-18) and the ri 0.2 case (1.07e-18). With a tilt of 1e-3 it is 2.44e-5 at both np 1 and np 8. Nothing hung.

F2: no warning on a given-wall rejection (fixed on the iterative route; N1 on LU)

case given_viol verdict rate/v warnings
tilt 1e-9 / 3e-8 1.3e-10 / 4.0e-9 accepted 1.5e-17 / 2.1e-17 none
tilt 1e-7 / 1e-5 / 1e-2 1.3e-8 / 1.3e-6 / 1.3e-3 given_wall 9.5e-3 / 9.5e-3 / 6.0e-3 1 at each
offset 1e-7 / 1e-3 (#969) 2.7e-8 / 2.7e-4 given_wall 9.5e-3 / 9.1e-3 1 at each
tilt 1e-7 at np 2 / 4 1.34e-8 given_wall on every rank 9.4e-3 / 9.6e-3 rank 0 only: [1,0] and [1,0,0,0]
tilt 1e-3, ri 0.2, np 8 2.44e-5 given_wall on every rank 1.7e-2 rank 0 only, 1
shell, Lower tilted by 0.05 6e-18, 7.2e-3, 7.4e-3 1 accepted, 2 given_wall 1.4 1
second solve on the same solver (cached workspace) same same same 0, so once per workspace
LU route, tilt 1e-2 1.3e-3 given_wall 5.5e-3 0 (N1)
annulus as built, cellSize 0.2 / 0.35 / 0.5 ≤7e-18 accepted ≤5e-17 none: the false warning stays gone
  • The warning is collective-safe [read].
    • given_rejected is built from given_viol, which _given_normal_violation reduces with an allreduce, so every rank holds the same list.
    • Every rank calls _warn_declared_modes_refused, which uses selective_ranks(0), and selective_ranks contains no collective. No collective sits inside a rank-conditional branch.
    • It is silent on accept.

F3: report fields (fixed; one wording residue)

case declared_modes_exempt declared_modes_tested_walls mode report
mixed, accepted [True] ['Lower'] rejected_by None, given_viol ~1e-18
mixed, tilted [True] ['Lower'] rejected_by "given_wall", given_viol 1.3e-3
split seam [True] ['UpperE'] accepted, given_viol 9.4e-18
all default [True] [] given_viol None
all given [False] [] rejected_by "constraint" when it rejects
LU route, mixed [True] ['Lower'] recorded correctly

What remains is wording:

  • All-given reads tested_walls: [] although every wall is tested. The exempt: [False] beside it disambiguates, but the comment at solve_rotated_freeslip could say so.
  • The shell warning is too absolute. When one of three modes is accepted and two are rejected, it still says "the declared rotation modes are not removed". It would be more accurate to say "N of M declared rotation modes are not removed".

F4: tests and mutants (fixed for M1, M2 and M4)

mutant test_1131 serial (27 tests) distinguishing probe
M1: skip the given-wall test caught, 3 failed tilt 1e-2 accepted, a false mode
M2: sphere test on every wall caught, 1 failed (off_its_circle) deformed given wall refused, rate/v 9.5e-3
M3: seam nodes dropped from the given test survives, 27 passed behaves exactly like the branch on every fixture
M4: round 1's frame-row rule caught, 1 failed (seam) seam given_viol 9.6e-2, rejected

M3 surviving is acceptable. With the test now against the given normal, dropping the seam nodes changes a verdict only when a given normal is wrong at the seam alone; M3 is close to an equivalent mutant.

F5: a missing per-name label lets a wall pass the sphere test vacuously (unchanged; not new, [read])

Not touched by this change. Still low.

test_1152

  • It passed at np 2 in 277 s (2 passed).
  • The progress lines appear on rank 0 only ([0] test_1152[zone] move 1/3 … [split] move 3/3, 6 lines), because uw.pprint prints on rank 0. That is enough for the supervisor, which watches the job's combined output.
  • Every move finished inside the silence budget. The longest single gap was not timed; the whole test took 277 s for 6 moves plus setup.
  • In round 1, at a higher load, it was killed at 300 s of silence on both builds.

Test runs

run result
test_1131 serial, branch 27 passed
test_1131 serial, base build with branch tests 4 failed (mixed, wrong-given, off-circle, seam), 23 passed
test_1131 parallel twin, branch, np 2 / np 4 5 passed / 5 passed on every rank
test_1131 parallel twin, base build with branch tests, np 2 2 failed (the two new mixed tests), 3 passed
rotated serial files (69, -m "not level_3"), branch 622 passed, 2 skipped, 0 failed; test_0052 passes now that src/ is in the archive
rotated parallel files (28), branch, np 2 all 28 files rc 0, 111 tests passed, test_1152 included

Regressions

case round 1 round 2
shell, all default rate 5.0e-17, v_rms 0.05802, n_rot 3 8.8e-17, 0.05802, 3
shell, all given 1.2e-18, 0.05755, 3 1.2e-18, 0.05755, 3
shell, Lower or Upper given (mixed) 5.1e-17 / 6.2e-17 3.8e-17 / 9.2e-17; given_viol now 5e-18 / 2.2e-17
annulus, slid, all default / all given 1.8e-19 / 1.2e-20 8e-21 / 1.2e-20; v_rms identical
re-registering BCs on one solver vs a fresh solver (4 changes, np 1 and 2) ≤3.7e-12 ≤3.9e-12

Faults and thin sheets with rotated walls are covered only by the suite files (test_1086, test_1088, test_1097, test_1142 and others), all of which pass. I built no separate mixed-normal fixture for them. Fault pair rows are not given-wall nodes, so the new test does not see them [read].

New findings

  • N1 (low). On the direct-LU route a given-wall rejection is recorded (rejected_by: "given_wall", given_viol 1.3e-3) but not warned, and the rotation stays (5.5e-3 of v_rms). The warning lives only in _rotated_nullspace, which the LU route does not call; _finalize_rotated_solution should warn the same way.
  • N2 (cosmetic). The two wording residues listed under F3: the all-given tested_walls: [], and the warning saying "not removed" when some modes were removed.

Merge conditions

None blocking. I recommend fixing N1 (one warning call in _finalize_rotated_solution when it is the verdict-setting path) and the N2 wording, either in this PR or as a follow-up.

Issue status

Not tested

  • FMG on the shell, forced-BLAS kernels, and np above 8.
  • Exact per-move timings in test_1152.
  • Dedicated fault or thin-sheet fixtures mixed with given normals.

Underworld development team with AI support from Claude Code

@lmoresi
lmoresi merged commit 36bb3ae into development Nov 10, 2026
10 checks passed
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