Repository navigation
Release a declared boundary surface where an operation may move the wall off it (stacks on #1148) - #1152
Conversation
…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
Adversarial review: #1148 (head ab64608) and #1152 (head 03de2ed), reviewed togetherFrom 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 Findings1. (#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
Read: neither PR changes 2. (#1148 hands it out; #1152 lists it as left) 3. (#1152) A direct coordinate write releases the declarations but leaves
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 4. (#1148) A solid disc declares a 5. (#1152) Two of the "keeps the declaration" tests cannot fail.
6. (#1152) Unlisted change: a label passed as free now slides along projected normals, and the mesh changes. Read: 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 8. (#1152) The refinement test's fixture depends on the host's triangulation. Measured on macOS: 9. (#1148, #1152) Smaller points, all read.
Attacks that failed.
The four choices(a) A label released as free and later slipped with restore stays free. Measured, mover run with
For: development's restore silently pulls a surface the user declared free back onto the constructor's circle, and (b) Release at projector build, even if the projector is never applied. Not probed (branch code). Read: (c) The direct-write path does not set (d) The label lookup assumes every rank's DM has the same label names. Not probed (needs more than one rank). Read: Tolerances and coordinate matches
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
Not run
Issue verdicts (open issues in the territory)
No issue should be labelled 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
|
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 (
The new Allreduce on the label set (
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".
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
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
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 An addition, from the integration desk through the hub: 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, Not run: above np 4; the constructors in your "Not run" list ( Underworld development team with AI support from Claude Code |
|
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.
The release verdict is the same on every rank, including a rank that holds no declared wall.
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.
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:
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
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:
Not run:
Underworld development team with AI support from Claude Code |
|
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 Underworld development team with AI support from Claude Code |
Review record, round 2, at 56dbc71From 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
New findings
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 Conditions
#1176 stays open (the per-rank facet restore exists on 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
Response to the round-2 recordHead ee45395 (with #1148's 4709fff merged in at db17258).
The two new cases failed first on the round-1 build (log: the warning lacked the hint, and named 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; Could the integration desk do the short re-check? Underworld development team with AI support from Claude Code |
|
Round 3, at ee45395 (integration desk; by reading the diff from 56dbc71, nothing built or run).
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
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
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_surfacesis 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.deformreleases; a mover holds a pinned wall and restores a sliding one onto its surface. These did neither: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_interiornow releases every declared wall outsidepinned_labelswhen 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 inpinned_labelsis held, or slid and restored, and keeps its declaration.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.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.mesh.X.coordson a mesh with no variables. This reaches the mesh withoutdeform. It now releases every surface, and switchesreturn_coords_to_boundsto the mesh's current boundary facets, both asdeformdoes.mesh.analytic_surfacegives 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
developmentcallsmesh.analytic_surface, so nothing new is refused today. What changes: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.adaptafter 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.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.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.A direct write to
mesh.X.coordsfollowed 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 withmesh.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, thenproject_to_slip_surface(coords, True):development(eb3d2f0)project_to_slip_surfaceno 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.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
deformalready had.An addition:
project_to_slip_surfaceon more than one rankAsked for by the integration desk during review. The projector of
boundary_slipmoves the vertices a rank owns, and the movers copy owner to ghost afterwards; the convenienceproject_to_slip_surfacereturned 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_wallin 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
boundary_slipandproject_to_slip_surfacesay souw.mpi.comm.Allreduce, which the collective guard scan can seeTests (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.Annulus(2 levels),AnnulusInternalBoundary(2 levels, with its Internal circle),SphericalShell(1 level)adapt, two levels on an annulus, refining at the outer wallOperations that release it:
pinned_labels=["Upper"], withpinned_labels=[], and the metric mover withpinned_labels=["Upper"]boundary_slip({"Upper": False, "Lower": True}), alone and through a mover runmesh.X.coordsAlso: 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.shtherefore 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 ofscripts/test.shcannot 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:
test_1188, and #1148'stest_1179)adapt,deform, free surfaces and direct coordinate writes, with the guard scan, three at a timetest_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 filestests/test_0052_collective_guard_scan.pyscripts/check_test_coverage.pyMutants, each applied to the built package and run against the two serial files (or the parallel case):
BoundingSurface.restorereturns its inputadaptsnaps onto no surfaceboundary_slipboundary_slipreleases every labelNot run: above np 4; the full suite (left to CI); the
Not runlist of the review beyond what is above (SegmentofSphere,SegmentedSphericalShell,RegionalSphericalBox, mmg paths).Left as it is, and flagged
register_tangent_slip_providerdeclares 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.pinned_labelsonly. A label named in the slip specification and not inpinned_labelsis not slid by the mover (its vertices are interior to it), so it is released like any other unpinned wall.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.meshing/smoothing/api.py; the mover's own file is not changed.Checklist (UW3 Style Charter — docs/developer/UW3_STYLE_CHARTER.md)
level_*andtier_*markers (S8)maybe_/try_/do_) and no commented-out code (S3, S4).array/mesh.X.coords— nowith ....access(...), nomesh.data(S7)pixi.toml/pixi.lockor other dependency changes riding in an unrelated PRUnderworld development team with AI support from Claude Code