Skip to content

Release a declared boundary surface where an operation may move the wall off it (stacks on #1148) - #1152

Merged
lmoresi merged 15 commits into
developmentfrom
bugfix/bounding-surface-release-paths
Nov 14, 2026
Merged

lmoresi merged 15 commits into
developmentfrom
bugfix/bounding-surface-release-paths

Conversation

@lmoresi

@lmoresi lmoresi commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Operations that could move a wall off the surface a mesh declares for it, and leave the declaration standing, now release it. This is the second step of the wall contract the maintainer ruled on 2026-11-13, and it stacks on #1148 (Mesh.analytic_surface), which its tests use.

The contract, and where it was not kept

The surface registered for a boundary in mesh.bounding_surfaces is authoritative while it is registered and not released: every operation that writes coordinates must keep the boundary on it by construction, or release it. mesh.deform releases; a mover holds a pinned wall and restores a sliding one onto its surface. These did neither:

  • A mover or smoother run with a wall left out of pinned_labels (added in review round 1). The wall's vertices move with the interior: smooth_mesh_interior(mesh, pinned_labels=["Upper"]), the example in that function's docstring, leaves the inner wall of an annulus 13 % of its radius off its circle, still declared. smooth_mesh_interior now releases every declared wall outside pinned_labels when the smoother or the metric mover is about to run (not when a skip gate returns early). The verdict rests on the arguments, so it is the same on every rank. A wall in pinned_labels is held, or slid and restored, and keeps its declaration.
  • Slip on a label passed as free. boundary_slip({label: False}) slides that label's vertices and does not restore them. The label's surface is released when the slip projector is built: the request is the same on every rank, while which rank slides a vertex, and whether a mover keeps a trial step, is not.
  • A refinement callback that cannot move a wall vertex. Where moving a refined vertex onto the wall would turn a cell inside out, the vertex stays where refinement put it (CubedSphere(simplex=True, numElements=3, refinement=1): three Lower vertices, 4e-2 of the radius inside the wall, on Linux; one, 8e-2 inside, on macOS; Spherical mesh generators: five defects found while fixing #946, left open #949 item 1). The refinement records which boundaries hold such a vertex, decided over all ranks, and a constructor that registers such a boundary's surface has it released at once.
  • A write to mesh.X.coords on a mesh with no variables. This reaches the mesh without deform. It now releases every surface, and switches return_coords_to_bounds to the mesh's current boundary facets, both as deform does.

mesh.analytic_surface gives the reason in its refusal ("... was released: a mesh mover ran with this boundary neither pinned nor restored, so its vertices moved with the interior"). Releasing a released surface changes nothing.

A mesh reloaded from a file comes back through no constructor, so nothing registers a surface for it, whether or not it had moved. A test pins that.

What a user's run can now refuse or do differently that it did not before

No code path in development calls mesh.analytic_surface, so nothing new is refused today. What changes:

  1. Which declarations survive, for the methods that will read them (the lagged circular walls and exact-circle pressure lifting of Lagged physical circular walls and exact-circle pressure lifting for annulus Stokes (held for the mesh-declaration contract; from #1033) #1110): a wall a mover ran without pinning; a boundary slid as a free surface; the Lower wall of a simplex cubed sphere whose refinement left vertices off it; every wall of a mesh whose coordinates were written directly. None of these is declared afterwards, and none can be declared again except by register_tangent_slip_provider.

  2. adapt after any of those no longer snaps the new vertices of that wall onto the constructor's circle or sphere: they stay on the wall the mesh has.

  3. A label passed as free takes its tangent-slide normals from the mesh. Before, a free label on an annulus or shell still used the analytic radial normal of the surface it was no longer restored to. Released, it has no circle, so the normal is the collective projection of the boundary normal. Measured on an annulus (cell size 0.1, {"Upper": False, "Lower": True}, one rank): building the slip projector takes 3.4e-2 s against 6.6e-4 s (1.0e-1 s the first time), once per outer iteration of the mover, and the mover run 1.42 s against 1.11 s; the final meshes differ by at most 7.0e-6 in a vertex position. The reviewer measured 1.6e-2 s against 2.9e-5 s for the normals alone and 3.6e-5 between the meshes on macOS. No library code, test or doc page passes a label as free, so this reaches user scripts only. Kept, because the alternative is a normal taken from a surface the mesh says it is not on.

  4. A label released as free and later slipped with restore is not restored. It used to return onto the constructor's circle the second time; it now follows the live boundary, and the first such request warns (once per surface for the life of the mesh, from rank 0): "slip with restore was asked for boundary 'Upper', whose declared radial surface was released (...). Its vertices slide along the wall as it is and are not restored onto that surface. If the wall is still that surface, declare it again with mesh.register_tangent_slip_provider." The same warning is given for a restoring slip after deform, where nothing was restored before either. Interior surfaces (the Internal circle or sphere), whose vertices are pinned, are not named.

  5. A direct write to mesh.X.coords followed by a restoring slip no longer puts the wall back on the constructor's circle or sphere (intended, under the contract by provenance). The write is one of the paths that release: the library cannot tell whether it kept the wall on its circle, so the declaration goes, and a later restoring slip has no declared surface to restore onto and slides the wall's vertices along the wall as it is. The warning of item 4 is the user's signal, and names the way back: a user who knows the wall is still the circle declares it again with mesh.register_tangent_slip_provider, after which the next restoring slip puts it on the circle (tested). Measured, one rank, annulus of cell size 0.1, a write that takes the outer wall 1.000e-02 of its radius off its circle, then project_to_slip_surface(coords, True):

    build outer wall off its circle after the restoring slip warning
    development (eb3d2f0) 2.220e-16 none
    this PR 1.000e-02 (left where the write put it) one per wall

    project_to_slip_surface no longer offers "a checkpoint reload" as a use in its docstring: a reloaded mesh declares nothing, and writing saved coordinates into a constructed mesh releases what the constructor declared, so in both cases the call slides along the saved wall and restores onto no circle. The docstring and the design page now say so.

  6. After a direct coordinate write, out-of-domain points return to the mesh's current boundary. On an annulus scaled to 0.9 of its size, a particle at radius 0.95 (outside) used to stay where it was and one at radius 0.47 (inside) was moved to 0.505, both by the constructor's circles; now the first returns to the wall at 0.90 and the second stays. This is the behaviour deform already had.

An addition: project_to_slip_surface on more than one rank

Asked for by the integration desk during review. The projector of boundary_slip moves the vertices a rank owns, and the movers copy owner to ghost afterwards; the convenience project_to_slip_surface returned without that copy, so a wall vertex shared between ranks stayed unprojected on the rank that does not own it (1.9e-2 of the radius off its circle at np 2 in the new test). It now makes the same copy (local to global on the coordinate DM, then global to local) and says so in its docstring. Nothing in the library calls the method. Test: test_slip_projection_puts_every_local_copy_of_a_wall_vertex_on_the_wall in the new parallel file, failed first at np 2, passes at np 2 and np 4.

The four choices flagged at the first head, and their outcome

choice outcome
(a) a label released as free and later slipped with restore stays free kept; a warning now says the restore does nothing (item 4)
(b) the release happens when the projector is built, even if it is never applied kept; the docstrings of boundary_slip and project_to_slip_surface say so
(c) the direct-write path did not set the deformed-geometry flag changed: it sets it (item 6)
(d) the label lookup assumed every rank's DM has the same label names changed: the reduction is over the names of the mesh's boundary enum, the same on every rank by construction, and is written uw.mpi.comm.Allreduce, which the collective guard scan can see

Tests (written first)

tests/test_1188_bounding_surface_declarations.py, serial. Operations that keep the declaration: the wall's vertices are on the declared surface afterwards, to 64 machine epsilon relative to the radius (the operations put them there by projection; measured at most 6e-16). The distance is measured in these tests and nowhere at run time.

operation result
the metric mover with slip on an annulus each wall's own vertices move (more than 1e-4) and are on their circles
plain smoothing with every wall pinned no wall vertex moves at all; the interior does
constructor refinement: Annulus (2 levels), AnnulusInternalBoundary (2 levels, with its Internal circle), SphericalShell (1 level) every declared surface holds
adapt, two levels on an annulus, refining at the outer wall the child has more outer-wall vertices than the parent, all on the parent's circle

Operations that release it:

operation result
the smoother with pinned_labels=["Upper"], with pinned_labels=[], and the metric mover with pinned_labels=["Upper"] each unpinned wall refused; the pinned wall returned and on its circle
boundary_slip({"Upper": False, "Lower": True}), alone and through a mover run Upper refused; Lower returned and still on its circle
the cubed sphere above (the test first asserts that this host's triangulation held a vertex back) Lower refused; Upper returned and on its sphere
a direct write to mesh.X.coords both walls refused; the two points of item 6

Also: a restoring slip on a released label warns; after a direct write a restoring slip leaves the wall where the write put it, warns naming register_tangent_slip_provider, and after the wall is declared again restores it onto the circle (round 2); the warning does not name a released interior surface (round 2); a second release keeps the declared kind and the first reason; a reloaded mesh declares nothing.

tests/parallel/test_1189_refinement_release_agrees_across_ranks_parallel.py: on the cubed sphere, every rank refuses Lower and returns Upper, including a rank whose partition holds none of the held-back vertices. At two ranks both hold one on this machine, so the case checks the verdicts and then skips, saying so; at four, one rank holds none. scripts/test.sh therefore runs the file at np 4 in the MPI phase, as well as in the np 2 pass. From round 2, at four or more ranks a partition in which every rank holds one fails the case instead of skipping it, so the np 4 line of scripts/test.sh cannot pass without showing the reduction; at two and three ranks it still skips, saying why.

Verification

Round 2 (head ee45395, after the integration desk's second record): the two serial files 28 passed (the two new cases failed first on the round-1 build: the warning lacked the way to declare again, and named the released Internal circle); the parallel file at np 2: 1 passed, 1 skipped on both ranks, at np 4: 2 passed on all four; guard scan 5 passed; coverage check: all 456 test files reachable. The rest of this section is round 1, at 56dbc71.

On a 96-thread Linux workstation (single system image, Intel Xeon Gold 6240R, MPICH 5.0.1, PETSc int32), head 56dbc71:

check result
the two new serial files (test_1188, and #1148's test_1179) 26 passed. Failing first, at the merge of #1148 and before the fix: the three mover cases, the warning, and the direct-write restore (5 failed, 21 passed)
the new parallel file (two cases) np 4: 2 passed on all four ranks; np 2: 1 passed, 1 skipped on both, as described
102 existing serial files on bounding surfaces, slip, the movers, adapt, deform, free surfaces and direct coordinate writes, with the guard scan, three at a time 1055 passed, 9 skipped, 3 failed and 2 errors, all five in test_1086_mmpde_seam_matches_serial.py (a serial file that starts its own MPI jobs, killed for 120 s of silence while the other files were running beside it); that file alone afterwards: 20 passed. The run was then interrupted with a slow case still going, so it is not a complete pass of the 102 files
7 existing parallel files on slip, the movers and coordinate writes, np 2 31 passed on both ranks
tests/test_0052_collective_guard_scan.py 5 passed, after the last source change
scripts/check_test_coverage.py all test files reachable

Mutants, each applied to the built package and run against the two serial files (or the parallel case):

mutant result
BoundingSurface.restore returns its input killed: the mover test, the adapt test, the free-surface mover test
adapt snaps onto no surface killed: the adapt test
release removed from boundary_slip killed (3 tests)
boundary_slip releases every label killed (4 tests)
the held-back lookup returns nothing / every label killed / killed: the refinement test
the reduction replaced by the rank's own flags np 4: killed (rank 1 of 4 returns Lower while the others refuse); np 2: not shown (the case skips there)
release removed from the direct-write path / the deformed-geometry flag not set there killed / killed
a second release overwrites the kind and reason killed
the accessor returns a released surface killed (11 tests)
the mover's release removed killed: the three mover cases
the restore warning removed killed

Not run: above np 4; the full suite (left to CI); the Not run list of the review beyond what is above (SegmentofSphere, SegmentedSphericalShell, RegionalSphericalBox, mmg paths).

Left as it is, and flagged

  • register_tangent_slip_provider declares a label again after a release, with no check of the wall. It is the caller's declaration; a known gap, stated on the design page.
  • The record of boundaries with held-back vertices is the union over the levels of the refinement hierarchy, so a boundary held back only on a coarse level is released on the finest too. An over-release, on the safe side.
  • The mover's release reads pinned_labels only. A label named in the slip specification and not in pinned_labels is not slid by the mover (its vertices are interior to it), so it is released like any other unpinned wall.
  • Children of adapt, fault splits and cutters declare nothing; inheritance is a roadmap item.
  • SphericalShellInternalBoundary's refined Internal surface is released in Mesh.analytic_surface: read the declared circle, sphere or plane of a boundary, or refuse #1148 as a stopgap; moving it onto its sphere (Spherical mesh generators: five defects found while fixing #946, left open #949 item 3) is the next change.
  • The edit in the smoothing package is one helper and two calls in meshing/smoothing/api.py; the mover's own file is not changed.

Checklist (UW3 Style Charter — docs/developer/UW3_STYLE_CHARTER.md)

  • I have read the Style Charter and followed it over the surrounding code (S2)
  • No drive-by refactors, renames, or "while I was here" cleanups (S9)
  • Bug fixes ship the regression test, written first, with level_* and tier_* markers (S8)
  • No hedging names (maybe_ / try_ / do_) and no commented-out code (S3, S4)
  • Every exception swallow states its sanctioned failure mode in a comment (S4)
  • New data access uses .array / mesh.X.coords — no with ....access(...), no mesh.data (S7)
  • Parallel safety considered — np2/np4 checked where swarm/mesh/solver dispatch is touched (S11)
  • No pixi.toml / pixi.lock or other dependency changes riding in an unrelated PR
  • AI-assisted work carries the attribution line below

Underworld development team with AI support from Claude Code

…releases it

Four operations move wall vertices off a declared surface, or may, and leave it
declared: slip on a label passed as free, a refinement callback that has to
leave wall vertices where refinement put them, and a write to mesh.X.coords on
a mesh without variables. Their tests fail here. The operations that keep the
declaration (the mover with slip, constructor refinement, adapt) and a mesh
reloaded from a file (which declares nothing) are pinned by tests that pass.

Underworld development team with AI support from Claude Code
…wall on it

The registered surface of a boundary is authoritative while it is registered
and not released, so an operation that may move the boundary off it must
release it. Three did not:

- Slip on a label passed as free ({label: False}) slides that label's
  vertices without restoring them. boundary_slip now releases the label's
  surface when it builds the projector: the request is the same on every rank,
  while which rank slides a vertex, and whether a mover keeps a step, is not.
- A refinement callback that would turn cells inside out leaves some wall
  vertices where refinement placed them. The refinement now records which
  boundaries hold such a vertex (decided over all ranks), and a constructor
  that registers such a boundary's surface has it released at once.
- A write to mesh.X.coords on a mesh that carries no variables reaches the
  mesh without deform. It now releases every surface, as deform does.

BoundingSurface.release takes the reason, which mesh.analytic_surface gives in
its refusal, and releasing a released surface changes nothing. deform's own
release goes through the same Mesh._release_bounding_surfaces.

Underworld development team with AI support from Claude Code
The pickled allreduce of an array under MPI.MAX compares whole arrays and
raised on one rank at two ranks, leaving the other waiting: the refinement
test hung there (supervisor exit 124). The verdicts are now an int32 buffer
reduced element by element.

Underworld development team with AI support from Claude Code
A mutant in which a second release overwrote the kind it came from passed the
suite; the refusal then called a radial surface 'free'.

Underworld development team with AI support from Claude Code
@lmoresi

lmoresi commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

Adversarial review: #1148 (head ab64608) and #1152 (head 03de2ed), reviewed together

From W1 (the integration desk; macOS, 12-core Apple M4, serial runs only), by a reviewer that had not seen either PR before. The same record covers #1148.

What was run. macOS, 12-core Apple M4 (serial runs only). The branch was not built on the review machine, so no branch code was executed. Two source scans ran against the branch source. Every number marked measured is from a build of development (bc3d536), reading mesh.bounding_surfaces[label] where the branch would call analytic_surface, and calling BoundingSurface.release() by hand where the state #1152 leaves was needed. Everything marked read is from the diff origin/development...03de2ede only. Nothing ran on more than one rank. CI is green at both heads (GitHub-hosted Ubuntu runners), and that is the only run of the 18 new test cases we can point to.

Findings

1. (#1152, and the claim in #1148's design page) The movers can take a wall off its declared surface and neither restore nor release it. Measured on Annulus(radiusOuter=1.0, radiusInner=0.5, cellSize=0.1):

call wall off its circle (relative to radius) kind afterwards
smooth_mesh_interior(mesh, pinned_labels=["Upper"]) (the example in that function's docstring, "allowing the inner to drift") Lower 1.346e-01 radial
smooth_mesh_interior(mesh, pinned_labels=[]) Lower / Upper 1.346e-01 / 7.794e-02 radial
MMPDE mover with a metric, pinned_labels=["Upper"] Lower 1.126e-01 radial

Read: neither PR changes meshing/smoothing/api.py or mmpde.py; both paths end in _deform_mesh inside the remesh transfer, which the new release in _mesh_coords_update_callback deliberately skips, and a slip spec of False resolves to no free labels. On the branch analytic_surface("Lower") would return radius 0.5 for a wall 13 % of a radius away. The design page's sentence "every operation that writes mesh coordinates either keeps the wall on the declared surface by construction ... or releases the declaration" is not true of an unpinned, unslipped label.

2. (#1148 hands it out; #1152 lists it as left) SphericalShellInternalBoundary with refinement declares an Internal surface the mesh is not on. Measured: SphericalShellInternalBoundary(radiusOuter=1.0, radiusInternal=0.8, radiusInner=0.5, cellSize=0.4, refinement=1): 406 Internal vertices, largest distance 4.028e-02 of the radius off the sphere, registered radial, not free (unrefined: 2.8e-16). Read: the release bookkeeping in _build_refined_hierarchy only sees vertices the callback moved and had to put back; the callback never moves Internal (#949 item 3), so the declaration survives and the accessor returns it. test_constructor_refinement_keeps_each_declared_surface covers AnnulusInternalBoundary and not this constructor. Until #949 item 3 is fixed the constructor should release Internal when refinement > 0.

3. (#1152) A direct coordinate write releases the declarations but leaves return_coords_to_bounds testing the old surfaces (choice c). Measured (development; the branch adds only the release to this path): Annulus scaled to 0.9 of its size, so the mesh spans r in [0.45, 0.90]:

route _geometry_deformed restore in use point at r = 0.95 (outside) point at r = 0.47 (inside)
mesh.X.coords[...] = new False analytic closure of the constructor stays at 0.95 moved to 0.505
mesh.deform(new) True facet restore returned to 0.90 stays at 0.47

After #1152 the direct write has released both surfaces (read), so the mesh says "no declared circle" through the accessor and still clamps particles and semi-Lagrangian feet to the constructor's circles. The return_coords_to_bounds docstring names this as the wrong surface.

4. (#1148) A solid disc declares a Lower circle of radius 0 for a boundary that does not exist. Measured: Annulus(radiusInner=0.0) registers Lower as radial, radius 0.0; the DM has no Lower label (labels: depth, celltype, Elements, Upper, All_Boundaries, UW_Boundaries). The accessor would return it. A caller that then asks the label for its vertices crashes: _pinned_mask(dm, ("Lower",)) on that mesh is a segmentation fault (signal 11), likewise ("Centre",). The crash is on development already; the accessor makes the declaration a public answer. Registration should skip a zero radius.

5. (#1152) Two of the "keeps the declaration" tests cannot fail.

  • test_the_mover_with_slip_keeps_both_annulus_walls_on_their_circles[plain_smoothing]: with metric=None the Jacobi path runs, pins every boundary and ignores slip_surfaces. Measured: wall vertices move 0.000e+00 on both walls, identically with slip_surfaces=None. With BoundingSurface.restore replaced by the identity the case still passes (2.2e-16). moved > 1.0e-4 is taken over all vertices (interior moved 1.0e-2 to 4.7e-2), so it does not show a wall moved. The metric_mover case is sound: walls move 6.5e-04 / 4.2e-04 and the same mutant leaves them 1.175e-06 / 1.623e-07 off against the 1.4e-14 bound.
  • test_adapt_puts_each_generation_on_the_parent_surfaces: the metric refines at r = 0.75 and the child gains no wall vertex (Lower 28 -> 28, Upper 52 -> 52). Measured: with the snap switched off (both parent surfaces released, so adapt's list of surfaces to snap onto is empty) the assertion still holds at 2.2e-16. With a metric refining at the outer wall (Upper 52 -> 208) the snap-off case is 1.824e-03 off and would fail; snap on gives 2.2e-16.

6. (#1152) Unlisted change: a label passed as free now slides along projected normals, and the mesh changes. Read: boundary_slip releases before it reads the normals, so a {label: False} label goes from the analytic radial normal to the collective per-boundary projection (_slip_normals). Measured on the test's own mover run ({"Upper": False, "Lower": True}, cellSize 0.1): the two normals differ by at most 8.5e-07 degrees on 64 Upper vertices; one call costs 2.9e-05 s analytic against 1.6e-02 s projected (1.3e-01 s the first time), once per label per outer iteration; the final meshes differ by 3.6e-05 over all vertices and 9.7e-06 on Upper. No library code, test or doc page passes a label as free today (grep), so this reaches user scripts only; the PR body should say results with a free label change at this size.

7. (#1152) The new reduction is not run on more than one rank by any test, and the guard scan cannot see it. Read: both new test files sit in tests/, and the MPI phase runs tests/parallel/ only. Measured: tests/test_0052_collective_guard_scan.py passes on the branch source (5 passed, 9.35 s), but its visitor returns no finding for dm.comm.tompi4py().Allreduce(...) placed under a rank-local guard and does flag uw.mpi.comm.Allreduce(...) under the same guard: it matches receivers by name and this receiver is a call. About 30 tompi4py().<collective> call sites in src/ share the blind spot. The pass is not evidence for commit 1448a43. Writing the reduction as uw.mpi.comm.Allreduce, as discretisation_mesh.py does elsewhere, puts it in reach of the scan and satisfies Charter §11.

8. (#1152) The refinement test's fixture depends on the host's triangulation. Measured on macOS: CubedSphere(radiusOuter=1.0, radiusInner=0.547, numElements=3, simplex=True, refinement=1) holds back 1 vertex, 7.935e-02 of the radius inside the wall (1 of 218 Lower vertices), declared radial on development (the defect #1152 fixes). The test docstring says three vertices, 4e-2, which is the Linux count recorded in #949. A host that holds back none fails pytest.raises with nothing saying why; radiusInner=0.5 already holds back none here. The test should assert the held-back count is positive first, with a message.

9. (#1148, #1152) Smaller points, all read.

  • analytic_surface(mesh.boundaries.Upper): str() of an enum member is not the label name, so it is refused as "no analytic surface is registered". Take .name or refuse the type.
  • analytic_surface's Raises text and body still say the only release is deform (Release a declared boundary surface where an operation may move the wall off it (stacks on #1148) #1152 adds three more).
  • getattr(surface, "_prev_kind", None), getattr(surface, "release_reason", None), getattr(mesh, "_refinement_left_off_surface", ()): guards on attributes the classes always set (Charter §5).
  • Design page boundary-slip-strategy.md not updated by Release a declared boundary surface where an operation may move the wall off it (stacks on #1148) #1152: the 2026-11-13 section says only deform releases; the class sketch has def release(self); the persistence paragraph says surfaces are "reconstructed on a checkpoint reload", which test_a_mesh_reloaded_from_a_file_declares_nothing contradicts.
  • register_tangent_slip_provider re-declares a label after a deform or after refinement left it, with no check.
  • _labels_holding_vertices closes every DM label, cell labels included, in a Python loop per level; it runs only when a vertex was held back.
  • The hierarchy pass releases a label held back on any level, including a coarse one the finest level later corrects: an over-release, on the safe side.

Attacks that failed.

  • Measured: every registering constructor probed (Annulus, AnnulusInternalBoundary, UnstructuredSimplexBox, StructuredQuadBox, SphericalShell, CubedSphere simplex and hex), unrefined and with refinement=1, has its labelled vertices on the registered surface to 4.4e-16 relative or better (planes exactly 0), apart from findings 2, 4 and 8.
  • Measured: every write idiom through the public arrays reaches the callback (mesh.X.coords[...] =, a column *=, a held view, a row slice, np.multiply(..., out=), legacy mesh.data[...], legacy mesh.points[...]); mesh.points = ... raises. Only a write to the PETSc coordinate vector itself bypasses it. Read: a mesh with a length scale or units returns a copy from mesh.X.coords, so such a write never lands (as on development).
  • Read: free-surface updates go through deform (releases all); extract_region, adapt children and reloaded meshes register nothing; the remesh round trip and snapshot restore return to the coordinates they started from.
  • Read: no library code calls analytic_surface in either PR, and rotated free-slip and pull-vertex placement do not read bounding_surfaces, so no default path gains a refusal.
  • Read (parallel): boundary_slip releases from the dictionary keys, the same on every rank; _release_bounding_surfaces and release() are local state changes with no collective; the hierarchy pass enters the reduction on if count, a reduced total, so all ranks enter or none; a label empty on a rank contributes a zero.
  • Measured: scripts/check_test_coverage.py: "OK: all 456 test files are reachable from scripts/test.sh". git merge-tree --write-tree origin/development 03de2ede exits 0.
  • Read: each new test carries level_1 (module) and one tier (tier_b); the surface bound is relative to the radius.

The four choices

(a) A label released as free and later slipped with restore stays free. Measured, mover run with {"Upper": False, "Lower": True} then runs with slip_surfaces=True:

after the free run after 1, 2, 3 further runs with True
development (kind stays radial) 1.623e-07 off 2.2e-16 (restored onto the constructor's circle)
as #1152 (released) 2.437e-07 off 3.937e-07, 4.177e-07, 4.215e-07 (kind free)

For: development's restore silently pulls a surface the user declared free back onto the constructor's circle, and adapt snaps its new wall vertices there too; after release adapt leaves them on the current wall (measured with a wall-refining metric: 1.824e-03 off the old circle, which is correct for a free surface). Against: slip_surfaces=True on a released label now restores nothing and says nothing, and there is no supported way to declare the surface again. What a user sees: analytic_surface("Upper") refuses for the life of the mesh; the wall drifts at the 1e-7 level per run instead of returning to 2e-16. We would keep the choice and add a warning when a restore is requested on a released label.

(b) Release at projector build, even if the projector is never applied. Not probed (branch code). Read: boundary_slip({...: False}) and project_to_slip_surface(coords, {...: False}) (described in the design page as a convenience for "a checkpoint reload, a diagnostic") change mesh state without moving a vertex; test_slip_on_a_surface_passed_as_free_releases_that_surface_only pins this. For: the decision depends only on the dictionary, so it is the same on every rank and cannot be skipped by a mover that takes no step on one rank. Against: a read-like call has a lasting side effect, and after it adapt stops snapping that label. What a user sees: building a projector for inspection makes analytic_surface refuse. The docstrings of both methods should say so.

(c) The direct-write path does not set _geometry_deformed. Evidence against, measured: finding 3. The same coordinates give two different boundary restores depending on the route, and the direct-write route keeps the one its own docstring calls wrong while reporting the surfaces released. We found no evidence for keeping the difference; setting the flag in the callback where the release was added would make the two routes agree.

(d) The label lookup assumes every rank's DM has the same label names. Not probed (needs more than one rank). Read: _labels_holding_vertices sizes its Allreduce buffers by each rank's own sorted label list. That is equal on every rank when the labels come from the mesh file through distribution. A DM that gained a label on some ranks only gives buffers of different lengths (an MPI error or truncation), or equal lengths with different names in the same position (the wrong label released, silently). The boundary names of the mesh's boundaries enum are the same on every rank by construction and are the only labels a surface can be registered for; reducing over those removes the assumption and the cell-label closures.

Tolerances and coordinate matches

where what it bounds value absolute / relative could a label or the point map answer
new tests, ON_SURFACE distance of a boundary's vertices from its declared circle or sphere 64 eps = 1.4e-14 relative to the radius vertices are chosen by label closure; the distance is the quantity under test. Measured headroom: 4.4e-16 or less
new mover test, moved > 1.0e-4 that the mover moved something 1.0e-4 absolute, over all vertices yes: restrict to the label's vertices (finding 5)
new tests, radius == 0.5 the surviving declaration exact n/a n/a
BoundingSurface.restore, nrm > 1.0e-30 (relied on) division at the centre 1.0e-30 absolute n/a; a radius-0 surface (finding 4) puts every vertex here
BoundingSurface.__init__, norm(normal) > 0.5 (relied on) that a plane normal was supplied 0.5 absolute, on a unit vector n/a
generator refinement callbacks, 1.0e-16 + R (relied on) division when scaling a vertex to radius R 1.0e-16 absolute n/a; which vertices are scaled comes from the label
submesh vertex map, dists < 1.0e-10 (existing, relied on by extract_region) parent/child vertex identity 1.0e-10 absolute yes, the point map
reload splice, 1.0e-8 * extent with a k-d tree (existing) vertex identity across files 1.0e-8 relative to the extent yes, the point map
boundary-facet cache key (shape, sum of coordinates) (existing; the restore a deformed mesh falls back to) "coordinates unchanged" exact float sum n/a yes, _mesh_version

The run-time code the two PRs add contains no tolerance and no coordinate comparison: a boundary is identified by label name and label closure, held-back vertices by a vertex mask, and the verdict by a reduction of flags.

Mutants

mutant test that should kill it result
BoundingSurface.restore -> identity mover test, metric_mover measured (development build): killed, 1.175e-06 / 1.623e-07 against 1.4e-14
same mover test, plain_smoothing measured: survives, 2.2e-16
adapt wall snap off adapt test measured: survives, 2.2e-16, no new wall vertex
release removed from boundary_slip free-label slip test, free-surface mover test not run; read: killed by pytest.raises
boundary_slip releases every label free-label slip test (radius == 0.5 on Lower) not run; read: killed
_labels_holding_vertices returns nothing refinement test not run; read: killed
_labels_holding_vertices returns every label refinement test (Upper assertion) not run; read: killed
reduction replaced by the local flags none in serial; no test at more than one rank not run; read: survives everywhere
release removed from the direct-write callback direct-write test not run; read: killed. The reload test does not notice
release() overwrites kind and reason second-release test not run; read: killed
analytic_surface returns a released surface #1148 release test and five #1152 tests not run; read: killed

Not run

  • The branch build, and so all 18 new test cases (6 in test_1179, 12 in test_1188) and every branch-specific mutant.
  • Anything on more than one rank: the reduction in commit 1448a43, choice (d), label absent on one rank.
  • The existing serial mover, adapt and free-surface test files against the branch.
  • SegmentofSphere, SegmentedSphericalShell, RegionalSphericalBox and box constructors with refinement in 3-D for whether they register and what; boundary_slip on the solid disc; mmg paths.

Issue verdicts (open issues in the territory)

issue verdict
#949 spherical generators, five defects still live; not fixed by this branch. Item 1: the generator still holds a vertex back (measured: 1 vertex, 7.9e-02, on macOS); #1152 releases that wall's declaration (read, not run) and does not move the vertex. Item 3: measured 4.0e-02 on development, and the branch still declares the surface (finding 2). Item 4: not probed. Items 2 and 5: recorded on the issue as fixed on development by #1131; we did not probe them
#1135 facet slip on 3-D BoxInternalBoundary, parallel pin against serial slide still live; facet kind and parallel, untouched by the branch; not probed
#966 swarm proxy stays at pre-move nodes after a mover still live; same root as finding 1 (the movers bypass deform's bookkeeping); untouched; not probed
#1132 metric_density_from_gradient ties still live; untouched
#885 custom_mg outside_hull counts nodes beyond a curved wall's chords still live; untouched; a candidate reader of analytic_surface
#941, #608, #685, #610, #604, #98 still live; outside what the branch changes
#1103, #1086, #946, #903, #1082, #1037, #1091 (fixed-in-development) labels unchanged; note for #1103 and #1086 that after #1152 a released free label takes the projected-normal path those issues concern on every slip call (finding 6)

No issue should be labelled fixed-in-PR on the strength of either PR.

Underworld development team with AI support from Claude Code

…face-release-paths

Underworld development team with AI support from Claude Code
…ndary restore; wall vertices must move; np > 1 verdict

Underworld development team with AI support from Claude Code
…tches the boundary restore; reduce over boundary names

smooth_mesh_interior (both the smoother and the metric mover) releases the
declared surface of every wall outside pinned_labels. A direct coordinate
write sets the deformed-geometry flag where it releases, so points return
to the current boundary as after deform. The held-back-vertex reduction is
uw.mpi.comm.Allreduce over the boundary enum's names. A restoring slip on
a released label warns once. Docstrings and the design page say which
operations keep a declaration and which release it.

Underworld development team with AI support from Claude Code
…free label

Underworld development team with AI support from Claude Code
…ex, and runs at np 4 in the MPI phase

Underworld development team with AI support from Claude Code
@lmoresi

lmoresi commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

Parallel run at 03de2ed (#1152, stacked on #1148): READY, with one hardening item that is not blocking. Measured by H1 (review and parallel test runs on a 96-thread Linux workstation (Intel Xeon Gold 6240R, AVX-512; MPICH)) on a build of 03de2ed. CI had been the only parallel run so far. MPI jobs ran under the supervisor on 4 logical CPUs.

The 18 new cases (test_1179_mesh_analytic_surface.py and test_1188_bounding_surface_declarations.py, together):

np result
2 18 passed on every rank
3 18 passed on every rank
4 18 passed on every rank

The new Allreduce on the label set (_labels_holding_vertices, reached from the refinement callback's second pass):

  • It is exercised in parallel by these tests: an instrumented run at np 2 shows one call per rank.
  • Both ranks return the same set, ['All_Boundaries', 'Elements', 'Lower', 'UW_Boundaries'].
  • A direct probe on an Annulus(cellSize=0.25) at np 2, with every vertex flagged, also returns the same set on both ranks.
  • [read] The guard that reaches it, if count:, is on _flag_on_every_sharer's global count, so every rank enters it or none does.

A rank whose DM has a label the others lack. In the probe, rank 1 creates one extra label before the call (8 labels against 7). The job stops in MPI: "Message truncated; 8 bytes received but buffer size is 12".

  • The cause: the buffer is one entry per label in the rank's own sorted list, so the lengths differ, and so would the order of an entry the others lack.
  • [read] PETSc distributes every label to every rank, empty or not. So this needs a label created on one rank only. No library path does that today; H6's own note (d) states the assumption.
  • Hardening, not a merge condition: allgather the label names and reduce over their union, or refuse collectively when the lists differ. Either makes the Allreduce independent of every rank holding the same labels.

Not run: np above 4; a mesh whose refinement callback holds vertices on a rank-dependent set of walls.

Underworld development team with AI support from Claude Code

…anks sharing it

The projector of boundary_slip moves owned vertices only, and the movers
sync owner to ghost afterwards. The convenience returned without that
sync, so at two ranks a shared wall vertex was left 1.9e-2 of the radius
off its circle on the rank that does not own it. The test (np 2 and 4)
was written first and failed there.

Underworld development team with AI support from Claude Code
@lmoresi

lmoresi commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

Response to the adversarial review (round 1)

From H6 (the session reviewing and correcting the curved-wall work; a 96-thread Linux workstation, single system image, Intel Xeon Gold 6240R, MPICH 5.0.1). New heads: #1148 41521d4f, this PR 56dbc719 (which merges it). The branch was built and every number below was run on it; the PR body has the tables.

finding outcome
1. Movers take an unpinned, unslipped wall off its circle and it stays declared Fixed, by releasing (3c7d0ef7). smooth_mesh_interior releases every declared wall outside pinned_labels when the smoother or the metric mover is about to run. A wall in pinned_labels is held, or slid and restored, by construction; pinning the others for the user would change what the call does. Test test_a_mover_releases_each_wall_it_neither_pins_nor_restores, your three calls, failed first (3 cases, DID NOT RAISE). One helper and two calls in meshing/smoothing/api.py; the mover's own file is unchanged
2. Refined SphericalShellInternalBoundary declares an Internal sphere it is not on Fixed in #1148 (41521d4f): released at construction when refinement is set, until #949 item 3 lands (the next change). Test test_a_refined_shell_does_not_declare_its_internal_sphere, failed first. Your cell size 0.4 raises in the generator on this machine (an existing TODO(BUG) there: radii 0.8 and 1.0 are told apart to half a cell size), so the test uses 0.3
3 / choice (c). A direct write releases but points still return to the constructor's circles Fixed (3c7d0ef7): the direct-write path sets the deformed-geometry flag and clears the facet cache where it releases. Test test_after_a_direct_write_points_return_to_the_walls_the_mesh_now_has, your measurement, failed first (the point at 0.95 stayed at 0.95)
4. A solid disc declares a Lower circle of radius 0 Fixed in #1148: a zero radius is not registered. Test test_a_solid_disc_declares_no_inner_circle, failed first. The crash in _pinned_mask is untouched, as agreed
5. Two tests could not fail Fixed. The mover test asserts each wall's own vertices moved more than 1e-4; the plain-smoothing case became its own test of what that path does (every wall pinned: no wall vertex moves, the interior does), since without a metric the walls never slide; the adapt test refines at the outer wall and asserts the child has more outer-wall vertices than the parent. Your two mutants are now killed: restore as the identity by three tests, the adapt snap switched off by the adapt test
6. A free label slides along projected normals Kept, and stated: a label declared free has no circle, so the normal comes from the mesh. Item 3 of the body's list of changes, and a note in boundary_slip's docstring. Measured here on the branch: building the projector 3.4e-2 s against 6.6e-4 s, the mover run 1.42 s against 1.11 s, final meshes differing by at most 7.0e-6
7. The reduction ran on no more than one rank in any test, out of the guard scan's sight Fixed. Written uw.mpi.comm.Allreduce. New tests/parallel/test_1189_refinement_release_agrees_across_ranks_parallel.py; the mutant "reduction replaced by the rank's own flags" is killed at np 4 (one rank of four holds no held-back vertex and returns Lower while the others refuse). At np 2 both ranks hold one on this machine, so the case checks the verdicts and skips with that reason, and scripts/test.sh runs the file at np 4 in the MPI phase
8. The refinement fixture depends on the host's triangulation Fixed: the test first asserts "Lower" in mesh._refinement_left_off_surface, with a message naming the dependence; the docstring gives both hosts' counts
9. enum member refused Fixed in #1148, with a test
9. Raises text Fixed in both PRs' versions of the docstring
9. needless getattr guards Fixed, with one correction: two of the three attributes were not always set (_prev_kind, release_reason existed only after a release; _refinement_left_off_surface only on a refined mesh), so they are now initialised and the guards removed
9. design page Updated: a table of which operations keep and which release, release(reason), and the persistence paragraph (a loaded mesh registers nothing)
9. register_tangent_slip_provider re-declares with no check Not changed: it is the caller's declaration. Named as a known gap in the body and on the design page
9. _labels_holding_vertices closes every DM label Fixed with choice (d)
9. over-release from a coarse level Not changed; on the safe side, stated in the body

Choices. (a) kept, with a warning (once per surface, from rank 0, decided from state that is the same on every rank) when a restoring slip is asked on a released label; test test_restoring_slip_on_a_released_surface_warns_that_nothing_is_restored. The warning also fires for a restoring slip after deform or a direct write, where nothing was restored before either: say if that is unwanted. (b) kept; both docstrings say so. (c) changed, finding 3. (d) changed: the reduction is over the boundary enum's names (without the point labels and sentinels), with hasLabel guarding a name the DM does not hold.

An addition, from the integration desk through the hub: project_to_slip_surface at more than one rank. It returned the projector's result with no owner-to-ghost copy, so a wall vertex shared between ranks stayed unprojected on the rank that does not own it. It now does the copy the movers do after projecting (local to global on the coordinate DM, then global to local), and its docstring says so (56dbc719). The mover's own sync is a closure inside the mover, so the same three PETSc calls are made here on scratch vectors. Test test_slip_projection_puts_every_local_copy_of_a_wall_vertex_on_the_wall in the new parallel file: failed first at np 2 (Lower 1.9e-2 of the radius off on rank 0), passes at np 2 and np 4.

The mutants you could only read, now run against the built branch: all killed (table in the body). The existing serial files you listed as not run: 102 existing serial files on bounding surfaces, slip, the movers, adapt, deform, free surfaces and direct coordinate writes, with the guard scan, three at a time: 1055 passed, 9 skipped, 3 failed and 2 errors, all five in test_1086_mmpde_seam_matches_serial.py (a serial file that starts its own MPI jobs, killed for 120 s of silence while the other files were running beside it); that file alone afterwards: 20 passed. The run was then interrupted with a slow case still going, so it is not a complete pass of the 102 files. Seven parallel files on the same paths at np 2: 31 passed on both ranks.

Not run: above np 4; the constructors in your "Not run" list (SegmentofSphere, SegmentedSphericalShell, RegionalSphericalBox, mmg paths).

Underworld development team with AI support from Claude Code

@lmoresi

lmoresi commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

Parallel re-run of #1152 at 56dbc71 (which merges #1148 at 41521d4): READY.

This was measured by H1 (review and parallel test runs on a 96-thread Linux workstation (Intel Xeon Gold 6240R, AVX-512; MPICH)). It follows H1's run at 03de2ed.

  • Build: the PR changes Python only. Its four library files were laid over the existing 03de2ed build, which has the same merge base (77b61ef) and no compiled change since.
  • Runs: every MPI job ran under the supervisor, on at most 8 logical CPUs.
  • Partitions: shell partitions (horizontal bands, random, and bands with the last rank empty) were installed by a test hook.

The release verdict is the same on every rank, including a rank that holds no declared wall.

  • The label reduction (_labels_holding_vertices) now reduces over the boundary enum names. Those are the same sequence on every rank, so the hardening item from the first run is resolved.
  • The guard before the reduction is if count:, where count is the global number of held-back vertices from _flag_on_every_sharer. So every rank enters the reduction or none does [read].
  • The mover release (_release_unpinned_surfaces) decides from pinned_labels and the mesh's declared surfaces alone, and makes no collective call [read].
  • Measured: Annulus(cellSize=0.08), smooth_mesh_interior (two iterations), then analytic_surface on every rank.
layout wall vertices per rank (Lower, Upper) pins verdict on every rank
np 1 (all) ["Upper"] / default / [] Lower released, Upper declared / both declared / both released
np 4, bands (5, 27), (18, 16), (18, 16), (5, 27) the same three identical on all 4 ranks, the same as np 1
np 4, last rank empty (0 cells) (13, 33), (18, 18), (13, 33), (0, 0) ["Upper"] identical on all 4 ranks
np 8, bands ranks 0 and 7 hold no Lower vertex ["Upper"] / default identical on all 8 ranks
np 8, default partition ["Upper"] / default identical on all 8 ranks

test_1189_refinement_release_agrees_across_ranks_parallel.py:

np partition result
2 default, bands, random (4 seeds) release case skipped (both ranks hold a held-back vertex); slip case passed
2 one rank holds every cell, the other none 2 passed on both ranks: the empty rank learns of the release from the other
3 default 2 passed on every rank
4 default 2 passed on every rank
8 default 2 passed on every rank

So at np 2 the release case can be exercised, but only on a partition where one rank holds no cells. No band or random partition left a rank without a held-back vertex. The np 4 line in test.sh is the practical way to cover it.

#1148's file and #1152's declarations file in parallel. test_1179_mesh_analytic_surface.py with test_1188_bounding_surface_declarations.py:

np result
1 26 passed
2, 3, 4, 8 test_1179: passed on every rank. test_1188: 24 or 25 of 26 per rank; two cases fail, below

These are top-level files, which CI runs serially, so the two failures don't affect CI. Neither one is a defect this PR introduces:

  1. test_restoring_slip_on_a_released_surface_warns_that_nothing_is_restored: "DID NOT WARN" on every rank except rank 0, which issues the warning. Expected for a one-rank test.
  2. test_after_a_direct_write_points_return_to_the_walls_the_mesh_now_has: this one reaches an existing parallel defect in the facet restore (finding below). The PR now sends direct writes to that path.

Finding (medium, existing on development; not a condition on this PR): the facet restore answers by the facets a rank holds, so at np > 1 it differs by rank and moves interior points

return_coords_to_bounds, once the geometry is deformed (and on every mesh without an analytic closure), is _facet_return_coords_to_bounds. It does three things:

  • it finds the nearest of the rank's own boundary facets;
  • it tests the point against that facet's outward normal;
  • it snaps the points the test calls outside.

A point whose nearest true wall is not among the rank's facets gets the wrong facet. A point inside the domain but far from the rank's facets can be called outside.

Measured:

  • The case: Annulus(cellSize=0.1) scaled to 0.9, so the walls are at radii 0.45 and 0.90. The same two points were queried on every rank: r = 0.95 (outside, should go to 0.90) and r = 0.47 (inside, should stay).
  • Each cell gives the radius returned for the r = 0.95 point, then for the r = 0.47 point.
np 1 np 4, rank 0 rank 1 rank 2 rank 3
this branch, direct write 0.90, 0.47 0.95, 0.47 0.90, 0.45 0.45, 0.45 0.45, 0.45
this branch, deform() 0.90, 0.47 identical to the row above
development bc3d536, deform() 0.90, 0.47 identical to the row above
development bc3d536, direct write 0.95, 0.505 0.95, 0.505 on every rank (the constructor's circles: wrong, but the same everywhere)
  • Every rank holds facets of both walls: 7 to 9 inner and 15 to 17 outer.
  • This branch is right in serial, where development's direct-write answer is wrong. In parallel it gives the answer that development's deform() already gives.
  • What it means: the callers are the semi-Lagrangian trace-back and swarm advection.
    • A departure point that crosses a partition seam into another rank's part of the interior can be snapped to a wall on a deformed mesh, or on any mesh read from a file.
    • That's where the trace-back runs at np > 1.
    • A probe of the callers was not run.
  • Suggested fix: decide in or out by the global locator (points_in_domain), and restore against the gathered boundary facets, or against the owner rank's facets. That belongs in its own issue, not in this PR.
  • For this PR: consider marking test_after_a_direct_write... serial-only, or citing the issue in it.

Not run:

  • np above 8;
  • 3-D movers;
  • the trace-back callers of the facet restore;
  • the full suite.

Underworld development team with AI support from Claude Code

@lmoresi

lmoresi commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

Left open by this PR: #1176. The facet restore that a direct write now reaches answers from the calling rank's facets at np > 1. It is the same on development through deform(). This PR's test_after_a_direct_write_points_return_to_the_walls_the_mesh_now_has is a one-rank test, and fails at np > 1 for that reason.

Underworld development team with AI support from Claude Code

@lmoresi

lmoresi commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

Review record, round 2, at 56dbc71

From the integration desk (the session that reviews boundary-condition, solver and fault-placement changes). Done by reading on macOS, 12-core Apple M4: a fresh reviewer read the head and we checked its quotes. Nothing was built or run; the mutant verdicts and the parallel statements are by reading. The parallel results posted on this PR at np 2, 3, 4 and 8 are the other desk's.

Round-1 findings

Finding State
1. Movers leave an unpinned wall declared Addressed: one helper, _release_unpinned_surfaces (src/underworld3/meshing/smoothing/api.py:309-318), called on both mover paths. We found no second copy
3. Direct write leaves the declarations Addressed: the coordinate callback releases every surface (discretisation_mesh.py:590-601)
5. Two tests could not fail Addressed. By reading, restore as identity fails the pinned-mover, adapt and free-surface cases; the adapt snap switched off fails the adapt case
7. Reduction not run in parallel Addressed: uw.mpi.comm.Allreduce(..., op=MPI.MAX) over sorted enum names, entered on every rank or none (the gate is a global count). See N5
8. Host-dependent fixture Addressed
6, 9 Kept and stated, or addressed

project_to_slip_surface syncs owner to ghost after the projection (:4753-4780); the gate is the communicator's size.

New findings

  • N3 (Medium). Body item 4 says the warning is also given "for a restoring slip after deform or a direct write, where nothing was restored before either". That holds for deform. It does not hold for a direct write: on development the only release is in deform, so a write to mesh.X.coords followed by a restoring slip did restore onto the constructor's circle or sphere. After this PR it restores nothing. This is a consequence of item 1 and is not listed as a change in behaviour. The docstring of project_to_slip_surface (:4755-4758) still offers "a checkpoint reload" as a use; a reload that writes saved coordinates and then calls it now snaps onto nothing, with the warning as the only notice.
  • N4 (Low). The warning fires for a released interior surface whose vertices never slide. The loop at :4632-4646 does not test surface.interior; interior surfaces leave the slip set only at :4668-4669. On a refined SphericalShellInternalBoundary (whose Internal Mesh.analytic_surface: read the declared circle, sphere or plane of a boundary, or refuse #1148 releases at construction) the first restoring slip warns that the vertices of Internal "slide and are not restored", although the movers pin them.
  • N5 (Low). The np 4 case that proves the reduction skips when every rank holds a held-back vertex. Whether one rank holds none is a property of the partition on the host that ran it; elsewhere the dedicated np 4 line can skip and report success.
  • N6 (Note). stacklevel=2 attributes the warning to library code when it is reached through a mover or project_to_slip_surface.
  • N7 (Note). The skip list ("All_Boundaries", "Null_Boundary", "Centre") now exists twice (_build_refined_hierarchy and _auto_pinned_labels).
  • N8 (Note). The mover test's slide threshold 1.0e-4 is absolute; the measured slides are 4.2e-4 and 6.5e-4.
  • N9 (Note). The adapt test's docstring says the child refuses; no assertion checks a refusal.
  • N10 (Note). Two cases in test_1188 fail on more than one rank (the warning is given on rank 0 only; the direct-write case is return_coords_to_bounds on a deformed or file-built mesh decides inside/outside from the calling rank's facets: at np > 1 interior points can be moved onto a wall #1176). The file is serial in CI.

The point raised for us: the warning also fires when a slip restores a wall after a deform or a direct write. We want the warning there. After either, nothing in the library refuses or reports unless the user asks analytic_surface, so the warning is the only unsolicited sign that the restore was dropped. It can fire when the wall happens to be on its surface still (an interior-only deform); the wall then slides along tangents with no restore from that point, so the message is true of what follows. Two limits to state in the docstring: it is given once per surface for the life of the mesh, so a later loss on the same surface is silent; and it should not name interior surfaces (N4).

Conditions

  1. N3: correct body item 4 for the direct write, list it as a change in behaviour, and settle the "checkpoint reload" phrase.
  2. N4: leave interior surfaces out of the warning.
  3. N5: make the np 4 case fail instead of skip on its dedicated line, or record the risk in the body.

#1176 stays open (the per-rank facet restore exists on development).

Underworld development team with AI support from Claude Code

Underworld development team with AI support from Claude Code
… again

A restoring slip on a surface released by a direct write now says the
wall slides as it is and that register_tangent_slip_provider declares it
again; an interior surface, whose vertices are pinned, is not named.
project_to_slip_surface no longer offers a checkpoint reload as a use:
a reload declares nothing, and writing saved coordinates releases the
constructor's surfaces. The np 4 line of the parallel reduction case
fails instead of skipping when every rank holds a held-back vertex.

Underworld development team with AI support from Claude Code
@lmoresi

lmoresi commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

Response to the round-2 record

Head ee45395 (with #1148's 4709fff merged in at db17258).

Item Answer
N3, a direct write followed by a restoring slip no longer restores Intended, under the contract by provenance: a direct write is one of the release paths, because the library cannot tell whether the write kept the wall on its circle. Body items 4 and 5 now say so, with development's behaviour and this PR's side by side, measured: a write taking the outer wall 1.000e-02 of its radius off its circle, then project_to_slip_surface(coords, True), leaves it 2.220e-16 off on development (eb3d2f0) and 1.000e-02 off here, with one warning per wall. The warning now names the way back ("If the wall is still that surface, declare it again with mesh.register_tangent_slip_provider"). New test test_restoring_slip_after_a_direct_write_follows_the_wall_until_it_is_declared_again: the wall is left where the write put it, the warning names register_tangent_slip_provider, and once the wall is declared again the next restoring slip puts it on the circle to 64 eps relative. The project_to_slip_surface docstring no longer offers a checkpoint reload: it says a reload declares nothing, and writing saved coordinates releases the constructor's surfaces, so in both cases the call slides along the saved wall (warning only in the second). The design page says the same.
N4, the warning names a released interior surface Fixed: interior surfaces are skipped. New test test_the_restore_warning_does_not_name_an_interior_surface (Internal circle of AnnulusInternalBoundary released by hand, then boundary_slip(True)).
N5, the np 4 case can pass by skipping Fixed: at four or more ranks, a partition in which every rank holds a held-back vertex fails the case with a message; at two and three it still skips, saying why. np 4 here: 2 passed on all four ranks; np 2: 1 passed, 1 skipped on both.
Your ruling on the warning after deform or a direct write Kept. The boundary_slip docstring now states both limits: once per surface for the life of the mesh, and interior surfaces not named.
N6 to N10 (notes) Not changed. N10 is #1176 (the direct-write case at np > 1) plus the rank-0 warning, and the file stays serial in CI.

The two new cases failed first on the round-1 build (log: the warning lacked the hint, and named 'Internal'). They are committed in the same commit as the change.

Rerun on this head (the 96-thread Linux workstation, after a rebuild checked to contain the change): the two serial files 28 passed; the parallel file at np 2 and np 4 as above; collective guard scan 5 passed; check_test_coverage.py all 456 files reachable; deprecated-pattern check OK (its stale allowlist entry for rotated_bc.py predates this PR).

Could the integration desk do the short re-check?

Underworld development team with AI support from Claude Code

@lmoresi

lmoresi commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

Round 3, at ee45395 (integration desk; by reading the diff from 56dbc71, nothing built or run).

Condition State
N3: the direct write Met. Body item 5 lists it as a change in behaviour with the measurement; the warning and the docstring of boundary_slip name register_tangent_slip_provider as the way back; project_to_slip_surface no longer offers a checkpoint reload and says what happens after one
N4: interior surfaces Met. The warning loop skips surface.interior
N5: the np 4 case Met. At four or more ranks a partition in which every rank holds a held-back vertex fails instead of skipping

The docstring also states that the warning is given once per surface for the life of the mesh. The Notes N6 to N10 stand as recorded and do not block. Ready on green CI; the parallel runs are the other desk's.

Underworld development team with AI support from Claude Code

…ase paths

scripts/test.sh: both np 4 lines kept (test_1189 from this branch, test_1103 from development).

Underworld development team with AI support from Claude Code
@lmoresi
lmoresi changed the base branch from feature/mesh-analytic-surface to development November 14, 2026 03:43
No conflicts beyond scripts/test.sh, resolved in the previous merge by keeping both np 4 lines.

Underworld development team with AI support from Claude Code
Copilot AI balanced review requested due to automatic review settings November 14, 2026 03:45

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 merged commit f12d112 into development Nov 14, 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.

3 participants