Repository navigation
mesh contour tree: a forced leaf that tops its split tree keeps one split tree - #886
Merged
Merged
Conversation
…plit tree
On a domain that is not simply connected, the merge runs out of leaves
and forces the highest remaining vertex out as an upper leaf, moving its
split-tree kids up to its own split parent. When that vertex also tops
its split tree there is no parent: each kid became a root, the split
tree a forest, and a later lower leaf found no split neighbour
("internal error: a leaf with no split neighbour"). The other kids now
hang from the highest kid, so one tree remains.
MeshContourTree.RandomFieldsOnLoopyDomainsStillGiveTrees failed this
way on macOS only (annulus seed 21): libc++'s uniform_int_distribution
maps the generator's draws differently from libstdc++'s and MSVC's. The
test now draws with libc++'s mapping by hand, so every platform tests
the same fields.
transfix
added a commit
that referenced
this pull request
Oct 30, 2026
… wider loopy sweep (#891) Follow-up to #886, which fixed the merge for a forced leaf that tops its split tree. The tests now hold that case on every platform, whatever the sweep draws: - AForcedLeafThatTopsItsSplitTreeStillGivesATree: the 9x7 annulus field that broke the merge on macOS (seed 21 of the sweep, as libc++ draws it), written out. - draw(): #886's by-hand libc++ mapping as one helper. The grid comparison's plateau fields use it too; they still drew with std::uniform_int_distribution, so each standard library tested other grids there. - The loopy sweep adds a 12x4 torus and annulus and runs 200 seeds. With the case unhandled, about 1 field in 10 broke the 12x4 annulus and 1 in 300 the 9x7 one, so 40 seeds of 9x7 caught it on one platform by luck.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #879,
MeshContourTree.RandomFieldsOnLoopyDomainsStillGiveTreesfails on every macOS recipe lane:compute_contour_tree (mesh): internal error: a leaf with no split neighbouron the annulus with seed 21. That reds the macOS jobs of every open PR (#862, #865, #868, #877, #882, #884), because PR runs build the merge with master.Cause
On a domain that isn't simply connected, the merge runs out of leaves. It then forces the highest remaining vertex out as an upper leaf and moves its split-tree kids up to that vertex's split parent (
remove_upperwithkids). When the forced vertex also tops its split tree,sup[x]iskNone. Each kid was then left a root, which made the split tree a forest. A later lower leaf then found no split neighbour, andremove_lowerthrew.Fix
In that case the other kids now hang from the highest kid, which
kidslists last because it's built in sweep order. That kid'ssdn_n/sdn_xtake them on, and one split tree remains, as cutting the loop at the forced vertex allows. The other paths are unchanged.Why only macOS
The test drew values with
std::uniform_int_distribution, whose mapping from the generator is up to each standard library. libc++ takes the low bits of a draw and redraws while they're out of range; libstdc++ and MSVC do something else. So only macOS ever tested the field that breaks the merge. The test now applies libc++'s mapping by hand, so every platform tests the same fields: Windows reproduced the macOS failure exactly with it.Testing
Local build on Windows (MSVC 19.44, against the cvcpkg deps prefix), with asserts on:
mesh_contour_test13/13,contour_tree_test40/40,tf_overlays_test18/18.