Skip to content

feat(splat3d): render-depth certification — Cesium SSE × EWA depth, HHTL cascade#206

Merged
AdaWorldAPI merged 5 commits into
masterfrom
claude/splat3d-cpu-simd-renderer-MAOO0
May 26, 2026
Merged

feat(splat3d): render-depth certification — Cesium SSE × EWA depth, HHTL cascade#206
AdaWorldAPI merged 5 commits into
masterfrom
claude/splat3d-cpu-simd-renderer-MAOO0

Conversation

@AdaWorldAPI
Copy link
Copy Markdown
Owner

@AdaWorldAPI AdaWorldAPI commented May 26, 2026

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::F32x16 exactly as splat3d mandates and make zero changes to SIMD dispatch or the merged project.rs/ProjectedBatch.

The result is "Cesium reverse-engineered with our advantages": Cesium accepts a tile on sse ≤ maximumScreenSpaceError alone; we keep that test but gate it on an auditable depth certificate (depth interval, ordering & occlusion uncertainty, separated error terms).

What landed

  • P1 — DTO + scalar reference (depth_cert.rs): RenderDepthCertificate (depth support interval z ± k·σ_z with the seven E_depth_total terms kept separate), certify_depth_scalar/certify_batch_scalar, camera_depth_variance (Σ_cam[2][2]), 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.
  • P2 — SIMD batch kernels (depth_cert.rs): camera_depth_variance_batch + certify_batch_simd (F32x16, 16-wide), same quat→R→W·Σ·Wᵀ convention as project_chunk_x16.
  • P3 — HHTL depth cascade (depth_cascade.rs): HEEL (frustum/near-far reject, scalar + F32x16 batch mask) → HIP (Cesium SSE + projected radius) → TWIG (depth certificate) → LEAF (fused KeepCoarse/Refine/ProjectExact decision).
  • P4 — mesh anchor + first demo (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

  • 31 new tests (validation plan Tier 1 scalar references + Tier 2 SIMD↔scalar parity); 119/119 splat3d tests pass, no regressions.
  • Key parity: camera_depth_variance_batch matches the scalar Spd3 reference within 1e-3; certify_batch_simd matches certify_batch_scalar end-to-end through culled slots; SIMD HEEL mask matches the scalar reject.

Constraints honored

  • No SIMD-dispatch changes; no edits to merged project.rs/ProjectedBatch.
  • No crates/cesium dependency (would cycle) — Cesium SSE pinned by golden value (37.412, the cesium::sse doctest value).
  • Honored plan guards: no generic field_kernel substrate yet, no 3D-Tiles parsing in ndarray, scalar-first → SIMD-parity, no panic in batch paths.

Test plan

https://claude.ai/code/session_017GFLBnDy23AWBqvkbHHC41


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Added depth certification and cascade-driven block selection to improve per-block rendering decisions (reject/keep/refine/project/render) based on occlusion confidence, projected footprint, and error budgets for better visual fidelity and performance.
  • Tests

    • Added extensive unit tests validating certification parity (scalar vs SIMD), rejection gating, cascade decision paths, and driver/indexing behavior.

Review Change Stack

claude added 4 commits May 26, 2026 04:03
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
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 19055a7f-dfdf-43b6-96c7-19f4577df89c

📥 Commits

Reviewing files that changed from the base of the PR and between de039e4 and 0827de1.

📒 Files selected for processing (3)
  • src/hpc/splat3d/depth_cascade.rs
  • src/hpc/splat3d/depth_cert.rs
  • src/hpc/splat3d/mod.rs

📝 Walkthrough

Walkthrough

Adds 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.

Changes

Render-Depth Certification and Block-Level Cascade Selection

Layer / File(s) Summary
Depth certification types and scalar foundation
src/hpc/splat3d/depth_cert.rs (range_0be3fad67740,range_0f6b488c17d0,range_4478bfaa4c94,range_e6de76452267)
Adds DepthCertParams, RenderDepthCertificate, screen_space_error, camera_depth_variance, and certify_depth_scalar implementing interval/variance/occlusion/ordering math and pass/fail logic.
Scalar batch certification and mesh alignment
src/hpc/splat3d/depth_cert.rs (range_ff89d77fbfe0,range_a369bf6b2190,range_0dc50a851d6d)
certify_batch_scalar for ProjectedBatch, MeshAlignment/mesh_alignment, and ZERO_CERT for invalid/culled slots.
SIMD depth variance and certification
src/hpc/splat3d/depth_cert.rs (range_0fe433ca8aa4,range_cda95f58e651)
16-lane SIMD infrastructure and implementations: camera_depth_variance_batch and certify_batch_simd (F32x16, stage16) matching scalar outputs.
Depth certification tests
src/hpc/splat3d/depth_cert.rs (range_c8363d4e743b)
Unit tests covering SSE, variance, scalar/SIMD parity, ZERO_CERT, and mesh-alignment cases.
Cascade types and HEEL rejection
src/hpc/splat3d/depth_cascade.rs (range_dde15fb880fd,range_f678537d7dde,range_27e8a74a7940)
Defines BlockBounds, HhtlTier, HhtlAction, DepthCascadeBudget, BlockDepthDecision; implements heel_reject_scalar and 16-wide heel_reject_mask SIMD HEEL rejection.
Block cascade decision and driver
src/hpc/splat3d/depth_cascade.rs (range_751f0c405d48,range_848591a8e785)
cascade_block executes HEEL→HIP→TWIG→LEAF: compute SSE, call certifier, and select action/priority/error; cascade_blocks drives per-block outputs.
Block cascade tests
src/hpc/splat3d/depth_cascade.rs (range_efe188ee2fa6)
Tests for HEEL near/off-screen rejection, cascade action selection (keep/refine/project-exact), SIMD mask equivalence, and driver indexing/length behavior.
Public API re-exports
src/hpc/splat3d/mod.rs (range_8cc684727840)
Adds pub mod depth_cert and pub mod depth_cascade and re-exports certification and cascade functions/types.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

A rabbit counts splats in orderly queues,
Certs and cascades pick what to use,
SIMD hums sixteen, decisions align,
From HEEL to LEAF the blocks fall in line,
Soft thumps of code—rendered just fine. 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(splat3d): render-depth certification — Cesium SSE × EWA depth, HHTL cascade' accurately summarizes the main changes: introducing render-depth certification using Cesium screen-space-error and an HHTL cascade system for the splat3d module.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/splat3d-cpu-simd-renderer-MAOO0

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@AdaWorldAPI AdaWorldAPI merged commit 9ca4004 into master May 26, 2026
16 checks passed
AdaWorldAPI pushed a commit that referenced this pull request May 26, 2026
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
AdaWorldAPI added a commit that referenced this pull request May 26, 2026
…erer-MAOO0

fix(splat3d): address Codex review on render-depth certification (#206 follow-up)
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.

2 participants