Repository navigation
P0c: permissive libraries as cvcpkg packages (Qhull, Clipper2, CDT, Shewchuk's predicates), smoke tests, CGAL A/B rows - #1112
Merged
Conversation
The VolumeRover ports replace CGAL's GPL packages with permissive libraries (docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md 1.2). The two header-only ones are vendored here, beside nanoflann, with no mutable process-wide state (1.3): - CDT 2.0.1 (MPL-2.0; its predicates BSD-3, its nth_element Apache-2.0 WITH LLVM-exception), from the tag's tarball. Two files changed: the never-written `static double log2_constant` is const, and Lenthe's predicates.h initialises its error bounds from constant expressions (same values), so no object file carries writable copies or guard variables for them. - Shewchuk's predicates (public domain), generated into shewchuk/predicates.hpp by shewchuk/gen_predicates.py: exactinit()'s globals become constexpr constants (no init call, nothing mutable), only the four adaptive predicates are kept, FP contraction is off around them, and insphereexact's ~200 KB of arrays move to the heap (a wasm thread's stack is 64 KB by default). Each has its notice in THIRD_PARTY_NOTICES.md, which also gains Qhull and Clipper2.
… T16 rows (P0c) - CVC_WITH_QHULL / CVC_WITH_CLIPPER2 (ON, OFF when the package is missing): cvc links reentrant Qhull (shared libqhull_r, or libqhullstatic_r for a static or wasm cvc) and Clipper2 PRIVATE; a static cvc lists both in CVC_PRIVATE_LINK_PACKAGES, so cvcConfig.cmake finds them. cvc_permissive_geometry (build tree only) adds third_party/ (CDT, Shewchuk) to the include path. - tests/permissive_libs_test.cpp, a plain main() under ctest and, with CVC_BUILD_PERMISSIVE_SMOKE, as wasm-mt under node: Qhull `d Qbb Qt Qz` gives the cube-and-centre's 12 tetrahedra and two triangulations on two threads equal the sequential ones; Clipper2's union, intersection, difference, offsets and Minkowski sum give the expected areas; CDT's constrained square gives 4 triangles; the predicates are exact on near-degenerate grids and degenerate integer points; and the predicates check Qhull's and CDT's empty circumspheres. - tools/cgal_ab: the first T16 rows (cgal_ab_permissive.cpp, Qhull alone in cgal_ab_qhull.cpp): Shewchuk vs CGAL's exact predicates, Qhull vs Delaunay_triangulation_3, CDT vs Constrained_Delaunay_triangulation_2, Clipper2 vs Polygon_set_2 Booleans, straight-skeleton offsets and minkowski_sum_2, exact where they must agree and by tolerance where they differ by design, both sides timed; plus the P1 spike, Qhull by incremental insertion (SPIKE lines).
…libcvc recipe needs qhull (P0c) - permissive-wasm, "permissive geometry (wasm-mt, node)": builds libcvc for wasm-mt with Qhull's static library and Clipper2 from the catalog, then runs permissive_libs_test under node. - cgal-ab installs qhull and clipper2 beside CGAL for the new rows. - The libcvc recipe gains qhull as a runtime dependency on the native platforms it is published for, so the native lanes run permissive_libs_test's Qhull checks. Clipper2 and qhull's wasm-mt build join once they are published to cvcpkg.org.
…hey are published cgal-ab and permissive-wasm stopped at "no bundles found in catalog": qhull's wasm-mt row and the clipper2 recipe (cy-pca/cvcpkg#578, squash 15d72750) are merged but not yet published to cvcpkg.org. Both jobs now fetch that commit's recipes (sparse, pinned) and let cvcpkg build those two from them when the catalog has no bundle (--fallback-to-source; nothing is published). Once the bundles are on the catalog they install prebuilt and the fallback never runs.
Joe, 2026-11-09: "dont vendor third party libraries in the libcvc repo!! make cvcpkg packages for them". The vendored src/cvc/third_party/CDT and shewchuk/ are gone; both are now cvcpkg packages (cy-pca/cvcpkg#597, open), as Qhull and Clipper2 already were (cy-pca/cvcpkg#578): - cdt 2.0.1 (CDT::CDT, #include <CDT/CDT.h>), with the same no-mutable-statics changes as a recipe patch; - shewchuk-predicates (Shewchuk::predicates, #include <shewchuk/predicates.hpp>), the same generated header, its generator in cvcpkg's third-party/shewchuk-predicates. CVC_WITH_CDT and CVC_WITH_SHEWCHUK find them like Qhull and Clipper2 (OFF when missing). cvc links the two header-only ones $<BUILD_INTERFACE:...>, as it links PEGTL, so they never reach its exports. permissive_libs_test runs each section whose package is present and prints SKIP otherwise. cgal_ab_test needs all four. CI: cgal-ab and permissive-wasm fetch #597's head (which includes #578) and let cvcpkg build whatever the catalog lacks from those recipes (--fallback-to-source), until the packages are published. libcvc's recipe gains them once published (install-deps is all-or-nothing). The roadmap's rule (1.2), 1.8, the P0c row and 9 item 1 now say: cvcpkg packages, never vendored. #597 also adds nanoflann 2.0.1, so the vendored nanoflann (#1080) can go once it is published; THIRD_PARTY_NOTICES and the third_party README say so. Checked locally against the packages as #597's scripts install them (Windows, MSVC 19.44): all four found, permissive_libs_test 19/19, cgal_ab_test ok, 0 failures.
…, not install's fallback permissive-wasm failed at 02770c2: `cvcpkg install qhull --platform wasm-mt --fallback-to-source` looks for qhull's build tools (cmake) for wasm-mt and finds none. The job now installs each geometry package from the catalog and, when there is no bundle, runs `cvcpkg build --platform wasm-mt --host-platform linux` on the pinned recipe, which takes the build tools for the host. clipper2's wasm-mt bundle is already published (populate-server run 42739931761); qhull's wasm rows failed packing there, fixed in cy-pca/cvcpkg#597 (7fe32a12), which both jobs now pin. cgal-ab's native fallback (clipper2 built from source) passed at 02770c2 and is unchanged.
Joe approved publishing them, and cy-pca/cvcpkg#597 is merged (830c55ed). populate-server runs 42759427894, 42759468516 and 42754861238 put qhull (wasm-mt), clipper2, cdt, shewchuk-predicates and nanoflann on cvcpkg.org: wasm, wasm-mt, linux, freebsd, netbsd, openbsd and windows. - cgal-ab and permissive-wasm install all four geometry packages from the catalog (--no-fallback-to-source), with no recipe fetch and no source build. - libcvc's recipe gains clipper2, cdt and shewchuk-predicates as build deps on the platforms they are published for. The header-only two are BUILD_INTERFACE links, and clipper2 is absorbed by a shared cvc, so none is baked into required_deps. The native lanes now run every section of permissive_libs_test, except on macOS, which has no bundles yet, so there those options turn OFF. - Not yet: qhull's wasm-mt row in the recipe (libcvc's wasm publish doesn't build with it), and nanoflann in place of the vendored copy (it needs a macOS bundle first).
…p0c-permissive-libs-f5c610 # Conflicts: # .github/workflows/ci.yml
…p0c-permissive-libs-f5c610 # Conflicts: # .github/workflows/ci.yml # src/cvc/CMakeLists.txt
The writable-data scan failed on package-linux / libcvc-release-grpc for the merge with master: commits that landed after the scan (#1107) added objects it did not list. None come from P0c. The new list is the one the scan itself emitted for that build. - algo/distance_transform.cpp edt_scratch()::s (tls + guard): the per-thread EDT scratch moved here from nav/grid_nav.cpp, so its two grid_nav lines go. - nav/grid_nav.cpp sdf_scratch()::s (tls + guard): a per-thread scratch buffer, the same pattern as astar_impl's S already listed. - ariadne/script_engine.cpp SlicedCall::SlicedCall()::body and locked_call()::body (bss + guard): each is a parsed constant AST built once and only read afterwards.
…ctory
package-linux / libcvc-release failed on
WasmEngineTest.KeyPointerAndSignalHooksGetTheirEvents: its load read an
empty guest.wat ("expected at least one module field"), at a different
line on each retry. ctest runs every case as its own process, several at
once, and all of them used /tmp/ariadne_wasm_test, where each SetUp
truncates and rewrites guest.wat. One case could load the file just
after another truncated it. #1129's new hook tests made the overlap
likelier.
The directory now carries the process id, the same way
ariadne_media_test and the hdf5 tests already name theirs.
package-macos / libcvc-debug failed ScriptEngineTest.AKeyHookTakesEveryKeyInOrder (finished 4, not 3) and AFailedEventLetsTheNextOneGo (3 outcomes, not 2), the same on every retry. ScriptLane::take_queue moved on_done out of its copy of the hook's options into the QueueDelivery, then passed the options on to start(). libc++ moves a std::function whose callable sits in its small buffer by copying it, so the moved-from on_done still held the test's lambda. The activation then called it once more when its process ended, on top of the one call per event. libstdc++ and MSVC leave a moved-from std::function empty, so Linux and Windows passed. std::exchange leaves the options without it on every standard library.
…p0c-permissive-libs-f5c610 # Conflicts: # src/cvc/ariadne/script_engine.cpp # tools/singleton_scan/allowlist.txt
transfix
enabled auto-merge (squash)
November 10, 2026 20:09
transfix
added a commit
that referenced
this pull request
Nov 10, 2026
) One conflict, in src/cvc/tests/CMakeLists.txt, where both sides added a test after physics_replay_test: master's permissive_libs_test and this branch's threaded runs of the two Ariadne suites. Both are kept; ctest registers permissive_libs_test, ariadne_runtime_test_threads_auto and ariadne_host_test_threads_auto. Neither PR adds a static or thread_local to a scanned target's sources, so the writable-data allowlist is unchanged. Rebuilt cvc; ocean_shore_test 15 passes, permissive_libs_test runs (its libraries are absent from this build, so it skips), and ariadne_runtime_test (291) and ariadne_host_test (48) pass with CVC_EXEC_THREADS=auto.
This was referenced Nov 10, 2026
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.
Phase P0c of
docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md("Permissive libraries"). This PR brings in the permissive libraries that replace CGAL's GPL packages (§1.2), with no mutable process-wide state (§1.3) and with wasm-mt builds (§1.8). It adds each library's smoke test, natively and under node, and the firstcgal_ab_testrows (T16). It is non-breaking.No vendoring (Joe, 2026-11-09: "dont vendor third party libraries in the libcvc repo!! make cvcpkg packages for them"). All four libraries are cvcpkg packages, and §1.2 and §9 item 1 of the roadmap now say so:
qhullandclipper2, from recipes: qhull for wasm/wasm-mt; new clipper2 (BSL-1.0), every platform cy-pca/cvcpkg#578 (merged);cdtandshewchuk-predicates, from recipes: cdt 2.0.1, shewchuk-predicates and nanoflann 2.0.1 (header-only, every platform) cy-pca/cvcpkg#597 (merged). That PR also addsnanoflann2.0.1, so libcvc's existing vendored copy can go once it has a macOS bundle.What lands
find_package(... CONFIG), as with Jolt):CVC_WITH_QHULL: reentrantlibqhull_r, shared (orlibqhullstatic_rfor a static or wasm cvc);CVC_WITH_CLIPPER2;CVC_WITH_CDT:CDT::CDT,#include <CDT/CDT.h>;CVC_WITH_SHEWCHUK:Shewchuk::predicates,#include <shewchuk/predicates.hpp>.CVC_PRIVATE_LINK_PACKAGES, whichcvcConfig.cmakeuses to find them). The header-only two link$<BUILD_INTERFACE:...>, as PEGTL does, so nothing reaches cvc's exports.cvc_permissive_geometryis a build-tree-only interface target carrying all four.qhullon the native platforms where it is published. The other packages join once published, becauseinstall-depsis all-or-nothing.permissive_libs_test: a plainmain(), run by ctest natively and, with-DCVC_BUILD_PERMISSIVE_SMOKE=ON, as wasm-mt under node in the newpermissive-wasmjob. Each section runs when its package is present and prints SKIP otherwise.d Qbb Qt Qzgives the cube-and-centre's 12 tetrahedra, none flat, and two triangulations on two threads equal the sequential ones tetrahedron for tetrahedron (13,040 and 19,597).tools/cgal_ab, the T16 rows (cgal_ab_permissive.cpp; Qhull alone incgal_ab_qhull.cpp). Results are compared exactly where the sides must agree and by tolerance where they differ by design, and both sides are timed. Details are intools/cgal_ab/README.md.Delaunay_triangulation_3, and CDT againstConstrained_Delaunay_triangulation_2: identical in general position.Polygon_set_2, straight-skeleton offsets andminkowski_sum_2: equal areas, exactly on the grid and within rounding otherwise.Packages
All four are published (Joe's "Yes, merge + publish"; cy-pca/cvcpkg#597 merged as 830c55ed; populate-server runs 42754861238, 42759427894 and 42759468516). They cover wasm, wasm-mt, linux, freebsd, netbsd, openbsd and windows; qhull was already published natively.
cgal-abandpermissive-wasminstall them from the catalog.qhull(runtime) andclipper2,cdtandshewchuk-predicates(build-only) on those platforms.Left for a follow-up:
nanoflannpackage, once it has a macOS bundle.Verified locally (Windows 11, MSVC 19.44, CGAL 6.0.1; emsdk 5.0.7, node 22)
All against locally installed packages built by #597's recipe scripts:
permissive_libs_testall checks, also under ctest;cgal_ab_testok: 0 failure(s);permissive_libs_testunder node.On MSVC objects (
llvm-nmon COFF):.data(Qhull'smergetypes; Clipper2'sconstsentinels and error-message pointers), candidates for P0a's allowlist.The P1 spike: Qhull by incremental insertion
qhull_incremental(incgal_ab_qhull.cpp) works like this:d Qbb Qz, led by the point farthest from the origin, because Qz's point at infinity sits at 1.1x the seed's highest lifted point.qh_setdelaunayandqh_addpoint.qh_triangulate, asQtdoes."Warm start" locates each point with
qh_findbestfrom the newest facet instead ofqh_findbestfacet's walk from the head of the facet list. The results are printed asSPIKElines (local Windows numbers).So incremental insertion reproduces the batch triangulation exactly in general position, at about the batch cost up to 20k points with the warm start. The documented
qh_findbestfacetwalk is not usable at scale.Findings for P1 and P3a
Qtleaves flat tetrahedra on exactly cospherical sets: 1,049 of 5,423 on a 10^3 lattice.Q0 Qt Qzhandles the lattice but fails on the sphere;QJ Qzhandles the sphere but leaves flats on the lattice.INFO). They agree before the first event and on convex polygons.