Skip to content

mesh contour test: the macOS field as its own case, portable draws, a wider loopy sweep - #891

Merged
transfix merged 1 commit into
masterfrom
fix/mesh-contour-tree-macos
Oct 30, 2026
Merged

transfix merged 1 commit into
masterfrom
fix/mesh-contour-tree-macos

Conversation

@transfix

Copy link
Copy Markdown
Owner

Follow-up to #886, which fixed MeshContourTree.RandomFieldsOnLoopyDomainsStillGiveTrees on macOS. Test-only.

The bug #886 fixed

The case is "annulus seed 21" on #881's package-macos / libcvc-release-grpc (job 123810230951): compute_contour_tree (mesh): internal error: a leaf with no split neighbour.

  • On a domain that isn't simply connected, the merge runs out of leaves. It then forces the highest vertex left out as an upper leaf, and its split-tree kids move up to its split parent.
  • When that vertex also tops its split tree, it has no parent. Each kid was left a root, so the split tree became a forest, and a later lower leaf threw. mesh contour tree: a forced leaf that tops its split tree keeps one split tree #886 hangs the other kids from the highest kid.
  • Only macOS hit it because the test drew with std::uniform_int_distribution, whose mapping each standard library picks for itself. libc++ (macOS) takes the low w bits of each mt19937 draw and redraws while the value is out of range. libstdc++ and MSVC map differently, so they drew other fields.

This PR

  • AForcedLeafThatTopsItsSplitTreeStillGivesATree: that field, all 63 values, written out. It stays tested whatever the sweep draws.
  • draw(): mesh contour tree: a forced leaf that tops its split tree keeps one split tree #886's by-hand libc++ mapping as one helper. The grid comparison's plateau fields (check_against_grid, levels 3 and 4) still used std::uniform_int_distribution, so each platform compared different grids. They use draw() now too.
  • A wider sweep: it adds a 12x4 torus and annulus and runs 200 seeds, up from 40. 9x7 alone is a weak net for this case. 55 ms for the whole test on MSVC Release.

Testing (Windows, MSVC 19.44 Release with asserts on, cvcpkg deps)

… wider loopy sweep

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.
@transfix
transfix merged commit 502da16 into master Oct 30, 2026
26 checks passed
@transfix
transfix deleted the fix/mesh-contour-tree-macos branch October 30, 2026 23:02
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.

1 participant