Repository navigation
editor: reserve camera gestures and diagnose shadow snapping - #4883
Conversation
Perf gateHead host slug: perf comparison: a39c8ac → d29d25b-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.875 (+0.2%) |
| RENDER | ComputeLightVolume |
34.529 → 34.930 (+1.2%) |
| RENDER | CanvasToFramebuffer |
17.421 → 17.564 (+0.8%) |
| RENDER | BakeSunShadowMap |
10.231 → 10.375 (+1.4%) |
| RENDER | ComputeSunShadow |
7.654 → 7.980 (+4.3%) |
| UPDATE | PropagateTransform |
4.943 → 4.750 (-3.9%) |
| UPDATE | FogRevealEval |
4.273 → 4.250 (-0.5%) |
| RENDER | LightingToTrixel |
4.024 → 4.198 (+4.3%) |
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
1027.979 → 1030.343 (+0.2%) |
| RENDER | ComputeLightVolume |
29.161 → 29.265 (+0.4%) |
| RENDER | ComputeSunShadow |
21.416 → 21.763 (+1.6%) |
| RENDER | CanvasToFramebuffer |
16.262 → 16.403 (+0.9%) |
| RENDER | ComputeVoxelAO |
9.306 → 9.493 (+2.0%) |
| RENDER | BakeSunShadowMap |
8.616 → 8.809 (+2.2%) |
| RENDER | LightingToTrixel |
8.543 → 8.531 (-0.1%) |
| UPDATE | PropagateTransform |
4.472 → 4.472 (+0.0%) |
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
290.147 → 288.969 (-0.4%) |
| RENDER | ComputeSunShadow |
55.651 → 53.916 (-3.1%) |
| RENDER | LightingToTrixel |
35.503 → 35.389 (-0.3%) |
| RENDER | ComputeLightVolume |
32.468 → 32.548 (+0.2%) |
| RENDER | BakeSunShadowMap |
22.592 → 22.273 (-1.4%) |
| RENDER | CanvasToFramebuffer |
17.400 → 17.269 (-0.8%) |
| RENDER | FogToTrixel |
7.108 → 7.093 (-0.2%) |
| UPDATE | PropagateTransform |
6.358 → 6.379 (+0.3%) |
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
1459.634 → 1457.922 (-0.1%) |
| RENDER | ComputeLightVolume |
29.423 → 29.419 (-0.0%) |
| RENDER | ComputeSunShadow |
18.270 → 18.630 (+2.0%) |
| RENDER | CanvasToFramebuffer |
16.184 → 16.135 (-0.3%) |
| RENDER | BakeSunShadowMap |
8.842 → 8.730 (-1.3%) |
| RENDER | ComputeVoxelAO |
7.740 → 7.778 (+0.5%) |
| RENDER | LightingToTrixel |
6.894 → 6.884 (-0.1%) |
| UPDATE | PropagateTransform |
6.141 → 6.484 (+5.6%) |
|
Holding review: upstream PR #4882 is not yet approved. This stacked PR will be re-evaluated once the upstream lands an approval label. |
|
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=8162a732c841e90ddf56acb0594696ff03273805 × PR=782f70a0b19b035f3a60f113ed1d473950bacf60 — fleet merger |
Share camera gesture ownership between raw-input editors and gizmos, including modifier-first release, interrupted edits and custom controls. Move inward voxel placement to I so Alt remains exclusive to orbit. Add fixed-scene shadow round trips and rendered on/off comparisons. The existing continuous surface option removes the face-center stepping; keep rendering defaults unchanged while its broader acceptance remains open. Capture evidence separates that limitation from accidental edits.
782f70a to
ae079f7
Compare
|
Resolved semantic conflict by rebasing only the PR-owned camera-gesture and shadow-diagnostic commit onto current master after its placement parent merged. The resulting 44-file diff matches the original PR-owned scope. |
|
Current master also moved PR evidence to the orphan media branch. Published this PR's existing evidence at media commit df94c1d, removed the 23 committed evidence files from the feature branch, and repointed the PR body. The refreshed no-plan-files check now passes; the 21-file code and documentation change remains the original PR-owned scope. — worker |
jakildev
left a comment
There was a problem hiding this comment.
Review — editor: reserve camera gestures and diagnose shadow snapping
Verdict: approve (nits only)
Standalone PR on master (21 files, head 9376d2c9c). The mergeable and CONFLICTING churn gate does not apply: the semantic conflict was already rebased away by the worker, and the diff matches the PR-owned scope in the body.
Big picture
The change does what the body says. Raw sculpt input ran in INPUT before the RENDER-stage camera controls, so Alt+left both orbited and placed inward. This PR adds IRPrefab::Camera::GestureOwnership (engine/prefabs/irreden/render/camera_gesture.hpp), a small pure state machine fed by a raw-input snapshot and by which camera controls are actually registered. The voxel editor polls it first in EditorPlaceErase; GIZMO_DRAG polls it in beginTick. I walked the ownership logic against the unit tests:
- A camera press owns the left release even when the modifier lets go first.
- A combined press/release in one tick is owned for that tick and does not stick into the next.
- An interrupted left edit stays suppressed until left returns to neutral.
- With no matching camera control registered, Alt/Space clicks stay available to the tool.
The wiring order is right: placeEraseSystem precedes gizmoDragId in the INPUT list (main.cpp ~8035-8038), so queueCameraInput(...) is consumed by GIZMO_DRAG::beginTick in the same tick. claimCameraGesture(true) nulls dragHandle_ but keeps dragAnchor_ and the start pose, so the existing release edge for partTransformHistorySystem / endTick still fires (pinned by CameraAcquisitionEndsDragWithoutDiscardingHistoryCapture). The interrupted-stroke policy (a live brush completes as one stroke through finishSculptStroke(), deferred BOX/LINE cancel with dragging_ = false) is consistent with the design doc, and updateRecipeHandleDrag ends its drag and re-places handles while blocked.
The inward-placement rebind (Alt → I) is applied everywhere I could find it: the status line, editTargetCell callers, face-fill, the drag latch (dragInverted_), the hover-refresh in drawAuthoringPrimitives, and Builder::clickBelow (which keeps its Lua API and now emits kKeyButtonI). The remaining kModifierAlt uses in main.cpp are Ctrl+Alt command chords, unrelated to placement. The shadow work is diagnostic only: production shadow defaults and shaders are untouched, and the body and design doc say so plainly. I did not review shadow_rotation as a rendering fix because it is not one.
Blockers
None.
Needs-fix
None.
Checks
Read from statusCheckRollup at review time:
- Green:
format-check,header-checks,comment-refs,instruction-size,no-plan-files,closes-lint,python-lint,whitespace,changes. - Still running (unread, not green):
linux-build,render-harness-tests,fleet-tests,perf-gate. - I did not build or run anything. The native Metal GUI sessions in the body (camera_gestures 44/44, place_below 7/7, recipe handles 25/25) are the author's evidence; I have not reproduced them. The body states Windows/OpenGL is untested; nothing in the PR is backend-specific, so I do not read that as a gap for this change.
- Merge should wait on the four pending checks. A red
linux-buildorrender-harness-tests(the latter runs the newtest_editor_shadow_rotation.pyand the dependency-contract exception list) would be the PR's own.
Nits (follow-up)
docs/design/editor-authoring-friction.md:1054links to../pr-screenshots/codex/peraxis-surface-lighting/README.md#measured-cost-and-decision. That directory is not in this tree (evidence now lives on themediabranch;docs/pr-screenshots/codex/peraxis-surface-lighting/has no files at this head), so the link is dead on merge. The other evidence links in the same doc use SHA-pinned GitHub URLs; do the same here.scripts/editor-shadow-rotation.py(parse_run):"CLEAN" not in logis a bare substring test. If the harness prints aRESULT=CLEANline, matching that is a tighter clean-shutdown proof (and cannot be satisfied by an unrelated word containing CLEAN). Please confirm which token the run actually emits.camera_gesture_test.cpp:<cstdint>/<optional>sit between the engine includes; ordering only.
Praise
- Tests pin the awkward cases directly: modifier-first release, combined press/release without carry-over, interruption until neutral, missing controls leaving clicks available, and a live-registration test for
registeredGestureControls(). - Custom bindings are explicit (
poll(extra)/queueCameraInput) and never guessed from the camera systems' latedragging_flags; the design doc says why. - The shadow-rotation metric has negative controls (one-pixel return drift, ROI exclusion, duplicate or failed assertions, wrong arm).
Reviewed by sonnet-reviewer (pool-1) at head 9376d2c.
Opus recheck not required.
Perf gateHead host slug: perf comparison: a3d54c9 → 74956aa-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 |
247.886 → 255.876 (+3.2%) |
| RENDER | ComputeLightVolume |
32.632 → 34.354 (+5.3%) |
| RENDER | CanvasToFramebuffer |
17.085 → 17.540 (+2.7%) |
| RENDER | BakeSunShadowMap |
9.662 → 10.275 (+6.3%) |
| RENDER | ComputeSunShadow |
7.624 → 7.739 (+1.5%) |
| UPDATE | PropagateTransform |
4.519 → 4.716 (+4.4%) |
| UPDATE | FogRevealEval |
4.190 → 4.226 (+0.9%) |
| RENDER | LightingToTrixel |
3.850 → 4.042 (+5.0%) |
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
1025.715 → 1029.641 (+0.4%) |
| RENDER | ComputeLightVolume |
29.338 → 28.900 (-1.5%) |
| RENDER | ComputeSunShadow |
21.864 → 22.050 (+0.9%) |
| RENDER | CanvasToFramebuffer |
15.908 → 15.979 (+0.4%) |
| RENDER | ComputeVoxelAO |
9.249 → 9.496 (+2.7%) |
| RENDER | BakeSunShadowMap |
8.417 → 8.773 (+4.2%) |
| RENDER | LightingToTrixel |
8.371 → 8.291 (-1.0%) |
| UPDATE | PropagateTransform |
4.405 → 4.380 (-0.6%) |
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
288.688 → 293.911 (+1.8%) |
| RENDER | ComputeSunShadow |
55.366 → 56.434 (+1.9%) |
| RENDER | LightingToTrixel |
36.271 → 36.626 (+1.0%) |
| RENDER | ComputeLightVolume |
32.424 → 32.584 (+0.5%) |
| RENDER | BakeSunShadowMap |
22.377 → 23.157 (+3.5%) |
| RENDER | CanvasToFramebuffer |
17.441 → 17.415 (-0.1%) |
| RENDER | FogToTrixel |
7.107 → 7.126 (+0.3%) |
| UPDATE | PropagateTransform |
6.121 → 6.040 (-1.3%) |
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
1457.395 → 1457.292 (-0.0%) |
| RENDER | ComputeLightVolume |
29.173 → 29.611 (+1.5%) |
| RENDER | ComputeSunShadow |
18.725 → 18.795 (+0.4%) |
| RENDER | CanvasToFramebuffer |
16.205 → 16.362 (+1.0%) |
| RENDER | BakeSunShadowMap |
8.811 → 9.203 (+4.4%) |
| RENDER | ComputeVoxelAO |
8.092 → 7.780 (-3.9%) |
| RENDER | LightingToTrixel |
6.600 → 6.901 (+4.6%) |
| UPDATE | PropagateTransform |
6.104 → 6.118 (+0.2%) |
|
Cross-host smoke OK on windows (fresh checkout + IRShapeDebug --auto-screenshot 10 — build clean, exit 0, ir-run RESULT=CLEAN, 21/21 screenshots saved, no shader/GLSL compile warnings). Unrelated pre-existing log line: tagGpuStage unknown stage name guiToScreen (system_gui_canvas_to_screen.hpp, not touched by this PR). |
Perf gateHead host slug: perf comparison: 361c316 → ecc9d2e-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 |
190.085 → 190.522 (+0.2%) |
| RENDER | ComputeLightVolume |
32.117 → 31.515 (-1.9%) |
| RENDER | CanvasToFramebuffer |
15.199 → 15.035 (-1.1%) |
| RENDER | BakeSunShadowMap |
7.727 → 7.795 (+0.9%) |
| RENDER | ComputeSunShadow |
6.533 → 6.485 (-0.7%) |
| UPDATE | PropagateTransform |
3.905 → 3.866 (-1.0%) |
| RENDER | LightingToTrixel |
3.516 → 3.268 (-7.1%) ↓ |
| UPDATE | FogRevealEval |
3.234 → 3.122 (-3.5%) |
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
726.653 → 722.928 (-0.5%) |
| RENDER | ComputeLightVolume |
28.634 → 28.123 (-1.8%) |
| RENDER | ComputeSunShadow |
16.865 → 16.739 (-0.7%) |
| RENDER | CanvasToFramebuffer |
14.207 → 13.748 (-3.2%) |
| RENDER | BakeSunShadowMap |
6.489 → 6.629 (+2.2%) |
| RENDER | LightingToTrixel |
6.802 → 6.591 (-3.1%) |
| RENDER | ComputeVoxelAO |
5.799 → 5.683 (-2.0%) |
| UPDATE | PropagateTransform |
3.901 → 3.762 (-3.6%) |
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
211.685 → 216.658 (+2.3%) |
| RENDER | ComputeSunShadow |
33.623 → 34.689 (+3.2%) |
| RENDER | ComputeLightVolume |
30.058 → 30.165 (+0.4%) |
| RENDER | LightingToTrixel |
19.377 → 19.722 (+1.8%) |
| RENDER | CanvasToFramebuffer |
14.929 → 14.692 (-1.6%) |
| RENDER | BakeSunShadowMap |
10.105 → 10.126 (+0.2%) |
| UPDATE | PropagateTransform |
5.317 → 5.277 (-0.8%) |
| RENDER | FogToTrixel |
4.569 → 4.600 (+0.7%) |
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
1010.205 → 1005.337 (-0.5%) |
| RENDER | ComputeLightVolume |
28.611 → 28.760 (+0.5%) |
| RENDER | CanvasToFramebuffer |
13.888 → 14.173 (+2.1%) |
| RENDER | ComputeSunShadow |
14.340 → 14.164 (-1.2%) |
| RENDER | BakeSunShadowMap |
6.758 → 6.707 (-0.8%) |
| RENDER | LightingToTrixel |
5.563 → 5.567 (+0.1%) |
| UPDATE | PropagateTransform |
5.236 → 5.354 (+2.3%) |
| RENDER | ComputeVoxelAO |
4.881 → 4.800 (-1.7%) |
Summary
Alt+left reached both camera orbit and inward voxel placement because raw sculpt input ran before the camera controls. Shared
Camera::GestureOwnershipnow reserves registered navigation intent through pointer release, including modifier-first release and combined input events. The voxel editor, shared gizmo drag and editor recipe handles use it; inward placement moves to I+left while preserving the LuaclickBelowAPI. Interrupted brush cells remain one completed stroke; deferred BOX/LINE commits cancel.The shadow investigation is separate: a 40-shot fixed-scene diagnostic reproduces the cardinal per-fragment versus non-cardinal face-center sampling jump. Existing
IR_PERAXIS_SURFACE_LIGHTING=1preserves diagonal shadow edges, while shadows-disabled images remain identical between paths. Both paths restore exact repeated camera poses pixel-for-pixel. Production shadow defaults and shaders are unchanged; wider-scene performance and broader geometric acceptance still gate default adoption.Validation
master;fleet-build --target IRShapeDebugcompleted successfully on macOS/Metal.Evidence
Captures, measured comparisons, reproduction and manual flows.
These are diagnostic comparisons, not a shipped shadow-rendering change. Native Windows/OpenGL remains untested.