Skip to content

Rotated free slip: the direct-LU route warns when a given wall keeps the rotation (#968 follow-up) - #1053

Merged
lmoresi merged 1 commit into
developmentfrom
bugfix/rotated-given-wall-lu-warning-968
Nov 11, 2026
Merged

lmoresi merged 1 commit into
developmentfrom
bugfix/rotated-given-wall-lu-warning-968

Conversation

@lmoresi

@lmoresi lmoresi commented Nov 11, 2026

Copy link
Copy Markdown
Member

The two recommendations from the round-2 review of #1052 (#968), which merged at its earlier head before this commit reached it.

  • The direct-LU route warns when a given-normal wall rejects the rotation. That route builds no null space, so the rejection it recorded in the solve's rotation_gauge was never announced, and the answer kept the rotation silently (5.5e-3 of v_rms on the review's fixture). It now warns from the gauge, through the same helper as the iterative route; an iterative solve still warns once.
  • Reporting. declared_modes_tested_walls lists every wall that takes a given normal, also when every wall does (it read []), and the warning says how many of the offered modes are not removed.

tests/test_1131_rotated_nullspace_from_mesh.py: a tilted given normal beside a default wall on the LU route warns once (a mutant that drops the warning is caught), and the all-given case reports both walls. On development 36bb3ae: test_1131, 28 passed; on the #1052 branch the 53 rotated test files gave 513 passed with this commit.

The same commit as 289d655 on #1052's branch, cherry-picked onto development. #968 is already fixed-in-development; this changes no verdict.

Underworld development team with AI support from Claude Code

- N1: the direct-LU route builds no null space, so the given-wall
  rejection it recorded in its gauge was never announced (5.5e-3 of v_rms
  left as rotation, silently). It now warns from the gauge, through the
  same helper as the iterative route.
- N2: declared_modes_tested_walls lists every given-normal wall, also when
  every wall takes one (it read []); the warning says how many of the
  offered modes are not removed.

test_1131: 28 passed, including the LU warning (a mutant that drops it is
caught) and the all-given tested walls. 53 rotated files (serial): 513
passed.

Underworld development team with AI support from Claude Code
Copilot AI balanced review requested due to automatic review settings November 11, 2026 00:24

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

Copy link
Copy Markdown
Member Author

Review record, round 3 (#968 follow-up): 8f7a4d2

Rounds 1 and 2 are on #1052. Paths under review3/ are on hyperion, in runs/2026-11-11-968/.


Review of PR #1053 (#968), round 3

Verdict: ready to merge. N1 and N2 are fixed. The one new finding (N3, low) is a test gap: a mutant that warns twice on the iterative route passes every test.

Header

Method

  • probes/r3.py runs the slid annulus (test_1131's fixture) with Lower given and Upper on the default normal.
    • It runs a sequence of solves on one solver, setting _rotated_use_lu per solve (--routes lu,it,...). --warm adds a fresh solver on the same fields, which is a warm start.
    • It counts the given-wall warnings recorded on each rank in each solve, and records rejected_by, given_viol, declared_modes_exempt, declared_modes_tested_walls and the rotation content measured on the global vector.
  • probes/shell.py is the round-1 shell.
  • Mutants run in-process (probes/mutants.py):
    • drop_lu_warn removes the warning from _finalize_rotated_solution.
    • warn_both makes _finalize_rotated_solution warn on both routes.
    • old_rbc executes 7a70b2e's rotated_bc.py into the module.

N1: the direct-LU route warns (fixed)

case np solves warnings per rank rejected_by given_viol rotation / v_rms
LU, tilt 1e-2 1 lu, lu [1] in each solve given_wall 1.3e-3 5.5e-3
LU, tilt 1e-2 2 lu, lu [1, 0] in each solve given_wall 1.3e-3 4.8e-3
LU, tilt 1e-2 4 lu, lu [1, 0, 0, 0] in each solve given_wall 1.3e-3 0.84, see note
LU, radial 1 lu [0] accepted 5.1e-18 6.4e-18
iterative then LU, radial 1 it, lu [0], [0] accepted 5.1e-18 ≤8e-18
  • Collective safety [read]. On the LU route the warning is decided by _rotated_use_lu, which is the same on every rank. It is passed given_rejected, which is built from given_viol, an allreduced value. It ends in selective_ranks(0), which contains no collective. Nothing collective sits inside a rank-conditional branch.
  • Silence on accept. Accepting stays silent on LU.
  • Note on the np 4 case (not caused by this change). The 0.84 rotation is the undetermined rotation that a rejected mode leaves for MUMPS to pick. The base build at np 4 gives the same 0.842 (r3base_np4_lu_tilt.log), and the warning now says so.

Iterative route: one warning per solve that builds a null space

sequence np warnings per solve
it, it, it, then a warm fresh solver 1 1, 0, 0, 1; the 2nd and 3rd solves reuse the workspace (rotation_reused True)
it, it, then a warm fresh solver 2 [1,0], [0,0], [1,0]
lu, it, it, lu, it 1 1, 1, 0, 1, 1
lu, it 2 [1,0], [1,0]
  • No solve ever warns twice. The iterative route warns once per workspace: a cached re-solve is silent, while LU warns on every solve. The rule is consistent with "once per null-space verdict"; I record it, not as a defect.
  • Switching routes mid-run, np 2 (not caused by this change). The sequence lu, it, lu fails on the third solve with PETSc "New nonzero at (2,0) caused a malloc". The base build fails the same way (r3base_np2_switch.log). The all-given sequence it, lu at np 2 does not fail. The switch is through a private attribute and is not part of this change, so it is reported for information only.

N2: fields and wording (fixed)

case declared_modes_exempt declared_modes_tested_walls warning
annulus, all given [False] ['Lower', 'Upper'] none
annulus, mixed [True] ['Lower'] "1 of the 1 declared rotation modes are not removed" when tilted
annulus, all default [True] [] none
shell, all given [False]×3 ['Lower', 'Upper'] none
shell, mixed radial [True]×3 ['Lower'] none; rate 3.8e-17
shell, all default [True]×3 [] none; rate 7.7e-17
shell, Lower tilted by 0.05, np 1 and np 4 [True]×3 ['Lower'] "2 of the 3 declared rotation modes are not removed", with 1 mode accepted and 2 rejected as given_wall

Tests

run result
test_1131 serial, branch 28 passed
the new LU test and the all-given tested-walls assertion, with 7a70b2e's rotated_bc.py swapped in both fail on their assertions: 0 warnings where 1 is expected, and [] where ['Lower', 'Upper'] is expected
test_1131 parallel twin, np 2 / np 4 5 passed on every rank at both
rotated serial files (69, -m "not level_3") 623 passed, 2 skipped, 0 failed
mutant drop_lu_warn caught: the new LU test fails
mutant warn_both survives: 28 passed (N3)

The rotated parallel files were not rerun at np 2: the src change since round 2 is confined to the warning paths in rotated_bc.py, the parallel twin covers it, and the core budget was cut.

Findings

  • N3 (low, tests only). warn_both gives two warnings per iterative solve: one from _rotated_nullspace and one from _finalize_rotated_solution. My probe measured 2 on the iterative solve, against 1 on LU. No test catches it, because test_a_wrong_given_normal_beside_a_default_wall_rejects_the_rotation asserts any(...) rather than a count of exactly one. Fix: assert one matching message in that test, as the LU test already does.

Status of the round-1 and round-2 findings

finding status
F1 (seam) fixed (round 2)
F2 (warning, iterative route) fixed (round 2)
F3 fixed
F4 fixed
N1 (LU warning) fixed: one warning per LU solve on rank 0, at np 1, 2 and 4
N2 (fields and wording) fixed
F5 (missing per-name label passes the sphere test vacuously) unchanged; existed before this change, low

Merge conditions

None blocking. Tightening the iterative-route test to an exact count (N3) is recommended.

Not tested

  • The rotated parallel files at np 2 in this round.
  • Thin-sheet and fault fixtures with mixed normals, beyond the suite files.
  • np above 4 on the LU route.

Underworld development team with AI support from Claude Code

@lmoresi
lmoresi merged commit 6fdc8da into development Nov 11, 2026
10 checks passed
lmoresi added a commit that referenced this pull request Nov 11, 2026
Underworld development team with AI support from Claude Code
lmoresi added a commit that referenced this pull request Nov 11, 2026
…se reads as one

- The iterative wrong-given-normal test asserts exactly one warning, as the LU
  route's test does (H1's #1053 review, N3).
- With one declared mode the warning says "The declared rotation mode is not
  removed", not "1 of the 1 declared rotation modes are not removed".

Underworld development team with AI support from Claude Code
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