Skip to content

render: skip the main-canvas sun-shadow dispatch on cardinal surfaces - #5176

Merged
jakildev merged 2 commits into
masterfrom
claude/5102-sun-shadow-content-skip
Nov 19, 2026
Merged

jakildev merged 2 commits into
masterfrom
claude/5102-sun-shadow-content-skip

Conversation

@jakildev

@jakildev jakildev commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

On a cardinal surface-lit frame, COMPUTE_SUN_SHADOW now skips the main-canvas grid dispatch when every occupied texel is a cardinal voxel surface. Lighting never samples the shadow texture there.

  • C_TriangleCanvasTextures records whether its distance content needs a query. Every distance writer binds through one chokepoint with a content kind, and only the device clear to the empty sentinel resets the record.
  • The distance texture member is private (m_textureTriangleDistances), so a CPU write outside the component's mutators does not compile.
  • When the dispatch does run, empty texels and cardinal voxel surfaces are left unwritten (GLSL and Metal).
  • Debug asserts check that the producer and the reader skip the same texels.

Screenshots

No visual change: 14 of 14 pairs identical, IRCanvasStress (--debug-overlay shadow, plus the skip-firing fixture; published to media at 7ab6843a7).

Acceptance evidence

Criterion Check run Observed
Premise probe (plan correction 1) throwaway env-gated skip vs master, 6 interleaved rounds computeSunShadow row absent with the skip, upper bound −94.8% (issue comment)
1. Cost drops by half (positive-fire) repeat_profile.py parent/head pairs, cardinal-zoom4-overlap8-subdiv4, Metal Debug, QUIET=guarded 6 clean pairs: 0.308 ms → absent; paired upper bound −0.295 ms = −95.7%; skip logged on every head run (docs/perf/main-canvas-sun-shadow-skip/comparison.json)
1. Frame rows, rule (i) same pairs, ratio limit 1.05 frame avg 0.990×, GPU commandBufferSpans 1.005×
2. Captures unchanged: nine-yaw IRCanvasStress, IRShapeDebug table, --debug-overlay shadow same-session parent/head, render-compare.py --per-pixel-tol 0 9/9, 28/28, 28/28 pairs at max delta 0
2. Captures where the skip fires (plan correction 2) fixture at subdiv 1 and 4, fixture nine-yaw, nine-yaw --probe-floor-mode grid 2/2, 2/2, 9/9, 9/9 at max delta 0; skip logged on 5 cardinal poses, resumed on 4 rotating
3. No new IRPerfGrid / IRFogDemo render-verify failures every manifest run (5 + 37, incl. --ceiling-shadow) replayed on parent and head 116/116 pairs at max delta 0; FOG-SHADOW-PROBE lines identical (see notes)
4. Writer census complete (GPU binds) fleet-rules-sweep --pattern 'TextureAccess::(WRITE_ONLY|READ_WRITE),\s*(IRRender::)?TextureFormat::R32I' … 16 hits / 10 files on master → 8 / 5 on head, none a canvas distance (table in notes)
4. Writer census complete (CPU writes) test_cpu_distance_writes_record_canvas_content in scripts/tests/test_render_cardinal_surface_lighting.py member private, accessor const, Texture2D::subImage2D / clear non-const, 0 other tracked sources name the member; 4 of 4 mutation controls fire (public member, mutable accessor, const CPU writer, outside writer)
5. Tests python3 scripts/tests/test_render_cardinal_surface_lighting.py; python3 scripts/tests/test_render_canvas_shape_geometry.py; bash scripts/tests/run_all.sh; IrredenEngineTest --gtest_filter='CanvasBackingResizeTest.*'; python3 scripts/shader_parity_audit.py Ran 5 tests … OK; Ran 3 tests … OK; 134 of 135 suites (the miss is test_render_verify_demo_args.py: 6 failures from its run mock catching the macOS display_preflight probe; subject and test are byte-identical to master); 3 of 3 passed; clean, 171 glsl and 158 metal files
5. No Decision 5 assertion Debug IRCanvasStress nine-yaw sweeps (SDF and grid floor) and every capture run above 0 assertion lines on any head run
Reviewer notes

Plan departures

  • Voxel stage 1. Its depth taps bind the distance texture READ_ONLY (atomic writes) and stay off the chokepoint. Stage 2's bind in the same tick records the content for both, because both cover the same texels apart from off-screen shadow feeders.
  • Reset sites (correction 3). Only clearDistancesToEmpty() (device clearTexImage) resets the record. canvas_clear.hpp and ShapeOnlyCanvasClear now call it. clear(), clearWithColor(), clearWithColorData(), clearDistances() and setTrixel() record QUERIED instead of resetting: Texture2D::clear is unreliable for R32I on Metal, and clearDistanceTexture stores 65534, which lighting reads as occupied.
  • Census miss. font_maker, trixel_rect.hpp (fillRect / blitRect) and mask_grid_painter.hpp wrote the distance texture directly with subImage2D. They now go through a new writeDistances mutator, which records QUERIED. The GPU-bind sweep cannot see a CPU write, so the member is now private and the CPU census runs as a test.
  • Stage 2's content kind is CARDINAL_VOXEL_SURFACE only when perAxisRoute_ == 0, the canvas is not detached, residualYaw_ == 0, there is no cut-section fog and no source-face display. Any fog canvas therefore keeps its dispatch. That covers the --ceiling-shadow probe and the lighting: fog-pass pipelines take the one sun-shadow receiver model by default (stage 2 of #4965) #5123 ordering gotcha.
  • Reader-side assert reads System<COMPUTE_SUN_SHADOW>::cardinalSurfaceLightingEligible_ through findSystem in lighting's beginTick. It asserts equality only when the producer is registered.
  • engine/prefabs/irreden/render/CLAUDE.md is not edited. It is over its byte budget on master (21050 against 20823). The chokepoint contract lives in the component and system header comments.
  • Criterion 3 is graded head against parent. This host had an external 1x display attached, so every capture on both arms is 1280×720 against the committed 2560×1440 macOS references. render-verify.py therefore fails on shape alone for parent and head alike (21/35 IRPerfGrid on both). The replay keeps the manifest's arguments and warmup per run.

Notes for reviewer

Closes #5102

🤖 Generated with Claude Code

On a cardinal surface-lit frame lighting reads no sun-shadow texel of a
main canvas whose occupied texels are all cardinal voxel surfaces, yet
COMPUTE_SUN_SHADOW still visited every texel of it. C_TriangleCanvasTextures
now records whether its distance content needs a query: every distance
writer binds through one chokepoint with a content kind (voxel stage 2
reports cardinal surfaces only under its own cardinal-bit gate), and only
the device clear back to the empty sentinel resets the record. The pass
skips the main-canvas grid dispatch when the surface variant is selected
and the record is clear.

When the dispatch runs, empty single-canvas texels and cardinal voxel
surfaces are left unwritten, in both shader twins. Debug asserts check
that the producer's and the reader's skip sets agree on each frame and
that the surface variant never runs at a non-zero residual yaw.

On Metal Debug, cardinal-zoom4-overlap8-subdiv4, computeSunShadow drops
from 0.308 ms to no GPU sample; captures are unchanged. Evidence:
docs/perf/main-canvas-sun-shadow-skip/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jakildev jakildev added fleet:author-claude Implementation last authored by Claude; route review to Codex fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend labels Nov 18, 2026

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — render: skip the main-canvas sun-shadow dispatch on cardinal surfaces

Verdict: needs-fix

The whole-dispatch approach and its Metal evidence are sound, but the current head does not yet uphold its writer-chokepoint invariant and turns a required CI validator red.

Needs-fix

  • engine/render/include/irreden/render/trixel_rect.hpp:76 and engine/render/include/irreden/render/mask_grid_painter.hpp:97 — both CPU helpers still write textureTriangleDistances_ directly with subImage2D, bypassing C_TriangleCanvasTextures::recordDistanceContent. After an empty reset, either helper can introduce queried content while holdsQueriedContent_ remains false, allowing COMPUTE_SUN_SHADOW to skip and leave stale shadow texels. Route both uploads through writeDistances (or the same recording chokepoint) and add a census/test that covers direct CPU texture writes; the current R32I bindAsImage sweep cannot see these two sites.
  • scripts/tests/test_render_canvas_shape_geometry.py::test_geometry_writers_invalidate_and_shading_preserves — the PR moved clearTexImage behind clearDistancesToEmpty() without updating this contract test. Both CI and a local run error at line 269 with ValueError: substring not found, so render-harness-tests and all-checks are red. Update the assertion to verify invalidation precedes the device clear inside clearDistancesToEmpty, then run the render-harness suite.

Acceptance (issue #5102)

4 of 5 met. Cost, capture parity/route transitions, parent-vs-head render verification, and the named shader/cardinal tests have credible positive-fire evidence. Criterion 4 (writer census) is unmet because the two direct CPU subImage2D writers above bypass the new content record and are invisible to the stated sweep.

Praise

  • The skip is scoped to the main-canvas grid dispatch rather than returning from the whole tick, preserving per-axis and shape-receiver work exactly as the reviewed plan required.
  • The evidence includes the skip-firing fixture, cardinal-to-rotating transitions, parent/head render-manifest replay, and a paired upper bound well beyond the required reduction.

Checked

  • Read the complete PR/issue thread, including both plans, both correction rounds, the refuted store-only premise, and the replacement premise probe.
  • Reviewed current head 71ab22ed9977bb44933d67d24872f976ac43d292 and all changed code/shader paths in context.
  • python3 scripts/tests/test_render_cardinal_surface_lighting.py: 4 tests passed.
  • python3 scripts/shader_parity_audit.py: clean, 171 GLSL and 158 Metal files.
  • python3 scripts/tests/test_render_canvas_shape_geometry.py: 3 tests run, 1 error at the stale clearTexImage assertion.
  • Current GitHub checks: render-harness-tests failed for the same error; linux-build and perf-gate were still pending when reviewed; the remaining completed checks passed.

Test plan the author should run before merge

  • Route both external CPU distance uploads through the recording mutator and add a regression census for direct textureTriangleDistances_ writes outside the owner component.
  • Update test_render_canvas_shape_geometry.py for the extracted clear helper and run bash scripts/tests/run_all.sh to a clean terminal result.

🤖 Reviewed by Codex GPT-5 (opus-class; review-pr skill)

Opus recheck not required (reviewed at opus class).

@jakildev jakildev added fleet:needs-fix Fleet reviewer found issues — author must address and removed fleet:reviewing-mac-pool-2 labels Nov 18, 2026
@jakildev jakildev removed the fleet:needs-fix Fleet reviewer found issues — author must address label Nov 18, 2026
@github-actions

Copy link
Copy Markdown

Perf gate

Head host slug: linux-x86_64-xeon-6975p-c-03-0-vga

perf comparison: b309c9f → 59c5e51-ci

baseline: /home/runner/work/_temp/perf-baseline/history/linux-x86_64-xeon-6975p-c-03-0-vga/b309c9f6048632dbfc29df976605a00b49aa3523
head: /home/runner/work/IrredenEngine/IrredenEngine/save_files/perf/59c5e5197-ci

host calibration

  • host: linux-x86_64-xeon-6975p-c-03-0-vga (matches baseline)
  • ref_ms: head 69.90 vs baseline 69.98 (load_factor 1.00×)
  • calibration target: 50.00 ms (informational)
  • baseline capture: perf-baseline@b309c9f60 (branch tip); master 40cb99890, finished 2026-11-18T00:35:20Z, 0.2 d before the head run, ref_ms 69.98
  • weighting: raw (class-matched capture; load_factor 1.00×; no calibration-scaling entry)
  • attribution: no measured master improvement between capture master 40cb99890 and merge base 18a91f694 (7 commits)

thresholds: regress ≥ 10%, improve ≥ 5%

voxel cull effectiveness

cell ratio (base→head) avg visible total avg feeder
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 1.000 → 1.000 (+0.0pp) 262144 → 262144 1024 → 1024 0 → 0
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 0.598 → 0.598 (+0.0pp) 156630 → 156630 1024 → 1024 0 → 0
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 1.000 → 1.000 (+0.0pp) 262144 → 262144 1024 → 1024 0 → 0
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 0.975 → 0.975 (+0.0pp) 255592 → 255592 1024 → 1024 0 → 0

frame timing (ms)

cell avg p99
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 451.04 → 444.89 (-1.4%) 1173.32 → 1175.05 (+0.1%)
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 959.09 → 960.05 (+0.1%) 1732.18 → 1751.68 (+1.1%)
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 503.95 → 515.42 (+2.3%) 6730.35 → 6996.33 (+4.0%)
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 1357.59 → 1358.45 (+0.1%) 2036.00 → 2081.53 (+2.2%)

GPU frame timing (ms; separate from stage samples)

cell envelope (base→head) buffer spans (base→head) coverage (base→head)
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable

GPU stage timing (avg ms per sampled invocation)

cell canvasClear voxelCompact voxelStage1 voxelCardinalElect voxelStage2 voxelSunFaces textToTrixel buildLightOcclusionGrid computeVoxelAO bakeSunShadowMap computeSunShadow computeLightVolume lightingToTrixel fogToTrixel trixelToFb resolvePerAxisScreenDepth fbToScreen
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 16.87→16.81 48.76→47.49 41.56→40.91 0.78→0.77 41.64→41.07 70.15→70.86 — 0.00→0.00 1.53→1.49 17.83→17.15 14.46→15.12 12.15→12.34 2.90→2.77 0.99→1.00 0.16→0.17 — 6.71→6.67
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 17.38→17.28 241.92→239.94 182.43→180.26 3.04→3.12 172.59→171.59 114.14→113.47 — 0.00→0.00 1.29→1.30 30.18→29.69 12.93→12.88 10.14→10.26 5.01→4.86 1.09→1.03 ↓ 0.16→0.15 ↓ — 6.35→6.34
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 15.45→15.50 55.69→56.56 44.44→44.56 6.62→6.84 37.16→37.62 65.84→65.51 1.29→1.30 0.00→0.00 4.16→4.26 38.79→40.13 12.29→12.91 29.16→29.87 4.86→4.91 1.38→1.39 0.15→0.16 0.00→0.00 7.13→7.20
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 16.48→16.72 393.12→393.32 292.56→292.94 4.66→4.71 268.53→268.27 127.72→128.16 1.33→1.31 0.00→0.00 1.31→1.36 38.63→38.74 13.79→14.40 11.02→11.19 4.34→4.27 1.18→1.19 0.15→0.15 0.00→0.00 6.24→6.22

top CPU systems by avg ms (head)

target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 221.593 → 219.673 (-0.9%)
RENDER ComputeLightVolume 26.250 → 27.102 (+3.2%)
RENDER CanvasToFramebuffer 14.773 → 14.828 (+0.4%)
RENDER ComputeSunShadow 13.119 → 12.464 (-5.0%)
UPDATE FogRevealEval 8.618 → 8.329 (-3.4%)
RENDER BakeSunShadowMap 6.145 → 6.064 (-1.3%)
UPDATE PropagateTransform 3.668 → 3.659 (-0.2%)
UPDATE LuaWaveStateToOffset 3.274 → 3.081 (-5.9%) ↓

target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 729.250 → 723.246 (-0.8%)
RENDER ComputeSunShadow 26.492 → 25.872 (-2.3%)
RENDER ComputeLightVolume 22.641 → 22.754 (+0.5%)
RENDER CanvasToFramebuffer 14.167 → 13.760 (-2.9%)
UPDATE FogRevealEval 7.354 → 8.151 (+10.8%) ⚠
RENDER ComputeVoxelAO 6.886 → 6.929 (+0.6%)
RENDER BakeSunShadowMap 5.002 → 5.154 (+3.0%)
RENDER LightingToTrixel 5.192 → 4.998 (-3.7%)

target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 235.817 → 237.672 (+0.8%)
RENDER ComputeSunShadow 34.222 → 35.665 (+4.2%)
RENDER ComputeLightVolume 23.624 → 24.525 (+3.8%)
RENDER LightingToTrixel 18.734 → 19.189 (+2.4%)
RENDER CanvasToFramebuffer 14.799 → 14.642 (-1.1%)
RENDER BakeSunShadowMap 8.113 → 8.060 (-0.7%)
UPDATE FogRevealEval 7.265 → 7.397 (+1.8%)
UPDATE PropagateTransform 4.769 → 4.746 (-0.5%)

target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 1101.999 → 1102.722 (+0.1%)
RENDER ComputeSunShadow 34.622 → 34.600 (-0.1%)
RENDER ComputeLightVolume 24.498 → 25.288 (+3.2%)
RENDER CanvasToFramebuffer 13.496 → 13.612 (+0.9%)
UPDATE FogRevealEval 7.735 → 7.453 (-3.6%)
RENDER ComputeVoxelAO 5.662 → 5.871 (+3.7%)
RENDER BakeSunShadowMap 5.175 → 5.272 (+1.9%)
UPDATE PropagateTransform 4.747 → 4.756 (+0.2%)

fillRect/blitRect and the mask-grid painter wrote the canvas distance
texture with subImage2D directly, so a CPU upload after an empty reset
left holdsQueriedContent() false and COMPUTE_SUN_SHADOW could skip a
canvas that now held queried content. Both go through writeDistances,
and the distance texture is private (m_textureTriangleDistances), so a
direct CPU write no longer compiles: getTextureDistances() hands out a
const texture, and Texture2D's CPU writers are non-const.

test_render_cardinal_surface_lighting gains the census: the member is
private, the accessor is const, Texture2D::subImage2D/clear take no
const receiver, and no other tracked source names the member, with one
mutation control per arm. test_render_canvas_shape_geometry checks the
invalidate-then-clear order inside clearDistancesToEmpty, now that
canvas_clear.hpp calls it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jakildev jakildev added fleet:changes-made Agent addressed human feedback — ready for human re-review and removed fleet:amending-mac-pool-2 labels Nov 18, 2026
@jakildev

Copy link
Copy Markdown
Owner Author

Addressed feedback:

  • Needs-fix 1 (direct CPU distance writes in trixel_rect.hpp:76 / mask_grid_painter.hpp:97): both now upload through writeDistances, which records QUERIED. I also made the distance texture private (m_textureTriangleDistances), so a CPU write that skips the mutators no longer compiles: getTextureDistances() returns a const texture, and Texture2D::subImage2D / clear are non-const. I added test_cpu_distance_writes_record_canvas_content as the census. It checks that the member is private, the accessor is const, those writers are non-const, and no other tracked source names the member. Each of its four checks has a mutation control that fires. writeDistances now also invalidates shape samples, like the other distance mutators. The one test that wrote the member directly (CanvasBackingResizeTest) now seeds through writeDistances.
  • Needs-fix 2 (stale clearTexImage assertion): test_render_canvas_shape_geometry.py now checks that invalidation comes before the device clear inside clearDistancesToEmpty, and that clearCanvasAndDistances resets through that call. clearDistancesToEmpty() and writeDistances( joined the list of writers that must invalidate.
  • Test plan, scripts/tests/run_all.sh: 134 of 135 suites passed. The one failure is test_render_verify_demo_args.py, which fails on this macOS host because the test's run mock catches the display_preflight probe. The script and its test are byte-identical to master, and the check is not red on CI.

New head: 070b033. Evidence rows 4 and 5 and the census plan departure are updated in the body.

@jakildev jakildev removed the fleet:changes-made Agent addressed human feedback — ready for human re-review label Nov 18, 2026

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — render: skip the main-canvas sun-shadow dispatch on cardinal surfaces

Verdict: approve

The amended head resolves both prior findings: every external CPU distance upload now crosses the recording mutator, and the clear-order contract test follows the extracted reset helper.

Acceptance (issue #5102)

5 of 5 met. The cost, capture parity and route-transition, parent/head render-verification, complete writer census, and required-test criteria all have credible positive-fire evidence on the amended head.

Checked

  • Read the complete PR and issue thread, including the superseded plan, both correction rounds, the refuted store-only premise, the replacement premise probe, the prior review, and the author's amendment response.
  • Reviewed the complete delta from 71ab22ed9977bb44933d67d24872f976ac43d292 to current head 070b033eaee110cb2f6df33e51edd557ab2f239f; no files changed beyond the two requested fixes and their tests/docs.
  • python3 scripts/tests/test_render_cardinal_surface_lighting.py: 5 tests passed, including the private-member/const-accessor CPU-writer census and mutation controls.
  • python3 scripts/tests/test_render_canvas_shape_geometry.py: 3 tests passed, including invalidate-before-device-clear and clearCanvasAndDistances delegation.
  • python3 scripts/shader_parity_audit.py: clean, 171 GLSL and 158 Metal files, 5 allowlisted.
  • Current GitHub checks completed green where concluded; linux-build, render-harness-tests, perf-gate, fleet-tests, and all-checks were still pending or in progress when reviewed and are unread, not green.

🤖 Reviewed by Codex GPT-5 (opus-class; review-pr skill)

Opus recheck not required (reviewed at opus class).

@jakildev jakildev added fleet:approved Fleet reviewer approved — ready for human merge fleet:needs-windows-smoke PR needs windows-debug build + smoke-run validation and removed fleet:reviewing-mac-pool-2 labels Nov 18, 2026
@github-actions

Copy link
Copy Markdown

Perf gate

Head host slug: linux-x86_64-epyc-7763-64-unknown

perf comparison: c03fe48 → 08aff6d-ci

baseline: /home/runner/work/_temp/perf-baseline/history/linux-x86_64-epyc-7763-64-unknown/c03fe48dab87d5d300542d0e688ff4393bf7b202
head: /home/runner/work/IrredenEngine/IrredenEngine/save_files/perf/08aff6d2f-ci

host calibration

  • host: linux-x86_64-epyc-7763-64-unknown (matches baseline)
  • ref_ms: head 103.64 vs baseline 103.65 (load_factor 1.00×)
  • calibration target: 50.00 ms (informational)
  • baseline capture: perf-baseline@c03fe48da (branch tip); master 44955ae9f, finished 2026-11-17T21:35:04Z, 0.4 d before the head run, ref_ms 103.65
  • weighting: raw (class-matched capture; load_factor 1.00×; no calibration-scaling entry)
  • attribution: no measured master improvement between capture master 44955ae9f and merge base 18a91f694 (8 commits)

thresholds: regress ≥ 10%, improve ≥ 5%

voxel cull effectiveness

cell ratio (base→head) avg visible total avg feeder
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 1.000 → 1.000 (+0.0pp) 262144 → 262144 1024 → 1024 0 → 0
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 0.598 → 0.598 (+0.0pp) 156630 → 156630 1024 → 1024 0 → 0
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 1.000 → 1.000 (+0.0pp) 262144 → 262144 1024 → 1024 0 → 0
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 0.975 → 0.975 (+0.0pp) 255592 → 255592 1024 → 1024 0 → 0

frame timing (ms)

cell avg p99
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 553.91 → 550.38 (-0.6%) 1865.43 → 1802.18 (-3.4%)
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 1276.14 → 1259.25 (-1.3%) 2584.83 → 2514.19 (-2.7%)
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 738.18 → 717.52 (-2.8%) 14006.37 → 13623.36 (-2.7%)
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 1810.79 → 1810.02 (-0.0%) 3053.63 → 3052.44 (-0.0%)

GPU frame timing (ms; separate from stage samples)

cell envelope (base→head) buffer spans (base→head) coverage (base→head)
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable

GPU stage timing (avg ms per sampled invocation)

cell canvasClear voxelCompact voxelStage1 voxelCardinalElect voxelStage2 voxelSunFaces textToTrixel buildLightOcclusionGrid computeVoxelAO bakeSunShadowMap computeSunShadow computeLightVolume lightingToTrixel fogToTrixel trixelToFb resolvePerAxisScreenDepth fbToScreen
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 22.95→23.09 65.28→65.27 56.26→55.99 0.96→0.97 55.56→55.93 95.85→96.34 — 0.00→0.00 2.88→2.70 ↓ 27.62→26.86 12.77→12.29 23.67→23.14 4.00→3.93 1.29→1.29 0.17→0.18 — 8.14→8.02
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 22.70→22.39 321.26→320.44 261.87→261.56 4.09→4.04 239.39→237.57 148.78→146.09 — 0.00→0.00 2.54→2.41 ↓ 46.99→45.71 11.74→10.89 ↓ 21.25→20.59 9.22→8.87 1.87→1.65 ↓ 0.22→0.16 ↓ — 7.87→7.51
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 20.96→20.42 81.11→80.65 62.43→62.44 13.66→13.77 51.00→51.21 89.96→90.11 1.23→1.16 ↓ 0.00→0.00 16.89→16.68 74.51→73.41 11.73→10.76 ↓ 61.24→59.07 8.38→8.12 1.91→1.86 0.19→0.17 ↓ 0.00→0.00 10.03→9.16 ↓
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 22.06→21.69 524.35→522.09 425.10→426.31 6.58→6.32 373.96→373.28 155.83→156.55 1.19→1.20 0.00→0.00 2.57→2.51 60.19→61.10 12.40→12.07 21.50→22.22 7.21→7.43 1.79→1.90 0.16→0.17 0.00→0.00 7.75→7.78

top CPU systems by avg ms (head)

target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 298.046 → 298.701 (+0.2%)
RENDER ComputeLightVolume 35.887 → 34.906 (-2.7%)
RENDER ComputeSunShadow 19.925 → 19.409 (-2.6%)
RENDER CanvasToFramebuffer 18.227 → 17.809 (-2.3%)
RENDER BakeSunShadowMap 10.420 → 10.034 (-3.7%)
UPDATE FogRevealEval 6.578 → 6.721 (+2.2%)
UPDATE PropagateTransform 4.948 → 5.056 (+2.2%)
RENDER ComputeVoxelAO 4.434 → 4.392 (-0.9%)

target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 992.838 → 987.179 (-0.6%)
RENDER ComputeSunShadow 40.580 → 39.667 (-2.2%)
RENDER ComputeLightVolume 32.529 → 31.054 (-4.5%)
RENDER CanvasToFramebuffer 17.101 → 16.210 (-5.2%) ↓
RENDER ComputeVoxelAO 11.089 → 10.933 (-1.4%)
RENDER LightingToTrixel 9.445 → 9.089 (-3.8%)
RENDER BakeSunShadowMap 8.988 → 8.642 (-3.8%)
UPDATE FogRevealEval 6.633 → 6.496 (-2.1%)

target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 346.948 → 342.429 (-1.3%)
RENDER ComputeSunShadow 67.001 → 65.961 (-1.6%)
RENDER LightingToTrixel 38.626 → 37.344 (-3.3%)
RENDER ComputeLightVolume 35.479 → 33.596 (-5.3%) ↓
RENDER BakeSunShadowMap 23.074 → 22.822 (-1.1%)
RENDER CanvasToFramebuffer 18.942 → 18.050 (-4.7%)
RENDER FogToTrixel 7.359 → 7.186 (-2.4%)
UPDATE PropagateTransform 6.053 → 6.362 (+5.1%)

target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 1504.717 → 1503.493 (-0.1%)
RENDER ComputeSunShadow 53.380 → 54.373 (+1.9%)
RENDER ComputeLightVolume 33.333 → 33.817 (+1.5%)
RENDER CanvasToFramebuffer 16.508 → 16.488 (-0.1%)
RENDER BakeSunShadowMap 9.077 → 8.996 (-0.9%)
RENDER ComputeVoxelAO 8.784 → 8.870 (+1.0%)
RENDER LightingToTrixel 7.400 → 7.609 (+2.8%)
UPDATE PropagateTransform 6.169 → 6.405 (+3.8%)

@jakildev jakildev added fleet:verified-windows Cross-host smoke passed on windows-debug and removed fleet:needs-windows-smoke PR needs windows-debug build + smoke-run validation labels Nov 18, 2026
@jakildev

Copy link
Copy Markdown
Owner Author

Cross-host smoke OK on windows (fresh checkout + IRShapeDebug --auto-screenshot 10 — build clean, exit 0, no log warnings).

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

Labels

fleet:approved Fleet reviewer approved — ready for human merge fleet:author-claude Implementation last authored by Claude; route review to Codex fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend fleet:verified-windows Cross-host smoke passed on windows-debug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

render: main-canvas sun-shadow compute pays a per-texel floor on texels that need no query

1 participant