Repository navigation
render: measure ownership-restricted gather filtering at fractional zoom - #4919
Conversation
An opt-in, measurement-only colour resolve for the camera-following rectangular gather (IR_GATHER_FILTER_DIAGNOSTIC=unrestricted|owner): an area-weighted box over the texels a minifying pixel covers, either unrestricted (the bleeding control) or restricted to taps that share the nearest texel's entity, face slot, flip and planar depth. Depth, alpha, entity id and hover stay on the nearest texel. Unset, the gather is byte-identical; the mode rides the former hover pad slot. IRShapeDebug --gather-filter-fixture and the metric's filter mode grade every arm against nearest across density-step zoom sweeps. On Metal the owner rule changes no owner, bleeds nowhere and halves the GRID interior's temporal difference at cardinal yaw. Production keeps nearest; continuous-camera-zoom.md records why and what a future opt-in policy would need. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jakildev
left a comment
There was a problem hiding this comment.
Review — render: measure ownership-restricted gather filtering at fractional zoom
Verdict: needs-fix
Needs-fix
scripts/gather_filter_metric.py:317— the file adds a blank line at EOF, so the PR'swhitespaceworkflow fails. I reproduced it withgit diff --check origin/master...HEAD. Remove the extra terminal blank line and let the whitespace check rerun green.
Praise
- The diagnostic preserves the existing UBO size and nearest-sample ownership/depth/hover path, and the GLSL/Metal implementations mirror the ownership filter closely.
- The metric uses a deliberately bleeding control, repeat captures, ownership counts, and a second stability statistic, which makes the negative production decision evidence-based rather than screenshot-only.
Acceptance (issue #4892)
| Criterion | Result | Evidence |
|---|---|---|
| Fractional sweeps and fixture coverage | Met | Forward/reverse yaw 0 and 0.4 sweeps cross density 2→3; the fixture contains GRID, DETACHED, DETACHED_REVOXELIZE, SDF, touching owners, one voxel, and a thin detached bar. The documented SOURCE_FACES nondeterminism is fenced and reported rather than attributed to the gather. |
| Temporal stability and ownership controls | Met | The candidate gates zero coverage changes, bleed, and owner disagreements; unrestricted filtering supplies the positive bleed control; repeat noise and temporal/interior-mean readings are published. The 26 metric tests pass locally. |
| Metal and OpenGL repeated timing | Deferred to #4916 | Metal results are published. OpenGL execution is host-only smoke debt explicitly tracked by #4916; the GLSL twin passes shader parity, so this is not treated as an unmet criterion in this host review. |
| Disabled-path parity and decision | Met with inherited host red disclosed | The PR reports byte-identical snapped/control captures against its parent and records the nearest-production decision. The broad render harness is red for the same named checks on the parent; the PR does not misstate it as green. |
Checks and tests
python3 scripts/tests/test_render_continuous_zoom_metric.py— 26 passed locally.python3 scripts/perf/test_repeat_profile.py— 56 passed locally.- GitHub
whitespace— failed on this head for the finding above. - GitHub
linux-build,perf-gate,render-harness-tests, andfleet-tests— still pending at review time and therefore unread, not green.
Test plan the author should run before merge
- Remove the extra blank line and verify
git diff --check origin/master...HEADis clean. - Confirm the rerun of the
whitespaceworkflow passes and review any later failures from the currently pending checks.
Reviewed by Codex GPT-5 (review-pr skill; opus-class final pass).
Opus recheck not required (reviewed at opus class).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed feedback:
|
jakildev
left a comment
There was a problem hiding this comment.
Re-review — render: measure ownership-restricted gather filtering at fractional zoom
Verdict: approve
The requested whitespace fix is complete. The amend from b0970eaff to 53468ecdb only removes the trailing blank line from scripts/gather_filter_metric.py; no other files or behavior changed.
Checks
git diff --check origin/master...HEAD— clean locally.- GitHub
whitespace— passed on53468ecdb. - GitHub
linux-build,perf-gate,render-harness-tests, andfleet-tests— still pending at re-review time and therefore unread, not green.
Reviewed by Codex GPT-5 (review-pr skill; opus-class final pass).
Opus recheck not required (reviewed at opus class).
Perf gateHead host slug: perf comparison: 361c316 → 36b2635-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.182 (+0.1%) |
| RENDER | ComputeLightVolume |
32.117 → 32.982 (+2.7%) |
| RENDER | CanvasToFramebuffer |
15.199 → 15.309 (+0.7%) |
| RENDER | BakeSunShadowMap |
7.727 → 7.916 (+2.4%) |
| RENDER | ComputeSunShadow |
6.533 → 6.497 (-0.6%) |
| UPDATE | PropagateTransform |
3.905 → 3.938 (+0.8%) |
| RENDER | LightingToTrixel |
3.516 → 3.458 (-1.6%) |
| UPDATE | FogRevealEval |
3.234 → 3.246 (+0.4%) |
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
726.653 → 723.117 (-0.5%) |
| RENDER | ComputeLightVolume |
28.634 → 28.197 (-1.5%) |
| RENDER | ComputeSunShadow |
16.865 → 16.715 (-0.9%) |
| RENDER | CanvasToFramebuffer |
14.207 → 13.862 (-2.4%) |
| RENDER | LightingToTrixel |
6.802 → 6.382 (-6.2%) ↓ |
| RENDER | BakeSunShadowMap |
6.489 → 6.357 (-2.0%) |
| RENDER | ComputeVoxelAO |
5.799 → 5.678 (-2.1%) |
| UPDATE | PropagateTransform |
3.901 → 3.936 (+0.9%) |
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
211.685 → 227.885 (+7.7%) |
| RENDER | ComputeSunShadow |
33.623 → 38.107 (+13.3%) ⚠ |
| RENDER | ComputeLightVolume |
30.058 → 30.449 (+1.3%) |
| RENDER | LightingToTrixel |
19.377 → 21.393 (+10.4%) ⚠ |
| RENDER | CanvasToFramebuffer |
14.929 → 15.669 (+5.0%) |
| RENDER | BakeSunShadowMap |
10.105 → 10.462 (+3.5%) |
| UPDATE | PropagateTransform |
5.317 → 5.301 (-0.3%) |
| RENDER | FogToTrixel |
4.569 → 4.769 (+4.4%) |
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
1010.205 → 1008.614 (-0.2%) |
| RENDER | ComputeLightVolume |
28.611 → 29.092 (+1.7%) |
| RENDER | ComputeSunShadow |
14.340 → 14.440 (+0.7%) |
| RENDER | CanvasToFramebuffer |
13.888 → 14.432 (+3.9%) |
| RENDER | BakeSunShadowMap |
6.758 → 6.925 (+2.5%) |
| RENDER | LightingToTrixel |
5.563 → 5.548 (-0.3%) |
| UPDATE | PropagateTransform |
5.236 → 5.336 (+1.9%) |
| RENDER | ComputeVoxelAO |
4.881 → 4.873 (-0.2%) |
Perf gateHead host slug: perf comparison: fae9b65 → 2d6ee9f-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 → 248.069 (-3.6%) |
| RENDER | ComputeLightVolume |
35.123 → 32.847 (-6.5%) ↓ |
| RENDER | CanvasToFramebuffer |
17.567 → 16.907 (-3.8%) |
| RENDER | BakeSunShadowMap |
10.266 → 9.471 (-7.7%) ↓ |
| RENDER | ComputeSunShadow |
8.088 → 7.553 (-6.6%) ↓ |
| UPDATE | PropagateTransform |
4.778 → 4.856 (+1.6%) |
| UPDATE | FogRevealEval |
4.235 → 4.230 (-0.1%) |
| RENDER | ComputeVoxelAO |
3.990 → 3.842 (-3.7%) |
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
1030.235 → 1023.953 (-0.6%) |
| RENDER | ComputeLightVolume |
29.441 → 28.849 (-2.0%) |
| RENDER | ComputeSunShadow |
21.962 → 21.663 (-1.4%) |
| RENDER | CanvasToFramebuffer |
16.233 → 15.900 (-2.1%) |
| RENDER | ComputeVoxelAO |
9.406 → 9.357 (-0.5%) |
| RENDER | BakeSunShadowMap |
8.992 → 8.556 (-4.8%) |
| RENDER | LightingToTrixel |
8.465 → 8.101 (-4.3%) |
| UPDATE | PropagateTransform |
4.339 → 4.470 (+3.0%) |
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
299.030 → 294.418 (-1.5%) |
| RENDER | ComputeSunShadow |
60.014 → 54.142 (-9.8%) ↓ |
| RENDER | LightingToTrixel |
38.631 → 35.556 (-8.0%) ↓ |
| RENDER | ComputeLightVolume |
32.634 → 32.283 (-1.1%) |
| RENDER | BakeSunShadowMap |
23.692 → 22.322 (-5.8%) ↓ |
| RENDER | CanvasToFramebuffer |
17.726 → 17.709 (-0.1%) |
| RENDER | FogToTrixel |
7.366 → 6.984 (-5.2%) ↓ |
| UPDATE | PropagateTransform |
6.200 → 6.150 (-0.8%) |
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1
| pipeline | system | avg ms (base→head) |
|---|---|---|
| RENDER | SingleVoxelToCanvasFirst |
1462.392 → 1455.810 (-0.5%) |
| RENDER | ComputeLightVolume |
30.012 → 28.552 (-4.9%) |
| RENDER | ComputeSunShadow |
18.963 → 18.544 (-2.2%) |
| RENDER | CanvasToFramebuffer |
16.640 → 16.168 (-2.8%) |
| RENDER | BakeSunShadowMap |
9.165 → 8.436 (-8.0%) ↓ |
| RENDER | ComputeVoxelAO |
7.862 → 7.885 (+0.3%) |
| RENDER | LightingToTrixel |
7.002 → 6.493 (-7.3%) ↓ |
| UPDATE | PropagateTransform |
6.182 → 6.135 (-0.8%) |
|
Cross-host smoke OK on windows (fresh checkout + IRShapeDebug --auto-screenshot 10 — build clean, exit 0, ir-run RESULT=CLEAN, no shader/GLSL compile warnings). Non-blocking notes: glad.h macro-redefinition warnings at build, and a runtime |
Closes #4892
Summary
Investigation spike for fractional-zoom minification shimmer. It adds an opt-in, measurement-only gather colour filter (
IR_GATHER_FILTER_DIAGNOSTIC=unrestricted|owner, GLSL + Metal), a fixture and a grader, Metal measurements, and a decision: production stays nearest, and no setting is exposed. Unset, the diagnostic is byte-identical to the parent commit.ir_trixel_to_framebuffer_body.{glsl,metal}: an area-weighted box over the canvas texels the pixel footprint covers. Inownermode a tap counts only if it shares the nearest texel's entity, face slot and flip, at a depth within a planar face's step. Depth, alpha, entity id and hover always come from the nearest texel. The mode rides the formerhoverResolvePad_slot (gatherFilterDiagnostic_, offset 268), so the UBO size and every other offset are unchanged.gather_filter_diagnostic.hpp: reads the env var once at system creation, the same pattern asIR_PERAXIS_*. Only camera-followingRECTANGULARgathers are filtered (main canvas; world-placed detached canvases with that layout).IRShapeDebug --gather-filter-fixture: unlit checker bodies as GRID / DETACHED / DETACHED_REVOXELIZE, an SDF box, a touching red/green pair, one voxel and a thin rotated DETACHED bar, with palettes chosen so cross-owner mixes are detectable. Its detached systems are registered only with the flag.render-continuous-zoom-metric.py filter/filter-grade+scripts/gather_filter_metric.py: ownership counts per arm against nearest, motion-compensated interior temporal difference, and interior mean-colour spread.docs/design/continuous-camera-zoom.md§ "Filtered minification": readings, coverage and the decision. Evidence is published on the media branch: 37a3b3eb…/gather-filter-diagnostic.Acceptance evidence
filtermode: z 1.80→2.40 and 2.40→1.80 (25 shots, density 2→3) at yaw 0 and 0.4, plus snapped z 2/4. Per-sweep zoom / density / scale are inresults.json(density [2, 3],scale [2]). All four presentations are in one fixture. DETACHED (SOURCE_FACES) renders incompletely and non-deterministically in IRShapeDebug's pipeline, lit or unlit (about 74k differing px per sweep between identical runs). It is never gathered, so it is fenced off and reported apart; see Plan departuresRESULT=PASS. Unrestricted control: bleed 33,482 px, owner disagreements 7,614. Owner candidate: 0 coverage changes, 0 bleed, 0 disagreements across all six sweeps. GRID interior temporal difference at yaw 0: nearest 10.73 / 10.84 → owner 5.18 / 5.50 (paired −5.55 / −5.34), repeat noise 0.0. Interior mean-colour spread: 0.511 → 0.113. Picking:gui-verify.py IRShapeDebug -- --continuous-zoom-gui-test5/5 under unset,ownerandunrestricted. Example frame below--auto-profileruns per arm at z 2.2, yaw 0 (gpu-timing.txt). Whole-frame envelope per-run averages: nearest 1.16–3.42 ms, owner 1.20–2.18 ms, unrestricted 1.26–3.34 ms; best frames 0.966 / 0.972 / 0.975 ms. Cost is below run-to-run variation on this shared host, and no stage sums are quoted. OpenGL: not measured. This macOS pane cannot run GL; the residual is #4916render-verify.py --allpasses and snapped-control frames match byte-for-byte; decision published in the design doc naming modes, scales and ownership cases23b4d0e72.render-verify --allon this host: 57 of 323 checks FAIL. All 57 fail on the parent23b4d0e72with the same check names (Launcher, FontMaker, UIWidgets, LightingSdfBlocker, CanvasStresscylinder_receiver*/so3_*, VoxelEditor previews, ShapeDebug yaw-180/270 shots), and the metrics match apart from animated scenes that drift between runs either way. One extra miss on the branch, LuaPerfGridzoom1_origin(99.9993%), passed on two reruns. This criterion is not green on this host, and the red is inherited from the parent. Decision:continuous-camera-zoom.md§ "Filtered minification"Nearest / owner / unrestricted at z 2.05, density 3 (top: GRID checker body; bottom: touching pair):
Plan departures
shader_parity_audit.pyand the GLSL reserved-word check, but no GL host has executed it. Filed render: measure the gather-filter diagnostic on OpenGL #4916 (Blocked by: #4892) for the OpenGLfilterand timing rows. The cross-host smoke lane compiles the edited gather programs when it runsIRShapeDebug.SOURCE_FACES) presentation cannot be graded in IRShapeDebug: identical runs differ by about 74k px in those owners, lit or unlit. This is not root-caused; IRShapeDebug normally registers no detached systems, and the fixture adds onlyREBUILD_DETACHED_VOXELS,PROPAGATE_CANVAS_ROTATIONandENTITY_CANVAS_TO_FRAMEBUFFER. Source faces are never gathered, so the candidate cannot touch them. The grader fences them (16 px margin) and reports their differing count separately.scripts/perf/repeat_profile.pyadmits only the SDF scene for IRShapeDebug, so timing used direct--auto-profileruns. The env var is still added to its experiment allowlist for future use.Open-PR overlap
fleet-pr-overlap --base master:VERDICT: overlap, every trial merge clean. Reviewer: please check the doc edits for semantic disagreement.#4893's doc hunk edits § Placement. This PR edits § Trade-offs, adds § Filtered minification and extends § Validators.
Test plan
python3 scripts/render-continuous-zoom-metric.py filter --output <dir>→RESULT=PASS(Metal)python3 scripts/tests/test_render_continuous_zoom_metric.py(26 tests),python3 scripts/perf/test_repeat_profile.py(56)python3 scripts/gui-verify.py IRShapeDebug -- --continuous-zoom-gui-test× 3 arms, 5/5shader_parity_audit.py, header checks, comment-ref lintNot verified here:
render-verify --allis red on this host and on the parent build, with identical failing checks; OpenGL readings are tracked in #4916.🤖 Generated with Claude Code