feat(splat3d): render-depth certification — Cesium SSE × EWA depth, HHTL cascade#206
Conversation
Add `RenderDepthCertificate` (depth support interval z±k·σ_z with the seven E_depth_total error terms kept separate for auditability) plus its scalar reference `certify_depth_scalar`/`certify_batch_scalar`, `camera_depth_variance` (Σ_cam[2][2] from scale+quat+view), and `screen_space_error` — the production lift of cesium::sse::sse_for_tile (OGC 3D Tiles §7.4), which collapses to geometricError·fy/distance for a pinhole camera. Consumes the merged Camera/ProjectedBatch/Spd3 surface; no SIMD-dispatch changes. 13 scalar reference tests (validation plan Tier 1). https://claude.ai/code/session_017GFLBnDy23AWBqvkbHHC41
Add F32x16-wide `camera_depth_variance_batch` (16-wide quat→R→W·Σ·Wᵀ depth spine, same convention as project_chunk_x16) and `certify_batch_simd` (SIMD interval math + per-lane branchy writeback, the project.rs SIMD-bulk/scalar-tail split). Share ZERO_CERT for culled slots across scalar+SIMD paths. Consumes crate::simd::F32x16 only — no dispatch changes. Two Tier-2 parity tests: depth-variance SIMD-vs-scalar within 1e-3, and full certify_batch SIMD-vs-scalar end-to-end (incl. culled ZERO_CERT slots). https://claude.ai/code/session_017GFLBnDy23AWBqvkbHHC41
Add HEEL→HIP→TWIG→LEAF block preselection (depth_cascade.rs) that fuses Cesium SSE with the render-depth certificate: HEEL rejects behind near/far + off-screen (scalar + F32x16 batch mask, parity-tested); HIP computes Cesium SSE + projected radius; TWIG builds the depth certificate; LEAF fuses them — KeepCoarse only when SSE ≤ max AND certificate passes AND occlusion confidence clears threshold, else Refine / ProjectExact. This is Cesium's flat SSE rule extended with auditable depth/ordering/occlusion uncertainty. DTOs: BlockBounds, HhtlTier, HhtlAction, DepthCascadeBudget, BlockDepthDecision. 9 tests (per-tier decisions + SIMD/scalar HEEL parity). No dispatch changes. https://claude.ai/code/session_017GFLBnDy23AWBqvkbHHC41
Add MeshAlignment + mesh_alignment (render-depth plan § Blender/CAD): compares an exact CAD/mesh depth against a splat's certified [min_depth,max_depth] interval — within_interval / within_tolerance / normalized σ-error / aligned. Ship the plan's "first demo" as a test: camera + mesh plane + splat block → project → camera_depth_variance_batch → certify → mesh_alignment, asserting the on-plane splat aligns and a distant CAD wall does not. Cesium SSE parity is pinned by golden value (sse_matches_cesium_formula = 37.412, the cesium::sse doctest value) — ndarray cannot depend on crates/cesium (cycle), so golden cross-check is the oracle tie-in. 7 P4 tests. https://claude.ai/code/session_017GFLBnDy23AWBqvkbHHC41
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds depth-certification (scalar + SIMD) and a block-level HEEL→HIP→TWIG→LEAF cascade: compute SSE, produce per-splat RenderDepthCertificate, run HEEL culling (scalar + 16-wide SIMD), and output per-block BlockDepthDecision via a scalar driver; includes tests and public re-exports. ChangesRender-Depth Certification and Block-Level Cascade Selection
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
cargo fmt --check clean. No behavioral change. https://claude.ai/code/session_017GFLBnDy23AWBqvkbHHC41
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de039e4c65
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| while start < len { | ||
| let depth_v = F32x16::from_slice(&stage16(&batch.depth, start, len)); | ||
| let radius_v = F32x16::from_slice(&stage16(&batch.radius, start, len)); | ||
| let var_v = F32x16::from_slice(&stage16(depth_var, start, len)).simd_max(zero); |
There was a problem hiding this comment.
Guard SIMD depth_var reads against short input
certify_batch_simd promises it "does not panic on malformed input", but this lane load unconditionally stages from depth_var up to batch.len. If depth_var.len() < batch.len, stage16 indexes past the slice and panics, unlike certify_batch_scalar which safely falls back to 0.0 via get(i).unwrap_or(0.0). Any caller passing mismatched buffers will crash in the SIMD path.
Useful? React with 👍 / 👎.
| priority: 0.0, | ||
| estimated_error_px: 0.0, | ||
| projected_radius_px: 0.0, | ||
| certificate: super::depth_cert::certify_depth_scalar(0.0, 0.0, 0.0, &budget.cert_params), |
There was a problem hiding this comment.
Return an actual zero certificate on HEEL rejection
This reject branch claims the certificate is "zeroed if rejected at HEEL", but it calls certify_depth_scalar(0.0, 0.0, 0.0, &budget.cert_params). With default params that yields passed = true, and with nonzero budget terms it yields nonzero errors, so downstream consumers can misread rejected blocks as certified or nonzero-certified. This should use a fixed zero/failed certificate (like ZERO_CERT) for rejected blocks.
Useful? React with 👍 / 👎.
Two correctness fixes on the merged #206 code: - certify_batch_simd no longer panics on a depth_var shorter than batch.len: stage16 now reads via get().unwrap_or(0.0), matching certify_batch_scalar's fallback — honors the "does not panic on malformed input" contract. - HEEL-rejected blocks in cascade_block now return RenderDepthCertificate::ZERO (passed=false) instead of certify_depth_scalar(0,0,0,..), which yielded passed=true under default params and could be misread as certified. Promote the shared zeroed/failed certificate to a public associated const RenderDepthCertificate::ZERO. Add regression tests: short-depth_var SIMD parity (no panic), and HEEL-reject carries a failed certificate. https://claude.ai/code/session_017GFLBnDy23AWBqvkbHHC41
…erer-MAOO0 fix(splat3d): address Codex review on render-depth certification (#206 follow-up)
Summary
Implements the 3DGS render-depth certification plan and transfers the Cesium 3D-Tiles screen-space-error knowledge into the production CPU-SIMD splat renderer. Four phases, all SIMD-consumer-only — they go through
crate::simd::F32x16exactly assplat3dmandates and make zero changes to SIMD dispatch or the mergedproject.rs/ProjectedBatch.The result is "Cesium reverse-engineered with our advantages": Cesium accepts a tile on
sse ≤ maximumScreenSpaceErroralone; we keep that test but gate it on an auditable depth certificate (depth interval, ordering & occlusion uncertainty, separated error terms).What landed
depth_cert.rs):RenderDepthCertificate(depth support intervalz ± k·σ_zwith the sevenE_depth_totalterms kept separate),certify_depth_scalar/certify_batch_scalar,camera_depth_variance(Σ_cam[2][2]), andscreen_space_error— the production lift ofcesium::sse::sse_for_tile(OGC 3D Tiles §7.4), which collapses togeometricError·fy/distancefor a pinhole camera.depth_cert.rs):camera_depth_variance_batch+certify_batch_simd(F32x16, 16-wide), same quat→R→W·Σ·Wᵀconvention asproject_chunk_x16.depth_cascade.rs): HEEL (frustum/near-far reject, scalar +F32x16batch mask) → HIP (Cesium SSE + projected radius) → TWIG (depth certificate) → LEAF (fusedKeepCoarse/Refine/ProjectExactdecision).depth_cert.rs):MeshAlignment(CAD-mesh-depth vs certified interval — the Blender/CAD "skin alignment" use case) and the plan's "first demo" pipeline test.Tests
splat3dtests pass, no regressions.camera_depth_variance_batchmatches the scalarSpd3reference within 1e-3;certify_batch_simdmatchescertify_batch_scalarend-to-end through culled slots; SIMD HEEL mask matches the scalar reject.Constraints honored
project.rs/ProjectedBatch.crates/cesiumdependency (would cycle) — Cesium SSE pinned by golden value (37.412, thecesium::ssedoctest value).field_kernelsubstrate yet, no 3D-Tiles parsing in ndarray, scalar-first → SIMD-parity, no panic in batch paths.Test plan
cargo test -p ndarray --features std,linalg,pillar,splat3d --lib hpc::splat3d::(119 pass)cesium::tileset(feat(cesium): implement tileset.rs cold-import parser — Group-A entry, no-serde #205) geometric-error into the cascade in place of the block-extent proxyhttps://claude.ai/code/session_017GFLBnDy23AWBqvkbHHC41
Generated by Claude Code
Summary by CodeRabbit
New Features
Tests