Lumen follow-up: true octahedral corner wrap for WSRC borders #23
Copy link
Copy link
Closed
Description
Activity
Completed in draft PR #147 at
8533774.Implementation:
- added one shared padded-octahedron mapping used by both
WSRC_BAKE_WGSLandWSRC_BAKE_HW_WGSL, removing the duplicated backend mappings; - all four padded corners now double-fold exactly as specified:
(0,0)->(7,7),(0,9)->(7,0),(9,0)->(0,7),(9,9)->(0,0); - retained the existing 10x10 workgroup, 16^3 probes/cascade, ray count, atlas, bindings, dispatch count, and amortization;
- added profiler-only timestamps to the existing WSRC compute pass; profiling off remains unchanged.
Live-GPU correctness evidence on Apple M1 Max / Metal:
- read back all four baked corner texels and their required wrapped interior texels; every pair is exactly equal;
- sampled all four slab corners through the production linear sampler and compared each result with the explicit 25% sum of its corner + two edge + one interior taps; every RGBA channel agrees within
0.0001half-float interpolation tolerance; - software and hardware bake variants both parse from the same helper and a unit contract prevents backend drift.
Performance evidence, fixed software WSRC bake, 120 measured bakes per run, 10 frozen pre/post pairs interleaved:
- before mean: 75.678 us
- after mean: 69.493 us
- delta: -6.185 us / -8.17%
Validation:
- native library: 298 passed, 0 failed, 1 ignored
- release golden/GPU corpus: 44 passed, 0 failed, 2 hardware-only ignored
- wasm32 shared check: passed
- FFI parity: 0 failures, 0 warnings
- formatting, shader parsing, diff whitespace, and file-line ratchet: passed
The issue scope and its quality/performance guardrails are fully satisfied, so this ticket can close.
- added one shared padded-octahedron mapping used by both
Metadata
Metadata
Assignees
Labels
No labels
Ticket 014 V11 landed true octahedral silhouette wrap for the 4 edges of each probe's padded 10×10 octel slab. Corners (padded (0,0), (0,9), (9,0), (9,9)) were left as edge-extend — the double fold at a corner has two valid mirror interpretations, and bilinear weight at the exact corner is tiny, so the visual impact was deemed negligible.
When to do this
Scope
WSRC_BAKE_WGSL/WSRC_BAKE_HW_WGSLcorner branch: instead ofedge-extend(reuse nearest inside octel), write the double-mirror neighbour. The standard convention: corner(0, 0)= nearest inside(7, 7);(0, 9)=(7, 0); etc.Why deferred
Bilinear weight at a corner texel is at most
1/16when the sample point sits at the cube-corner's uv — and probe silhouette-edge directions are rare targets for miss rays (most rays point into meaningful world directions, not at the octahedral "poles"). See docs/perf/014-lumen-mesh-sdfs.md §V15 closure.