Skip to content

Exact point location on simplex meshes: barycentric coordinates and a face-crossing walk (#1123, register row 14) - #1175

Merged
lmoresi merged 9 commits into
developmentfrom
feature/locator-barycentric-walk
Nov 14, 2026
Merged

lmoresi merged 9 commits into
developmentfrom
feature/locator-barycentric-walk

Conversation

@lmoresi

@lmoresi lmoresi commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Fixes #1123. Replaces #1117's interim tolerance on simplex meshes (register row 14). Covers #960 item 3. Based on development with #1158.

What changes. On straight-sided simplex volume meshes, the cell that evaluates a point is found exactly:

The two pieces are in discretisation/_simplex_locator.py and Mesh._simplex_locator/_walk_to_owning_cells.

Quadrilaterals, hexahedra and 2-manifolds keep the cell-wall test, as the plan says. They follow with an inverse map.

Barycentric against the face-pair test (plan step 1): measured per point on 1e6 points, warm, serial, on a 96-thread Linux workstation (single system image; Intel Xeon Gold 6240R, AVX-512; MPICH).

mesh face-pair barycentric
2-D simplex 233–246 ns 105–115 ns
3-D simplex 354–366 ns 169–176 ns

Both are exact. Barycentric is about 2.1 times faster.

What a rank claims does not change.

  • The tolerant fallback is kept: a point no local cell contains still takes today's face-tolerance claim through _robust_owning_cells.
  • Swarm migration's first stage is kept: points_in_domain, which swarm migration reads, keeps its boundary-sign test. In parallel its later stages (_eval_use_robust_location, strict validation) call _robust_owning_cells, which this PR changes. Serially they do not.
  • Only evaluation classifies by the exact locator (_classify_points_in_domain(..., exact_location=True), passed by evaluate_nd).
  • Evaluation's mask matches the claims: at np 2 and 4 it equals the claim mask point for point.
  • Measured: random points, every mesh vertex, and points 1e-9, 1e-7 and 1e-5 off vertices, in 2-D and 3-D, at np 2, 3 and 4. _robust_owning_cells >= 0 and points_in_domain (strict and not) are identical to development on every rank, on these unsheared meshes.
  • Except on a mesh like Strongly sheared 3-D simplex meshes: the point locator's 50-centroid walk misses the containing cell and evaluate returns RBF values off by up to 0.17 #1123's. There development's search misses containing cells. H1 measured that on the sheared box the branch claims 3 to 52 more points per run, every one truly inside, and development keeps no point the branch drops. So swarm migration changes on such meshes at np >= 2: it now keeps points development lost. A new parallel test seeds a swarm at the inside points and checks that every one survives migration with lost points deleted; development drops 6, 1 and 1 at np 2, 3 and 4. Serial runs still lose them, because the boundary-sign test is unchanged: 27 of 3,825 inside points on Strongly sheared 3-D simplex meshes: the point locator's 50-centroid walk misses the containing cell and evaluate returns RBF values off by up to 0.17 #1123's mesh, the same as development. That is the swarm follow-up.
  • What can change for a swarm: which cell holds a point already claimed (the tie rule), not whether it is claimed.
  • Follow-up: making points_in_domain agree with the locator, and starting the walk from a particle's previous cell, is the swarm PR that comes next.

#1123. On its sheared 3-D mesh, development (with #1117) gets points 1e-8, 1e-6 and 1e-4 from interior edges wrong by up to 0.18: 10, 12 and 18 of about 1260. They are classified exterior and filled by RBF. On this branch every one is exact (< 2e-15).

Empty ranks. The locator is chosen from mesh-wide facts only (isSimplex is agreed over ranks at construction). A rank with no cells gets an empty locator that returns -1, so every rank takes the same path. On development, _robust_owning_cells raised on such a rank ("An error was encountered attempting to find the closest cells"); here it returns -1. That is tested at np 3, and fails on development.

#960 item 3. global_evaluate_nd's rank-local steps (the first pass and the containment round) agree on failure before the next collective. Every rank raises: the failing rank its own error, the others a RuntimeError naming #960. Development hangs (supervisor exit 124). A raise inside evaluate_nd before its own collectives is not covered.

Cost.

  • H1's timings (H1 is the parallel review desk). These are of 51e8973 against development bc3d536, at a machine load of 21 to 24, so about ±15 %. P2 field, best of 3, maximum over ranks; "near-vertex" means within 1e-6 of a vertex. Each entry is development → branch:
case locator (_robust_owning_cells) evaluate global_evaluate
3-D, 1e5 near-vertex, serial 2.0-2.2 → 0.37-0.39 s 3.3-3.6 → 1.6 s 4.2-4.9 → 3.9-4.1 s
3-D, 1e5 random interior, serial 0.42-0.48 → 0.21-0.23 s 2.1-2.2 → 1.4-1.5 s 2.6-2.7 → 2.3-2.5 s
3-D, 1e5 near-vertex, np 2 1.0-1.1 → 0.35-0.37 s 1.2-1.3 → 0.69-0.74 s 3.5-4.1 → 1.4-1.5 s
3-D, 1e5 random interior, np 2 0.80-0.84 → 0.48 s 0.93-0.98 → 0.83-0.85 s 1.9-2.1 → 1.35 s
2-D, 1e5 near-vertex, np 4 0.086 → 0.062 s 0.136 → 0.138 s 0.56 → 0.39 s
3-D, 1e6 near-vertex, serial 19.2 → 3.9 s 31.3 → 15.4 s 46.3 → 36.1 s
3-D, 1e6 random interior, serial 5.5 → 1.9 s 19.6 → 12.6 s 25.2 → 23.2 s
3-D, 1e6 near-vertex, np 4 6.8 → 2.1 s 4.8 → 3.3 s 22.3 → 7.8 s
3-D, 1e6 random interior, np 4 6.0 → 2.8 s 5.4 → 3.7 s 17.4 → 7.6 s
3-D, 1e6, 7/8 exterior, np 4 3.2 → 1.6 s 2.7 → 2.2 s 19.6 → 10.8 s
  • The one regression H1 found, and its fix.
    • What H1 measured: serial, 1e6 points with 7/8 outside a 3-D box. evaluate went from 7.0-7.5 s to 11.2-11.8 s. Every point the walk did not place went on to the old 50-centroid face-tolerance search.
    • The fix, at c6ea730:
      • A point beyond every local cell's reach is not handed to that search. Nor is a point farther than 2.0 * _local_cell_reach from every local boundary face control point: a claim needs the point within the tolerance slab of a local face, which lies within the face's size of its control point. The test is rank-local.
      • For evaluation in serial, a lost point is tested against the cell the walk left the mesh through. On 1.02e6 points, including points 1e-6 and 1e-8 off boundary vertices, this gives the same in/out answer as the full search for every point.
      • In parallel the full search still decides. Near a partition seam another cell can meet the point: with the exit-cell test, up to 37 points per rank would differ at np 2 to 4.
    • Now: the same case, serial, takes 5.1 s for evaluate against development's 6.5 to 7.1 s, and 5.1 s for _robust_owning_cells against 11.0 s. With the full search kept in parallel, the evaluation mask equals the claim mask at np 2 and 4.
  • Mover cost: the locator build. 0.19 s on a 38k-cell 2-D mesh and 1.3 s on a 64k-cell 3-D one. It is built lazily, on the first evaluation after a geometry change. A mover that deforms without evaluating pays nothing; one that evaluates after every move pays it per move.
  • H2's mover timing (H2 is the mesh-mover session). The evaluate uses the cell that contains a point before any face tolerance (#1115) #1117 annulus mover, 22,724 cells, three moves, 51e8973 against bc3d536, on a shared machine (about 10 %):

The single-rank mover path differs from development's from the first move, and why. H2 found 566 locator calls against 497, and a minimum radius of 4.426e-3 against 4.207e-3 after three moves; both are deterministic on one rank. I traced every evaluate and locator call of the first move on both builds:

  • The first difference is a cell choice, not a value. In call 0, 9,853 of 11,665 points get a different owning cell. Every one lies on a shared vertex or face (a barycentric coordinate within 1e-12 of 0), and both cells contain it. That is the tie rule: the lowest cell in the star, where development took the containing cell with the nearest centroid.

  • The values agree to round-off. Where the cell changes, values differ by at most 6.75e-14 on a field of scale 22. In calls 3 to 9, the most is 3.4e-13 on a scale of 64. No value differs where the cell is the same.

  • The inputs then diverge. They first differ at call 10, by 2.7e-14 in a coordinate, and the paths separate from there.

  • The mover amplifies round-off of that size on its own. Perturbing development's evaluate outputs in calls 0 to 9 by 3e-15 relative (applied changes of 2e-13 to 7e-13) moves development's own path more than the branch does:

    run evaluate calls min radius after one move
    development 510 5.159e-3
    development, seed 1 594 5.039e-3 (−2.3 %)
    development, seed 2 585 5.063e-3 (−1.9 %)
    branch 454 5.153e-3 (−0.13 %)

So the 5 % difference in minimum radius after three moves is the mover's sensitivity to round-off, which development shows by itself. It is not a value the locator gets wrong. Under Louis's rule, a different owning cell on a shared entity with the same value to round-off is expected.

The single-rank wall time, 374 s against 338 s, is not re-timed yet. The machine has not been quiet: its load has been 18 to 27 throughout. The mover's step count follows the path. Development's own run takes 510 or 594 evaluate calls in one move depending on round-off of 2e-13 (+16 %). H2 measured less time in evaluate on the branch. So the extra wall time is consistent with a path that takes more mover steps, not with a slower locator. A quiet re-time is open and will be added here.

Tests.

  • tests/test_1123_exact_locator_simplex.py:

    All fail on development.

  • tests/parallel/test_0960_global_evaluate_agrees_on_failure_parallel.py: hangs on development; passes at np 2 (H1: np 2, 3, 4, 8, and it hangs under the no-agreement mutant).

  • tests/parallel/test_1123_exact_locator_parallel.py: on Strongly sheared 3-D simplex meshes: the point locator's 50-centroid walk misses the containing cell and evaluate returns RBF values off by up to 0.17 #1123's sheared mesh every inside point is owned by some rank (development: 27, 6, 1 and 1 owned by none at np 1 to 4). It is exact serially, and a rank with no cells returns -1 instead of raising. It runs in batch 3 and under --p N.

  • test_0761: two tests encoded the cell-wall path and are rewritten for the exact locator:

    • the classifier hands over a containing cell for every interior point;
    • the cost of a point outside the mesh is counted in barycentric tests: 0 for a point beyond reach, 1 for an owned centroid.
  • Run here:

    • serial: 62 to 70 files of evaluate, swarm, location, remap, transport and history tests;
    • parallel evaluate, swarm and empty-rank files at np 2 and 4 (85 and 99 passed);
    • serial at c6ea730: 70 files of evaluate, swarm, location, remap, transport, history and mover tests, 4 workers, 526 passed. The exceptions were test_1086's cases, whose serial and parallel children hit their 120 s silence limit under the workers and a machine load of about 20; run alone, test_1086 passes in full (20).
    • test_1086 in full, alone (20);
    • the test-coverage gate.

Left open (not in this PR).

UWTN 2026-009. The note describes a kd-tree of control points with face pairs, retrying from the next-nearest control point. This PR keeps the control-point kd-tree for the start cell and replaces the face-pair test and the retries with barycentric coordinates and a face-crossing walk, on simplex meshes. The note would want an update; that is Louis's.

Reviews: H3 (it wrote #1117); W1 checks ownership and the swarm; H1 runs parallel.

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 (S11): claims identical at np 2 to 4; the failure agreement adds one Allreduce per local step
  • No mesh entity or rank identified by coordinates; any remaining tolerance is named, relative and says what it bounds (S12)
  • 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

…ex meshes (#1123) [wip]

On straight-sided simplex volume meshes, _robust_owning_cells finds the containing
cell by barycentric coordinates and a walk across the face each point fails worst,
from the cell of its nearest control point; a point still lost is walked again from
its few nearest centroids. The only tolerance is SimplexLocator.ROUNDOFF, a guard on
the dimensionless barycentric coordinates. A point several cells contain gets the
lowest-numbered local cell in the star of the entity it lies on.

The set of points a rank claims is unchanged: a point no local cell contains keeps
today's face-tolerance claim, and points_in_domain, which the swarm's migration
reads, keeps its boundary-sign test. Measured identical to development at np 2, 3
and 4 on random points, vertices and points 1e-9 to 1e-5 off vertices, 2-D and 3-D.
Only evaluation classifies by the exact locator (exact_location=True), which fixes
#1123: on its sheared 3-D mesh, points 1e-8 to 1e-4 from interior edges were wrong
by up to 0.18 at 10 to 18 of about 1260; now every one is exact.

Quadrilaterals, hexahedra and 2-manifolds keep the cell-wall test.

Underworld development team with AI support from Claude Code
…960 item 3)

The local evaluations inside global_evaluate_nd (the first pass and the containment
round) run between collectives. A raise on one rank alone left the others waiting in
the next one. _agreed_on_every_rank runs the step, reduces a failure flag, and raises
on every rank: the failing rank its own error, the others a RuntimeError naming #960.
A raise inside evaluate_nd before its own collectives (update_lvec, the locator) is
not covered: that needs the collectives themselves to agree.

tests/parallel/test_0960_global_evaluate_agrees_on_failure_parallel.py: rank 1 fails
after its local evaluation; every rank raises. Development hangs (supervisor exit 124).

Underworld development team with AI support from Claude Code
…in-star tie rule

Underworld development team with AI support from Claude Code
…of reach or (serially) outside the mesh

H1's timings found serial evaluation of mostly exterior points 50 to 65 % slower than
development, although the walk itself was faster: every point the walk did not place
went on to the 50-centroid face-tolerance search.
- A point beyond every local cell's reach is not handed to it (it would reject it by
  the same reach test).
- A lost point farther than twice the local cell reach from every local boundary face
  control point is not handed to it either (the tolerance cannot claim it). Rank-local.
- For evaluation in serial, a lost point is tested with the face tolerance against the
  cell the walk left the mesh through only. In parallel the full pass decides, as for
  claims: near a partition seam another cell than the exit cell can meet the point
  (measured: up to 37 points per rank differ at np 2 to 4).
Claims are unchanged (identical to development at np 2, 3, 4), and the evaluation mask
equals the claim mask at np 2 and 4. 1e6 points, 7/8 outside a 3-D box, serial:
evaluate 5.1 s against development's 6.5 to 7.1 s; _robust_owning_cells 5.1 s against 11.0 s.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@lmoresi

lmoresi commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

Verdict: READY with conditions at d77bab4.

The parallel review of #1175 is by H1 (review and parallel test runs on a 96-thread Linux workstation (Intel Xeon Gold 6240R, AVX-512; MPICH)). H3 reviews the general code and W1 reviews ownership and the swarm. This record covers parallel correctness only.

Short version

The conditions are two small changes, items 2 and 3 below.

Findings by severity

Medium (already on development; not caused by this PR, but it limits what "exact" means in parallel)

1. An interior point near a partition seam can be evaluated by a rank that does not contain it. Its value then depends on which rank asked.

  • How it happens:

    • The claim still uses the face tolerance (_EVAL_FACE_TOL = 1e-2).
    • A rank whose cell lies within that tolerance of a point keeps the point, even when the cell that contains it is on another rank.
    • The swarm migration then does not move the point, so it is evaluated on the rank that asked, in a cell that does not contain it.
    • The error grows with the distance from the seam.
  • Measured with diag_seam.py (box2 and box3s, np 2):

    • every inside point with an error above 1e-9 is contained by one rank only, claimed by both, and wrong only when the other rank asked;
    • box2: 23 points, up to 2.9e-6;
    • box3s: 31 points, up to 2.4e-5.
  • Seam-offset sweep (seam_offset.py, np 4; points on interior faces moved by delta·h in random directions, every rank querying the same set):

    delta·h box2, max error box2, points box3, max error box3, points
    1e-6 6.4e-8 20 of 1600 1.7e-7 26 of 1600
    1e-4 6.4e-6 23 1.7e-5 26
    1e-3 2.1e-5 10 2.4e-5 6
    3e-3 4.9e-6 6 3.1e-15 0
    1e-2 4.6e-7 3 3.6e-15 0

    Development gives the same numbers in every cell of this table.

  • Worst case: random partitions of the sheared box, up to 2.7e-4 at inside points on both arms, on an O(1) field.

  • Rank to rank: the same point evaluated from different origin ranks differs by up to 2.8e-4. That is the same on both arms at every np and layout.

  • A comment is now false. The comment at _EVAL_FACE_TOL says "a rank never claims a point another rank owns" and "found by exactly one rank". In this data, 30 to 2,690 points per run are claimed by two or more ranks.

  • Why it matters here: the PR's "every one is exact (< 2e-15)" is true in serial, and in parallel for points no seam's face slab reaches. It is not true for points near a seam.

  • The follow-up the PR already names would close this: claim by exact containment first, and use the face tolerance only for a point that no rank contains. Not a blocker for this PR. A follow-up issue is recommended.

Low

2. The #1123 fix has no parallel test (condition 1).

3. The claim "points_in_domain identical to development" holds only on meshes without the #1123 problem (condition 2: correct the PR text and tell W1).

  • On the sheared box the branch claims more points than development:

    np (layout) strict not strict _robust_owning_cells
    2 23 22 23
    3 10 9 10
    4 7 5 7
    8 6 3 6
    2, with an empty rank 52 51 52
  • Every extra claim is a truly inside point that development lost: interior points, face points, edge points, boundary-face points and points 1e-6 inside the boundary.

  • Development claims nothing the branch drops (0 in every run).

  • So this is an improvement, but swarm migration does change on such meshes.

4. A test-side collective hazard in test_0761::test_the_classifier_hands_over_the_cells_it_located (new code in this PR).

  • The new block starts with if mesh._simplex_locator() is not None:, which is rank-local. It then calls _classify_points_in_domain, which is collective (get_max_radius).
  • On a rank that owns no cells the locator is None (finding 6), so that rank would skip the collective while the others wait.
  • It does not trigger on the test's own partitions. It would under an empty-rank layout.
  • Fix: decide the branch collectively (an allreduce of the flag), or call the classifier on every rank.

5. test_0761 hangs at np 8 on both arms (already on development).

  • test_p1_field_on_a_shared_edge_matches_the_closed_form asserts query.shape[0] > 100 on rank-local interior edges, before the collective evaluate.
  • At np 8 rank 7 holds 99 such edges (the others hold 104 to 129). Rank 7 fails, the other ranks wait in get_max_radius, and the supervisor reports the hang.
  • Development hangs the same way. Not caused by this PR, but test_0761 cannot run at np 8 until that assertion is made collective.

6. Empty rank.

  • SimplexLocator raises ValueError on zero cells, so _simplex_locator() returns None there. The locator.n_cells == 0 early return in _walk_to_owning_cells therefore cannot be reached.
  • The empty rank takes the cell-wall path, where a direct _robust_owning_cells(P) with points raises RuntimeError ("An error was encountered attempting to find the closest cells…").
  • That is the same on development, and evaluation never reaches it: _classify_points_in_domain returns early on an empty rank.
  • global_evaluate, points_in_domain and the evaluation mask were correct with an empty rank at np 2, 4 and 8.
  • A swarm caller that passes points to _robust_owning_cells on an empty rank would raise. That is rank-local, so a hang only follows if a collective comes next. For W1.

7. In serial, the exit-cell shortcut and the full search disagree on 2 of 300 points 1e-6 outside the sheared box.

8. A degenerate cell disables the exact locator on that rank only.

  • np.linalg.LinAlgError is a subclass of ValueError, so an exactly singular cell sends that rank, and only that rank, back to the cell-wall path.
  • This does not hang: there are no collectives on either path. It is noted so the rank-dependent strategy is known.

For #1176 (not reviewed here)

The locator answers "is this point in a local cell" exactly, and nothing more. A global in/out still needs a reduction over ranks on the same point set, at the same call on every rank.

Union of exact containment works on this data:

  • Inside points owned by no rank were 0 in every branch run.
  • Seam points are contained on both sides to within 1e-12 in barycentric coordinates.

The face-tolerance claim is not an in/out test. At np > 1, points_in_domain claims 96 to 300 points 1e-6 outside the boundary that np 1 rejects (on both arms).

Partition independence

Setup

  • Meshes:

  • Points: one fixed set per mesh, built once from the serial mesh and loaded on every rank. The meshes were checked to be identical at every np.

    • 2,000 random interior points;
    • 400 vertices;
    • 600 points each 1e-6 and 1e-10 from vertices;
    • 800 points on interior faces;
    • 400 on edges (3-D only);
    • 300 on boundary faces;
    • 300 each at 1e-6 and 1e-3 outside the boundary, and 1e-6 inside it;
    • 60 far exterior points.

    That is 4,844 to 6,060 points in all.

  • "Inside": a brute-force barycentric test over all cells, to -1e-12.

  • Field: P2 with a quadratic, which is exact on straight-sided cells, so the error at inside points is measured against the closed form.

  • Each rank queries the whole set.

Main table, default partitioner. "extra claims (branch)" lists the points the branch claims and development does not, for strict, non-strict and _robust_owning_cells. Development claims nothing the branch drops in any row. "eval ≠ claim" is summed over ranks.

mesh np extra claims (branch) inside points owned by no rank (branch / dev) eval ≠ claim (branch / dev) max error, inside, not near a vertex (branch / dev) max error, all inside (branch / dev)
annulus 1 0/0/0 0 / 0 0 / 269 1.8e-15 / 1.8e-15 2.4e-14 / 6.0e-14
annulus 2, 3, 4, 8 0/0/0 0 / 0 0 / 0 1.8e-15 / 1.8e-15 2.0–2.8e-6, same on both
box2 1 0/0/0 0 / 0 0 / 136 1.8e-15 / 1.8e-15 2.2e-15 / 2.2e-15
box2 2, 3, 4, 8 0/0/0 0 / 0 0 / 0 1.8e-15 / 1.8e-15 2.8–3.7e-6, same on both
box3 1 0/0/0 0 / 0 0 / 524 4.4e-15 / 4.0e-15 2.5e-14 / 4.4e-15
box3 2, 3, 4, 8 0/0/0 0 / 0 0 / 20–77 4.4e-15 / 4.0e-15 3.1–4.3e-6, same on both
box3s 1 0/0/52 0 / 52 2 / 463 2.8e-14 / 1.6e-1 2.8e-14 / 1.6e-1
box3s 2 23/22/23 0 / 23 0 / 553 2.8e-14 / 1.6e-1 1.4e-5 / 1.6e-1
box3s 3 10/9/10 0 / 10 0 / 1,783 2.8e-14 / 1.8e-1 2.5e-5 / 1.8e-1
box3s 4 7/5/7 0 / 7 0 / 2,381 2.8e-14 / 1.8e-1 2.7e-5 / 1.8e-1
box3s 8 6/3/6 0 / 6 0 / 4,431 2.8e-14 / 1.8e-1 8.8e-5 / 1.8e-1

How to read it:

  • "Not near a vertex" covers the interior, interior-face, edge, vertex, boundary-face and 1e-6-inside points. "All inside" adds the points 1e-6 and 1e-10 from vertices, where the seam effect in finding 1 shows.
  • Values at inside points: the branch matches development to 6e-14 on the annulus, box2 and box3 at every np.
  • Points owned by two or more ranks (the same on both arms): 30 to 107 on the annulus, 76 to 268 on box2, 238 to 651 on box3, 207 to 491 on box3s.
  • Every inside point was owned by at least one rank on the branch at every np.

Other layouts: a shell partition that leaves the last rank empty, and random cell assignment with seeds 3 and 7. The other columns behave as in the main table.

mesh layout, np extra claims (branch) inside points owned by no rank (branch / dev) max error, inside, not near a vertex (branch / dev) max error, all inside (branch / dev) rank to rank (both)
annulus empty rank, 2/4/8 0 0 / 0 1.8e-15 / 1.8e-15 ≤ 2.4e-6, same ≤ 3.1e-6
annulus random, 3/4 0 0 / 0 1.8e-15 / 1.8e-15 3.5e-6, same 3.7e-6
box2 empty rank, 2/4/8 0 0 / 0 1.8e-15 / 1.8e-15 ≤ 3.8e-6, same ≤ 3.8e-6
box2 random, 3/4 0 0 / 0 ≤ 9.2e-6, same 9.2e-6, same 9.2e-6
box3 empty rank, 2/4/8 0 0 / 0 ≤ 1.9e-6, same ≤ 4.1e-6, same ≤ 1.0e-5
box3 random, 3/4 (seed 3), 4/8 (seed 7) 0 0 / 0 6.2e-6, same 6.2e-6, same 8.5e-6
box3s empty rank, 2 52/51/52 0 / 52 2.8e-14 / 1.6e-1 2.8e-14 / 1.6e-1 0
box3s empty rank, 4 6/5/6 0 / 6 2.8e-14 / 1.8e-1 4.2e-5 / 1.8e-1 4.5e-5
box3s empty rank, 8 0 0 / 0 2.4e-5, same 2.9e-5, same 2.5e-4
box3s random, 3/4 (seed 3), 4/8 (seed 7) 0 0 / 0 2.7e-4, same 2.7e-4, same 2.8e-4

How to read it:

  • On random partitions most interior points are near a seam, so the seam error in finding 1 shows even away from vertices, and the sheared mesh's lost points are absorbed by tolerant neighbours on development too.
  • The evaluation mask equals the claim mask on every rank of every branch run with np ≥ 2. On development the two masks differ on one rank by up to 1,240 points (the sheared box) and up to 245 points (box3 with an empty rank).
  • Exterior values: values at points outside the domain vary with np by up to 0.4 for far points and 0.2 for points 1e-3 out, on both arms. That is the existing nearest-cell RBF fallback, not changed here.

Tests

file np 1 np 2 np 3 np 4 np 8 development
test_0761_point_locator 23 passed, 2 skipped 21 passed, 4 skipped 21 passed, 4 skipped 21 passed, 4 skipped hang (finding 5) np 8: same hang
test_1123_exact_locator_simplex 4 passed 4 skipped 4 skipped 4 skipped 4 skipped np 1: 4 failed; np 2: 4 skipped
parallel/test_0960 (#960 agreement) – passed passed passed passed np 2 and np 4: hang (supervisor exit 124)
#960 mutant (_agreed_on_every_rank replaced by lambda call: call(), monkeypatched) – hang – hang – –

#960 and its mutant

  • In the mutant, rank 0 waits in global_evaluate (in the swarm migration back) and rank 1 in the test's allgather. That is development's hang, so the test catches the removal.
  • What the agreement does not cover (the PR says so too): a raise inside evaluate_nd before its own collectives. These include update_lvec (globalToLocal), get_max_radius in the classifier, DMInterpolation setup and, for derivatives, the Clement or L2 projection.
  • A raise in the new locator code itself sits between get_max_radius and petsc_interpolate (finding 8 shows the likeliest one is caught as ValueError and turned into the fallback).

Existing parallel files, branch, np 2 and 4: all 18 files pass.

  • np 2: 63 passed; np 4: 71 passed.
  • Some tests skip at np 2 by design.
  • The files: ptest_0762, test_0020, 0755, 0756, 0757, 0760, 0765, 0766, 0767, 0777, 0785, 0790, 0795, 0796, 0974, 1075, 1076, 1093 (every file under tests/parallel/ whose name contains evaluate, swarm, migrate or locate).
  • With no failures, development was not run on them.

Collective audit

function collectives why every rank reaches them
SimplexLocator.__init__, walk, locate, lowest_in_star, barycentric none numpy plus local DMPlex closure and support queries
Mesh._simplex_locator (lazy build) none _build_kd_tree_index is local: the coordinate arrays and the KD-tree, no reductions. The cache is keyed by the identity of _index, which deform/remesh reset and rebuild. Building on some ranks only (e.g. ranks with no points, or an empty rank returning early) is safe because nothing in it is collective.
Mesh._walk_to_owning_cells none KD-tree queries and the walk. Its n_cells == 0 return is rank-local and has no collective after it.
Mesh._robust_owning_cells none added uw.mpi.size == 1 is the same on every rank. The reach and "far from the local boundary" checks use _local_cell_reach (local) and boundary_face_control_points_kdtree (local, rebuilt on deform), not get_max_radius. _get_closest_local_cells_internal and _test_if_points_in_cells_internal have no collectives.
Mesh._classify_points_in_domain get_max_radius (allreduce), unchanged Still called before every early return. The new exact_location return comes after it. _mark_local_boundary_faces_inside_and_out is local.
_agreed_on_every_rank one allreduce(LOR) per call Call site 1 follows evaluation_swarm.migrate, which every rank reaches. Call site 2 is inside if n_ext_total > 0, and n_ext_total comes from an allgather, so it is the same everywhere. size > 1 is the same on every rank. It catches Exception only (not KeyboardInterrupt/SystemExit).
global_evaluate_nd swarm migrations, barrier, allgathers, Allreduces (unchanged) plus the 2 agreement allreduces Each new allreduce sits between collectives every rank already reaches. A failure now raises on every rank.
evaluate_nd update_lvec, the classifier's get_max_radius, interpolation setup (unchanged) Only the exact_location=True keyword is new. A raise before these is not covered (above).

Rank-local if … return/raise before a collective:

  • Library code: none found.
  • Test code: findings 4 and 5.

Lazy build and movers

Script: mover_check.py.

  • Each mesh is moved twice with deform() by a map that keeps the boundary in place. A P2 quadratic is reset on the moved nodes and evaluated globally after each move.
  • The locator was built on every rank before move 1, and on rank 0 only before move 2.
mesh np locator fresh on every rank after each move its geometry matches the DM moved mesh vs a fresh mesh deformed to the same coordinates: values ownership counts
box2 1, 2, 4 yes yes identical (0.0) identical
box3 1, 2, 4 yes yes identical (0.0) identical
annulus 1, 2, 4 yes yes identical (0.0) identical
box3, empty rank 4 yes; the locator is None on the empty rank yes not compared (the script's own direct _robust_owning_cells call raised on the empty rank: finding 6) –

The errors before and after the moves are the same (3e-6 to 8e-6 at points 1e-6 from boundary vertices; exact elsewhere).

What passed and what was not run

Passed

Not run

  • The 18 existing parallel files on development (no failures on the branch to compare).
  • Spherical and 3-D shell meshes, quad/hex meshes (out of the PR's scope) and 2-manifolds.
  • The H2 mover wall-time re-run and any timing.
  • The moved-against-fresh comparison with an empty rank.
  • np 8 for test_0761 (it hangs on both arms: finding 5).

Development arm

Scripts and logs are kept by the reviewer.

Underworld development team with AI support from Claude Code

…the tolerance comment)

- tests/parallel/test_1123_exact_locator_parallel.py: on #1123's sheared mesh every
  inside point is owned by some rank at any rank count (development: 27, 6, 1, 1 inside
  points owned by no rank at np 1 to 4), exact serially. Also run in batch 3.
- A rank with no cells gets an empty exact locator. The locator is chosen from
  mesh-wide facts only (isSimplex is agreed over ranks), so every rank takes the same
  path; _robust_owning_cells returns -1 there where development raised from the empty
  kd-tree (tested at np 3).
- test_0761: the exact-locator branch is decided collectively before the collective
  classifier call; an empty rank's empty selection is handled.
- The _EVAL_FACE_TOL comment says what the tolerance does: it does not make ownership
  unique near a partition seam (#1178).

Underworld development team with AI support from Claude Code
@lmoresi

lmoresi commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

Review record: does the ownership change break a consumer of point ownership?

From the integration desk (the session that reviews solver, boundary-condition and fault-placement changes). A fresh reviewer read d77bab4 for this one question, and we checked its quotes there; 65eed15 arrived during the review and we read its diff only. Reading only, on macOS, 12-core Apple M4. Nothing was built or run; every count quoted is the PR's or the Linux-workstation desk's.

Answer. We found no consumer that depends on the old loss of these points, no path in migration that duplicates a particle, no double-counted value in global_evaluate, and no new collective that some ranks skip. Callers read: Swarm.migrate, add_particles_with_coordinates, global_evaluate_nd, Swarm._owning_cells (Voronoi share, repopulate, ddt.py), petsc_interpolate hints, cell_polynomial_projection.locate, FaultNetwork._slips_ti, SwarmVariable.read_timestep. A particle development lost was deleted and stored nowhere, so none can reappear; the population stops shrinking.

Findings

  1. Medium. The body's "Swarm migration's test is kept" holds for the sign stage only. points_in_domain keeps the boundary-sign test first, but in parallel its near-boundary stage and its strict_validation stage both call _robust_owning_cells (when _eval_use_robust_location() is true, that is on more than one rank), and Swarm.migrate calls it with the default strict validation. That is the path by which the branch claims more points. In serial points_in_domain uses _get_closest_local_cells_internal, which the diff does not touch.
  2. Medium. Serial and parallel swarm populations now differ on a mesh like Strongly sheared 3-D simplex meshes: the point locator's 50-centroid walk misses the containing cell and evaluate returns RBF values off by up to 0.17 #1123's. In serial an unclaimed particle is still deleted by the capped cell-wall test; at np >= 2 the containing rank keeps it. On development it was lost at every rank count. The body should say so.
  3. Medium. "Strongly sheared 3-D simplex meshes: the point locator's 50-centroid walk misses the containing cell and evaluate returns RBF values off by up to 0.17 #1123 fixed in parallel" holds where the sign stage passes. A point a local cell contains, far from the nearest local boundary control point and with a negative sign there, is refused by migration on its containing rank (the comment in _classify_points_in_domain says this happens on a sheared mesh). It is then offered round the candidates; if it ends on a rank that does not contain it, it takes an RBF value flagged extrapolated, and the result depends on the origin rank. development is no better at these points. The new parallel test counts owners through _robust_owning_cells, not through points_in_domain, so it does not see this.
  4. Medium, unmeasured. Can the walk fail on a contained point? A walk across the most negative barycentric coordinate can cycle on a triangulation that is not Delaunay. A point that runs out of steps from every start and lies more than 2.0 * reach from every local boundary control point is not handed to the fallback, where development searched 50 cells. A non-zero count here would mean the branch drops a point development claimed.
  5. Medium, unmeasured. A walk walled off by an internal cut. On a split fault mesh the two sides are not neighbours. If every start lies across the cut, the walk leaves through the cut face; in serial evaluation the point is then tested against the exit cell at the face tolerance only.
  6. Low. add_particles_with_coordinates does not deduplicate: a point two ranks claim is added twice when the same array is given to every rank. This exists on development; the branch takes a Strongly sheared 3-D simplex meshes: the point locator's 50-centroid walk misses the containing cell and evaluate returns RBF values off by up to 0.17 #1123 point on a seam from no copy to two (A point within the face tolerance of a partition seam is claimed by both ranks, and evaluated by the one whose cell does not contain it #1178's territory).
  7. Low. The far-from-boundary filter reads boundary_face_control_points_kdtree by getattr; the tree exists only after the boundary faces have been marked since the last geometry change, so a direct caller of _robust_owning_cells runs with or without the filter depending on call history. The answers differ only for a point the walk fails to place.
  8. Low. A zero-volume cell on one rank makes SimplexLocator.__init__ raise an error that is caught, and that rank alone drops to the capped test. The collectives stay aligned; the ranks then claim by different rules.
  9. Tolerances. "The only tolerance is ROUNDOFF" is true of _simplex_locator.py. _robust_owning_cells adds an unnamed 2.0 * reach filter (new), four restarts chosen by centroid distance, a step cap that assumes an isotropic mesh, and keeps _EVAL_FACE_TOL. The tie rule is the lowest local cell in the local star, which depends on the partition; a discontinuous field evaluated on a shared entity can see it.
  10. Note. ddt.py's _fit_arrivals uses the capped test at tol=0.0 and keeps the Strongly sheared 3-D simplex meshes: the point locator's 50-centroid walk misses the containing cell and evaluate returns RBF values off by up to 0.17 #1123 defect. Not caused here, not fixed here.

Probes that would settle 3, 4 and 5 (parallel; not ours to run)

  • For 3: the sheared box at np 2, 3, 4, 8. Count points where _robust_owning_cells >= 0 on some rank and points_in_domain(strict) is false on every rank; for those, the extrapolated flags and the error on a linear field from each origin rank.
  • For 4: serial, np 2 and 4; the Strongly sheared 3-D simplex meshes: the point locator's 50-centroid walk misses the containing cell and evaluate returns RBF values off by up to 0.17 #1123 shear, one twice as strong, a 2-D anisotropic mesh; 1e6 interior points. Count _robust_owning_cells < 0 among points a brute-force barycentric test places inside, before and after a points_in_domain call.
  • For 5: a split fault mesh, points 1e-8 to 1e-3 h either side of the cut, serial and np 2, 4. Count returned cells on the wrong side, against development.

Conditions

  1. Body: findings 1 and 2, and the 2.0 * reach filter in the tolerance list.
  2. A parallel test on the sheared mesh that reads points_in_domain(strict) and a swarm's global count through migrate(delete_lost_points=True).
  3. The probe for 4 before merge; a non-zero count blocks. The probe for 3 decides whether the body's parallel claim needs a qualifier.
  4. The probe for 5 can follow with the swarm PR; wrong-side cells at a cut would be an issue against this branch, since fault meshes are a default route.

Not checked: periodic meshes; volume meshes given an overlap by option; the Cython handling of -1 hints; anything executed.

Underworld development team with AI support from Claude Code

@lmoresi

lmoresi commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

Re-check of #1175 at 65eed15: both conditions met. READY on the review's conditions. From H1 (review and parallel test runs on a 96-thread Linux workstation (Intel Xeon Gold 6240R, AVX-512; MPICH)). The head's Python is laid over the d77bab4 build; the new commit changes no compiled file. W1's condition iii (the walk-cycling probe) is a separate run and follows.

Condition 1: a parallel #1123 test. tests/parallel/test_1123_exact_locator_parallel.py:

np this branch development c766bea
1 1 passed, 1 skipped (the empty-rank case needs np ≥ 3) 1 failed
2 1 passed, 1 skipped on every rank 1 failed on every rank
3 2 passed on every rank
4 2 passed on every rank 2 failed on every rank
8 2 passed on every rank
2, one rank holding every cell 1 passed, 1 skipped on both ranks

Condition 2: the body. It now limits "identical to development" to unsheared meshes, gives the 3 to 52 extra claims on the sheared box, and says that swarm migration changes there.

The other items:

  • The empty-rank locator. _simplex_locator() is now chosen from mesh-wide facts (isSimplex), and a rank without cells gets an empty locator. That removes the rank-dependent strategy, and _robust_owning_cells no longer raises there. Probe at np 8, box with cells [0, 3, 2, 2, 0, 3, 2, 2], 50 points:
    • development: both empty ranks raise RuntimeError ("…closest cells…");
    • branch: each returns 0 owned;
    • on both builds, every point is owned by some rank.
  • test_0761's block is decided by an allreduce. On the default partitions: 21 passed, 4 skipped on every rank at np 2, 3 and 4.
  • The _EVAL_FACE_TOL comment now states the seam behaviour and names A point within the face tolerance of a partition seam is claimed by both ranks, and evaluated by the one whose cell does not contain it #1178.

One test-side note, not a condition. Under a shell partition that empties the last rank, test_0761 at np 3 and np 4 hangs. Several of its tests fail on the empty rank alone (rank-local assertions on that rank's own query set), and that rank then reaches get_max_radius while the others wait in update_lvec. This is the file's one-rank design meeting an empty rank, the same kind as the np 8 hang the body already names. It is not a library path: the PR's own empty-rank test passes, as does the probe above. Making test_0761's per-rank assertions collective, or skipping them on a rank with no cells, would cover it.

Underworld development team with AI support from Claude Code

…inside point (W1's review of #1175)

- On #1123's sheared mesh the most violated face of a cell near the wavy boundary can
  be a boundary face although the point is inside, further along the wall: the walk
  left the mesh there and lost 7 of 2e5 contained points (no cycling: all seven exited
  through a one-cell face, the same with 10,000 steps). It now crosses the most violated
  face that has a neighbour, and stops as outside only when every violated face is on
  the local boundary: 0 of 2e5 on the sheared mesh, a 3-D box and an annulus. Serially,
  evaluation's exit-cell test relied on that.
- tests/parallel/test_1123_exact_locator_parallel.py: points_in_domain(strict) owns
  every inside point at np 2 to 4, and a swarm seeded at them keeps every one through
  migration with lost points deleted (development: 6, 1, 1 owned by no rank).
- test_1123: the walk alone finds every contained point on the sheared mesh.

Claims stay identical to development on unsheared meshes at np 2 to 4; the serial
exterior case is unchanged (5.3 s against development's 9.4 s at this load).

Underworld development team with AI support from Claude Code
@lmoresi

lmoresi commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

#1175: the walk-failure probe (the integration desk's condition iii), at 65eed15 against development c766bea. From H1 (review and parallel test runs on a 96-thread Linux workstation (Intel Xeon Gold 6240R, AVX-512; MPICH)).

Question. Can the walk fail on a point a local cell contains, with the new 2.0 * reach filter then keeping it from the fallback search, so that the branch drops a point development claimed?

Method.

mesh np branch: contained, not owned development: contained, not owned lost on the branch but owned on development
#1123 shear 1 0 12,458 0
#1123 shear 2 2 7,085 0
#1123 shear 4 1 2,365 0
doubled shear 1 68 14,393 0
doubled shear 2 46 11,981 0
doubled shear 4 6 2,018 0
2-D anisotropic 1, 2, 4 0 not run –

The counts were the same before and after the points_in_domain call, on both builds.

Answer: no. Every contained point the branch fails to own, development fails to own too. The branch drops no point development claimed, and it owns 99.5 % or more of the points development loses.

What remains, for the record.

Underworld development team with AI support from Claude Code

@lmoresi

lmoresi commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

Re-check at 3e49802 (integration desk; by reading the diff from 65eed15, nothing run).

Conditions (i) and (ii) of our record are met: the body states the sign stage, the serial loss and the 2.0 * reach filter, and the parallel test reads points_in_domain and a swarm's count.

The walk hunk (_simplex_locator.py, cross the most violated face that has a neighbour). The logic reads correctly: a contained row has no violated face and is not moved; a row leaves only when every violated face lacks a neighbour; the exit cell is then the last cell reached. Two consequences to measure in the probe:

  1. Low. Points outside the local mesh now walk further. A point on another rank, or outside the domain, used to leave through the first boundary or seam face it failed worst. It now slides along the boundary until only faces without a neighbour are violated. In parallel most query points are outside each rank's mesh, so this is the common case. Please report the step counts, or the timing of the 7/8-outside case in the body, before and after.
  2. Low. An outside point that runs out of steps has no exit cell. Sliding along a boundary is not monotone on a sheared mesh. Such a point gets exit_cell = -1, and the serial evaluation path tests only the exit cell at the face tolerance. A point within the face tolerance outside the boundary that used to be claimed through its exit cell could then be lost. Count, among points within the slab outside the boundary, those with exit_cell < 0.

Condition (iii), the count of contained points the walk fails to place, is reported as 0 on three meshes with a test asserting it; the parallel re-run is the other desk's. The fault-cut walk stays open as listed.

Underworld development team with AI support from Claude Code

@lmoresi

lmoresi commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

Code review, from the second review desk (session H3): READY at 3e49802. Run on a 96-thread Linux workstation (single system image; Intel Xeon Gold 6240R, AVX-512; MPICH) with a build of the head. H1's parallel review and W1's ownership review cover their own ground; this review is of the locator code and its claims.

What I read.

The barycentric test, the walk, and the lowest-in-star table are correct for straight-sided simplices. The choice is made from mesh-wide facts (isSimplex, degree == 1, no manifold), so every rank, an empty one included, takes the same path. Curved (degree 2) and non-simplex meshes keep the cell-wall test, unchanged.

Probes (scripts kept with the record):

  1. Far from the origin. ROUNDOFF is an absolute 1e-12 on the barycentric coordinates, and their rounding grows like machine epsilon times |x|/h. So I checked a unit simplex box (cellSize 0.05) offset to minCoords X0 = 0, 1e2, 1e4 and 1e6. Query points: every vertex, every edge midpoint, and 5,000 random points. A linear P1 field, serial.

    X0 lost by the walk unclaimed extrapolated max error, branch max error, development
    0 0 0 0 1.1e-13 —
    1e4 0 0 0 1.0e-10 5.7e-6 (random points)
    1e6 0 0 0 1.0e-6 6.7e-6, and 1 vertex extrapolated

    No point is lost or ping-pongs at any offset. The error that grows with X0 is the interpolation's own rounding, about ε·X0/h, and it is present on development too, where it is worse. Not a finding against this PR.

  2. The tie rule and the start cell (3-D tetrahedral box, cellSize 0.2). Every vertex and every edge midpoint, 1361 points, is located from three different start-cell choices.

    • With the points exactly on the entities, all 1361 get the same cell. The claim holds.
    • With the points moved about 1e-12 off their edges, 61 of 1361 get a different cell depending on the start. One cell reads a "zero" coordinate as 3.5e-12 and another as 1.1e-12, either side of ROUNDOFF, so the two cells disagree on which entity the point is on. Both cells contain the point, so the value is the same to round-off. And the start is the cell of the nearest control point, which depends only on the point, so a given call is reproducible.
    • Suggestion, not blocking: say in the module docstring that the rule is start-independent for points on an entity, and that within about ROUNDOFF of one the cell can depend on the start.
  3. The PR's tests:

    • test_1123_exact_locator_simplex, test_0761_point_locator and test_0511: 36 passed, 2 skipped, serial.
    • test_1123_exact_locator_parallel and test_0960_global_evaluate_agrees_on_failure_parallel: pass at np 2, 3 and 4.

Notes, not blocking.

  • _agreed_on_every_rank wraps evaluate_nd, which is itself collective for an expression with derivatives (its projection solve). So a raise inside it before that solve still hangs. The PR states this limit ("A raise inside evaluate_nd before its own collectives is not covered").
  • In serial evaluation, a point whose walk exhausts max_steps has no exit cell. It is not offered the face-tolerance test, and is extrapolated. No probe here produced one; the restarts from four centroids catch what the first walk loses.
  • _star_min is used briefly as a holder for rows and then popped. A local list would read more plainly.

Underworld development team with AI support from Claude Code

@lmoresi

lmoresi commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

#1175 at 3e49802: the walk probe again, and the integration desk's two Low items. From H1 (review and parallel test runs on a 96-thread Linux workstation (Intel Xeon Gold 6240R, AVX-512; MPICH)). The head's library Python is laid over the d77bab4 build; the walk fix is Python only.

1. The walk probe (method as in the 65eed15 post: 1e6 points contained by a local cell by construction, the same points on both builds).

mesh np 65eed15 3e49802 lost at 3e49802 but owned on development
#1123 shear 1 0 0 0
#1123 shear 2 2 2 0
#1123 shear 4 1 0 0
doubled shear 1 68 68 0
doubled shear 2 46 46 0
doubled shear 4 6 6 0
2-D anisotropic (20:1) 1, 2, 4 0 0 –

The updated tests at 3e49802: test_1123_exact_locator_simplex.py with the parallel file at np 1: 6 passed, 2 skipped. The parallel file at np 2: 2 passed, 1 skipped; at np 3 and 4: 3 passed on every rank.

2. Item b: an outside point whose walk ends with no exit cell (serial).

  • Points: outside the boundary, placed on each boundary face (40 per face) and moved outward by 1e-9 h to 2e-2 h, so across the face-tolerance slab.
  • Meshes: a 3-D box (38,960 points), an annulus (9,520) and Strongly sheared 3-D simplex meshes: the point locator's 50-centroid walk misses the containing cell and evaluate returns RBF values off by up to 0.17 #1123's sheared box (21,600).
  • No cell and no exit cell: 0 on all three meshes, at both heads. Every walk that leaves the mesh records the face it left through.
  • Against the full face-tolerance search (_get_closest_local_cells_internal), the serial evaluation path:
    • box: drops 1 point the full search claims;
    • annulus: drops 0;
    • sheared box: drops 3 (11 at 65eed15) and claims about 50 more.
  • The serial path tests only the exit cell, so a point in the slab of a neighbouring boundary face, but not of the exit cell's, is not claimed.

3. Item a: points outside the local mesh, before and after the fix. 3-D box, 7/8 of 1e6 points outside, best of 3:

locator evaluate global_evaluate
serial, 65eed15 7.61 s 5.04 s 9.53 s
serial, 3e49802 7.53 s 5.05 s 9.36 s
np 4, 65eed15 1.06 s 2.09 s 9.68 s
np 4, 3e49802 1.07 s 1.66 s 10.25 s

The machine was under load, so these carry about ±15 %. No cost from sliding along the boundary shows at this size. Step counts were not instrumented.

Underworld development team with AI support from Claude Code

@lmoresi

lmoresi commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

Correction to H1's two walk-probe posts on #1175: the "doubled shear" mesh is folded.

Underworld development team with AI support from Claude Code

claude and others added 3 commits November 14, 2026 13:27
…'s one start dependence in the locator's docstring (H3)

Underworld development team with AI support from Claude Code
…epend on the start (H3's review)

Underworld development team with AI support from Claude Code
@lmoresi
lmoresi merged commit 2bc779d into development Nov 14, 2026
10 checks passed
lmoresi pushed a commit that referenced this pull request Nov 16, 2026
…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
jcgraciosa pushed a commit to jcgraciosa/underworld3 that referenced this pull request Nov 17, 2026
…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 underworldcode#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,
underworldcode#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
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