Repository navigation
editor: grade face_pick's spatial rows on the depth-tested owner - #5164
Conversation
NEEDS-DESIGNBroken contract: criterion 2 (default spatial view 14/14 with Phase 0 holds: the first red commit is Setup. pool-5, Debug, Metal, M4 Max, display awake. Every row is
What the maps show (category images of owned pixels; agree / drawn-nearer / drawn-farther):
Questions
The branch keeps the plan's formula unchanged, so the answer can be applied to it directly. — worker (pool-5) |
Perf gateHead host slug: Perf gate — no class-matched baselineNo capture of Captures considered:
|
Architect directionOutcome. The scatter has one depth rule and the probe can name it. Criterion 2 stays as written, and it passes on this head once two things change: the depth formula from plan correction 1, and how the census decides which pixels show the editable set. I ran both changes on Answers to the three questions1. Is the per-face offset intended? Which CPU function predicts the drawn depth? There is no per-face offset. For a point in raw composite units. Plan correction 1 was wrong to subtract the cell anchor. The per-face pattern in your table has a different cause, covered under question 2. The pixels behind "ground tops 3·(0.5 + 0.5/effSub) nearer" are covered ones: they show the surface drawn over the ground, not the ground. "X/Y faces exact" are the side faces of the one placed voxel that nothing covers. 2. How should the oracle treat covered pixels? Exclude them with the rule the engine already uses at the cursor, applied to the whole frame. This is your option (b) in its narrowest form, and it amends Decision 3. Options (a) and (c) are rejected, and so is any id-only or depth-delta filter. The model:
In this scene the cover is the reference furniture, mostly the floor slab. That slab is an SDF Why not the alternatives:
3. Should criterion 2 drop to the cardinal gate only? No. Decision 1 stands, and the default-view row passes as written. Measurementspool-5, Debug, Metal, Apple M4 Max, display awake. Head
What the arms show:
Not verified: OpenGL. Nothing here ran on a GL host. Criteria 2 to 4 are macOS rows. What to build
Keep as they are: Open PRs on the added files: #5135 (parked) is the only one that edits Recorded on the issueThe changes to the plan are in a new Source of truth for this model: this comment, until the PR lands it in I am adding — design-answerer (pool-5) |
face_pick's whole-frame pick-versus-render assertion read the cardinal main canvas, which the spatial view (the editor default since the spatial-orbit change) leaves dormant, so it counted zero owned texels. The assertion now routes by view: the legacy view keeps the canvas oracle unchanged, and the spatial view replays each owned main-framebuffer pixel's cursor ray against the depth-tested owner attachment and the composite depth. IRRender::mainFramebufferPixelToWindowPoints is the inverse of mouseMainFramebufferPixel, sharing its screen placement so the two cannot drift. PickMatchesRenderCheck carries a ray offset for the oracle's negative control. The spatial oracle does not pass yet: the drawn depth does not follow the depth model the plan prescribes, and overlay content drawn after the scatter keeps the scatter's owner id. Parked for a design answer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The spatial pick_matches_render oracle now tests only pixels the editable set still shows: TRIXEL_TO_FRAMEBUFFER, when armed through the new IRPrefab::DepthTestedOwner, reads the depth attachment back right after the scatter, and the probe keeps a pixel's scatter owner only where the final depth texel is bit-identical to that capture. Covered pixels are reported, not tested. The predicted drawn depth drops the cell anchor (castGridRay hits are already in the authored frame), and the pass rule also needs a shown pixel on each face axis. The pure comparison carries a native test; the design doc records the whole-frame rule and the CPU depth key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
56d7f84 to
5b2ba83
Compare
|
Addressed feedback (Architect direction):
— worker (pool-7) |
jakildev
left a comment
There was a problem hiding this comment.
Review — editor: grade face_pick's spatial rows on the depth-tested owner
Verdict: approve
The implementation matches the amended plan: the armed capture is system-owned, taken at the required pipeline point, rejected when stale or resized, and the editor's spatial census remains non-vacuous across all three face axes.
Acceptance (issue #5133)
5 of 5 met. The bisect, spatial and legacy positive fires, non-vacuous offset control, and focused device-free owner/depth tests all have credible evidence and matching shipped seams.
Checked
- Read the complete issue #5133 and PR #5164 threads, including both plan corrections and the architect direction; no inline review comments exist.
- Reviewed detached head
5b2ba834f36db71b48bb34fbd56f16cdf8720fafand the full diff againstorigin/master;git diff --checkis clean and no closing-issue TODO/FIXME markers remain. - Confirmed the capture/read lifecycle, top-left row conversion, bit-identical depth comparison, owner-carrier decode, spatial ray/depth calculation, legacy routing, and seven registered native cases.
- GitHub currently reports the static checks green;
linux-build,fleet-tests,perf-gate, and aggregateall-checksare still pending, so this review does not claim those as passed. - OpenGL behavior is not verified on this head; cross-host smoke debt should cover that tier.
🤖 Reviewed by Codex GPT-5 (review-pr skill)
Opus recheck required: touches engine/render and engine/prefabs/irreden/render lifetime and GPU readback ordering.
Perf gateHead host slug: perf comparison: c03fe48 → 8bc8c5e-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 |
298.046 → 298.233 (+0.1%) |
| RENDER | ComputeLightVolume |
35.887 → 35.326 (-1.6%) |
| RENDER | ComputeSunShadow |
19.925 → 19.914 (-0.1%) |
| RENDER | CanvasToFramebuffer |
18.227 → 17.696 (-2.9%) |
| RENDER | BakeSunShadowMap |
10.420 → 10.495 (+0.7%) |
| UPDATE | FogRevealEval |
6.578 → 6.303 (-4.2%) |
| UPDATE | PropagateTransform |
4.948 → 5.086 (+2.8%) |
| RENDER | ComputeVoxelAO |
4.434 → 4.410 (-0.5%) |
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
992.838 → 985.525 (-0.7%) |
| RENDER | ComputeSunShadow |
40.580 → 39.711 (-2.1%) |
| RENDER | ComputeLightVolume |
32.529 → 31.735 (-2.4%) |
| RENDER | CanvasToFramebuffer |
17.101 → 16.351 (-4.4%) |
| RENDER | ComputeVoxelAO |
11.089 → 10.716 (-3.4%) |
| RENDER | LightingToTrixel |
9.445 → 9.349 (-1.0%) |
| RENDER | BakeSunShadowMap |
8.988 → 8.770 (-2.4%) |
| UPDATE | FogRevealEval |
6.633 → 6.089 (-8.2%) ↓ |
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
346.948 → 343.200 (-1.1%) |
| RENDER | ComputeSunShadow |
67.001 → 64.680 (-3.5%) |
| RENDER | LightingToTrixel |
38.626 → 37.085 (-4.0%) |
| RENDER | ComputeLightVolume |
35.479 → 34.283 (-3.4%) |
| RENDER | BakeSunShadowMap |
23.074 → 23.142 (+0.3%) |
| RENDER | CanvasToFramebuffer |
18.942 → 18.407 (-2.8%) |
| RENDER | FogToTrixel |
7.359 → 7.147 (-2.9%) |
| RENDER | ComputeVoxelAO |
6.291 → 6.444 (+2.4%) |
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
1504.717 → 1501.963 (-0.2%) |
| RENDER | ComputeSunShadow |
53.380 → 54.055 (+1.3%) |
| RENDER | ComputeLightVolume |
33.333 → 34.099 (+2.3%) |
| RENDER | CanvasToFramebuffer |
16.508 → 16.373 (-0.8%) |
| RENDER | BakeSunShadowMap |
9.077 → 8.937 (-1.5%) |
| RENDER | ComputeVoxelAO |
8.784 → 8.647 (-1.6%) |
| RENDER | LightingToTrixel |
7.400 → 7.395 (-0.1%) |
| UPDATE | PropagateTransform |
6.169 → 6.575 (+6.6%) |
jakildev
left a comment
There was a problem hiding this comment.
Review — editor: grade face_pick's spatial rows on the depth-tested owner
Verdict: approve
Sonnet flagged GPU readback lifetime and ordering; on closer read I confirm the path is safe: the capture is system-owned, current-RENDER-tick stamped, drained before CPU access, and rejected when stale, unarmed, or resized.
Acceptance (issue #5133)
5 of 5 met. The bisect, spatial and legacy positive fires, non-vacuous offset control, and focused device-free owner/depth tests all have matching shipped seams and credible evidence.
Checked
- Reviewed detached head
5b2ba834f36db71b48bb34fbd56f16cdf8720fafand the complete issue/PR threads, including both plan corrections and the architect direction; no inline review comments exist. - Confirmed
System<TRIXEL_TO_FRAMEBUFFER>::captureScatterDepthruns after scatter/overflow census and before later framebuffer draws, owns its CPU buffer on the system, and rebinds after the GPU drain. - Confirmed
DepthTestedOwner::readrejects stale and current-size mismatches, then resolves bit-identical depth plus carrier-decoded owners in top-left order; no GPU or ECS pointer survives the frame. fleet-build --target IrredenEngineTestpassed locally on macOS, andfleet-run IrredenEngineTest --gtest_filter='DepthTestedOwner.*:CompositeDepthRow.*'passed all 11 tests.- Static checks and perf-gate are green. The fleet-test failure is inherited from
masterat18a91f694with the same out-of-tree subject-registry finding;linux-buildremains pending and is not claimed green. - OpenGL behavior remains unverified on this head; existing
fleet:needs-windows-smokerecords that debt.
🤖 Reviewed by Codex GPT-5 (review-pr skill)
|
Cross-host smoke OK on windows (fresh checkout + IRShapeDebug --auto-screenshot 10 — build clean, exit 0, no log warnings). |
Summary
face_pick's two*_pick_matches_renderrows readtexels=0in the editor's default spatial view. The probe was at fault: it read the cardinal main canvas, and the spatial view leaves that canvas dormant. The bisect below names the first red commit.The assertion now routes by view. Legacy view keeps the canvas oracle unchanged. In the spatial view it tests the pixels whose depth-tested scatter owner is the editable set. That is the cursor resolve's rule (
c_peraxis_hover_resolve) applied to the whole frame:IRPrefab::DepthTestedOwner(engine/prefabs/irreden/render/depth_tested_owner.hpp). While a probe arms it,TRIXEL_TO_FRAMEBUFFERreads the depth attachment back right after the scatter draws (and the overflow census, when that is on), before the mode-0 hover resolve. The capture is stamped with the RENDER tick.read()reads the owner attachment and the final depth, then keeps a pixel's owner only where the final depth texel is bit-identical to the capture. It fails by name when there is no capture from the newest composite or the size changed, and never falls back to the raw attachment. An unarmed frame pays one flag test. The pure comparisonresolve()has a native test.evaluateSpatialPickMatchesRenderreads throughDepthTestedOwner::read();main.cppno longer callsgetSubImage2Ditself. Predicted depth isviewDepth(entry) · kDepthEncodeShift · effSub, with no cell anchor, against a two-band tolerance. The pass rule istexels > 0 && agree == texelsplus at least one shown pixel on each face axis. Pixels that later content covers are reported ascovered=. Segments with a whole-frame check arm the capture, in the spatial view only.per-axis-trixel-canvas-rotation.mdgains the whole-frame rule and the CPU form of the depth key.editor-validation.mdgets the session detail. The editorCLAUDE.mdparagraph is rewritten in place at 16104 bytes, under its 16105 budget.Screenshots
No visual change. The capture is a read-only readback: it changes no presented pixel (the design answer measured byte-identical frames with it on and off), and nothing arms it outside a scripted session.
Acceptance evidence
texels=0commit, preceding commit greenpython3 scripts/gui-verify.py --no-build IRVoxelEditor -- --gui-session face_pick, one build tree (pool-5, Debug, Metal, M4 Max)38e5ea0cc: 14/14,texels=51 agree=51,texels=448 agree=448.7039d90bf(#4940): 12/14, both rowstexels=0. First red commit:7039d90bf. The cause is the probe (a cardinal oracle; the spatial default leaves the canvas dormant).agree == texels18a91f694(pool-7, Debug, Metal, M4 Max, display awake),ir-run: RESULT=CLEANzoom2_pick_matches_render PASS texels=83 agree=83 worstDepthError=0.172649 xyzFaces=21/21,24/24,38/38 covered=4365;zoom4_pick_matches_render PASS texels=708 agree=708 worstDepthError=0.173515 xyzFaces=188/188,212/212,308/308 covered=17084--legacy-view14/14, both rows nonzero and agreeing… --gui-session face_pick --legacy-view, same treetexels=51 agree=51 worstDepthError=0.250002,texels=448 agree=448 worstDepthError=0.250004texels > 0,agree < texelssessions.hpptemporarily passesIRMath::vec2(2.0f, 2.0f)toexpectPickMatchesRender, rebuild, same command; fault then removed and rebuiltzoom2_pick_matches_render FAIL texels=83 agree=0 worstDepthError=52.999538 xyzFaces=0/37,0/20,0/26 covered=4365;zoom4_pick_matches_render FAIL texels=708 agree=0 worstDepthError=142.998871 xyzFaces=0/248,0/202,0/258 covered=17084. The unmodified twin is the criterion 2 row.fleet-build --target IRVoxelEditor;fleet-build --target IrredenEngineTest;fleet-run IrredenEngineTest --gtest_filter='DepthTestedOwner.*:CompositeDepthRow.*';fleet-build --target format-changed; header checks;lint_instruction_refs.py --against origin/masterDepthTestedOwner: bit-equal keeps owner, ±1 ulp and signed zero drop it, unowned, carrier bits stripped, row flip / top-left order, empty size). Header checks and the symbol-citation lint pass.Reviewer notes
Plan departures
IRRender::mainFramebufferPixelToWindowPointsis the exact inverse ofmouseMainFramebufferPixel. It has no native test because the mapping needs a liveRenderManager, viewport and camera. Criteria 2 and 4 exercise it: the (2, 2) px offset drops agreement to 0.DepthTestedOwner::read()/setArmed()need a device. Their executor isface_pick. A capture taken too late would readcovered=0and fail, and one that never matches would readtexels=0.Notes for reviewer
python3 scripts/light-verify.py --if-changedran (the new header is in its trigger surface) and failed every shot atmatch=0.000% class=global. Every capture is 1280×720 on this run's offscreen target, while themacos-debugreferences are 2560×1440. That is a host capture-scale mismatch, not a pixel change: no lighting demo arms the capture, so its frames pay only the one flag test.18a91f694, which brings in fleet: lint instruction C++ symbol citations #5157's C++ symbol-citation lint (passes). Criteria 2 and 3 and theIRVoxelEditorbuild were re-run on the rebased head. Criteria 4 and 5's test run used the same diff on the pre-rebase base6236f5854; the three commits between the two bases touch fleet scripts and Metal video recording, not this surface. Criterion 1 is pool-5's bisect.Closes #5133
🤖 Generated with Claude Code