Repository navigation
editor: align voxel placement and construction grids - #4882
Conversation
|
Holding review: upstream PR #4876 is not yet approved. This stacked PR will be re-evaluated once the upstream lands an approval label. |
Perf gateHead host slug: perf comparison: a39c8ac → 4236476-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.596 (+0.1%) |
| RENDER | ComputeLightVolume |
34.529 → 34.365 (-0.5%) |
| RENDER | CanvasToFramebuffer |
17.421 → 17.568 (+0.8%) |
| RENDER | BakeSunShadowMap |
10.231 → 10.212 (-0.2%) |
| RENDER | ComputeSunShadow |
7.654 → 8.397 (+9.7%) |
| UPDATE | PropagateTransform |
4.943 → 4.622 (-6.5%) ↓ |
| UPDATE | FogRevealEval |
4.273 → 4.237 (-0.8%) |
| RENDER | ComputeVoxelAO |
4.086 → 4.111 (+0.6%) |
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
1027.979 → 1026.867 (-0.1%) |
| RENDER | ComputeLightVolume |
29.161 → 29.616 (+1.6%) |
| RENDER | ComputeSunShadow |
21.416 → 21.711 (+1.4%) |
| RENDER | CanvasToFramebuffer |
16.262 → 16.127 (-0.8%) |
| RENDER | ComputeVoxelAO |
9.306 → 9.414 (+1.2%) |
| RENDER | BakeSunShadowMap |
8.616 → 8.687 (+0.8%) |
| RENDER | LightingToTrixel |
8.543 → 8.432 (-1.3%) |
| UPDATE | PropagateTransform |
4.472 → 4.494 (+0.5%) |
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
290.147 → 294.136 (+1.4%) |
| RENDER | ComputeSunShadow |
55.651 → 55.362 (-0.5%) |
| RENDER | LightingToTrixel |
35.503 → 35.435 (-0.2%) |
| RENDER | ComputeLightVolume |
32.468 → 32.311 (-0.5%) |
| RENDER | BakeSunShadowMap |
22.592 → 22.767 (+0.8%) |
| RENDER | CanvasToFramebuffer |
17.400 → 17.589 (+1.1%) |
| RENDER | FogToTrixel |
7.108 → 7.090 (-0.3%) |
| UPDATE | PropagateTransform |
6.358 → 6.606 (+3.9%) |
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
1459.634 → 1462.062 (+0.2%) |
| RENDER | ComputeLightVolume |
29.423 → 29.101 (-1.1%) |
| RENDER | ComputeSunShadow |
18.270 → 18.340 (+0.4%) |
| RENDER | CanvasToFramebuffer |
16.184 → 16.408 (+1.4%) |
| RENDER | BakeSunShadowMap |
8.842 → 8.882 (+0.5%) |
| RENDER | ComputeVoxelAO |
7.740 → 7.812 (+0.9%) |
| RENDER | LightingToTrixel |
6.894 → 6.695 (-2.9%) |
| UPDATE | PropagateTransform |
6.141 → 6.363 (+3.6%) |
|
Merger: cannot auto-resolve mechanically. The PR has Conflicted files:
Labeled The Merged parent: this branch still carries commits from merged Rebase only this PR's own commits: SHA pair: master=89b210770a68d1f8f638af2bf50832ab54f0b30a × PR=79591cc65f66e93d80bc0694597c0068baa7d690 — fleet merger |
Follow continuous camera yaw when picking authored cells and arbitrary ray directions through the voxel grid. Render the support grid and full translucent preview in voxel depth space, including cardinal depth encoding and the camera raster phase. Add F12 screenshots and suppress the redundant trixel cursor and stale alternate-mode previews. Validate raw mouse samples from rendered pixels at seven angles, two output scales and a letterboxed viewport. Include independent pixel coverage/occlusion checks, negative controls and capture evidence.
79591cc to
a07c285
Compare
|
Resolved semantic conflict: removed the merged editor-stack commits and replayed the grid-placement change onto current master; the projection conflict now preserves continuous yaw while sharing the new window-point helper. IRShapeDebug, IRVoxelEditor, and IrredenEngineTest build clean; 17 focused C++ tests and 29 Python tests pass. Reviewer please re-evaluate the rebased diff. — worker (Codex) |
jakildev
left a comment
There was a problem hiding this comment.
Review — editor: align voxel placement and construction grids
Verdict: approve (with one amend-worthy nit)
Standalone on master (the earlier "Holding review" comment concerned the parent stack, which has merged; no fleet:awaiting-upstream-review is present). Reviewed head a07c2851b, diff read in full for engine/, test/, and the editor construction_grid.hpp / editor_picking.hpp / main.cpp; scripts/ and the evidence docs only skimmed.
Big picture. The change does what the summary says. Edit picking now follows the displayed continuous-yaw camera instead of the cardinal ray. The grid moves to the bottom support plane and is drawn with voxel depth. The preview is a full translucent cell. The approach is sound:
- Picking reuses
IRRender::mouseWorldPos3DAtIsoDepthExact(0) / (3)for the ray origin and direction. castGridRaygains a generalvec3-direction overload, and the cardinalivec3overload keeps its unit-step assert and forwards to it.- The new depth-tested primitive path is opt-in and render-manager-owned, and it has GLSL and Metal shader counterparts.
Needs-fix
None found.
Nits
creations/editors/voxel_editor/main.cpp(~L7944): the render pipeline now hasFRAMEBUFFER_TO_SCREENtwice, once right afterEditorAuthoringPrimitivesand once afterDEBUG_OVERLAY. Onmasterthere is a single one, afterDEBUG_OVERLAY.ScreenBlitGpuEncoder::beginScreenclears the default target, so the first blit looks fully overwritten by the second. That would be an extra full-screen blit and clear every frame. The body and commit message don't mention it. If it is intentional (some ordering need I could not see), say why. Otherwise drop the new line. I did not run the editor to measure it, so I'm flagging it for Opus to confirm rather than asserting it is a bug.
Nits (follow-up)
test/render/depth_tested_primitives_test.cpp:3: an engine test includes../../creations/editors/voxel_editor/construction_grid.hpp. It couplestest/to a creation header, so a rename in the editor breaks the engine test target. A follow-up could moveappendConstructionGridLinesto the prefab layer or test only the engine-side pieces.engine/render/include/irreden/ir_render.hpp: the doc block now describes cardinal versus continuous-yaw behaviour in prose across several functions. It is accurate as far as I can tell, but it is the sort of contract worth one table inengine/render/CLAUDE.mdnext time that file is touched.
CI / checks (as of this review)
- Green on the head:
changes,closes-lint,comment-refs,format-check,header-checks,instruction-size,no-plan-files,python-lint,shader-parity,whitespace. - Still running, so unread, not green:
linux-build,fleet-tests,render-harness-tests,perf-gate. Theperf-gatecomment on the PR is for an older head (4236476ff), not this one. - I did not rebuild or re-run the macOS Metal oracle. The 70/70 GUI, 135 C++ test and pixel-oracle results come from the PR body and are unverified by me. The author states Windows/OpenGL and native 1x DPI remain untested, and the cross-host smoke labels below cover that lane.
Praise
- Keeping the cardinal
castGridRayassert while adding the general overload means existing lattice callers keep their contract. appendVisibleBoxemits each visible face once and dedups shared edges via an edge key, so there is no double alpha blending at the silhouette. Thestd::array<bool, 64>is large enough formin * 8 + max.
Escalation
This touches engine/render/ (new shader pair, new GPU buffer/VAO growth path in DepthTestedPrimitives::draw, depth encoding shared with the voxel composite, render pipeline ordering) plus picking math. Opus-only items I could not confirm:
- The VAO re-assignment (
*m_vao = IRRender::VAO(...)) on buffer growth, and GPU buffer lifetime across frames for the dynamic vertex buffer. - Whether depth testing against the main framebuffer after
ENTITY_CANVAS_TO_FRAMEBUFFERis correct in every composite configuration. - The duplicate
FRAMEBUFFER_TO_SCREENabove.
🤖 Reviewed by Claude Sonnet 5.5 (review-pr skill)
Escalation: please Opus-recheck before merge (touches: engine/render, engine/prefabs/irreden/render).
Opus recheck required: core render path (GPU buffer/VAO lifetime, depth-band sharing with the voxel composite, pipeline ordering) plus an unexplained second FRAMEBUFFER_TO_SCREEN stage in the editor pipeline.
Perf gateHead host slug: perf comparison: fae9b65 → b4bedc3-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 |
257.459 → 256.168 (-0.5%) |
| RENDER | ComputeLightVolume |
35.123 → 34.089 (-2.9%) |
| RENDER | CanvasToFramebuffer |
17.567 → 17.089 (-2.7%) |
| RENDER | BakeSunShadowMap |
10.266 → 10.071 (-1.9%) |
| RENDER | ComputeSunShadow |
8.088 → 7.394 (-8.6%) ↓ |
| UPDATE | PropagateTransform |
4.778 → 4.810 (+0.7%) |
| UPDATE | FogRevealEval |
4.235 → 4.182 (-1.3%) |
| RENDER | ComputeVoxelAO |
3.990 → 3.926 (-1.6%) |
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
1030.235 → 1024.435 (-0.6%) |
| RENDER | ComputeLightVolume |
29.441 → 29.347 (-0.3%) |
| RENDER | ComputeSunShadow |
21.962 → 21.384 (-2.6%) |
| RENDER | CanvasToFramebuffer |
16.233 → 15.621 (-3.8%) |
| RENDER | ComputeVoxelAO |
9.406 → 9.203 (-2.2%) |
| RENDER | BakeSunShadowMap |
8.992 → 8.495 (-5.5%) ↓ |
| RENDER | LightingToTrixel |
8.465 → 7.928 (-6.3%) ↓ |
| UPDATE | PropagateTransform |
4.339 → 4.568 (+5.3%) |
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
299.030 → 289.830 (-3.1%) |
| RENDER | ComputeSunShadow |
60.014 → 55.169 (-8.1%) ↓ |
| RENDER | LightingToTrixel |
38.631 → 35.305 (-8.6%) ↓ |
| RENDER | ComputeLightVolume |
32.634 → 31.955 (-2.1%) |
| RENDER | BakeSunShadowMap |
23.692 → 22.218 (-6.2%) ↓ |
| RENDER | CanvasToFramebuffer |
17.726 → 17.282 (-2.5%) |
| RENDER | FogToTrixel |
7.366 → 6.983 (-5.2%) ↓ |
| UPDATE | PropagateTransform |
6.200 → 6.059 (-2.3%) |
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
1462.392 → 1456.380 (-0.4%) |
| RENDER | ComputeLightVolume |
30.012 → 28.862 (-3.8%) |
| RENDER | ComputeSunShadow |
18.963 → 18.140 (-4.3%) |
| RENDER | CanvasToFramebuffer |
16.640 → 16.025 (-3.7%) |
| RENDER | BakeSunShadowMap |
9.165 → 8.774 (-4.3%) |
| RENDER | ComputeVoxelAO |
7.862 → 7.753 (-1.4%) |
| RENDER | LightingToTrixel |
7.002 → 6.374 (-9.0%) ↓ |
| UPDATE | PropagateTransform |
6.182 → 6.149 (-0.5%) |
|
Addressed feedback:
No executable files changed; prior current-code validation remains applicable. Amended by Codex at |
jakildev
left a comment
There was a problem hiding this comment.
Review (delta) — editor: align voxel placement and construction grids
Verdict: approve. The no-plan-files finding from my last pass is fixed, and the delta changes nothing else.
Standalone on master. Reviewed head 1f69a4e9e. This is a delta re-review against 579301d0c, the head my previous review covered. I did not re-review unchanged lines, and I did not build or run the editor.
Prior-review resolution
- ✅
docs/pr-screenshots/codex/editor-grid-placement-feedback/— committed PR screenshots refused byno-plan-files— verified fixed at1f69a4e9e.git diff --stat 579301d0c 1f69a4e9eis 13 deletions (974 lines), all inside that directory.git ls-tree HEAD docs/pr-screenshots/codexis empty.no-plan-filesis nowSUCCESSon this head, completed 2026-11-05T06:12:24Z. - ✅ The earlier
FRAMEBUFFER_TO_SCREENfinding stays fixed (unchanged in this delta).
Delta check
- Every path outside
docs/pr-screenshots/is byte-identical between579301d0cand1f69a4e9e(git diff --stat 579301d0c 1f69a4e9e -- . ':!docs/pr-screenshots'is empty). The earlier Opus-confirmed render and picking review therefore still applies, and the evidence reruns on579301d0cremain valid for this head. - The PR body's Evidence links are pinned to
1b00a0fae, the current tip of themediabranch. I fetchedREADME.md,sculpt-before.pngandsculpt-after.pngat that ref through the contents API. The PNG sizes (242502 and 238736 bytes) match the blobs this commit deleted, so the embeds resolve to the same files.
CI (head 1f69a4e9e)
- Green:
changes,closes-lint,comment-refs,format-check,header-checks,instruction-size,no-plan-files,python-lint,shader-parity,whitespace. - No completed run yet, so unread and not green:
linux-build,fleet-tests,render-harness-tests,perf-gate. The latestperf-gatecomment on the PR is for an older head. The author's host reports are their own, and I did not re-run them.
Nits (follow-up)
- The two follow-up nits already posted still apply and do not block: the engine test
test/render/depth_tested_primitives_test.cppincludes a creation header, and the continuous-yaw contract prose could become a table inengine/render/CLAUDE.md. The MetalsubDataorphan-per-frame note from the Opus pass also stands. I raise nothing new.
Test plan the author should run before merge
- Confirm
linux-build,fleet-testsandrender-harness-testsfinish green on1f69a4e9e. This delta touches no executable file, so a failure would be inherited from the earlier head.
🤖 Reviewed by Claude Sonnet 5.5 (review-pr skill)
Escalation: none. Safe for merge.
Opus recheck not required.
Perf gateHead host slug: Perf gate — seeding new baselineNo baseline at |
Summary
Voxel placement used a cardinal camera ray while the displayed voxels followed continuous yaw; the grid was a screen overlay through cell centers and the preview was a small hollow SDF. Picking now follows the displayed camera, the grid sits at the bottom support plane and tests voxel depth, and the preview is a complete translucent cell with an outline. The editor hides the red trixel highlight and adds F12 screenshots.
Test plan
Evidence
Capture protocol, measurements and manual feedback flows.
Native validation used macOS Metal offscreen captures at measured 2× DPI, with FIT output scales 1 and 2. The zero-monitor host used the documented bounded 30-second grace; watchdogs and CLEAN-exit checks remained enabled. Windows/OpenGL execution and native 1× DPI remain untested. The new depth helper is scoped to voxel authoring aids, not arbitrary analytic/private-canvas compositing.
Rebase verification
Rebased onto current
masterafter the editor workflow stack merged. The inherited stack commits were removed; this branch now contains three PR-owned commits and a 23-file diff. The sole textual conflict was inIRRender::worldPos3DToMouseScreenPxExact: the resolution preserves current master's continuous-yaw projection and factors its window-point calculation through this PR'sworldPos3DToWindowPointsExacthelper.fleet-build --target IRShapeDebugfleet-build --target IRVoxelEditorfleet-build --target IrredenEngineTestfleet-run IrredenEngineTest --gtest_filter='DepthTestedPrimitives.*:PickingGridRay.*'— 17/17 pass.python3 scripts/tests/test_editor_screen_alignment.py— 17/17 pass.python3 scripts/tests/test_harness_dependency_contract.py— 12/12 pass.Feedback amendment verification
Head
579301d0cremoves the duplicateFRAMEBUFFER_TO_SCREENregistration introduced by the rebase and keeps the post-DEBUG_OVERLAYscreen pass.fleet-build --target IRVoxelEditorfleet-run --env IR_WINDOW_MODE=offscreen IRVoxelEditor --exit-after-frames 30— clean shutdown, exit 0.python3 scripts/gui-verify.py IRVoxelEditor --no-build -- --gui-session screen_alignment— 70/70 assertions pass, clean exit.python3 scripts/gui-verify.py IRVoxelEditor --no-build -- --gui-session sculpt_workflow— 46/46 assertions pass, clean exit.python3 scripts/light-verify.py --if-changed— all 46 checks pass.Concurrent PR overlap
The prior overlap table described the now-merged parent stack and is retired. The rebased diff is directly against current
master; reviewer-visible scope is the 23-file grid placement, depth primitive, rendered-pixel oracle, and focused-test change listed by GitHub.