-
Notifications
You must be signed in to change notification settings - Fork 39
Parallel CPU LBVH Implementation #188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ing support - Introduced LBVH class for efficient broad phase collision detection. - Implemented LBVH node structure with AABB intersection checks. - Added methods for detecting vertex-vertex, edge-vertex, edge-edge, face-vertex, edge-face, and face-face candidates. - Integrated profiling functionality with IPC_TOOLKIT_WITH_PROFILER flag. - Updated CMakeLists to include new LBVH test files and source files. - Added tests for LBVH construction and candidate detection. - Included Python bindings for LBVH and example usage scripts. - Enhanced configuration options in config.hpp for profiling support.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #188 +/- ##
==========================================
- Coverage 97.37% 97.24% -0.13%
==========================================
Files 157 161 +4
Lines 24240 24590 +350
Branches 843 882 +39
==========================================
+ Hits 23604 23913 +309
- Misses 636 677 +41
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a parallel CPU implementation of Linear Bounding Volume Hierarchy (LBVH) for broad-phase collision detection and adds performance profiling capabilities. The LBVH uses Morton codes for efficient spatial sorting and parallel construction.
Changes:
- Implemented LBVH broad-phase collision detection method with parallel construction using TBB
- Added profiler utility with CSV export and optional compilation via CMake flag
- Integrated profiling blocks into BVH and LBVH implementations
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ipc/broad_phase/lbvh.hpp | Defines LBVH class with Node structure and detection methods |
| src/ipc/broad_phase/lbvh.cpp | Implements LBVH construction using Morton codes and parallel traversal |
| src/ipc/utils/profiler.hpp | Profiler header with timing macros and data structures |
| src/ipc/utils/profiler.cpp | Profiler implementation with CSV export functionality |
| tests/src/tests/broad_phase/test_lbvh.cpp | Test cases for LBVH construction and candidate detection |
| python/examples/lbvh.py | Python example demonstrating LBVH visualization |
| CMakeLists.txt | Adds profiler option and nlohmann/json dependency |
| .github/workflows/python.yml | Updates Python version to 3.14 |
| .clang-format | Removes Language and RemoveEmptyLinesInUnwrappedLines options |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
This pull request introduces a new broad phase collision detection method, LBVH (Linear Bounding Volume Hierarchy), and adds performance profiling capabilities to the project. It also includes updates to the build system and Python bindings to support these features. The most important changes are grouped below.
LBVH Broad Phase Collision Detection
LBVHclass insrc/ipc/broad_phase/lbvh.hppand corresponding source file, providing a new broad phase method for collision detection. This includes node structure, build routines, and candidate detection logic.python/examples/lbvh.pydemonstrating LBVH usage and visualization.Performance Profiling
src/ipc/utils/profiler.cpp,src/ipc/utils/profiler.hpp) to measure and record performance metrics, with CSV output support.CMakeLists.txt,src/ipc/config.hpp.in) to allow enabling/disabling the profiler via theIPC_TOOLKIT_WITH_PROFILERoption.src/ipc/broad_phase/bvh.cpp) with profiler blocks to collect timing data for key routines.Type of change