Repository navigation
render: clear the sun depth-slab planes with device fills and census the splat footprint - #4867
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…the splat footprint The opt-in raster sun depth-slab layer, rebased onto the bake body split, stays compiled out at zero slots. Its slab planes are now stored min planes then max planes and cleared by two contiguous device fills through a RenderDevice::fillBuffer that takes a byte offset on both backends; the per-texel clear kernel no longer loops over slots. Measured on three frozen build trees in guarded interleaved windows, the fills are cost-neutral against the per-texel clear, so the writer's dependent loads carry the layer's 2x bake cost on the two small raster cells. A capture-only footprint probe reports, per bake workgroup and cascade, the sun-texel bounding box of the pixels' splat boxes and the share that fits a fixed shared-memory window at 16x16 and 8x8 grouping. At the 32-texel window the 32 KiB threadgroup floor allows for three slots, 54% / 81% of the small raster cells' caster pixels fit (78% on the default scene), so the workgroup-cooperative splat is not written here; the census and the multi-arm timing driver carry the data the design decision needs. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
NEEDS-DESIGNPhase 0 of the plan (footprint probe before the kernel) measured the cooperative-splat premise below its bar, so per the plan this PR stops after decision 5 (fills) with the layer compiled out. Contract break: decision 4 (workgroup-cooperative splat over a fixed window under the 32 KiB threadgroup floor) and criterion 3 cannot be honoured as written; criterion 1's two small raster cells stay far outside the gate without it (bake 1.93x to 2.11x, frame mean 1.30x to 1.69x on the current tree, three frozen arms, five guarded interleaved rounds, The census (
Nearest word + three (min, max) pairs = 28 B per window texel, so the 32 KiB floor holds a 32 window (28,672 B): 54% / 81% / 78% against the plan's 95% / 90%. The redundancy a tile reduction removes is real (29x to 43x box writes per texel inside a tile; 164x per written texel across tiles). The fills (decision 5) are cost-neutral: within 0.12 ms of the per-texel clear on every bake and envelope row, so the writer's dependent loads are the whole cost. Questions (one decision needed; options with my view):
Everything else in the plan holds: rebase (decisions 1 to 3) done, fills and |
Perf gateHead host slug: perf comparison: ec70f10 → aae963c-cibaseline: host calibration
thresholds: regress ≥ 10%, improve ≥ 5% voxel cull effectiveness
frame timing (ms)
GPU frame timing (ms; separate from stage samples)
GPU stage timing (avg ms per sampled invocation)
top CPU systems by avg ms (head)
|
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
164.152 → 162.096 (-1.3%) |
| RENDER | ComputeLightVolume |
27.204 → 25.399 (-6.6%) ↓ |
| RENDER | CanvasToFramebuffer |
12.842 → 11.608 (-9.6%) ↓ |
| RENDER | BakeSunShadowMap |
1.225 → 7.160 (+484.5%) ⚠ |
| RENDER | ComputeSunShadow |
4.687 → 4.986 (+6.4%) |
| UPDATE | PropagateTransform |
2.792 → 2.823 (+1.1%) |
| RENDER | LightingToTrixel |
3.394 → 2.736 (-19.4%) ↓ |
| UPDATE | FogRevealEval |
2.312 → 2.659 (+15.0%) ⚠ |
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
630.881 → 617.456 (-2.1%) |
| RENDER | ComputeLightVolume |
23.692 → 22.028 (-7.0%) ↓ |
| RENDER | ComputeSunShadow |
11.466 → 13.786 (+20.2%) ⚠ |
| RENDER | CanvasToFramebuffer |
12.352 → 10.665 (-13.7%) ↓ |
| RENDER | BakeSunShadowMap |
1.089 → 6.458 (+493.0%) ⚠ |
| RENDER | LightingToTrixel |
6.399 → 5.581 (-12.8%) ↓ |
| RENDER | ComputeVoxelAO |
5.526 → 5.228 (-5.4%) ↓ |
| UPDATE | PropagateTransform |
2.609 → 2.716 (+4.1%) |
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
167.005 → 170.925 (+2.3%) |
| RENDER | ComputeSunShadow |
25.352 → 24.354 (-3.9%) |
| RENDER | ComputeLightVolume |
23.052 → 23.203 (+0.7%) |
| RENDER | LightingToTrixel |
14.689 → 14.564 (-0.9%) |
| RENDER | CanvasToFramebuffer |
11.851 → 11.551 (-2.5%) |
| RENDER | BakeSunShadowMap |
1.836 → 8.364 (+355.6%) ⚠ |
| UPDATE | PropagateTransform |
3.727 → 3.861 (+3.6%) |
| RENDER | FogToTrixel |
3.556 → 3.574 (+0.5%) |
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
859.274 → 857.277 (-0.2%) |
| RENDER | ComputeLightVolume |
22.681 → 21.829 (-3.8%) |
| RENDER | ComputeSunShadow |
7.820 → 10.897 (+39.3%) ⚠ |
| RENDER | CanvasToFramebuffer |
11.706 → 10.685 (-8.7%) ↓ |
| RENDER | BakeSunShadowMap |
1.105 → 5.970 (+440.3%) ⚠ |
| RENDER | LightingToTrixel |
4.901 → 4.234 (-13.6%) ↓ |
| RENDER | ComputeVoxelAO |
4.129 → 3.950 (-4.3%) |
| UPDATE | PropagateTransform |
3.837 → 3.911 (+1.9%) |
Architect directionDesign answerer, dispatched on this non-epic block. Both questions are engine design and are decided below; nothing here is a product call. 1. The gate is timing; the premise bar is retiredDecision 7 is the gate: 2. Shape: option (a), with three corrections8x8 pixel tile, 32x32 window, full representation (nearest word + three (min, max) pairs = 28 B per texel, 28,672 B), the branch's claim logic in threadgroup memory. Your preference, and derivable from the record: it keeps decision 4's exactness argument intact and adds no fallback class. The invariant the kernel and the harness rest on, stated once: the primary layer's final state is a function of the write set alone. Nearest word = min over the set (associative, so byte-identical under any grouping); slabs = the set union of the writes' slabs with per-slab extrema, overflow sticky once a texel has seen more than three distinct slabs (the receiver answers from the nearest word on overflow, so which three slots survive is unobservable). Any writer that partitions the write set across paths is exact iff every write lands exactly once in a path that ends in the global merge. Window size, group shape and anchor never enter exactness; they only move cost. Corrections to decision 4 as planned:
Kernel contract (everything not listed is the implementer's call):
Rejected: (b) and (c) add a second spill class (a second slab inside one tile) that the census did not measure and that concentrates on exactly the stacked-caster edges the layer exists to repair, each with its own harness emulation and controls; one censused spill class is the design. (d) at 16x16 the median footprint is 41 texels against a 32 window on the two gated cells; at the measured per-write cost any double-digit spill share fails F. 3. Harness (criterion 5)As planned, plus one control: a spill write dropped instead of routed to global must fail by name. The lane-by-lane emulation uses the barriers as phase boundaries and compares the flushed-plus-spilled global state with the per-pixel writer's on every write set, including the sets that overflow. 4. Gate, adoption and the failure branchDecision 7 is unchanged; criteria 1 to 4 and 6 are unchanged; the arms are decision 6's (base, per-pixel, fills, HEAD). If the bake row fails on either small cell, finish per decision 7 (compiled out, residual per path, the failing cell and row named in the PR body) and add one attribution arm: the cooperative kernel with the slab words compiled out (nearest only through the window), so the design note separates window overhead from slab-merge cost. Record in the design note, do not build, the two next levers: 256 threads over the 8x8 tile (four lanes per pixel splitting the box rows) if the attribution reads as occupancy; a load-free direct-mapped slab table (slot = slab mod slots, fire-and-forget The perf-gate comment of 04:53Z flags 5. Docs and planSource of truth for the layer's model: Read this direction alongside the issue's |
…er compiled out Builds decision 4 as the design answer corrected it: a third bake wrapper, c_bake_sun_shadow_map_cooperative, runs the shared body at an 8x8 pixel tile and reduces each cascade's splat boxes over a 32-texel threadgroup window (kSunDepthSlabWindowTexels in the three layout twins, 28 bytes per texel under the asserted 32 KiB floor), routing each box write per texel between the shared claim and the per-pixel global write. The bake system constructs it only with slots compiled in and dispatches it where the coverage splat is engaged; the production, second-depth and clear kernels stay at 16x16. The single slab write is the degenerate pair of the merge the flush uses. The kernel is exact (receiver hashes identical to the per-pixel writer on all 58 captures; the harness emulates the window lane by lane with the barriers as phase boundaries and agrees on every write set, four window controls failing by name) and slower than the writer it replaces: the bake row at 3.28x / 2.80x of the base arm on the two small raster cells, with the nearest-only window skeleton alone costing +0.66 ms against floors of 0.064 / 0.029 ms. Decision 7 fails, so the shipped layout stays at zero slots and the dispatches are master's (measured against master's binary: bake 1.004x, frame mean 1.022x). The design note records the residual per path and the two next levers; the footprint probe now reports the per-write spill share. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Addressed the design direction (decision 4 as corrected, phase 0 spill share, criterion 5 controls):
Evidence under |
jakildev
left a comment
There was a problem hiding this comment.
Review — render: clear the sun depth-slab planes with device fills and census the splat footprint
Verdict: needs-fix
Needs-fix
IRPrefab::SunShadow::writeSunPrimaryDepthProbe(engine/prefabs/irreden/render/sun_shadow_probe.hpp:398) reads the overflow bit fromslabs[width + i]. The buffer is populated plane-major as allkSunDepthSlabSlotsmin planes followed by all max planes, so on the intended three-slot build this indexes min plane 1 rather than max plane 0. The CSVoverflowcolumn, and thereforecapture.py's committed overflow census, can be wrong. Read max plane 0 atslabs[kSunDepthSlabSlots * width + i]and add a probe-level regression that enables more than one slot and distinguishes min plane 1 from max plane 0.- The current head's mandatory
python-lintcheck fails with eight E501 errors in the changed harnesses:scripts/tests/test_render_legacy_shadow_bake.py:47andscripts/tests/test_render_sun_depth_slab.py:427,469,686,695,927,939,942. This is the PR's own red CI result and must be clean before merge.
Acceptance (issue #4845)
| Criterion | Grade | Evidence |
|---|---|---|
| 1. Timing and attribution | Met via the specified failure branch | The five-cell evidence is committed; both gated cells fail, and the required nearest-only attribution plus residuals and next levers are recorded. |
| 2. Recovery matrix | Met by committed evidence | The PR reports the beyond-throw matrix repaired and 17/17 control receiver hashes identical to the base arm. The overflow-column defect above still needs correction so the probe evidence is trustworthy. |
| 3. Cooperative exactness and speed | Exactness met; speed unmet and handled by compile-out | Receiver hashes agree on all 58 captures and the emulation agrees on 107 write sets. The cooperative arm is slower than the per-pixel arm on both gated cells, so decision 7 correctly keeps the feature disabled. |
| 4. Zero-slot opt-out identity | Met by committed evidence | The shipped zero-slot arm reports both render verifiers and light-verify passing, identical default captures, bake at 1.004x, and steady mean at 1.022x versus master. |
| 5. Harness and build checks | Not established on the current head | The PR records its local harness/build checks, but current python-lint is red; linux-build, render-harness-tests, and fleet-tests were still pending at review time. |
| 6. Decision and layout twins | Met | The README, design note, and PR body record compile-out and residual costs; all three twins ship zero slots and the same 32-texel window. |
Praise
- The failure branch is unusually well attributed: the nearest-only arm separates the window skeleton from the slab merge, and the shipped zero-slot path preserves the current render behavior instead of forcing an over-budget experiment into production.
Test plan the author should run before re-review
-
ruff check scripts/ - Add and run a multi-slot regression for
writeSunPrimaryDepthProbe's overflow-plane selection. - Let
linux-build,render-harness-tests, andfleet-testscomplete successfully on the amended head.
Reviewed by Codex (GPT-5), runtime codex.
Opus recheck required: this changes core render shaders, cross-backend atomics, and threadgroup synchronization.
…slab write in the box-face fixture The rectangle probe's CSV row now comes from writeSunPrimaryDepthProbeRow, which takes the slot count and reads the sticky overflow bit from max plane 0 (planar storage puts it right after the last min plane); the old read landed on min plane 1, whose EMPTY sentinel carries the same bit, so every single-slab texel reported overflow. A gtest drives the row writer at three slots with the two words disagreeing both ways. The head arm's capture matrix is re-taken with the corrected probe: receiver hashes unchanged on all 46 captures, overflow census identical to the per-pixel arm's on every cascade row. The box-face fixture stubs writeSunPrimaryDepth in both dialects, asserts the primary layer alone goes through it, and adds a nearest-only mutation that fails by name. The eight over-long harness lines are rewrapped. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Addressed feedback (review of 2026-11-02T08:45Z):
|
jakildev
left a comment
There was a problem hiding this comment.
Review — render: clear the sun depth-slab planes with device fills and census the splat footprint
Verdict: approve
Prior-review resolution
- ✅
scripts/tests/test_render_box_face_projection.py::BoxFaceProjectionTest::test_fog_cut_shape_index_and_depth_layer— the fixture now provides the slab-aware primary writer in both dialects, asserts that only primary-layer writes use it, and thenearest_only_primarymutation fails at its named control — verified at353ada28e. - ✅
IRPrefab::SunShadow::writeSunPrimaryDepthProbeRow— overflow is read from max plane 0 atslots * stride + column; the three-slot regression makes min plane 1 and max plane 0 disagree in both directions — verified at353ada28e. - ✅
scripts/tests/test_render_legacy_shadow_bake.pyandscripts/tests/test_render_sun_depth_slab.py— the eight E501 findings are rewrapped and Ruff is clean — verified at353ada28e.
Acceptance (issue #4845)
| Criterion | Grade | Basis |
|---|---|---|
| 1. Timing and attribution | met via the specified failure branch | The committed evidence records both gated bake failures, the nearest-only attribution arm, residuals, and the two next levers; the shipped slot count remains zero. |
| 2. Recovery matrix | met | The corrected head capture keeps the prior receiver-hash sequence exactly, and its overflow sequence matches the per-pixel arm exactly across the recorded rows. |
| 3. Cooperative exactness and speed | met via compile-out | The slab harness still proves agreement on all 107 cooperative write sets in both dialects; the over-budget cooperative path remains disabled. |
| 4. Zero-slot opt-out identity | met by committed evidence | The amended evidence records the zero-slot render/light verification and unchanged default receiver captures. |
| 5. Harness and build checks | met for the amendment | Local Ruff, box-face projection, legacy bake, and seven-test slab harness runs pass; IrredenEngineTest builds and both SunPrimaryDepthProbeRowTest cases pass. GitHub linux-build, render-harness-tests, fleet-tests, and perf-gate were still pending when reviewed, so they are not claimed green here. |
| 6. Decision and layout twins | met | The layer remains compiled out at zero slots and the decision/evidence record remains consistent. |
Praise
- The regression distinguishes the exact two planar words involved in the original bug in both directions, so it would fail for the prior index rather than merely exercising the corrected output shape.
Validation reviewed
ruff check scripts/tests/test_render_box_face_projection.py scripts/tests/test_render_legacy_shadow_bake.py scripts/tests/test_render_sun_depth_slab.py— pass.python3 scripts/tests/test_render_box_face_projection.py— 2 tests pass in both dialects.python3 scripts/tests/test_render_legacy_shadow_bake.py— 3 tests pass.python3 scripts/tests/test_render_sun_depth_slab.py— 7 tests pass; both dialects agree on 107 cooperative write sets.fleet-build --target IrredenEngineTest— pass.fleet-run IrredenEngineTest '--gtest_filter=SunPrimaryDepthProbeRowTest.*'— 2 tests pass.
Reviewed by Codex (GPT-5), runtime codex.
Opus recheck not required (reviewed at opus class).
Perf gateHead host slug: perf comparison: a39c8ac → 72c0845-cibaseline: host calibration
thresholds: regress ≥ 10%, improve ≥ 5% voxel cull effectiveness
frame timing (ms)
GPU frame timing (ms; separate from stage samples)
GPU stage timing (avg ms per sampled invocation)
top CPU systems by avg ms (head)
|
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
256.310 → 256.908 (+0.2%) |
| RENDER | ComputeLightVolume |
34.529 → 34.869 (+1.0%) |
| RENDER | CanvasToFramebuffer |
17.421 → 18.059 (+3.7%) |
| RENDER | BakeSunShadowMap |
10.231 → 10.540 (+3.0%) |
| RENDER | ComputeSunShadow |
7.654 → 7.952 (+3.9%) |
| UPDATE | PropagateTransform |
4.943 → 4.912 (-0.6%) |
| UPDATE | FogRevealEval |
4.273 → 4.295 (+0.5%) |
| RENDER | LightingToTrixel |
4.024 → 4.211 (+4.6%) |
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
1027.979 → 1032.135 (+0.4%) |
| RENDER | ComputeLightVolume |
29.161 → 29.426 (+0.9%) |
| RENDER | ComputeSunShadow |
21.416 → 22.259 (+3.9%) |
| RENDER | CanvasToFramebuffer |
16.262 → 16.407 (+0.9%) |
| RENDER | ComputeVoxelAO |
9.306 → 9.711 (+4.4%) |
| RENDER | BakeSunShadowMap |
8.616 → 8.640 (+0.3%) |
| RENDER | LightingToTrixel |
8.543 → 8.526 (-0.2%) |
| UPDATE | PropagateTransform |
4.472 → 4.450 (-0.5%) |
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
290.147 → 301.919 (+4.1%) |
| RENDER | ComputeSunShadow |
55.651 → 60.847 (+9.3%) |
| RENDER | LightingToTrixel |
35.503 → 39.459 (+11.1%) ⚠ |
| RENDER | ComputeLightVolume |
32.468 → 33.461 (+3.1%) |
| RENDER | BakeSunShadowMap |
22.592 → 23.443 (+3.8%) |
| RENDER | CanvasToFramebuffer |
17.400 → 18.197 (+4.6%) |
| RENDER | FogToTrixel |
7.108 → 7.385 (+3.9%) |
| UPDATE | PropagateTransform |
6.358 → 6.214 (-2.3%) |
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
1459.634 → 1466.132 (+0.4%) |
| RENDER | ComputeLightVolume |
29.423 → 29.600 (+0.6%) |
| RENDER | ComputeSunShadow |
18.270 → 18.344 (+0.4%) |
| RENDER | CanvasToFramebuffer |
16.184 → 16.656 (+2.9%) |
| RENDER | BakeSunShadowMap |
8.842 → 8.949 (+1.2%) |
| RENDER | ComputeVoxelAO |
7.740 → 7.806 (+0.9%) |
| RENDER | LightingToTrixel |
6.894 → 6.972 (+1.1%) |
| UPDATE | PropagateTransform |
6.141 → 6.177 (+0.6%) |
Summary
claude/4799-sun-raster-depth-slabs,ece131393) onto master's bake body split: the slab write lives inc_bake_sun_shadow_map_body.{glsl,metal}under both wrappers, master's fixture flags win (--probe-particle-raster,--sun-primary-probe), the branch's rectangular CSV probe ships as--sun-primary-rect-probe, and the overlapping-source stack extensions sit beside master's ray casters. One harness file, one VALIDATION row, one design-doc section.RenderDevice::fillBuffergains a byte offset on both backends, the two test doubles follow, and a GPU test covers the offset form. Cost-neutral against the per-texel clear (within 0.31 ms on every bake row).c_bake_sun_shadow_map_cooperative.{glsl,metal}, the shared body at an 8x8 pixel tile (IR_SUN_BAKE_GROUP_SIZE, Metal registry(8, 8, 1)), reducing each cascade's splat boxes over a 32-texel threadgroup window (kSunDepthSlabWindowTexelsin the three layout twins, 28 bytes per texel,static_assertunder the 32 KiB floor) with the spill routed per write to the per-pixel global path;ir_sun_depth_slab_window.{glsl,metal}holds the shared arrays and the five phases (reset, footprint reduction, init, routed splat, flush). The bake system constructs it only whenkSunDepthSlabSlots > 0and selects it per dispatch where the coverage splat is engaged (cardinal main-canvas bake, world-placed cast); the per-axis resolve, the no-splat detached bakes and the second-depth diagnostic keep per-pixel writes. The single-write path is now the degenerate pair ofmergeSunDepthSlabPair, which the flush also uses.bakeSunShadowMap3.28x / 2.80x of the base arm on the two small raster cells against 1.87x / 2.08x for the per-pixel arm. The attribution arm with the slab words compiled out costs +0.66 ms on both cells, ten and twenty-two floors wide, so the window skeleton itself is over budget before any slab is touched.kSunDepthSlabSlots = 0uin the three twins), the cooperative program is never constructed and the dispatches are master's, measured against origin/master's own binary (bake 1.004x by rule (i), frame mean 1.022x). The design note records the residual per path and the two next levers; the load-free direct-mapped slab table is filed as render: load-free direct-mapped slab table for the raster sun depth-slab layer #4874 with its collision census (4 of 79,738 multi-slab texels congruent mod 3 across the matrix).Test plan
ruff check scripts/clean;python3 scripts/tests/test_render_box_face_projection.pyOK in both dialects (the fixture carries awriteSunPrimaryDepthstub that counts primary writes, and anearest_only_primarymutation routing the primary write through the plainatomicMinfails by name);fleet-run IrredenEngineTest --gtest_filter='SunPrimaryDepthProbeRowTest.*'PASS, and FAILS with the row writer pointed back at min plane 1 (both overflow columns flip); the three-slot probe census re-captured natively (below).python3 scripts/tests/test_render_sun_depth_slab.py— OK (7 tests: both proofs, the executed three-slot sweep, the cooperative emulation, every mutation control, the twin / group-size agreement).test_render_legacy_shadow_bake.py(extracts the productionmainbeside the cooperative one),test_render_source_face_query.py,_overflow.py,_index.py,test_render_shadow_layer_union.py— OK.python3 scripts/shader_parity_audit.py— clean, 145 glsl and 135 metal files.fleet-build --target IRCanvasStress IRPerfGrid IrredenEngineTestat three and at zero slots — clean;header-checks(Metal kernel registry membership included),format-changed— clean.canvas-lower(RESULT=CLEAN); capture matrix on the base, per-pixel and head arms;ab_timing.py --pairs 5on all five cells with four arms, the nearest-only attribution arm on the two small cells, and origin/master against the zero-slot arm.render-verify --target IRCanvasStress --no-build,--target IRPerfGrid --no-build,light-verify --if-changed,captures-default.json— IRCanvasStressall 59 checks PASS, IRPerfGridall 21 checks PASS,[light-verify] all checks PASS;captures-default.json(lower,stacked-8-h60,oblique-lower,oblique-stacked-8-h60) receiver hashes identical to the base arm's.Acceptance evidence
gpu:bakeSunShadowMappassing F = 0.064 / 0.029 ms on the two small raster cells; per-row table with base spread, paired delta, lower bound, verdict; residuals recorded per pathir-acquire --timeout 3600 benchmark -- python3 …/ab_timing.py --output <dir>/<cell> --baseline arms/base --arm per-pixel=… --arm fills=… --head arms/head --pairs 5 --cells <cell>×5 (budget/<cell>/ab-timing.md); attribution armbudget/attribution/<cell>/budget/cooperative-full-window/).ir-acquire gpu -- python3 …/capture.py --output <dir> --label head(build at three slots),--build-dir arms/base --label base(master's path plus the fixture flags; master's own binary rejects the stack flags)stacked-8-h60,-last,-128,-h90,layered-2-h60-step40, both re-voxelized cases,oblique-stacked-8-h60/-last/-128/-h90,oblique-layered-3/-4and every moving-track pose: 0 missing / 0 excess where the base arm loses 2,347 (cardinal) / 2,428 (oblique) / 2,773 / 2,262 / 2,604..2,608;oblique-stacked-8-h300 missing with the base arm's own 772 excess (base 296 / 772); controls (lower,floor,distant-8-h60,stacked-8-h30, the unlit pairs,layered-3/-4, their oblique twins exceptoblique-layered-2-h60-step40at 2,344 vs 2,436) receiver hashes identical to the base arm's: 17 of 17.captures-{baseline,per-pixel,head}.json.captures-head.jsonre-captured at three slots after the probe's overflow read moved to max plane 0 (writeSunPrimaryDepthProbeRow, regressionSunPrimaryDepthProbeRowTest): all 46 receiver hashes unchanged, overflow census identical to the per-pixel arm's on 80 of 80 cascade rows (437 / 379 onlayered-3and-4, 277 / 249 onoblique-layered-2-h60-step40, 0 elsewhere).arms/per-pixel(captures-per-pixel.json) vscaptures-head.json;budget/<cell>/ab-timing.mdcaptures-default.jsonbyte-identical; master vs zero-slot arm within F and 1.10x on canvas-lowerpython3 scripts/render-verify.py --target IRCanvasStress --no-build,--target IRPerfGrid --no-build,python3 scripts/light-verify.py --if-changed,capture.py --cases lower,stacked-8-h60,oblique-lower,oblique-stacked-8-h60 --label defaultatkSunDepthSlabSlots = 0u;budget/master-vs-base/ab-timing.mdall 59 checks PASS, IRPerfGridall 21 checks PASS,[light-verify] all checks PASS;captures-default.json(lower,stacked-8-h60,oblique-lower,oblique-stacked-8-h60) receiver hashes identical to the base arm's. Master vs zero-slot arm, five interleaved pairs on canvas-lower:bakeSunShadowMap1.465 vs 1.458 ms (+0.006, 1.004x, pass by (i)), envelope 1.004x, steady frame mean 1.022x pass; steady p99 1.110x with both arms 90% / 93% in the 7..9 ms bins (two base runs' bimodal 8.8 ms p99). Amended head (probe row writer, fixtures, lint):render-verify --target IRCanvasStress --no-build59 of 59 PASS,light-verify --if-changedPASS, the four default captures re-taken on the rebuilt binary with receiver hashes identical to the committed default and the base arm.IrredenEngineTestbuild cleanpython3 scripts/tests/test_render_sun_depth_slab.py; the five neighbour tests;python3 scripts/shader_parity_audit.py;fleet-build --target header-checks,format-changed,IrredenEngineTestRan 7 tests … OK:61750 write sets (200 overflowed, 18440 recovered …)and107 cooperative write sets agree with the per-pixel writer (153953 spilled writes, 411 dropped at the cascade edge, 39060 overflowed texels)in both dialects;dropped_flush,dropped_spill,wrong_window_origin,inclusive_window_boundeach fail withcooperative window disagrees with the per-pixel writer; the twin test checkskSunDepthSlabWindowTexelsacross the three twins and the group size across the two wrappers, the system constant and the Metal registry. Neighbours OK;shader_parity_audit: clean; all three targets built. Amended head:ruff check scripts/clean (the eight E501 lines rewrapped),test_render_box_face_projection.pyOK with the slab-write stub and the newnearest_only_primarycontrol,test_render_legacy_shadow_bake.pyOK, the probe-row gtest PASS with its positive control. CI:fleet-testson this head fails ontest_fleet_tests_workflow_paths.sh/test_fleet_test_subjects.py(unregisteredscripts/perf/sdf_controls.py), fixed on master by #4878 and not in this branch's fork point; it clears on the merge rebase.kSunDepthSlabSlotsmatches in the three twinsgrep -n 'kSunDepthSlabSlots = ' engine/prefabs/irreden/render/sun_face_query_layout.hpp engine/render/src/shaders/ir_sun_face_query_layout.glsl engine/render/src/shaders/metal/ir_sun_face_query_layout.metal0uin all three; compiled out, the design-doc row and "cost and the budget work" section carry the four-arm readings, the attribution and the two recorded levers; README "Budget" sections and this body likewise.Plan departures
--sun-primary-rect-probe(the plan left the name to the implementer); master's--sun-primary-probeflag is unchanged.budget/cooperative-full-window/) and is within the spread of the restructure. The single slab write delegates tomergeSunDepthSlabPair(the same loads and atomics as the prototype's loop, now one copy), and the window's shared claim restates that loop over the shared words because GLSL cannot pass a shared array.--baseline <zero-slot-build> --head buildform is preserved; the driver takes--arm name=treeso every arm interleaves in one window. The capture baseline is the zero-slot base arm, since master's own binary rejects the stacked scenes' fixture flags (plan, Verified current state); master's binary is measured in cost on canvas-lower (criterion 4).FrameDataVoxelToCanvas/FrameDataSunuploads with the CPU iso twins; it also reports 8x8 grouping and a 64 window, and now the per-write spill share. The committed census frame is the zoom-2 capture shot (16,008 caster pixels on the lower cell); the timing cells profile at zoom 1, whose frame (4,002 casters) is committed beside it asfootprint/<cell>-zoom1.csv.test_render_legacy_shadow_bake.py) extracts the productionmainfrom behind the cooperative#ifand stubsIRPrefab::Camera::getYawSplitplus theRasterBakeDispatchselector; same controls, same expected failures.Discovered 0 display monitors); every GPU window ran undercaffeinate -d -i -u, and the one quiet-window breach (exit 76, canvas-lower attempt 1) was retaken whole.Notes for reviewer
Linux perf-gate on the design-unblocked head (
53c77f701-civsperf-baseline@955715317, master4d4a9c114, 1.3 d old, no measured master improvement to the merge base): passes;bakeSunShadowMapGPU stage 14.84→15.56 / 28.15→27.94 / 65.19→65.48 / 25.53→24.50 ms on the four llvmpipe cells, the system row at most +9.2% (IRLuaPerfGrid zoom 1, under the 10% threshold, the other three within ±2.2%). At zero slots the bake dispatches are master's, so the earlier flagged run against the 2.9-day-old baseline reads as runner drift.fleet-pr-overlap --base master:VERDICT: overlap— #4864 sharesengine/render/src/metal/metal_render_impl.cppandtest/render/gpu_compute_dispatch_test.cpp, both trial merges clean (this PR's hunks there are thefillBufferoffset overload and one upload test, unchanged this iteration).Design-unblocked resume: the direction's decision 4 is built, measured and found over budget, so the shipped render path is master's (zero slots). The diff a reviewer should read: the window include and the cooperative body under its define (both dialects), the bake system's
rasterBakeDispatchselection, the harness emulation and controls, the probe's spill share, and the evidence (budget/,captures-*.json, README, design doc). The frozen arms' identities are inbudget/*/manifests.jsonand the capture JSONs; the per-pixel and fills arms are pool-2's frozen trees from the previous iteration (same binary hashes as the committed manifests), the head arm is this head at three slots.Closes #4845
🤖 Generated with Claude Code