Skip to content

Lumen follow-up: true octahedral corner wrap for WSRC borders #23

Description

@proggeramlug

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

  • If a scene appears where the sampler's bilinear tap lands squarely on a corner texel at a silhouette-equatorial direction and produces a visible artifact.
  • If WSRC quality ever becomes load-bearing for visual parity tests.

Scope

  • WSRC_BAKE_WGSL / WSRC_BAKE_HW_WGSL corner branch: instead of edge-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.
  • Verify sample weights behave correctly at the corner — the bilinear tap there combines 1 corner + 2 edge + 1 inside texel with tiny weights on the corner.

Why deferred

Bilinear weight at a corner texel is at most 1/16 when 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.

Activity

  1. added 2 commits that reference this issue on Jun 12, 2026
  2. proggeramlug commented on Jul 28, 2026

    @proggeramlug
    ContributorAuthor

    Completed in draft PR #147 at 8533774.

    Implementation:

    • added one shared padded-octahedron mapping used by both WSRC_BAKE_WGSL and WSRC_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.0001 half-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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions