Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ removed no sooner than the next major (see `docs/API_STABILITY.md`).

### Changed

- Add explicitly uploaded reusable GPU query batches and resident KD-tree
nearest-k/radius neighborhoods under `gpu-wgpu`. k=0..=64 retains CPU
selection and stable distance order; radius rows retain traversal order and
count all matches even when capacity is exceeded. Complete readback access
rejects overflow; named truncated access and count-only search are explicit.
Owned result buffers can feed subsequent GPU kernels without readback.

- Extend explicit GPU correspondence reuse to GICP under `register-gicp-gpu`,
retaining unbounded matching followed by the original host distance gate,
ordered Hessian/gradient reduction and CPU pose solving. Optional radius
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,13 @@ GICP exposes the same explicit correspondence entry point under
and share the transfer receipt. Its Hessian/gradient accumulation and pose
solver stay on CPU. See [GICP measurements](notes/2026-10-12_gpu_gicp_correspondences.md).

GPU k-NN/radius search can retain its results for later device passes with
`GpuQueryBatch::upload` and
`GpuKdTree::{nearest_k_resident,radius_neighbors_resident}` (`gpu-wgpu`). Radius
capacity overflow is counted explicitly and complete readback rejects it.
This provides the neighborhood foundation for feature compute; FPFH/ISS/MLS
remain CPU algorithms. See [contracts and measurements](notes/2026-10-12_gpu_bounded_neighborhoods.md).

### Library

Load or save by file extension:
Expand Down
5 changes: 4 additions & 1 deletion crates/spatialrust-gpu/src/kernels/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ mod voxel_gather;

pub(crate) mod cluster_union;
pub(crate) mod nearest;
pub use nearest::GpuKdTree;
pub use nearest::{
GpuKdTree, GpuNeighborhoodKind, GpuNeighborhoodReadback, GpuNeighborhoods, GpuQueryBatch,
MAX_GPU_K_NEIGHBORS,
};
#[cfg(feature = "gpu-wgpu")]
mod euclidean_cluster;

Expand Down
8 changes: 8 additions & 0 deletions crates/spatialrust-gpu/src/kernels/nearest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ use wgpu::util::DeviceExt;

use crate::{scratch::ScratchBuffers, WgpuRuntime};

#[path = "neighborhoods.rs"]
mod neighborhoods;
pub(crate) use neighborhoods::NeighborhoodPipelines;
pub use neighborhoods::{
GpuNeighborhoodKind, GpuNeighborhoodReadback, GpuNeighborhoods, GpuQueryBatch,
MAX_GPU_K_NEIGHBORS,
};

#[repr(C)]
#[derive(Clone, Copy, Pod, Zeroable)]
struct Node {
Expand Down
394 changes: 394 additions & 0 deletions crates/spatialrust-gpu/src/kernels/neighborhood_tests.rs

Large diffs are not rendered by default.

Loading
Loading