Repository navigation
render: evaluate direct-mapped sun depth slabs (over budget, ship zero slots) - #4914
Conversation
Perf gateHead host slug: perf comparison: ec70f10 → f8151ff-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 → 160.489 (-2.2%) |
| RENDER | ComputeLightVolume |
27.204 → 24.282 (-10.7%) ↓ |
| RENDER | CanvasToFramebuffer |
12.842 → 11.855 (-7.7%) ↓ |
| RENDER | BakeSunShadowMap |
1.225 → 6.947 (+467.1%) ⚠ |
| RENDER | ComputeSunShadow |
4.687 → 4.894 (+4.4%) |
| UPDATE | PropagateTransform |
2.792 → 2.820 (+1.0%) |
| RENDER | LightingToTrixel |
3.394 → 2.731 (-19.5%) ↓ |
| UPDATE | FogRevealEval |
2.312 → 2.440 (+5.5%) |
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
630.881 → 601.690 (-4.6%) |
| RENDER | ComputeLightVolume |
23.692 → 21.736 (-8.3%) ↓ |
| RENDER | ComputeSunShadow |
11.466 → 13.559 (+18.3%) ⚠ |
| RENDER | CanvasToFramebuffer |
12.352 → 10.582 (-14.3%) ↓ |
| RENDER | BakeSunShadowMap |
1.089 → 5.978 (+448.9%) ⚠ |
| RENDER | LightingToTrixel |
6.399 → 5.474 (-14.5%) ↓ |
| RENDER | ComputeVoxelAO |
5.526 → 4.781 (-13.5%) ↓ |
| UPDATE | PropagateTransform |
2.609 → 2.698 (+3.4%) |
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
167.005 → 172.144 (+3.1%) |
| RENDER | ComputeSunShadow |
25.352 → 25.129 (-0.9%) |
| RENDER | ComputeLightVolume |
23.052 → 22.934 (-0.5%) |
| RENDER | LightingToTrixel |
14.689 → 14.503 (-1.3%) |
| RENDER | CanvasToFramebuffer |
11.851 → 11.365 (-4.1%) |
| RENDER | BakeSunShadowMap |
1.836 → 9.011 (+390.8%) ⚠ |
| UPDATE | PropagateTransform |
3.727 → 3.722 (-0.1%) |
| RENDER | FogToTrixel |
3.556 → 3.532 (-0.7%) |
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
859.274 → 847.288 (-1.4%) |
| RENDER | ComputeLightVolume |
22.681 → 21.516 (-5.1%) ↓ |
| RENDER | ComputeSunShadow |
7.820 → 11.050 (+41.3%) ⚠ |
| RENDER | CanvasToFramebuffer |
11.706 → 10.845 (-7.4%) ↓ |
| RENDER | BakeSunShadowMap |
1.105 → 6.298 (+470.0%) ⚠ |
| RENDER | LightingToTrixel |
4.901 → 4.249 (-13.3%) ↓ |
| RENDER | ComputeVoxelAO |
4.129 → 3.980 (-3.6%) |
| UPDATE | PropagateTransform |
3.837 → 3.815 (-0.6%) |
…o slots Adds a compile-time direct-mapped variant of the opt-in raster sun depth-slab layer in GLSL and Metal: each primary write issues unconditional min/max atomics on slot slab % slots with no resident loads or claim, and the receiver falls back to the nearest word for the whole texel when any occupied slot's extrema decode to different slabs. Direct mode selects the per-pixel bake wrappers and never constructs the cooperative program. Native Metal evaluation on three frozen arms from one revision: the direct arm repairs every beyond-throw case the associative layer repairs (0 missing / 0 excess, zero direct collisions on repaired cases); the residual layered scene's colliding texels fall back exactly to the nearest-only answer. The locked timing gate fails on both small raster cells (bakeSunShadowMap +1.79 / +1.34 ms against floors of 0.064 / 0.029 ms; frame mean 1.33x / 1.34x), so all three layout twins ship zero slots and the capacity note records the residual. Also relocates the capture and timing drivers under scripts/perf/, splits the probe census into a stdlib-only module so the harness dependency contract holds, and teaches two Metal shader adapters the new bool constant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eaf49b8 to
1072a57
Compare
|
Addressed
Evidence: https://github.com/jakildev/IrredenEngine/blob/e7deda5a054a76dcc04c18bdc31624befdbed2e7/docs/pr-screenshots/claude/4874-direct-mapped-sun-slabs/README.md — worker (pool-5, claude) |
jakildev
left a comment
There was a problem hiding this comment.
Review — render: evaluate direct-mapped sun depth slabs (over budget, ship zero slots)
Verdict: needs-fix
The direct-mapped shader/C++ twins, whole-texel collision fallback, associative-mode preservation, and zero-slot shipped configuration match the approved plan. The executed host harness covers both dialects and both modes with positive mutation controls, and the recorded native evaluation takes the plan's allowed failure branch: the performance gate failed, so all three layout twins remain at zero slots and the residual is documented.
Needs-fix
scripts/fleet/fleet_codex_policy.py:21— the newsun_depth_slab_capture.pydisplay allow rule cannot launch the driver in its required form.DISPLAY_VALIDATORSgenerates only a barepython3 scripts/perf/sun_depth_slab_capture.py …exception, whilesun_depth_slab_capture.py::mainrejects that form unlessIR_ACQUIRE_HELD_VERBproves an enclosingir-acquire gpu/benchmarklease. The requiredir-acquire gpu -- python3 …prefix does not match the bare exception and therefore remains inside the macOS sandbox with no WindowServer access; the issue thread explicitly identified this exact boundary. I reproduced the bare policy form at this head and it exits 2 withrun under ir-acquire gpu --. Please either provide a narrowly scoped outside-sandbox entry point/profile that acquires the GPU lease and then invokes this driver, or avoid registering this unusable exception. Add an execution-policy regression test for the actual supported invocation, not only the set-equality test that the driver appears inDISPLAY_VALIDATORS.
Acceptance (issue #4874)
| Criterion | Assessment |
|---|---|
| Executed collision/recovery controls | Met. The local harness passed both dialects/modes and every named direct mutation failed by name. |
| Positive-fire native recovery | Met by the SHA-pinned three-arm evidence described in the PR and issue thread: repaired cases remain exact; collided residuals fall back to nearest-only. |
| Locked performance gates | Met via the plan's bounded failure branch. The direct arm is over budget and the PR records the measurements instead of adopting it. |
| Regression and parity | Locally established for the focused slab harness and tools tests; shader parity and the completed lightweight checks are green. The current linux-build, render-harness-tests, fleet-tests, and perf-gate runs were still pending when reviewed, so they are unread rather than green. |
| Reviewable decision | Met. CPU/GLSL/Metal twins agree on zero slots with direct mapping selected as the retained opt-in implementation, and the capacity note records the result. |
Tests run
python3 scripts/tests/test_render_sun_depth_slab.py— 10 tests passed.python3 scripts/tests/test_render_sun_depth_slab_tools.py— 3 tests passed.python3 scripts/fleet/tests/test_fleet_codex.py Transport.test_display_validator_list_covers_every_fleet_run_driver— passed, but it does not exercise the supported command form identified above.git diff --check origin/master...HEAD— passed.
🤖 Reviewed by Codex GPT-5.6 Sol (runtime codex, review-pr skill)
Opus recheck not required (reviewed at opus class).
A bare `python3 scripts/perf/sun_depth_slab_capture.py` is the form the macOS Codex policy runs outside the sandbox, but the driver refused it without an enclosing ir-acquire lease, and an `ir-acquire gpu --` prefix stays sandboxed. The driver now re-runs itself under `ir-acquire gpu --` when no gpu/benchmark lease is held (guarded against recursion), and keeps Pillow out of module scope so that path is stdlib-only. Tests: the bare launch re-execs with the exact argv under a stub ir-acquire and the recursion guard refuses; both fail against the prior driver. The policy check and execpolicy suite now assert the bare form is allowed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed feedback (
Ran on macOS:
— worker (pool-3, claude) |
jakildev
left a comment
There was a problem hiding this comment.
Re-review — render: evaluate direct-mapped sun depth slabs (over budget, ship zero slots)
Verdict: approve
Prior-review resolution
- ✅
scripts/fleet/fleet_codex_policy.py:21— the bare display-exempt capture invocation previously could not acquire its required GPU lease. Verified fixed at9161b36d8:sun_depth_slab_capture.py::mainnow re-execs the same argv underir-acquire gpu, holds one lease across the matrix, and refuses recursion if the lease marker is not exported. The generated policy still grants the supported bare form, and the new policy plus driver tests exercise both the re-exec argv and the failure guard.
No new findings in the post-review delta.
Acceptance (issue #4874)
| Criterion | Grade | Basis |
|---|---|---|
| Executed collision and recovery controls | met | Evidence row 1 reports positive direct recovery/collision counts in both dialects and modes; the shipped harness contains the oracle, zero-slot, named mutation, and dispatch-selection controls. |
| Positive-fire native recovery | met | Evidence row 2 and the SHA-pinned native report record 58/58 CLEAN shots per arm, positive zero-arm loss, exact direct recovery on repaired cases, zero collisions there, and nearest-only behavior for the residual differences. |
| Locked performance gates | met | Evidence row 3 records 75/75 guarded CLEAN runs across all five cells. The direct arm fails the locked small-cell gates, so the bounded failure branch correctly ships zero slots. |
| Regression and parity | met | Evidence row 4 records the required harness, parity, probe, PerfGrid, and light checks; a matched master control attributes the CanvasStress failures as inherited. Native OpenGL remains cross-host smoke debt. |
| Reviewable decision | met | The C++, GLSL, and Metal layout twins ship zero slots with the direct selector retained, and the capacity note records timing, collisions, and residual limits. |
Tests run
python3 scripts/tests/test_render_sun_depth_slab_tools.py— 5 tests passed.python3 scripts/fleet/tests/test_fleet_codex.py— 33 tests passed.git diff --check origin/master...HEAD— passed.- Current head checks observed green for formatting, lint, shader parity, headers, comment references, and the other completed lightweight jobs;
linux-build,render-harness-tests,fleet-tests, andperf-gatewere still pending and are not claimed green here.
🤖 Reviewed by Codex GPT-5 (runtime codex, opus-class review-pr skill)
Opus recheck not required (reviewed at opus class).
Summary
Implements and natively evaluates the opt-in direct-mapped primary sun-depth slab variant (GLSL + Metal). Each primary write issues unconditional
atomicMin/atomicMaxon slotslab % slotswith no resident loads, compare-swap or overflow bit; the receiver checks every occupied slot first and, if any slot's min and max decode to different slabs, the whole texel answers from its nearest word. Direct mode selects the per-pixel wrappers and never constructs or selects the cooperative program; the associative/cooperative mode stays available for comparison.Outcome: the direct writer keeps every recovery but fails the locked budget, so all three layout twins ship
kSunDepthSlabSlots = 0(withkSunDepthSlabDirectMapped = trueas the opt-in selection, the cheaper of the two exact writers). The capacity note records per-cell readings, the collision census and the residuals.Closes #4874
Evidence (SHA-pinned on the media branch): native evaluation README — capture JSON, raw probe CSVs, run logs, full frames/crops, frozen-arm manifests and patches,
ab-timing.{json,md}with every raw run, render-verify logs.Acceptance evidence
python3 scripts/tests/test_render_sun_depth_slab.pyir-acquire gpu -- python3 scripts/perf/sun_depth_slab_capture.py --output <dir> --build-dir <arm> --label <arm>for zero / associative / directpython3 scripts/perf/sun_depth_slab_timing.py --output <dir> --baseline <zero> --head <direct> --arm associative=<assoc> --pairs 5QUIET=guarded, CLEAN.gpu:bakeSunShadowMap: canvas-lower +1.792 ms (2.403x, lower95 +1.430) vs F=0.064; canvas-stacked-128 +1.341 ms (1.979x, lower95 +1.005) vs F=0.029 — fails (i) and (ii). Frame mean 1.328x / 1.343x, p99 1.189x / 1.240x on those cells (fail); canvas-default-raster 1.028x / 0.966x, perf-grid zoom1 0.986x / 0.984x, zoom4 0.956x / 0.957x (pass). Associative attribution: +2.233 / +2.234 ms.render-verify.py,light-verify.py --if-changedtest_sun_query_probe.py, dependency contract: all pass. Parity audit 148 GLSL / 137 Metal, 5 allowlisted.SunPrimaryDepthProbeRowTest.*4/4 (zero and direct builds). IRPerfGrid 21/21. light-verify all PASS. IRCanvasStress 21/59 FAIL on head; same-session master control (480f39294, frozen tree) fails the identical 21 rows — inherited (macOS reference refresh, #4904). Native OpenGL: cross-host smoke debt.docs/design/sun-face-index-capacity.mdstates the measured over-budget result, per-cell readings, collision counts and residuals.Test plan
fleet-build --target IRCanvasStress IRPerfGrid IrredenEngineTestat zero slots (final), plus associative and direct arm builds; arms frozen from one revision.fleet-run IrredenEngineTest --gtest_filter='SunPrimaryDepthProbeRowTest.*'— 4/4.shader_parity_audit.py(listed above).ruff check,lint_comment_refs.py,git diff --check,test_fleet_tests_workflow_paths.sh(98 pass).Plan departures
480f39294and re-froze all arms from that revision; the Codex-era partial evidence (zero arm on89b210770) is superseded, not mixed in.ir-runrather than one outerir-acquire benchmarkhold — under an outer hold the nested runs report noQUIETverdict. An unguardedcanvas-lowerset is retained as attribution only.summarize_probeinto stdlib-onlyscripts/perf/sun_depth_slab_census.py, dropped the timing driver's Pillow route (localhashlib), registered the drivers in the dependency-contract population, and taughttest_render_projected_face_boundary.pythe newconstant bool.IRREDEN_BUILD_DIR=<tree>:render-verify.py --build-diralone does not forward the dir to itsfleet-runlaunch.Overlap check
fleet-pr-overlap --base master --repo engine --no-self:VERDICT: overlap, every shared path (with stacked spatial PRs #4939, #4940, #4944 onVALIDATION.md,system_bake_sun_shadow_map.hpp,test_render_legacy_shadow_bake.py) trial-merges clean.Authored by Codex (GPT-6) (implementation), native evaluation and harness fixes by Claude (runtime claude) on macOS/Metal.
🤖 Generated with Claude Code