Skip to content

Keep GICP k-NN covariance preparation on GPU - #173

Merged
rsasaki0109 merged 1 commit into
mainfrom
codex/gpu-gicp-resident-covariances
Oct 13, 2026
Merged

rsasaki0109 merged 1 commit into
mainfrom
codex/gpu-gicp-resident-covariances

Conversation

@rsasaki0109

Copy link
Copy Markdown
Owner

Depends on #172 (resident point-to-plane reductions); this PR contains only the GICP k-NN covariance slice.

GICP's existing GPU reduction path still prepares k-NN covariances on CPU and uploads the source-sized covariance arrays. Add align_with_gpu_resident_covariances and GpuGicpInput::upload_with_gpu_covariances to compute bounded k-NN, centered/scaled sample covariance and plane eigenvectors on GPU, then retain those covariances for the existing equation/update loop. Original query/sample positions and target tree are reused; source-tree upload is counted. No neighborhood/covariance readback or covariance re-upload occurs.

CPU tree construction, normalized 6x6 solve and world pose updates remain. The new path supports k=3..=64, epsilon as f32 in 1e-4..=1 and covariance_radius=None. Existing CPU/uploaded/radius paths retain their behavior. Malformed neighborhoods or unsupported arithmetic invalidate all covariance and equation payload (equation status bit 16); f32 products/eigenvectors can change results at small/repeated spectra, without CPU fallback.

Validation:

  • GPU library/integration: 224 passed; registration library: 35 passed. Five new native covariance tests check independent f64/spectral/Rayleigh math, malformed GPU rows, status propagation, limits, ownership and concurrent callers. Two new integrations compare 148,392 points in 162 pose/scale/k/stopping conditions, maximum scale-normalized pose-coordinate error 9.54e-7.
  • Previous GPU reduction/radius integrations and facade smoke passed, as did all-feature/all-target and CPU-only Clippy, WASM compilation, minimal facade and formatting. Original CPU source and the shared evaluation/solve/pose loop are unchanged.
  • Two isolated release surveys: 24 conditions, 20 samples per stage. At 65,537 points, completed calls improved 2.74–6.19x versus previous GPU and 4.29–6.64x versus CPU in this environment. Default k=20 gained 4.12x/4.36x versus previous GPU. H2D fell 37.9% (7,602,320 to 4,718,720 bytes); fixed D2H remains 1,024 bytes for three updates. Small 257-point calls favor CPU; one small previous/new interval includes one.

Full contracts, timing tables, transfers and precision limits.

@rsasaki0109
rsasaki0109 changed the base branch from codex/gpu-point-to-plane-reduction to main October 13, 2026 00:05
@rsasaki0109
rsasaki0109 merged commit 633be76 into main Oct 13, 2026
125 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant