Skip to content

render: make sun record admission deterministic (#5022) - #5063

Merged
jakildev merged 5 commits into
masterfrom
claude/5022-deterministic-sun-admission
Nov 15, 2026
Merged

jakildev merged 5 commits into
masterfrom
claude/5022-deterministic-sun-admission

Conversation

@jakildev

@jakildev jakildev commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • replace arrival-ordered voxel sun-face record reservation with per-workgroup counting, a dispatch-order prefix scan, and assigned record IDs
  • keep fallback rasterization active for every qualifying face when the record pool is exhausted
  • land structurally paired GLSL and Metal kernels plus an invocation-order regression for assigned IDs
  • create the admission scratch buffer unbound, publish GLSL shared-memory writes before both workgroup barriers, and restore IndirectDispatchParams after the three-pass bake releases shared SSBO slot 26

Test plan

  • python3 scripts/tests/test_render_sun_record_capacity.py — 3 tests passed; GLSL and Metal each passed 12 retention orders and 6 grown-capacity controls
  • bash scripts/tests/run_all.sh — 129/131 suites passed; all seven PR-affected suites pass, with only the documented master-red test_editor_screen_alignment.py and test_harness_dependency_contract.py failures remaining
  • python3 scripts/tests/test_sun_record_loss_stability.py — 11 tests passed
  • python3 scripts/shader_parity_audit.py — clean across 148 GLSL and 137 Metal files
  • cmake --build build --target header-checks — 842 headers and all shader/header registries passed
  • python3 scripts/lint_comment_refs.py — passed
  • fleet-build --target IRCanvasStress IrredenEngineTest — passed at amendment head
  • fleet-run IRCanvasStress --auto-screenshot 10 --no-auto-rotate --no-spin — clean sun-on exit; first and final captures inspected with voxel geometry and shadows present
  • fleet-run IRCanvasStress --auto-screenshot 10 --debug-overlay shadow --no-auto-rotate --no-spin — clean before/after exits; all 12 captures published below
  • fleet-run IRStatelessParticles --auto-screenshot 10 — clean exit; all four captures inspected and voxel particles render from the first shot through steady state
  • fleet-run IRCanvasStress --auto-screenshot 10 --no-shadows --no-auto-rotate --no-spin — clean exit; first and steady-state captures inspected with voxel geometry present
  • git diff --check — passed
  • python3 scripts/light-verify.py --if-changed — current-head runs reached shots 23/36 and 24/36, then the host lost its Aqua display connection (RESULT=NO-DISPLAY, exit 69); no validator verdict

Acceptance evidence

Criterion Check run Observed
Metal frozen gate is stable across 10 launches 10 independent fleet-run launches using the controller's exact canvas-frozen fixture, then the controller comparison helpers 100 captures requested 95,164 records against capacity 65,536; lost_min = lost_max = 3214, distinct_sets = 1, tiles_differing_any = 0, all pairwise differences = 0, and every in-run/cross-launch crop pixel difference = 0
Run the same gate on OpenGL or name it as owed Host capability review Owed on Windows/Linux OpenGL; this macOS 26.5.2 Apple M4 Max host exposes Metal only
Unfrozen positive control loses no records Direct canvas-unfrozen fixture run and controller comparison helpers 10 captures requested 95,164 records against capacity 131,072; lost_min = lost_max = 0, with one stable set and zero pixel differences
Capacity test passes and GLSL/Metal twins land together python3 scripts/tests/test_render_sun_record_capacity.py; python3 scripts/shader_parity_audit.py 3 tests passed for both backends; parity audit clean; both shader twins are in this PR
Measure frozen 64³ cost against master Clean Release IRPerfGrid --mode voxel_set --grid-size 64 --wave-freeze --auto-profile 300 --no-overlay --sun-face-index-probe runs on origin/master and head voxelSunFaces: master 1.044 ms, head 1.440 ms (+0.396 ms, +37.9%); steady frame: master 8.61 ms, head 8.33 ms. Each figure is one clean 300-frame run, with the first 75 frames excluded from steady-frame timing

Plan departures

  • No ## Plan was posted; implementation follows the issue body's count-and-prefix-scan design example and all five acceptance criteria.

Notes for reviewer

  • The admission scratch buffer is created without a target/index binding, is bound only inside bakeVoxelFaces, and the named IndirectDispatchParams buffer is restored to slot 26 after the three admission passes. The lookup is cached while remaining tolerant of pipelines that omit or create the resource late.
  • The canonical controller command python3 scripts/perf/sun_record_loss_stability.py capture canvas-frozen --launches 10 --raw /private/tmp/sun-record-loss-5022 was blocked because its sandboxed child saw Discovered 0 display monitors and ir-run: RESULT=NO-DISPLAY exe=IRCanvasStress exit=69. The evidence above comes from the same exact fixture launched through the permitted bare fleet-run path.
  • The earlier statement that 18 light-verify golden differences were an expected overflow-retention delta was too strong. A pre-PR run on this pane shows the same baseline-local delta family, but that is not a clean master comparison. The current-head reruns were environment-blocked before completion, so this PR records the lighting harness as unverified rather than passing or re-blessed; the ticket-specific 100-capture oracle remains pixel-identical.
  • Repository-wide format-check remains red on untouched pre-existing files; the changed header passes clang-format --dry-run --Werror directly.
  • fleet-pr-overlap reports one clean shared path with render: preserve per-light propagation falloff (#4967) #5036: engine/render/include/irreden/render/ir_render_types.hpp.
  • The serial admission scan and many-canvas scaling observations remain follow-up performance considerations; this amendment does not widen scope beyond the correctness fixes.

Screenshots

so3_smooth_sweep
Before After
so3_offsnap_disc
Before After
so3_wide_parity
Before After
so3_grid_cross
Before After
so3_offsnap_wide
Before After
revoxelize_solids
Before After
revoxelize_solids_zoom
Before After
orbit_overview
Before After
shadow_overlay_floor
Before After
revox_coverage
Before After
smallzoom_low
Before After
smallzoom_high
Before After

Clip:
full clip (mp4)

Closes #5022

🤖 Authored with Codex.

Count qualifying voxel faces per workgroup, reserve their record range once, and assign record IDs in dispatch order. This removes atomic scheduling from overflow admission while retaining the existing fallback raster path.

Keep the Metal and GLSL kernels structurally paired and extend the capacity regression to prove invocation-order-independent assigned IDs.
@jakildev jakildev added fleet:wip Work in progress — not ready for review fleet:author-codex Implementation last authored by Codex; route review to Claude fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend and removed fleet:wip Work in progress — not ready for review labels Nov 12, 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: make sun record admission deterministic (#5022)

Verdict: needs-fix

The approach is sound and matches the issue's count / prefix-scan design: per-workgroup counts, a dispatch-order scan, assigned record IDs, and the fallback raster kept active for every qualifying face. The UBO layout (48 → 64 bytes, GLSL std140, Metal struct, static_assert), the dispatch.y == grid.x flattening, resize before bindBase, the (groups + 2) * 4 sizing, and barrier uniformity all check out. Two defects block merge: a binding-slot hazard that can zero the voxel dispatch, and a missing shared-memory barrier in the GLSL kernel.

Checks on this head: linux-build, render-harness-tests, fleet-tests and perf-gate have no completed run yet, so they are unread, not green. All completed checks pass, including shader-parity and header-checks.

Needs-fix

  • engine/prefabs/irreden/render/systems/system_bake_sun_shadow_map.hpp:1385-1394 — the scratch buffer is created with BufferTarget::SHADER_STORAGE, kBufferIndex_SunFaceAdmissionScratch (slot 26). Both OpenGLBufferImpl and MetalBufferImpl call bindBase in that constructor (opengl_buffer.cpp:20-28, metal_buffer.cpp:25-31). VOXEL_TO_TRIXEL_STAGE_1::create ends by rebinding indirectBuf_ to slot 26 (system_voxel_to_trixel.hpp:2929-2932, with the comment that the single-canvas compact relies on that sticky bind). BAKE's create() runs after STAGE_1's (it now looks up "IndirectDispatchParams"), so it leaves slot 26 bound to the 8-byte scratch. The only restore is the one this PR adds at the end of bakeVoxelFaces (hpp:1276-1279), and that path does not run on every frame:

    • It returns early when shadowsEnabled_ == 0, when count == 0, or when a detached canvas has !castsWorldShadow_ (hpp:1219).
    • beginVoxelFaceCoverage() returns false whenever RENDER_STATELESS_PARTICLES_TO_TRIXEL or RENDER_GPU_PARTICLES_TO_TRIXEL is registered (hpp:1177-1181). creations/demos/stateless_particles/main.cpp:151-155 registers STAGE_1, stateless particles and BAKE together, so the restore never runs there.
    • The single-canvas path in STAGE_1 does not rebind 26 before the compact (only the per-axis split path does, at system_voxel_to_trixel.hpp:2127-2130). The compact's IndirectDispatchParams writes therefore land out of bounds in the scratch, and the real indirectBuf_ stays at its zeroed value (system_voxel_to_trixel.hpp:2095). That publishes zero-count stage-1/2 dispatches, so the likely symptom is no voxels drawn and no error.
    • Even in the normal sun-on case, the first frame's compact runs before the first restore.

    I verified the constructor binds, the STAGE_1 sticky rebind, and the missing rebind on the single-canvas path by reading the code. I did not run stateless_particles. Fix: drop the target and index arguments from the scratch createNamedResource so it is created unbound, as IndirectDispatchArgs is at system_voxel_to_trixel.hpp:2769; bakeVoxelFaces already binds it before use. If the creation bind stays, end create() with p->voxelIndirectBuf_->bindBase(BufferTarget::SHADER_STORAGE, kBufferIndex_IndirectDispatchParams). Add a smoke run of stateless_particles or a sun-off scene to the evidence.

  • engine/render/src/shaders/c_bake_voxel_sun_faces.glsl:165 and :184 — each barrier() guards a shared sharedRecordCounts[64] write that another invocation reads next. Lane 0 reads all 64 entries after the first barrier, and every lane reads its own prefix entry after the second. barrier() is an execution barrier only; the GLSL spec requires memoryBarrierShared() before it, as c_bake_sun_shadow_map_body.glsl:175-176 does. NVIDIA tends to fuse the two, so a GL smoke can pass anyway. Fix: add memoryBarrierShared(); immediately before both barrier() calls. The Metal side is correct (threadgroup_barrier(mem_flags::mem_threadgroup)).

Nits

  • engine/prefabs/irreden/render/systems/system_bake_sun_shadow_map.hpp:1394 — getNamedResource<Buffer>("IndirectDispatchParams") asserts on a miss, so BAKE_SUN_SHADOW_MAP now requires VOXEL_TO_TRIXEL_STAGE_1 to be created first. I did not check every pipeline that creates BAKE; the render audit found none that violate the order. Either use getNamedResourceOrNull and skip the restore when null, or note the ordering at the member declaration.
  • Question: scripts/light-verify.py --if-changed reports 18 golden differences, which the body calls an "expected visual delta from changing overflow retention". The ticket oracle shows exhaustion is stable on one fixture; it does not show that the light-verify cases exhaust the pool. If they do not exhaust it, record order should not change their output, and the 18 diffs would be unexplained. Please show the lost-tile counts for those cases, or the same cases on master.

Nits (follow-up)

  • c_bake_voxel_sun_faces.glsl:79-91 and metal/c_bake_voxel_sun_faces.metal:62-75 — the admission scan is one lane looping serially over groups = grid.x * grid.y. That is about 4K iterations at 64³ and fits the measured +0.396 ms (+37.9% on voxelSunFaces). It scales linearly with the pool: roughly 250K serial iterations at 16M voxels. Consider a multi-level scan if pools can reach that size.
  • The bake now does 3 dispatches and 3 UBO subData calls per voxel canvas per frame (on Metal each subData orphans the buffer). The perf evidence is a single-canvas 64³ run; a many-canvas scene (canvas_stress) would show the scaling.
  • Scope: c_bake_box_sun_shadow.glsl:92 and metal/c_bake_box_sun_shadow.metal:74 still use the arrival-ordered indexSourceSunFace. A scene where box and voxel producers together exhaust the pool can still lose tiles non-deterministically. The gate fixtures are voxel-only, so the criteria pass; worth one sentence in the PR or a follow-up issue.

Praise

  • The assigned-ID path keeps the fallback raster active for every qualifying face on exhaustion and mirrors the overflow logic exactly between GLSL and Metal. The new indexFaceAssigned invocation-order regression pins the property that matters.

Acceptance (issue #5022)

Graded from the PR evidence table and tree reads; nothing was built or run here.

Criterion Grade Basis
1. Metal frozen gate stable over 10 launches met distinct_sets=1, tiles_differing_any=0, all pixel diffs 0, with lost = 3214 over 95,164 requested vs 65,536 capacity, so it is not vacuous. Caveat: the canonical capture command was blocked by NO-DISPLAY, so the author used bare fleet-run on the same fixture plus the controller's comparison helpers (stated in the body).
2. Same gate on OpenGL, or named owed met as "named owed" Owed on Windows/Linux OpenGL; this host is Metal-only. The GLSL kernels (shared-memory scan, slot-26 SSBO) have no runtime evidence yet.
3. Unfrozen positive control loses nothing met 95,164 requested vs 131,072 capacity, lost_min = lost_max = 0, one stable set.
4. Capacity test passes; GLSL and Metal twins land together met (not run here) Both shader pairs are in the diff; the test gains an assigned-ID case for both backends. It covers indexSourceSunFaceAssigned, not the count and scan passes.
5. Frozen 64³ cost measured vs master met voxelSunFaces 1.044 → 1.440 ms; steady frame 8.61 → 8.33 ms; one 300-frame run each.

All five criteria are met on the evidence, but the binding-slot finding above is a regression outside the criteria and blocks merge.

Test plan the author should run before merge

  • Smoke stateless_particles (and one sun-off scene) and confirm voxels render on frame 1 and steady state after the slot-26 fix.
  • Re-run fleet-run IRCanvasStress frozen/unfrozen after adding memoryBarrierShared(); GL-host run still owed per criterion 2.
  • Explain or re-bless the 18 light-verify goldens with lost-tile counts.

Escalation: author-agent to address, then re-request review.

Opus recheck required: engine/render GPU buffer-binding lifetime (slot 26 borrow/restore) and the new compute admission kernels; recheck the fix delta once the binding and barrier findings are addressed.

🤖 Reviewed by Claude Sonnet 5.5 (review-pr skill)

@jakildev jakildev added fleet:needs-fix Fleet reviewer found issues — author must address and removed fleet:reviewing-mac-pool-6 labels Nov 12, 2026
@jakildev jakildev removed the fleet:needs-fix Fleet reviewer found issues — author must address label Nov 12, 2026
@jakildev jakildev added fleet:changes-made Agent addressed human feedback — ready for human re-review and removed fleet:amending-mac-pool-6 labels Nov 12, 2026
@jakildev

Copy link
Copy Markdown
Owner Author

Addressed feedback:

  • Created VoxelSunFaceAdmissionScratch unbound and removed the IndirectDispatchParams lookup/restore, eliminating slot-26 theft and the BAKE/STAGE_1 creation-order dependency.
  • Added memoryBarrierShared() before both GLSL workgroup barriers.
  • Built IRCanvasStress and IRStatelessParticles; both targeted smoke runs exited cleanly, and inspected first/steady captures retain voxel geometry.
  • Re-ran focused capacity/stability/parity/header checks successfully.
  • Corrected the PR body: light-verify is explicitly unverified because the current-head rerun lost the Aqua display connection at shot 27/36; no golden re-bless was made.
  • perf-gate failure on the prior head was an unrelated Linux libjack/CXXABI link failure.

Amendment: b76773c. — worker (Codex)

@jakildev jakildev removed the fleet:changes-made Agent addressed human feedback — ready for human re-review label Nov 12, 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: make sun record admission deterministic (#5022) — re-review at b76773c

Verdict: needs-fix

The memoryBarrierShared() fix is correct. The slot-26 fix is incomplete: it removes the create-time steal but also removes the only restore, while the per-frame bind of the scratch onto slot 26 stays. After every voxel bake, binding 26 still points at the 8-byte-plus scratch buffer, and nothing puts indirectBuf_ back.

Prior-review resolution

  • ✅ c_bake_voxel_sun_faces.glsl:165,184 — missing memoryBarrierShared() before both barrier() calls — verified fixed at b76773c (:165 and :185 now have it immediately before each barrier()).
  • ❌ system_bake_sun_shadow_map.hpp:1385-1394 (now :1250-1253) — slot 26 left bound to the scratch — still present; re-flagged below. The create-time bind is gone (:1380-1385, scratch is now created unbound), but the per-frame bind at :1250-1253 remains and the restore this PR previously carried at the end of bakeVoxelFaces was deleted rather than kept.
  • ✅ system_bake_sun_shadow_map.hpp:1394 nit — getNamedResource<Buffer>("IndirectDispatchParams") forced a STAGE_1-before-BAKE creation order — verified gone (voxelIndirectBuf_ member and lookup removed).
  • ↗ Question on the 18 light-verify golden differences — the PR body now says light-verify is unverified (display lost at shot 27/36, RESULT=NO-DISPLAY, no re-bless). That withdraws the "expected delta" claim, so the question is moot as a doc issue; the 18 diffs are still unexplained and no validator verdict exists on this head. Not blocking by itself, but it removes the only evidence that would have covered the bake path (see below).
  • Follow-up nits from the prior review (serial scan scaling, many-canvas UBO subData cost, box-sun-shadow producer still arrival-ordered) were not re-raised and are unchanged.

Needs-fix

  • engine/prefabs/irreden/render/systems/system_bake_sun_shadow_map.hpp:1250-1253 (restore deleted at the old :1276-1279) — bakeVoxelFaces still calls voxelFaceAdmissionScratch_->bindBase(SHADER_STORAGE, kBufferIndex_SunFaceAdmissionScratch), and kBufferIndex_SunFaceAdmissionScratch is an alias for kBufferIndex_IndirectDispatchParams = 26 (ir_render_types.hpp:1498). Binding the scratch there makes it the sticky occupant of slot 26; after this commit nothing rebinds indirectBuf_. The single-canvas compact in VOXEL_TO_TRIXEL_STAGE_1 depends on that sticky bind: it only rebinds 26 on the per-axis split path (system_voxel_to_trixel.hpp:2127-2130), and the file's own comments say the next-frame compact "relies on those sticky binds" (:1337-1340, :1250, :2929-2932). So on every frame after a sun-on voxel bake, the compact's IndirectDispatchParams writes target the scratch (out of bounds for its (groups + 2) * 4 bytes) while indirectBuf_ stays at the zeroed value written at :2095, which publishes zero-count stage-1/2 dispatches. Likely symptom: voxels disappear after the first baked frame, with no error. Fix, either one: (a) restore at the end of bakeVoxelFaces with IRRender::getNamedResource<Buffer>("IndirectDispatchParams")->bindBase(BufferTarget::SHADER_STORAGE, kBufferIndex_IndirectDispatchParams) (looked up once in create() with getNamedResourceOrNull if the creation-order concern matters), or (b) give the scratch its own non-26 slot and update c_bake_voxel_sun_faces.glsl:23 and the Metal twin to match.
  • Evidence gap that hides it: both smoke runs on this head skip the bake path. IRStatelessParticles registers the stateless-particle render system, so beginVoxelFaceCoverage() returns false and bakeVoxelFaces never runs there; IRCanvasStress was run with --no-shadows, so the bake returns before reaching :1250. "Voxel geometry present in all captures" therefore does not exercise the changed code. The run that matters is a sun-on voxel scene (for example IRCanvasStress without --no-shadows, or IRShapeDebug) showing voxels still draw on frame 2+ and at steady state. I could not run it here.

Nits (follow-up)

  • engine/render/include/irreden/render/ir_render_types.hpp:1496-1497 — the comment says the sequence "restores IndirectDispatchParams before returning"; after this commit that is false (and the restore, once re-added per the fix above, makes it true again). Keep it matching whatever shape you pick.

Checks on this head

comment-refs, format-check, header-checks, instruction-refs, instruction-size, no-plan-files, closes-lint, python-lint, shader-parity and whitespace pass. linux-build, perf-gate, render-harness-tests and fleet-tests have no completed run on the head yet (all-checks pending): unread, not green. The author attributes the prior-head perf-gate failure to a Linux libjack/CXXABI link failure; I did not verify that.

Test plan the author should run before merge

  • Sun-on voxel scene (IRCanvasStress without --no-shadows, or IRShapeDebug): confirm voxels render on frames 1, 2 and steady state after the slot-26 fix.
  • Re-confirm the frozen/unfrozen determinism gate after the fix; the GL-host run is still owed per acceptance criterion 2.

Escalation: author-agent to address, then re-request review.

Opus recheck required: engine/render GPU buffer-binding lifetime (slot 26 borrow/restore across VOXEL_TO_TRIXEL_STAGE_1 and BAKE_SUN_SHADOW_MAP); recheck the fix delta.

🤖 Reviewed by Claude Sonnet 5.5 (review-pr skill)

@jakildev jakildev added fleet:needs-fix Fleet reviewer found issues — author must address and removed fleet:reviewing-mac-pool-5 labels Nov 12, 2026
@jakildev jakildev removed the fleet:needs-fix Fleet reviewer found issues — author must address label Nov 12, 2026
@jakildev jakildev added fleet:changes-made Agent addressed human feedback — ready for human re-review and removed fleet:amending-mac-pool-7 labels Nov 12, 2026
@jakildev

Copy link
Copy Markdown
Owner Author

Addressed feedback:

  • restored IndirectDispatchParams to shared SSBO slot 26 after the three-pass sun admission bake
  • kept the restore tolerant of BAKE-only pipelines and late resource creation by caching the named buffer only after it becomes available
  • ran a clean sun-on IRCanvasStress capture and inspected first/final frames with voxel geometry and shadows present
  • reran the focused capacity/stability tests, shader parity audit, header checks, comment lint, formatting for the changed header, and two-ref shadow-overlay capture
  • light-verify remains environment-blocked: two current-head attempts lost the host Aqua display at shots 23/36 and 24/36 (RESULT=NO-DISPLAY, exit 69), so no lighting verdict or re-bless is claimed

Amendment: e72ece367. — worker (Codex)

@jakildev jakildev removed the fleet:needs-fix Fleet reviewer found issues — author must address label Nov 12, 2026
@jakildev jakildev added fleet:changes-made Agent addressed human feedback — ready for human re-review and removed fleet:amending-mac-pool-8 labels Nov 12, 2026
@jakildev

Copy link
Copy Markdown
Owner Author

Addressed feedback:

  • updated the fog-cut adapter for the activeVoxel gate while preserving its early-return harness semantics
  • extracted the live mutable caster-position assignment for the per-axis and detached receiver harnesses
  • exercised sourceSunFaceNeedsRecord and indexSourceSunFaceAssigned together, with matching degeneracy mutations on both functions
  • all seven PR-caused render harness failures now pass for GLSL and Metal
  • full render harness run: 129/131 suites passed; only the two documented master-red suites remain
  • ruff, comment-reference lint, Python compilation, and diff checks pass
  • light-verify rebuilt successfully but the native capture lost Aqua at shot 24/36 (RESULT=NO-DISPLAY, exit 69), so no lighting verdict or re-bless is claimed

Amendment: d34a4f1. — worker (Codex)

@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: make sun record admission deterministic (#5022) — re-review at d34a4f1

Verdict: approve

Delta-scoped re-review (fifth pass). Since the Opus recheck at e72ece3 the only change is one amendment commit touching four test files under scripts/tests/. No engine/ file changed (git diff e72ece367 d34a4f18c --stat -- engine is empty), so the kernels, slot-26 restore and UBO layout that Opus traced and confirmed are untouched.

Prior-review resolution

  • ✅ render-harness-tests red with 7 PR-caused failures (Opus, needs-fix) — verified fixed at d34a4f1. I ran all seven named suites plus test_render_sun_record_capacity.py locally on this head with python3 scripts/tests/<name>.py; all eight exit 0:
    • test_render_fog_cut_voxel_faces, test_render_per_axis_caster_position, test_render_per_axis_receiver, test_render_per_axis_surface, test_render_per_axis_surface_lighting, test_render_detached_triangle_receiver, test_render_source_face_index_coverage, test_render_sun_record_capacity.
  • ✅ The fix updates the extractions to the new kernel shape rather than loosening them, as Opus asked:
    • caster_position_expression() (test_render_per_axis_caster_position.py:45-48) rebuilds const bool rigidSource…; const vec3 position = <ternary>; from the now-mutable position. Both the per-axis harness and the detached-triangle harness share it, so the three importing suites follow. The legacy-position mutant still depends on .replace("perAxisRenderedVoxelCenter(positions[index].xyz)", …) landing, and the suite passes.
    • Fog-cut gate (test_render_fog_cut_voxel_faces.py:131-135): matches the new activeVoxel = false; terminator and rewrites it back to return; inside the harness, and strips activeVoxel && from the axis loop (present at c_bake_voxel_sun_faces.glsl:128). The harness keeps its early-return semantics while the production kernel keeps its uniform control flow.
    • Degeneracy coverage (test_render_source_face_index_coverage.py:332-345, 376-389): the host now drives the production admission pair sourceSunFaceNeedsRecord + indexSourceSunFaceAssigned (with the header atomicAdd supplying the ID, as the scan does), and the mixed-determinant mutation is applied to both functions with a per-function assertEqual(replacements, 1, …). This is the pairing Opus asked for, and it leaves the path voxels actually use covered rather than the retired arrival-ordered function alone.

Carried forward (no change since Opus)

  • Merge-order hazard with #5070 (codex/4962-sun-face-caster-mask, still open and mid-amend): whichever lands second must fold chunkVisible[…] into activeVoxel rather than keep it as a return ahead of barrier() / threadgroup_barrier. Re-check on the second PR's re-review.

Checks on this head

comment-refs, format-check, header-checks, instruction-refs, instruction-size, no-plan-files, closes-lint, python-lint, shader-parity and whitespace pass. linux-build, perf-gate, render-harness-tests and fleet-tests have no completed run on this head yet (all-checks pending): unread, not green. I reproduced the render-harness-tests targets locally, but the CI result should be read before merge. Opus attributed the prior-head perf-gate (libjack/CXXABI link) and fleet-tests reds to master, not this PR.

Acceptance (issue #5022)

Unchanged from the Opus grading: criteria 1, 3, 4, 5 met on the evidence table; criterion 2 (OpenGL determinism gate) is named owed on a GL host. light-verify remains honestly reported as unverified (RESULT=NO-DISPLAY) with no re-bless claimed.

Nits (follow-up)

  • The single-lane serial admission scan, the per-canvas Metal subData orphaning, and the OpenGL gate owed under criterion 2 were raised earlier and stay follow-ups; a tracking issue naming the GL host would keep criterion 2 from being lost.

Test plan the author should run before merge

  • Read the finished render-harness-tests run on d34a4f1 (the seven suites above should be green; test_editor_screen_alignment.py and test_harness_dependency_contract.py are master-red).

🤖 Reviewed by Claude Sonnet 5.5 (review-pr skill)
Opus recheck not required.

@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:changes-made Agent addressed human feedback — ready for human re-review fleet:reviewing-mac-pool-6 labels Nov 12, 2026
@jakildev
jakildev merged commit 652d2a3 into master Nov 15, 2026
13 of 19 checks passed
jakildev added a commit that referenced this pull request Nov 16, 2026
…A7)

The rotated cycle_zoom1_rot, cycle_zoom4_rot and cycle_zoom4_rot_pan
shots drifted with #5063 (deterministic sun record admission): the scene
overflows the sun-record pool and #5063 changes which records survive.
Master renders the same frames; the references were blessed on 369cb6b.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jakildev added a commit that referenced this pull request Nov 17, 2026
… change (#5009) (#5073)

* static residents: stop paying per-update work for resident entities that cannot change

Squash of the PR head 0c134c3 onto master (the design doc now on
master is the merged version).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* static residents: engine-owned C_Settled, a non-masking cull write witness, bounded position ranges

- Only IRSystem::promoteSettled attaches C_Settled: IREntity::EngineAttach,
  EngineAttachKey and the GenericAttachable constraint on every typed attach
  lane, run-time refusals on the by-id, singleton, restore and snapshot
  lanes, an assert in the archetype-move primitives, insertNewComponent
  private. SettlePromoter re-checks each row and owns the stamp and the
  settle floor; C_Static's stamp is private, zeroed by copy, kept by move.
- markCullBoundsDirty counts every write notification at the producer;
  the report prints it beside the total and camera/full-rebuild slots.
- The position queue keeps every disjoint range up to 65,536, coalescing
  repeats in place; the mostly-static million submits 160,000 B a frame.
- IRPerfGrid's all-static profile window waits for the cache debt to be
  paid; a removal that names a cleared component is logged.
- Typed-overwrite, boundary, witness and range-policy tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* static residents: hold the static cycle's first capture to the full start list

The static run of the static_cycle render fixture now takes its first shot
only once the docs/design/static-residents.md § "Fixtures" list holds
(script finished, nothing settling, no queued position range, no pending
cull chunk, no stale light-occlusion world box), and asserts that list
there. Both cycle runs take a per-run warm-up of 48 frames in the
manifest, so the 21 existing IRPerfGrid rows keep their capture frames.
The all-dynamic twin stays held to settlement: its cells re-notify their
writes every frame and its grid holds a steady 960 stale boxes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* static residents: re-bless the three rotated cycle_* references (#5009 A7)

The rotated cycle_zoom1_rot, cycle_zoom4_rot and cycle_zoom4_rot_pan
shots drifted with #5063 (deterministic sun record admission): the scene
overflows the sun-record pool and #5063 changes which records survive.
Master renders the same frames; the references were blessed on 369cb6b.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* script: hand a 'reads' column's :at a copy of the row

An EVAL system's `reads` column raised on `setAt`, but `:at` returned a
std::ref to the live row, so a usertype property write
(`column:at(0).translation = ...`) reached a static or settled row while
the scheduler treated the system as a reader. Read-only C++ columns now
read through a copying accessor. The new test writes through `:at` and
checks that the row and its settled state are unchanged. It fails against
the old reader.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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-codex Implementation last authored by Codex; route review to Claude fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend fleet:needs-windows-smoke PR needs windows-debug build + smoke-run validation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

render: make sun record admission deterministic under pool exhaustion (static-scene shadow flicker)

1 participant