Add unsafe versions of foreach_neighbor and foreach_point_neighbor#154
Add unsafe versions of foreach_neighbor and foreach_point_neighbor#154efaulhaber wants to merge 5 commits intomainfrom
foreach_neighbor and foreach_point_neighbor#154Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces “unsafe” neighbor-iteration APIs intended to skip bounds checks for performance-critical CPU/GPU loops, and restructures the internal neighbor-loop dispatch to separate a safe function barrier from an inbounds-propagating inner loop.
Changes:
- Add exported
foreach_neighbor_unsafeandforeach_point_neighbor_unsafeAPIs. - Introduce a
foreach_neighbor_innerfunction-barrier pattern and updateGridNeighborhoodSearchto specialize the inner loop. - Update documentation and exports to expose the new unsafe entry points.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/neighborhood_search.jl | Adds foreach_point_neighbor_unsafe and foreach_neighbor_unsafe, plus a new foreach_neighbor_inner dispatch layer and updated docs. |
| src/nhs_grid.jl | Renames the grid specialization to foreach_neighbor_inner and adjusts comments around bounds-check safety. |
| src/nhs_precomputed.jl | Attempts to adjust the precomputed specialization for the new unsafe/safe split (currently miswired). |
| src/PointNeighbors.jl | Exports the newly added unsafe APIs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #154 +/- ##
==========================================
+ Coverage 84.82% 86.06% +1.23%
==========================================
Files 15 15
Lines 725 739 +14
==========================================
+ Hits 615 636 +21
+ Misses 110 103 -7
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:
|
Add unsafe versions of
foreach_neighborandforeach_point_neighborthat skip all bounds checks.Once again citing @sloede: