Skip to content

test(LBIE): AdapterKeepsLbiesHexahedronCorners expects #808's fitted sphere - #830

Merged
transfix merged 1 commit into
masterfrom
fix/lbie-adapter-jacobian
Oct 27, 2026
Merged

transfix merged 1 commit into
masterfrom
fix/lbie-adapter-jacobian

Conversation

@transfix

Copy link
Copy Markdown
Owner

Summary

Master is red on every platform since #808 merged: LbieMesherTest.AdapterKeepsLbiesHexahedronCorners fails with a mean scaled Jacobian of 0.49893, against a limit of 0.5. The value is identical on Linux, macOS and Windows; see master's package-linux / libcvc-debug and package-macos / libcvc-debug jobs for a87215b. Every PR cut from master inherits it, for example #825.

How it happened: #802 added this test, and #808 merged 13 minutes later from a branch that never contained #802 (their merge base is 3cb8c4c). Neither PR's CI ran the two together.

Cause: #808 fitted the mesh to the sphere; the threshold assumed the old cube

The test's sphere (17³ samples over [−1,1]³, voxels 0.125 across) meshes as 27 hexahedra, a 3×3×3 block with 64 vertices, both before and after #808. Measured with a temporary diagnostic (not committed):

LBIE sources Outer 56 vertices, distance from centre (radius 0.5) Scaled Jacobian, mean / worst
#802 (4393a8a) 0.31–0.50, mean 0.386: a cube inside the sphere 0.9996 / 0.999
#808 (master) 0.491–0.513, mean 0.500: on the sphere 0.499 / 0.218, none inverted
master, read through the pre-#802 twisted adapter — −0.78, all 27 inverted

So nothing is broken: #808's grid-unit fix reached hexahedra too, and bending the block onto the sphere turns its edge and corner hexahedra into wedges. The test exists to catch twisted (inverted) hexahedra, and the twisted layout still scores −0.78.

Change

Test only: src/cvc/tests/lbie_mesher_test.cpp.

  • Every hexahedron must be right-handed. It used to allow a tenth to be inverted; today's mesh has none.
  • The mean scaled Jacobian must be above 0.4, instead of 0.5.
  • The comment records the measured numbers.

Verification

  • lbie_mesher_test, the whole binary, passes all 58 tests: Windows, MSVC 14.44 Release, cvcpkg prefix.
  • clang-format 18 is clean on the changed lines.

…sphere

Master fails LbieMesherTest.AdapterKeepsLbiesHexahedronCorners on every
platform: mean scaled Jacobian 0.49893 < 0.5. #802 added the test and #808
merged 13 minutes later from a branch that never had it, so neither PR's CI
ran the two together.

The mesh is fine; the threshold was set on the wrong mesh. The test's
sphere (17^3 samples over [-1,1]^3, voxels 0.125 across) meshes as 27
hexahedra, a 3x3x3 block with 64 vertices, before and after #808. Measured:

- #802's LBIE: the block was a cube inside the sphere. Its 56 outer
  vertices were 0.31-0.50 from the centre (radius 0.5), every hexahedron
  ~1.0, mean 0.9996.
- #808's LBIE: the 56 outer vertices are on the sphere (0.491-0.513). The
  edge and corner hexahedra become wedges: mean 0.499, worst 0.218, none
  inverted.
- The pre-#802 twisted adapter on today's mesh: every hexahedron inside out,
  mean -0.78.

So the check that matters is that no hexahedron is inverted. The test now
requires every hexahedron to be right-handed (it allowed a tenth to be
inverted) and a mean above 0.4 instead of 0.5. The twisted layout still
fails both by far.
@transfix
transfix enabled auto-merge (squash) October 27, 2026 00:13
@transfix
transfix merged commit 2d5a0a9 into master Oct 27, 2026
23 of 24 checks passed
@transfix
transfix deleted the fix/lbie-adapter-jacobian branch October 29, 2026 20:53
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