Benchmark suite: PointCloudBVH vs picoflann/nanoflann, TriMeshSDF vs fcpw (#109)#112
Draft
rmrsk wants to merge 3 commits into
Draft
Benchmark suite: PointCloudBVH vs picoflann/nanoflann, TriMeshSDF vs fcpw (#109)#112rmrsk wants to merge 3 commits into
rmrsk wants to merge 3 commits into
Conversation
…n, fcpw Toward a benchmark suite (issue #109), gather all submodules under a single Submodules/ directory: - Move common-3d-test-models -> Submodules/common-3d-test-models, updating every relative mesh path in the Examples (MeshSDF, CSGUnion) and Integrations (AMReX MeshSDF/PaintEB) main.cpp defaults, Examples/CMakeLists.txt, and the docs (ObtainingEBGeometry/ExampleMeshSDF/ExampleCSGUnion.rst, READMEs) + the REUSE.toml note. URLs and the submodule's own name are left untouched. Verified MeshSDF and CSGUnion still load the mesh at the new path. - Add the benchmark comparison libraries as submodules: Submodules/nanoflann, Submodules/picoflann, Submodules/fcpw (all shallow). fcpw's Eigen dependency is its own nested submodule (deps/eigen). reuse lint compliant (submodule contents carry their own licensing). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HS5LFQihKoMrE6nbPaQW9R
…F vs fcpw Per issue #109, add a benchmark suite comparing EBGeometry against other geometry-query libraries (pinned as submodules under Submodules/). Illustrative and not CI-tested, like Integrations/. - Benchmark/NearestNeighbor: all-nearest-neighbor over a 500k point cloud -- PointCloudBVH vs picoflann vs nanoflann. Flann queries iterated in Hilbert order for a fair (warm-cache) comparison; the one-time sort they need is reported separately (EBGeometry reuses its build order for free). PointCloudBVH ~0.29 us/pt, nanoflann ~0.25, picoflann ~0.47; folding the sort in, PointCloudBVH wins the end-to-end job. - Benchmark/MeshSDF: closest-point on a triangle mesh (armadillo, ~100k tris, float) -- TriMeshSDF vs fcpw, the task both are built for. Mesh parsed once; each builds its own BVH over the same triangles and answers the same queries; distances cross-checked (0 mismatches). TriMeshSDF ~2.6 us/query vs fcpw ~7.5 -- with the caveat, documented, that fcpw runs its scalar Eigen fallback here (Enoki off) while TriMeshSDF is SIMD, so fcpw's vectorized path would narrow the query gap. Adds a Benchmark.rst docs page (wired into the toctree) and a REUSE.toml block for the benchmark build files/READMEs (main.cpp carry inline SPDX). Both benchmarks build via their GNUmakefiles against the Submodules/ deps. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HS5LFQihKoMrE6nbPaQW9R
… to the comparison - fcpw is now built with its Enoki CPU vectorization (FCPW_USE_ENOKI, vectorized MBVH) instead of the scalar Eigen fallback -- a like-for-like float/SIMD comparison with TriMeshSDF. Enoki's headers are vendored inside the fcpw submodule, so no extra fetch is needed; FCPW_SIMD_WIDTH is a GNUmakefile variable (default 8 = AVX2; set 4 for SSE, 16 for AVX-512). - Add TriangleMeshDistance (https://github.com/InteractiveComputerGraphics/TriangleMeshDistance) as a third contender, pinned as a submodule under Submodules/. It is a header-only, double-precision, scalar signed-distance library -- a widely-used reference point, noted as not a same-precision comparison. Its distances are cross-checked against TriMeshSDF alongside fcpw's (0 mismatches). Representative (armadillo ~100k triangles, 100k queries, one machine): TriMeshSDF build ~63 ms query ~2.6 us fcpw (Enoki) build ~46 ms query ~3.5 us (was ~7.5 us scalar) TriangleMeshDistance build ~115 ms query ~10.5 us (double, scalar) Updates the Benchmark README and Benchmark.rst accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HS5LFQihKoMrE6nbPaQW9R
Open
5 tasks
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.
Summary
Adds a reproducible
Benchmark/suite comparing EBGeometry against other open-source geometry-querylibraries, and consolidates all git submodules under a single
Submodules/directory.Closes #109. Supersedes #110 (auto-closed when its base branch
particle_soa_pr3was merged anddeleted); this branch has been rebased onto
mainand carries the same two commits.Background
Issue #109 proposed a reproducible benchmark suite comparing EBGeometry against other open-source
geometry-query libraries, and consolidating git submodules under a single
Submodules/directory.This PR implements that. It builds on
PointCloudBVHandTriMeshSDF, both now merged tomain(#106, #108).
Solution
Submodule consolidation. All git submodules now live under
Submodules/:common-3d-test-models→Submodules/common-3d-test-models, rewiring every relative meshpath (Examples MeshSDF/CSGUnion, Integrations AMReX MeshSDF/PaintEB,
Examples/CMakeLists.txt, thedocs, and the
REUSE.tomlnote). URLs and the submodule's own name are untouched; verified MeshSDFand CSGUnion still load the mesh at the new path.
Submodules/nanoflann,Submodules/picoflann,Submodules/fcpw(fcpw's Eigen dependency is its own nested submodule).Benchmark/suite (illustrative, not CI-tested, likeIntegrations/):Benchmark/NearestNeighbor— all-nearest-neighbor over a 500k unit-cube point cloud (double):PointCloudBVHvs picoflann vs nanoflann. The KD-tree queries iterate in Hilbert order so theirnode cache is as warm as
PointCloudBVH's leaf-order batch (natural order is ~2× slower — unfair);the one-time spatial sort they need for that order is reported separately, since
PointCloudBVHreuses the ordering its build already produced for free. Representative:
PointCloudBVH~0.30,nanoflann ~0.24, picoflann ~0.47 µs/pt; folding the sort into the KD-trees,
PointCloudBVHwins theend-to-end job and builds ~1.5× faster than nanoflann.
Benchmark/MeshSDF— closest-point on a triangle mesh (armadillo, ~100k triangles):TriMeshSDFvs fcpw vsTriangleMeshDistance, the task all three are built for. The mesh is parsedonce; each library builds its own structure over the same triangles and answers the same queries,
with distances cross-checked (0 mismatches). fcpw is built with its Enoki CPU vectorization
(vectorized MBVH) for a like-for-like float/SIMD comparison;
TriangleMeshDistanceis header-only,double-precision and scalar (a reference point, not a same-precision comparison). Representative:
TriMeshSDF~2.6, fcpw (Enoki) ~3.5,TriangleMeshDistance~10.5 µs/query.Each benchmark has a
GNUmakefile, and every result is verified against a brute-force / independentbaseline. Adds a
Benchmark.rstdocs page (in the toctree),Benchmark/README.md, and aREUSE.tomlblock for the benchmark build files/READMEs (main.cpp carry inline SPDX).
Side-effects
FCPW_USE_ENOKI, vectorized MBVH) — a like-for-likefloat/SIMD comparison with
TriMeshSDF.FCPW_SIMD_WIDTHis aGNUmakefilevariable (default 8 =AVX2; 4 = SSE, 16 = AVX-512) to match the build machine's ISA.
TriangleMeshDistanceis double-precision and scalar (no SIMD) — its query runs in double, so itis not a same-precision comparison; it is included as a widely-used reference point, with distances
cross-checked against
TriMeshSDF.Benchmark/and comparison submodules are not part of CI (they pull external libraries withtheir own build systems), matching how
Integrations/is treated.common-3d-test-modelschanges the default mesh path in the CI-tested Examples (MeshSDF,CSGUnion) and Integrations examples; all were updated and re-verified.
Alternative solutions
were chosen for exact version pinning (better for reproducible benchmarks), per Benchmarks: compare EBGeometry against other NN/geometry libraries (picoflann, nanoflann, ...) #109.
Benchmark/vsIntegrations/Benchmark— went with top-level, since benchmarkingagainst external libraries is distinct from integrating EBGeometry into an application code.
Reviewer checklist (to be completed by a human)
@claude review.