Repository navigation
Conversation
Perf gateHead host slug: perf comparison: a990fd6 → c84ba8e-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 |
240.443 → 278.265 (+15.7%) ⚠ |
| RENDER | ComputeSunShadow |
31.232 → 39.984 (+28.0%) ⚠ |
| RENDER | ComputeLightVolume |
29.633 → 32.349 (+9.2%) |
| RENDER | LightingToTrixel |
18.523 → 23.333 (+26.0%) ⚠ |
| RENDER | CanvasToFramebuffer |
15.822 → 18.161 (+14.8%) ⚠ |
| RENDER | BakeSunShadowMap |
1.167 → 10.993 (+842.0%) ⚠ |
| UPDATE | PropagateTransform |
4.949 → 6.250 (+26.3%) ⚠ |
| RENDER | FogToTrixel |
4.669 → 5.657 (+21.2%) ⚠ |
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
1218.093 → 1471.659 (+20.8%) ⚠ |
| RENDER | ComputeLightVolume |
25.504 → 30.364 (+19.1%) ⚠ |
| RENDER | CanvasToFramebuffer |
14.310 → 17.007 (+18.8%) ⚠ |
| RENDER | ComputeSunShadow |
9.793 → 15.710 (+60.4%) ⚠ |
| RENDER | BakeSunShadowMap |
0.198 → 7.308 (+3590.9%) ⚠ |
| RENDER | ComputeVoxelAO |
5.222 → 6.398 (+22.5%) ⚠ |
| UPDATE | PropagateTransform |
4.911 → 6.360 (+29.5%) ⚠ |
| RENDER | LightingToTrixel |
4.476 → 5.671 (+26.7%) ⚠ |
unmatched cells
only in head: target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1, target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1
|
Holding review: upstream PR #4883 is not yet approved. This stacked PR will be re-evaluated once the upstream lands an approval label. |
Start Box and Line on the selected construction floor and keep their preview and drag plane consistent across empty space and foreign parts. Enable accurate voxel surface lighting in the editor and skip redundant axis-shadow dispatches using a shared current-frame route decision. Retain native GUI, independent geometric shadow, route-mutation and paired performance evidence, including the unresolved scheduler timeout that prevents an editor throughput claim.
The evidence directory now lives at media commit 08f3bae; master keeps no committed PR screenshots. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Rebased onto the rewritten parent: the parent #4883 was replayed onto master after #4882 merged, so this layer's single owned commit ( |
d3f9d78 to
9b369c4
Compare
jakildev
left a comment
There was a problem hiding this comment.
Review — editor: restore region tools and continuous yaw shadows
Verdict: approve (pending Opus recheck on the render change)
Stacked on #4883 (cross-author, approved separately). Reviewing the child diff only; the 15 files in scope match the body.
Big picture
The PR does what it says, in two independent pieces:
- Box/Line on an empty grid (
main.cpp,region_tools.hpp,sessions.hpp). Press now starts fromsculptTarget()(the selected canvas floor) instead of requiring an occupied hit.FillToolStatelatchesfloorPlane_/planeAxis_/planeSlice_/planeOffset_. During HELD a floor-started drag skipspickEditable()and usespickEditablePlaneon the latched plane. A surface-started drag only accepts hits on its own start entity, then falls back to its initial face plane. A foreign part cannot redirect the gesture.- BRUSH/PAINT return earlier in the handler, so the new hover-ghost block only affects BOX/LINE.
- Class-paint and bone-paint keep the old pick path through
ordinaryRegion.
- Continuous surface lighting by default in the editor, plus skipping the three sampled per-axis shadow dispatches. The eligibility logic moves verbatim into
surface_lighting_route.hpp::resolveRoute.LIGHTING_TO_TRIXEL::beginTicknow calls it, and so doesCOMPUTE_SUN_SHADOW::beginTick.
I checked the skip for a consumer that would be left reading stale textures:
- The only readers of
axis.sunShadow_aredispatchPerAxisLightingand the shadow producer's own dispatch (grepoverengine/prefabs,engine/render). dispatchPerAxisLightingonly runs in theelsebranch ofif (perAxisSurfaceLightingEligible_)(system_lighting_to_trixel.hpp:448-454). That is the same predicate the producer now skips on.- Both predicates are computed in the same RENDER pass from the same inputs.
shadow != nullptrin lighting's tick is covered bymainCanvasSunShadow_ != nullptrin the route. - Fallbacks keep the sampled producer: no
LIGHTING_TO_TRIXELsystem, debug overlay, depth-color debug, fog LOS or glitch fallback, and surface lighting toggled off. The harness mutations (shadow-always-skipped,shadow-missing-consumer,shadow-stale-route) cover these.
IR_PERAXIS_SURFACE_LIGHTING handling in the editor (unset or anything but "0" → on) matches the documented behavior. Other creations keep their defaults.
Checks
statusCheckRollup:comment-refs,format-check,header-checks,instruction-size,no-plan-files,closes-lint,python-lint,whitespaceandchangesare green.linux-build,render-harness-tests,fleet-testsandperf-gatewere still IN_PROGRESS when I read them, so they are unread, not green.- The Metal GUI/shadow/oracle evidence in the body is the author's. I did not re-run it. The body states OpenGL runtime validation is outstanding (see Test plan).
- No
Closes #Nin the body (Refs #1271 / #4231), so no acceptance grading applies. - No comment in the added code carries an issue number.
Nits (follow-up)
surface_lighting_route.hpp:40-47:resolveRouteparameters and locals carry a trailing_(perAxisCanvasEntity_,cardinalSurfaceLightingEligible_, …). The convention reserves the suffix for public members. They were lifted from member names, so drop it on the way through.surface_lighting_route.hpp:78-83/system_compute_sun_shadow.hpp:179: when a fog pass is registered, a glitch-capable pipeline now runs theanyGlitchSubjectActive()archetype scan twice per frame, once in eachbeginTick. It is guarded and cheap, but it could be shared if it ever shows up in the CPU rows.main.cpp(EditorShadowProfile): the pass/fail check hard-codesfingerprint.active_ != 219, which duplicates theseedShadowRotationScenecount. A named constant would keep the two in step.
Test plan the author should run before merge
-
render-verify/light-verify --if-changedon an OpenGL host, since the shadow-dispatch skip is only Metal-validated. - Wait for
linux-buildandrender-harness-testson this head to finish green.
Escalation: please Opus-recheck before merge (touches: engine/prefabs/irreden/render, voxel_editor input).
🤖 Reviewed by Claude Sonnet 5.5 (review-pr skill)
Opus recheck required: touches engine/prefabs/irreden/render (a GPU dispatch skip gated on a per-frame route shared between two systems, so the producer/consumer ordering deserves a second read) plus the editor input state machine.
jakildev
left a comment
There was a problem hiding this comment.
Opus recheck — editor: restore region tools and continuous yaw shadows
Verdict: approve with nits
Stacked on #4883 (cross-author, fleet:approved, still open). Reviewing the child diff only, at head 9b369c49f; the upstream is approved separately.
Sonnet's escalation: producer/consumer agreement on the sampled-shadow skip
Sonnet asked for a second read on the skip in COMPUTE_SUN_SHADOW. On closer read I confirm it is safe, for these reasons:
- Same inputs. Both systems resolve
IRRender::getCanvas("main")inbeginTick.resolveRoute(EntityId)in the shadow system reads the same seven optional components from that entity thatLIGHTING_TO_TRIXEL::beginTickresolves itself (resolveMainCanvasVoxelFrameInputs+ its own shadow/LV/AO/fog lookups,voxel_frame_data.hpp:275). The predicate body is one function, so the producer and consumer cannot drift apart. - Nothing can flip the route mid-frame. Per-axis allocation (
syncAllocationToCameraYaw) runs inVOXEL_TO_TRIXEL_STAGE_1, before both systems. The editor pipeline (main.cpp:8280-8282) runs onlyCOMPUTE_LIGHT_VOLUMEbetween them, and it touches none of the route inputs. Debug overlay, the surface-lighting singleton, glitch subjects and fog observers are all written outside RENDER. If allocation does change between frames, the guard still holds: the skip needsisAllocated()on the producer side, and the consumer'sdispatchPerAxisLightingneeds it too. - No other reader.
git grep 'sunShadow_'overengine/andcreations/finds exactly two users of the per-axis texture: the producer's own dispatch (system_compute_sun_shadow.hpp:138) anddispatchPerAxisLighting(system_lighting_to_trixel.hpp:493). The latter runs only in theelseofif (perAxisSurfaceLightingEligible_)(:448). So the skipped work only fed a dispatch that was already skipped on the same predicate before this PR. The lighting tick's extrashadow != nullptris implied by the route'smainCanvasSunShadow_ != nullptr. - Stale texture contents are harmless. When the route turns sampled again (surface lighting off, fog LOS, glitch, debug), the producer re-resolves that frame and writes before the consumer reads. No frame reads a texture left over from an earlier exact-route frame.
- Binding table. Skipping
dispatchPerAxisSunShadowalso skips its main-canvas image re-bind. Slots 0/1 were never moved off the main canvas in that case, so no dangling Metal image binding is left behind. - Missing consumer.
findSystem(LIGHTING_TO_TRIXEL)on the producer side keeps the sampled path in a pipeline that has no lighting pass. Theshadow-missing-consumermutation covers this case.
I ran the routing harnesses on this head:
test_render_per_axis_surface_lighting: 3 OK, including all four newshadow-*mutations failing as expected.test_render_cardinal_surface_lighting: 2 OK.test_editor_shadow_rotation: 9 OK.- All three on macOS clang.
Editor input state machine
- Box/Line start. The new start path uses
sculptTarget(), the same target resolver BRUSH uses. Erase and the inward key latch the same way as before (editTargetCell(*hit, erase, inverted)). The floor fallback applies only to place mode, as before. - Held drag. While the button is held, a floor-started drag never re-picks, and a surface-started drag only accepts hits on its own entity. Both fall back to the latched plane. This is the "foreign part cannot redirect the gesture" behaviour the body claims, and the
regionForeign_shots prove it. - Class/bone paint. These keep the old raw-pick path, because
ordinaryRegionis false for them. - Stored entity.
dragStartEntity_is now dereferenced every HELD frame, not only at release. This adds no new exposure: the release path already dereferences it unconditionally, so a part destroyed mid-drag was already fatal at release. - Test hook entity creation.
prepareRegionToolscallscreateEntityfrom the GUI-testonAssertFrame_hook. That hook runs in theC_GuiTestAnchorsystem's frame callback, not its per-entity tick (auto_screenshot.cpp:356), so this is not a mid-iteration structural change. The editor already does the same thing in other session prep functions.
Checks
- Green on
9b369c49f:comment-refs,format-check,header-checks,instruction-size,no-plan-files,closes-lint,python-lint,whitespace,changes. linux-build,render-harness-tests,fleet-testsandperf-gateare still pending, so I have not read them as green. The merge needs them green.- The perf-gate comment on the thread is from the pre-rebase head
c84ba8e43, stacked on an unmerged base. It does not measure this head. - OpenGL runtime validation is outstanding, per the body. That is ledgered via
fleet:needs-windows-smoke, not a merge gate.
Nits (follow-up)
- I agree with Sonnet: in
surface_lighting_route.hpp:841-857, theresolveRouteparameters and locals keep the trailing_from their old member names. The convention reserves it for public members. - I agree with Sonnet's glitch-scan nit: with fog registered,
anyGlitchSubjectActive()can now run twice per frame, once perbeginTick. It is guarded and cheap. - On the PRESS frame of a Box/Line drag,
pickEditable()now runs three times: the hover block, the unusedhitat PRESS whenordinaryRegion, and the call insidesculptTarget. Hoistinghitbehind!ordinaryRegiondrops one of them. This is not per-entity work, so it is not a hot-path concern. - I agree with Sonnet: the
219literal inEditorShadowProfileduplicates the seeded-scene count. It is also repeated inevaluateShadowRotationCheckandeditor-shadow-rotation.py.
🤖 Reviewed by Claude Opus 5.5 (role-opus-reviewer, Opus recheck)
|
Cross-host smoke OK on windows (fresh checkout + IRShapeDebug --auto-screenshot 10 — build clean, ir-run RESULT=CLEAN exit 0, no shader/compile warnings; the only log warning is a runtime profiler note: tagGpuStage unknown stage name "guiToScreen", not a compile warning). |
Perf gateHead host slug: perf comparison: a3d54c9 → 56f6762-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 → 257.209 (+3.8%) |
| RENDER | ComputeLightVolume |
32.632 → 34.712 (+6.4%) |
| RENDER | CanvasToFramebuffer |
17.085 → 17.509 (+2.5%) |
| RENDER | BakeSunShadowMap |
9.662 → 10.313 (+6.7%) |
| RENDER | ComputeSunShadow |
7.624 → 7.850 (+3.0%) |
| UPDATE | PropagateTransform |
4.519 → 4.899 (+8.4%) |
| UPDATE | FogRevealEval |
4.190 → 4.319 (+3.1%) |
| RENDER | LightingToTrixel |
3.850 → 3.954 (+2.7%) |
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
1025.715 → 1026.942 (+0.1%) |
| RENDER | ComputeLightVolume |
29.338 → 29.410 (+0.2%) |
| RENDER | ComputeSunShadow |
21.864 → 21.527 (-1.5%) |
| RENDER | CanvasToFramebuffer |
15.908 → 16.001 (+0.6%) |
| RENDER | ComputeVoxelAO |
9.249 → 9.368 (+1.3%) |
| RENDER | BakeSunShadowMap |
8.417 → 8.631 (+2.5%) |
| RENDER | LightingToTrixel |
8.371 → 8.453 (+1.0%) |
| UPDATE | PropagateTransform |
4.405 → 4.651 (+5.6%) |
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
288.688 → 288.765 (+0.0%) |
| RENDER | ComputeSunShadow |
55.366 → 54.691 (-1.2%) |
| RENDER | LightingToTrixel |
36.271 → 35.546 (-2.0%) |
| RENDER | ComputeLightVolume |
32.424 → 32.900 (+1.5%) |
| RENDER | BakeSunShadowMap |
22.377 → 22.325 (-0.2%) |
| RENDER | CanvasToFramebuffer |
17.441 → 17.266 (-1.0%) |
| RENDER | FogToTrixel |
7.107 → 7.045 (-0.9%) |
| UPDATE | PropagateTransform |
6.121 → 6.060 (-1.0%) |
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
1457.395 → 1457.466 (+0.0%) |
| RENDER | ComputeLightVolume |
29.173 → 28.997 (-0.6%) |
| RENDER | ComputeSunShadow |
18.725 → 18.544 (-1.0%) |
| RENDER | CanvasToFramebuffer |
16.205 → 16.278 (+0.5%) |
| RENDER | BakeSunShadowMap |
8.811 → 8.669 (-1.6%) |
| RENDER | ComputeVoxelAO |
8.092 → 7.612 (-5.9%) ↓ |
| RENDER | LightingToTrixel |
6.600 → 6.717 (+1.8%) |
| UPDATE | PropagateTransform |
6.104 → 6.147 (+0.7%) |
Summary
Box and Line could not begin on the empty construction grid because their input path required an occupied voxel hit. Both now use the selected canvas floor, maintain a stable drag plane over empty space or another part, preview while held, and commit one undoable edit on release.
The voxel editor now enables continuous surface lighting by default. Under yaw, its previous receiver path shaded whole face samples; the existing accurate path evaluates the actual visible surface point. CanvasStress's default SDF floor already used that form of shading. Explicit
IR_PERAXIS_SURFACE_LIGHTING=0retains the comparison path; other creations keep their current defaults.The shared renderer skips three redundant sampled axis-shadow dispatches when accurate presentation consumes the sun geometry directly. A common current-frame route resolver keeps producer and consumer eligibility aligned, including debug, fog and incomplete-pipeline fallbacks. No shadow shader or filtering changes.
Test plan
Debug and Release voxel-editor builds; Release CanvasStress build; format, Python lint, comment/header/instruction checks.
Native Metal GUI replay: region tools 25/25, camera gestures 44/44, inward placement 7/7; CLEAN exits, no layout findings. Includes actual toolbar selection, 30°/67° drags, Undo/Escape, and a foreign slab proven to own the raw pick while the selected floor receives the edit.
Native shadow sweep: 80 assertions each for default accurate and explicit coarse paths. Forty poses include quarter-degree offsets around all four cardinal angles, intermediate quadrants and exact returns. Every repeated pose returns identical pixels; all 40 unshadowed views match between routes.
Independent finite-box shadow oracle at 22.5°, 112.5°, 202.5°, 292.5°: 208,344 sun-facing interior pixels, zero false/missed shadows or invalid colors. Coarse negative control at 22.5° fails with 225 false and 185 missed shadow pixels.
Optimization preserves all RGB pixels in four accurate and four coarse full-frame comparisons. Routing harness passes 131,072 eligibility configurations plus live toggles/fog and failing mutation controls.
Native lighting regression gate: all checks pass.
Full render harness: 126 suites passed, zero failed.
Guarded optimization matrix: 20 Release runs, five alternating baseline/candidate pairs per zoom; binary/runtime identity, pose and overflow checks pass. Sampled-shadow GPU scope decreases consistently (0.927→0.171 ms at zoom 1; 0.421→0.126 ms at zoom 4). Whole-frame paired intervals include zero, so no proven whole-frame speedup is claimed.
Editor performance
The timing investigation exposed missing upstream scheduler completion-ordering fixes. #4886 supplies that correction and completes the fresh 24-run guarded editor matrix (8,640 frames), with no timeouts. In the 219-cell fixture, stage-timing-off GPU-envelope means increase by 0.156 ms and 0.108 ms at 30°/zoom 4 and 67°/zoom 8. Steady wall means increase 2.110/2.303 ms with substantial run variation, so no stable FPS or universal 60 Hz claim is made. The rejected earlier matrix remains retained as diagnostic evidence; it is excluded from these measurements.
Visual evidence
Evidence, reproduction commands, limits and manual test flows
Validation is macOS Metal on Apple M4 Max. OpenGL runtime validation remains for another host. Finite-record overflow remains approximate; broader renderer adoption and dense-scene tuning remain outside this change. Refs #1271 and #4231.
Authored with Codex.
Overlap check
fleet-pr-overlap: overlap, no new conflicting tree. Remaining matches are upstream stack members. Review these clean/shared instruction paths and the existing parent-base conflict: