Repository navigation
P3b part 1: the VolumeRover ContourTiler on cvc::planar, its tests and the legacy goldens - #1332
Merged
Merged
Conversation
…f0fbd7) The legacy library (transfix/volrover src/ContourTiler and inc/ContourTiler at the commit tools/volrover-goldens/volrover.sha pins), copied without changes so the next commit's diff is the port: the library's sources and the headers they include, without its tools (ecs, smfconvert, decimate, sandbox, ContourNear), its command line (main.cpp, cl_options.cpp), its readers (reader_ser.h, reader_csv.h, xml/), dev.cpp, minkowski.cpp (nothing calls it), CGAL_hash.cpp and tiler_output.cpp (debug output). Not built.
…int hashes, grid convexity
…18 settles on it clang-format re-wraps a comment holding tabs differently on every pass, so the changed-lines check never passed on those lines. Also drops the doubled blank lines the include clean-up left.
…tiler-core # Conflicts: # .github/workflows/ci.yml
…ts, no FMA) The legacy's choices follow its containers' iteration order and std::sort's order of ties. The branch parity case failed on wasm32 (other untiled regions, other topology) and on macOS arm64 (other contour triangles). - Hashes: Boost 1.86's 64-bit hash_value(double) and hash_combine, computed in 64 bits everywhere. Where size_t is 32 bits they are folded to lo32 + hi32, which is what Boost.Unordered's 64-bit bucket placement reduces a hash to, so the buckets and iteration order are the 64-bit ones. On 64-bit platforms the values are boost's own, unchanged. - The four std::sort calls whose ties matter (the OTV candidates by distance among them) are stable_sort, so ties keep their input order on every standard library. MSVC already gave that order: Windows still matches the goldens. - The tiler's sources compile with -ffp-contract=off, as nav, lsys and world. Checked: native MSVC tiler_test 20/20 and tiler_legacy_test 58/58; wasm-mt under node tiler_test 20/20, with the committed series embedded (the CI failure reproduced first, the same numbers).
…und) trim() calls find_last_adj(end, c.end(), p) once its cuts reach the polyline's end. The legacy then formed begin + 1 past the end and read *end (asan-ubsan: heap-buffer-overflow in TilerLegacy_intersection.intersection_poly). An empty range now returns end, which ends trim()'s loop as the legacy meant to.
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.
P3b of the VolumeRover library ports (
docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md§3, §7): the legacy ContourTiler, vendored intosrc/cvc/geometry/tiler/and ported ontocvc::planar, with no CGAL and no process-wide state. This PR is the core and its tests.cvc tile, pycvc and thetiler.tileintrinsic follow in a PR stacked on this one.What it adds
cvc::tile_contours(inc/cvc/geometry/tiler.h): a constcvc::contour_stackin, onecvc::geometryper component out (triangles, normals, colours), plus the warnings.tile_paramshas a param_table (tiler_params.h). Files are left to the CLI.tile_stepperandtile_contours_job(§1.9): phasessnapping,curating,augmenting,tiling,assembling. Work within a slice pair is sliced too: correspondences per contour pair, tiling regions and the OTV table per vertex, phase 1 per OTV pair and chord step, phase 2 per untiled region, intersection removal per component pair. The legacy functions became coroutines (the skeleton port'sstep_task); each is still callable as before. The slowest single unit on the test series is 2.4 ms.kernel.h,kernel.cpp) replacesCGAL::Cartesian<double>andPolygon_2. It keeps the names and members the vendored code calls. Predicates are Shewchuk's (exact; CGAL's Cartesian kernel rounded them).planar_bridge.h: a grid is fitted per call, and contour vertices, already snapped to the stack's grid, cross over exactly.wavefront_offset.triangulate()s were never called, so they are gone.tiler_context; warnings and errors becometile_result::warnings. Trace and debug output is compiled out, and an error that preceded a throw is now in the exception's message. The static counters and the debug file output (tiler_output.h) are gone too.Parity (§9 item 2, settled 2026-11-17)
tools/volrover-goldensnow builds the legacy ContourTiler at the pinned sha and runs it on three committed Reconstruct series.tiler_test's T1 compares:tube(tiled between contour vertices only)branch(caps, a branch, an annulus)touching(curation and intersection removal)Findings, also in the roadmap's §3:
Point_2isCGAL::Point_2, hashed by x and y only. The port's kernel hashes exactly as CGAL 6 does. With an x-y-z hash, the untiled fill lost its interpolated heights.fix_simple's 10-decimal rounding of curated contours stays: it gives an untouched contour back its own vertices after dilate and erode.Callback::untiled_regionreturns no value. Clang's code aborts there on every untiled region, so the goldens build patches it.tiler.hnow documents.std::sort's order of ties. The first CI run failed the branch case on wasm32 (other untiled regions) and on macOS arm64 (other contour triangles). The kernel now hashes with Boost's 64-bit arithmetic everywhere. Wheresize_tis 32 bits, each hash is folded as Boost.Unordered's 64-bit bucket placement folds one, so wasm32 gets the 64-bit buckets and order. Ties now sort stably (MSVC already kept input order, so Windows still matches), and the tiler compiles with-ffp-contract=off.Tests
tiler_test, 20 tests:tiler_legacy_test: the legacy CppUnitLite2 tests on gtest, 58 tests. The file header lists each legacy test and why some can't run: they read atest_data/that volrover never committed, or call a harness the legacy itself had commented out.CVC_PORT_TESTS) and are added to the sanitizer lanes'SAN_CXX_TESTS(ci.yml, a one-line change).Checked locally:
tiler_test20/20 andtiler_legacy_test58/58.tiler_legacy_test58/58 andtiler_test20/20. The series and goldens are embedded, because NODERAWFS can't read the cwd on Windows. That build reproduced CI's branch failure before the fix.make_goldens.py --libs tiler --checkpasses on Windows.Not checked locally: Linux GCC and macOS builds (macOS arm64 is where the sort-tie and FMA changes matter), the sanitizer lanes, the singleton scan, and the goldens check on Linux. CI runs all of these.