Conversation
- Add cross-platform SIMD in LBVH using the xsimd library
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #207 +/- ##
=======================================
Coverage 97.34% 97.35%
=======================================
Files 161 161
Lines 24664 24697 +33
Branches 877 883 +6
=======================================
+ Hits 24010 24044 +34
+ Misses 654 653 -1
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.
Pull request overview
This pull request modernizes the SIMD implementation in IPC Toolkit by replacing Apple-specific SIMD intrinsics with the cross-platform xsimd library, enabling SIMD acceleration on all supported platforms (not just macOS). The changes also make SIMD enabled by default with automatic fallback when not available.
Changes:
- Integrated xsimd library (v14.0.0) as a dependency for cross-platform SIMD support
- Refactored LBVH SIMD code to use xsimd APIs with architecture-dependent batch sizes
- Updated build system to enable SIMD by default with automatic capability detection and graceful degradation
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| cmake/recipes/xsimd.cmake | Adds xsimd library integration via CPM |
| CMakeLists.txt | Enables SIMD by default, adds detection logic, links xsimd, and disables Eigen vectorization |
| CMakePresets.json | Removes dedicated SIMD preset (now default) and SIMD-OFF flag from python preset |
| IPCToolkitOptions.cmake.sample | Reorders SIMD option to reflect its new default-enabled status |
| src/ipc/config.hpp.in | Adds IPC_TOOLKIT_WITH_SIMD configuration macro |
| src/ipc/utils/eigen_ext.hpp | Adds workaround for Eigen abs() issue when vectorization is disabled |
| src/ipc/broad_phase/lbvh.cpp | Refactors SIMD code from Apple-specific to xsimd with dynamic batch sizes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| message(STATUS "Third-party: creating target 'xsimd::xsimd'") | ||
|
|
||
| include(CPM) | ||
| CPMAddPackage("gh:xtensor-stack/xsimd#14.0.0") |
There was a problem hiding this comment.
The CPMAddPackage("gh:xtensor-stack/xsimd#14.0.0") call introduces a supply-chain risk by fetching and building third-party code from GitHub pinned only to a mutable tag without any additional integrity verification. If the xtensor-stack/xsimd repository or its tags are compromised, CI/builds that have access to secrets could execute attacker-controlled code. To mitigate this, pin the dependency to an immutable commit SHA (and, if supported by CPM, enable checksum/signature verification) rather than relying solely on a version tag.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Description
This pull request introduces cross-platform SIMD (Single Instruction, Multiple Data) support using the xsimd library, replacing the previous Apple-specific SIMD implementation in the LBVH code. It also adds build system enhancements to detect and configure SIMD support automatically. The main changes are grouped below:
Build System Enhancements
IPC_TOOLKIT_WITH_SIMDto be enabled by default, and improve CMake logic to detect SIMD capabilities and configure the build accordingly.cmake/recipes/xsimd.cmake), and updated the build to link against xsimd and disable Eigen's internal vectorization to avoid conflicts.Codebase Modernization for SIMD:
src/ipc/broad_phase/lbvh.cppto use xsimd for cross-platform SIMD support, replacing Apple-specificsimdintrinsics. This includes updating batch types, boolean operations, and utility functions to use xsimd APIs.src/ipc/config.hpp.in)These changes make SIMD acceleration available on all supported platforms, not just Apple, and improve maintainability by standardizing on a widely-used SIMD abstraction library.
Type of change
Please delete options that are not relevant.