2-D ribbon + removal go parallel; the fault lifecycle composes in both dimensions - #524
Conversation
…oth dimensions The lifecycle ruling's remaining instalments. _place_thin_volume_2d is rewritten in the collective form (rank-0 assembly + broadcast, mark by skin distance, gather, target carve with ring growth and orphan promotion, holes fill, one rebuild, cell+skin labels by join, collective gates incl. the validity battery) — serial is the same path at size 1, and the 2-D serial refusal is gone. remove_embedded gains its 2-D branch on the same skeleton (label-seeded ring carve, PLAIN background-scale fill); the face soup and the interface readers generalise (edges as the 2-D facets; the exclusion that stops a removal holding its own object against itself). The composition is now the tested contract in BOTH dimensions: zone -> FE-exact -> remove -> FE-exact -> place a line in the same region -> remove again, at np=1..4, with zero area drift — formalised as test_the_two_dimensional_lifecycle_composes (serial) and the two distributed lifecycle tests in ptest_0856 (2-D and 3-D, each stage held to the P2 quadratic oracle). Suites 0853-0856 and all four ptest files green at np=2 and 4. Underworld development team with AI support from Claude Code
|
Adversarial review (self, posted per project practice): What we attacked: the ribbon rewrite replaces a working serial path wholesale with the collective form — the risk is a silent behaviour change hiding behind passing tests. The guard is threefold: the serial suite (0855, 11 tests incl. kink quality and second-zone safety) runs the SAME code at size 1; the X-junction produces identical zone/skin counts (114/92) at np=1..4; and every stage of the composition is held to the quadratic-exactness oracle, which no chart, cone or SF disorder can pass. A real behaviour change, declared: the parallel-capable paths measure local h as min incident cell diameter (SF-reconciled) where the old serial ribbon used edge-based vertex h — cavity extents shift slightly. The suites are insensitive by design (counts not pinned, quality thresholded); anyone pinning cavity sizes downstream would notice, and nothing does. The exclusion readers' known blind spot: an edge carried by BOTH the removed label and another interface label is unlocked during a removal's carve. Documented at the definition; the other label's own count gate is what catches a genuine overlap, and the composition tests exercise exactly that adjacency (line placed where a zone was). Not done, stated: wall-touching 2-D line ends remain serial-only (collective end-settling unbuilt — refusal names it); the serial 2-D LINE path still runs its pre-battery gates rather than _validity_and_orientation_gates (the ribbon and removal paths run the battery at any size now); refill cell counts remain partition-sensitive and outside the contract. Underworld development team with AI support from Claude Code |
There was a problem hiding this comment.
Pull request overview
This PR completes the “gather-first + dimension-generic rebuild” lifecycle contract by extending embedded-surface operations to compose correctly in 2-D and 3-D, including 2-D removal and making 2-D thin-volume placement run through the same collective mechanism as the 3-D path. It also adds lifecycle composition tests that use a quadratic FE exactness oracle to validate correctness across add/remove sequences.
Changes:
- Add a 2-D serial lifecycle composition test that checks FE exactness and area conservation across zone→remove→line→remove.
- Add distributed (MPI) lifecycle tests for both 2-D and 3-D using a shared quadratic FE oracle.
- Extend
place_surface.pywith 2-Dremove_embeddedplus collective/gather-first updates to_place_thin_volume_2d, and generalize labelled-facet “soup” extraction for 2-D/3-D.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tests/test_0856_remove_embedded.py |
Adds a 2-D lifecycle composition test with FE exactness + area conservation checks. |
tests/parallel/ptest_0856_remove_embedded_parallel.py |
Adds distributed lifecycle tests (2-D + 3-D) using a quadratic FE oracle reduced across ranks. |
src/underworld3/utilities/place_surface.py |
Implements 2-D removal and updates 2-D thin-volume placement to the collective gather-first + rebuild approach; generalizes labelled facet soup extraction. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| locked = reconnect._interface_edges(dm).copy() | ||
| pStart, _pEnd = dm.getChart() | ||
| eS, eE = dm.getDepthStratum(1) | ||
| for name, value in exclude: | ||
| if not dm.hasLabel(name): | ||
| continue | ||
| lab = dm.getLabel(name) | ||
| if lab.getStratumSize(int(value)) == 0: | ||
| continue | ||
| for p in lab.getStratumIS(int(value)).getIndices(): | ||
| p = int(p) | ||
| if eS <= p < eE: | ||
| locked[p - pStart] = False | ||
| return locked |
Final instalments of the lifecycle ruling: every placement-family operation — line, sheet, ribbon, thin volume, removal — now runs serial AND parallel through one gather-first mechanism and one dimension-generic rebuild, with no redistribution anywhere.
_place_thin_volume_2din collective form: rank-0 assembly + broadcast, mark by skin distance, gather, target-rank carve (ring growth, orphan promotion), holes fill, the one rebuild, cell+skin labels by join, collective gates including the validity battery. Serial is the same path at size 1; the last 2-D serial refusal in the volume family is gone.Suites 0853–0856 and all four parallel test files green at np=2 and 4. With this, the fat-fault session's mesh-machinery ledger is clean: add a stack, delete a stack, on the running distributed mesh, in either dimension — the remaining scoped exception (wall-touching 2-D line ends, serial-only) is refused with its reason and recorded.
Underworld development team with AI support from Claude Code