Skip to content

Commit 3c78901

Browse files
committed
docs(splat-native): sync module skeleton with §4.2/§4.3 (codex P2 on #213)
Follow-up to codex review on PR #213. The per-primitive specs at §4.2 (`batched_mahalanobis`) and §4.3 (`batched_opacity_blend`) were correctly updated in #213, but the module skeleton at the top of the same file (the `pub fn` declarations in the `src/simd_splat.rs` sketch around line 50) still advertised the OLD no-scratch / no-ray-offsets signatures. Since this document is the implementation handoff for `src/simd_splat.rs`, an implementer scanning the skeleton first would recreate the exact APIs #213 was meant to eliminate, leaving the zero-allocation contract (Mahalanobis) and per-ray segmentation contract (opacity blend) unenforceable. ## Fix Updates the two skeleton signatures to match §4.2 and §4.3 exactly, with cross-references to the per-primitive sections: - `batched_mahalanobis` — adds `cholesky_scratch: &mut [f32]` (length N × 6); inline comment cites §4.2 sizing guidance and the "function MUST NOT allocate" contract. - `batched_opacity_blend` — adds `ray_offsets: &[u32]` (length n_rays + 1, CSR-style); `sorted_amplitudes` re-described as flat concatenation; `out_alpha` length now `n_rays` (not "per pixel"); inline comment cites §4.3 segmentation contract. The two implementations of the §4.2 / §4.3 detailed specs are unchanged in this PR — this commit only syncs the up-front skeleton so the two views of the API agree. ## Test plan - [x] Skeleton + §4.2 + §4.3 now show identical parameter lists. - [x] Comments on the new parameters cite the section that owns the detailed contract (so an implementer who reads the skeleton first gets pointed to the contract section). - [ ] Codex re-review on this PR.
1 parent 0c1fb05 commit 3c78901

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

.claude/plans/splat-native-ultrasound-simd-substrate-v1.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,18 @@ pub fn batched_cholesky_3x3(
4848
);
4949

5050
pub fn batched_mahalanobis(
51-
query_xyz: &[f32], // M × 3 query points
52-
mu_xyz: &[f32], // N × 3 Gaussian centroids
53-
sigma_packed: &[f32], // N × 6 packed Σ
54-
out_dist_sq: &mut [f32], // M × N output (squared Mahalanobis)
51+
query_xyz: &[f32], // M × 3 query points
52+
mu_xyz: &[f32], // N × 3 Gaussian centroids
53+
sigma_packed: &[f32], // N × 6 packed Σ
54+
cholesky_scratch: &mut [f32], // N × 6 — caller-provided packed-L scratch (24 MiB @ N=1M); function MUST NOT allocate (see §4.2)
55+
out_dist_sq: &mut [f32], // M × N output (squared Mahalanobis)
5556
);
5657

5758
pub fn batched_opacity_blend(
58-
sorted_amplitudes: &[f32], // N (front-to-back along view ray)
59-
opacity_lut: &[u8; 256], // amplitude → opacity LUT
60-
out_alpha: &mut [u8], // composited alpha per pixel
59+
sorted_amplitudes: &[f32], // flat; all rays' samples concatenated (front-to-back per ray)
60+
ray_offsets: &[u32], // length = n_rays + 1 (CSR-style); ray r's range is [ray_offsets[r]..ray_offsets[r+1]) (see §4.3)
61+
opacity_lut: &[u8; 256], // amplitude → opacity LUT
62+
out_alpha: &mut [u8], // length = n_rays — composited alpha per ray
6163
);
6264

6365
pub fn batched_sh_eval_l3(

0 commit comments

Comments
 (0)