|
| 1 | +# 3DGS HHTL CPU Cascade Plan — ndarray |
| 2 | + |
| 3 | +## Goal |
| 4 | + |
| 5 | +Adapt the existing HHTL / HEEL-HIP-TWIG-LEAF cascade ideas into reusable CPU-side kernels for 3DGS tile and splat preselection. |
| 6 | + |
| 7 | +This plan is not the full geospatial traversal policy. It defines fast kernels that higher layers can call. |
| 8 | + |
| 9 | +## Cascade shape |
| 10 | + |
| 11 | +```text |
| 12 | +HEEL coarse tile/block rejection |
| 13 | +HIP screen-space and density scoring |
| 14 | +TWIG covariance/opacity/quantization refinement |
| 15 | +LEAF exact projection/render payload |
| 16 | +``` |
| 17 | + |
| 18 | +## Kernel responsibilities |
| 19 | + |
| 20 | +### HEEL |
| 21 | + |
| 22 | +Fast broad-phase rejection: |
| 23 | + |
| 24 | +- bounding sphere/box vs frustum |
| 25 | +- tile availability bitmask scan |
| 26 | +- distance band classification |
| 27 | +- optional Morton range locality scan |
| 28 | + |
| 29 | +### HIP |
| 30 | + |
| 31 | +Mid-tier priority estimation: |
| 32 | + |
| 33 | +- screen-space error estimate |
| 34 | +- projected tile/block radius |
| 35 | +- splat density estimate |
| 36 | +- opacity budget estimate |
| 37 | +- camera motion/fovea relaxation factor |
| 38 | + |
| 39 | +### TWIG |
| 40 | + |
| 41 | +Block-level refinement: |
| 42 | + |
| 43 | +- covariance stability estimate |
| 44 | +- quantization error estimate |
| 45 | +- depth bucket estimate |
| 46 | +- weak-dependence correction hook |
| 47 | +- certificate-ready stats |
| 48 | + |
| 49 | +### LEAF |
| 50 | + |
| 51 | +Exact hot path: |
| 52 | + |
| 53 | +- call `splat3d` projection kernel |
| 54 | +- optionally call raster kernel |
| 55 | +- emit exact counters and certificate values |
| 56 | + |
| 57 | +## DTOs |
| 58 | + |
| 59 | +```rust |
| 60 | +pub struct Hhtl3dgsRequest<'a> { |
| 61 | + pub camera: Splat3dCamera, |
| 62 | + pub block_bounds: &'a [BlockBounds], |
| 63 | + pub block_stats: &'a [SplatBlockStats], |
| 64 | + pub budget: Hhtl3dgsBudget, |
| 65 | +} |
| 66 | + |
| 67 | +pub struct Hhtl3dgsBudget { |
| 68 | + pub max_error_px: f32, |
| 69 | + pub min_confidence: f32, |
| 70 | + pub max_projected_radius_px: f32, |
| 71 | + pub max_blocks: usize, |
| 72 | + pub allow_skip_lod: bool, |
| 73 | +} |
| 74 | + |
| 75 | +pub struct Hhtl3dgsDecision { |
| 76 | + pub block_index: usize, |
| 77 | + pub tier_reached: HhtlTier, |
| 78 | + pub priority: f32, |
| 79 | + pub estimated_error_px: f32, |
| 80 | + pub action: HhtlAction, |
| 81 | +} |
| 82 | + |
| 83 | +pub enum HhtlAction { |
| 84 | + Reject, |
| 85 | + KeepCoarse, |
| 86 | + Refine, |
| 87 | + ProjectExact, |
| 88 | + RenderExact, |
| 89 | +} |
| 90 | +``` |
| 91 | + |
| 92 | +## SIMD strategy |
| 93 | + |
| 94 | +- Batch bounding-volume tests. |
| 95 | +- Batch distance-to-camera. |
| 96 | +- Batch projected radius approximations. |
| 97 | +- Use bitset outputs for rejected/accepted blocks. |
| 98 | +- Keep scalar reference path for every tier. |
| 99 | + |
| 100 | +## Integration with existing ndarray capabilities |
| 101 | + |
| 102 | +Use or extend existing modules where possible: |
| 103 | + |
| 104 | +- `hpc::cascade` |
| 105 | +- `hpc::clam` |
| 106 | +- `hpc::cam_pq` |
| 107 | +- `distance`, `byte_scan`, `spatial_hash` |
| 108 | +- `simd_dispatch` |
| 109 | +- `splat3d` |
| 110 | +- `pillar` |
| 111 | + |
| 112 | +## Runtime principles |
| 113 | + |
| 114 | +- No heap allocation in inner loops. |
| 115 | +- No hidden global state except existing SIMD dispatch tables. |
| 116 | +- No policy decisions that belong to `lance-graph`. |
| 117 | +- Return measurable reasons for rejection/refinement. |
| 118 | + |
| 119 | +## Acceptance criteria |
| 120 | + |
| 121 | +- Scalar and SIMD broad-phase decisions match. |
| 122 | +- Benchmarks for 1k, 10k, 100k block candidates. |
| 123 | +- HHTL decision output can be consumed without depending on renderer internals. |
| 124 | +- Exact LEAF mode can call `splat3d` projection and merge reports. |
| 125 | +- Test cases include camera motion and foveated relaxation inputs, even if policy remains in `lance-graph`. |
| 126 | + |
| 127 | +## Cross-repo usage |
| 128 | + |
| 129 | +`lance-graph` calls this cascade after it has selected candidate tiles from 3D Tiles / Lance metadata. |
| 130 | + |
| 131 | +```text |
| 132 | +lance-graph tile candidates |
| 133 | + -> |
| 134 | +ndarray HHTL cascade |
| 135 | + -> |
| 136 | +ranked block decisions |
| 137 | + -> |
| 138 | +lance-graph traversal/render scheduler |
| 139 | +``` |
0 commit comments