Repository navigation
test_1123 / test_1183: a sheared box that cannot tangle; the #1183 fallback tested directly (stacked on #1213) - #1214
Conversation
…claims agree with global_evaluate points_in_domain, which a swarm's migration reads, decided a point far from the local boundary by a boundary-face sign test standing in for containment (Style Charter section 12). On #1123's sheared mesh it called contained points exterior: serially 449 of 3825 near-edge points, and at np 2 one inside point owned by no rank, whose particle a swarm then lost, while global_evaluate's ownership (the exact locator, #1175) had it. On a straight-sided simplex mesh a point is now in a rank's domain when a local cell contains it; a point no local cell contains takes the face tolerance development applied near the boundary (the evaluation tolerance in parallel, the cell-wall test's own serially), and only within 2 max_radius^2 of the local boundary, as before. Claims change only by contained points: on unsheared 2-D and 3-D boxes and an annulus, the strict claims (migration's) are identical to development at np 1, 2 and 4, and serially every variant is. A swarm in solid rotation on an annulus keeps all 15200 particles over 20 steps at np 1, 2 and 4, as on development. tests/parallel/test_1209_points_in_domain_exact_parallel.py (with the structured sheared box, tests/parallel/sheared_box_fixture.py): development leaves 449 and 1 inside points in no domain at np 1 and 2; none here, and a swarm keeps every one. Underworld development team with AI support from Claude Code
Underworld development team with AI support from Claude Code
… mean on a simplex mesh (W1's review) Underworld development team with AI support from Claude Code
|
Review from the Underworld development team with AI support from Claude Code (H1: review and parallel test runs on a 96-thread Linux workstation (Intel Xeon Gold 6240R, AVX-512; MPICH)) Verdict on head 8e36b64: changes requested. This asks for one small change. The fixture is sound, the mesh is the same at every np, and the regression power claimed for #1175 and #1190 reproduces exactly. One test, however, has silently lost all its power on the new fixture: Build. The PR's library code is #1213's, so the head ran on the same overlay used for #1213: the eccae6d-matched build with the branch's 1. The diff and the stack
2. The fixtureInvertibility. The map is Y = A X + W (sin 2πy, sin 2πz, sin 2πx).
The sine terms' Jacobian is a permutation pattern with entries of magnitude at most 2πW. Its 2-norm is therefore at most 0.157, below σmin(A) = 0.175, so A + D is never singular and the continuous map is injective on the box. The argument also carries over to the discrete mesh, which the docstring does not say but is worth a sentence. Each Kuhn tetrahedron's three path edges are axis-aligned steps. Each sine component depends on one coordinate, so the P1 interpolant's gradient of that component is exactly (0, Δ/h, 0), or its permutation. By the mean value theorem |Δ/h| ≤ 2πW. Every cell's affine Jacobian is therefore A + D_cell with the same bound, so no cell can turn over. The construction guarantees it, not only the check. The no-turnover assertion is collective. Same mesh at every np. The values below are gathered from every rank, with cells deduplicated by centroid:
The values are identical, and the volume sum equals det A. Shape quality here is volume over longest edge cubed, normalised to 1 for a regular tetrahedron. Its minimum of 0.0041 shows the cells are strongly sheared, as intended, but none is degenerate. 3. Regression powerPre-#1175 is the first parent of #1175's merge on development's first-parent history (2bc779d^1 = 862fd35). Pre-#1190 is the same for #1190 (88d98ac^1 = d583072). For each, I overlaid every Both commits differ from that build in compiled code:
The pre-#1175 Python does not accept that keyword. For that overlay only, I added
The PR body's numbers reproduce exactly: 116 to 125 per distance, 392/47/10, and 1200 to 1427. On development (eccae6d) at np 2, both parallel test_1123 cases fail with 1 inside point unowned. That is #1213's defect, so this PR depends on #1213, as its stacking already says. As the body says, the #1183 sampling test no longer separates pre-#1190 from the head. The new direct fallback test carries that regression, and does. 4. The test filesAgainst development's versions, no assertion is changed or loosened. Each test only swaps its inline gmsh mesh for Finding: the non-convex-boundary walk test has lost its power. I re-implemented the walk as it was before the boundary fix (cross the most violated face; leave if it has no neighbour). I ran it on the test's own 2e5 points with the test's nearest-centroid starts:
On the new fixture the test passes with or without the fix. Its docstring still cites "lost 7 of 2e5 on the old gmsh fixture", which is true but no longer tested. A direct test, like the one written for #1183, is within reach. On the new fixture, from random boundary-cell starts the old walk loses 1189 of 2e5 and the current walk 55; from random cell starts, 690 against 33. The current walk still loses some because a far start can be walled off or run out of steps;
Either is enough. The minimum fix is to say in the docstring that the fixture no longer exercises the case. Nit. In the parallel test_1123, 5. The gmsh-specific meshThe old gmsh-built sheared box (cell 1/6, wave 0.03) is removed from all three files, not kept beside the new one. Development's versions had no gmsh or mesh-fingerprint skip, so there is none to remove or keep. The only remaining gmsh meshes in these files are unsheared: the 2-D vertex test in test_1123 and the graded box in test_1183, and neither depends on a build-specific tangle. 6. Neighbours
Not run:
All logs and scripts are kept by the reviewer. Underworld development team with AI support from Claude Code |
…fallback tested directly The sheared fixture was gmsh's box with #1123's shear and sine terms of amplitude 0.03. gmsh builds differ (1094 cells on macOS against 1086 on Linux), and on one macOS build a cell was turned over, so the locator tests had no right answer. tests/parallel/sheared_box_fixture.py (from #1213): a structured box of cubes split into six tetrahedra, independent of gmsh, with the sine amplitude at 0.025: the sine gradient's norm (2 pi 0.025 = 0.157) is below the linear shear's smallest singular value (0.175), so the map is invertible, and the fixture asserts, collectively, that no cell turned over. test_1123 (serial and parallel) and test_1183 use it. Regression power on it: before #1175, test_1123 fails at np 1, 2 and 4 (116 to 125 inside points classified exterior per distance; 392, 47 and 10 owned by no rank). #1183's 2 per million lived in near-degenerate cells of one gmsh build and no valid fixture reproduces them; test_1183 tests the fallback directly instead: with the walk forced to miss every point, the fallback must find them all, which before #1190 loses 1200 to 1427 of 2e4. Underworld development team with AI support from Claude Code
…el test runs serially too (H1's review) On the structured fixture the walk from the nearest control point's cell loses no point even without the boundary-following rule, so that test pins the guarantee but no longer the rule. test_the_walk_from_boundary_cells_and_its_recovery starts every point at a random boundary cell: the walk returns only containing cells, every point it loses left through the boundary, it loses fewer than 0.1 % (54 of 2e5), and the restarts and exact fallback place every one. With the walk crossing the most violated face even when it is a boundary face (the rule before), it loses 1232 and the test fails. test_1123_exact_locator_parallel: since #1213 points_in_domain is exact serially too, so the swarm test no longer skips at np 1; docstrings updated. Underworld development team with AI support from Claude Code
8e36b64 to
3e80819
Compare
|
Review from the Underworld development team with AI support from Claude Code (H1: review and parallel test runs on a 96-thread Linux workstation (Intel Xeon Gold 6240R, AVX-512; MPICH)) Verdict on head 3e80819: ready to merge on green from this review (parallel runs; the code review is the integration lead's). The one item I asked for is done: the boundary-following walk is now tested from far starts, and the test has power. Stack. The branch sits on d106c7d, now in development through #1213's merge (1bd2b66). Against development the diff is test-only, in three files: The new test,
The mutant count matches the one in the PR. The test checks three things:
These and the 0.1% bound are the right guarantees to pin. Docstrings and assertions against 8e36b64.
Runs.
At np 2 and 4 the skips are the serial-only tests. The earlier findings on the fixture still hold, since the fixture is unchanged: invertibility, the collective no-turnover check, and an identical mesh at np 1, 2 and 4. Not run: the full suites, np 3, and macOS. All logs and scripts are kept by the reviewer. Underworld development team with AI support from Claude Code |
Stacked on #1213: merge that first. This branch is rebased onto #1213's head (d106c7d); the change here is two test-only commits.
Why. test_1123's sheared fixture was gmsh's box under #1123's linear shear, plus sine terms of amplitude 0.03. gmsh builds differ: 1094 cells on macOS against 1086 on Linux (W1). On one macOS build the map turned a cell inside out, so the walk test missed 1110 of 2e5 points, because a tangled mesh has no right answer.
test_points_near_interior_edges_are_exactused the same fixture, unguarded.The fixture (
tests/parallel/sheared_box_fixture.py, added by #1213):test_1123 (serial and parallel) and test_1183 use it.
Regression power, measured on the new fixture.
The single point before #1190 at np 2 is
points_in_domain's sign test, which #1213 fixes.Why #1183's 2-per-million case cannot be kept. Those points sat in near-degenerate cells of one gmsh build: at amplitude 0.03 the worst cell kept a volume ratio of 0.027, and the same shear turns a cell over on another gmsh build. On every valid, non-tangling shear tried, the walk misses none of 1e6 sampled points (or 1, at one rank count): amplitudes 0.01 to 0.0275, on the gmsh box and on structured 5³ to 8³ boxes. So the fallback is tested directly: with the walk patched to miss every point, each contained point must still be found, in a cell that contains it. That is what #1190 added, and before it the 50-nearest-centroid search lost 1200 to 1427 of 2e4.
The walk's boundary-following rule (H1's review). On the structured fixture, the walk from the nearest control point's cell loses nothing even without that rule, so
test_the_walk_finds_every_contained_point_on_a_non_convex_boundarynow pins the guarantee but not the rule (its docstring says so). The newtest_the_walk_from_boundary_cells_and_its_recoverystarts each of 2e5 points at a random boundary cell and asserts:With the walk crossing the most violated face even when it is a boundary face (the rule before #1175's fix), it loses 1232 and the test fails; H1 measured 1189.
After #1213:
points_in_domainis exact serially too, so test_1123's parallel swarm test no longer skips at np 1, and its docstring is updated.Tests run. The three files, with #1213's, pass at np 1, 2 and 4 (12, 6 and 7 tests; the rest skip by rank count). The coverage gate passes. Measured on a 96-thread Linux workstation (single system image; Intel Xeon Gold 6240R, AVX-512; MPICH). H1 reviews.
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