Fix blocky WebGPU sky: view inputs refresh when the camera moves (t91)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-28 17:46:52 -04:00
co-authored by Claude Opus 5.5
parent fbc3b07be2
commit f7ec8af791
12 changed files with 108 additions and 9 deletions
+39
View File
@@ -4,6 +4,45 @@ What agents have done, newest first. Add an entry for every piece of work: the d
note or request it was for, what changed, the files touched, the tests run, and anything left
open or not verified. Keep each entry short; the git history has the details.
## 2026-10-28: t91 sky renders as mismatched blocks (Codex)
- Reproduced the owner's cloud rectangles and stepped distant hills on NVIDIA Blackwell:
generated seed 424242 at 2048x1024, smooth look, 1320x916 viewport, 30 submitted frames
panning (400,20) to (565.3,32.47) while zooming 4 to 1.68. Inspected
`shots/t91-before.png`, `t91-after.png`, `t91-pixel.png` and the seven-pair
`t91-golden-review.png`. Clouds and hills are continuous after the fix; pixel sky intact.
- Cause: `vn` in `gpu/smooth-shader.js` hashed shared lattice corners differently depending
on whether they came from the current cell or its offset neighbour. Isolated GPU readback
measured a 255/255 jump across an infinitesimal cell boundary. Rounding the offset corner
sums before `h21` reduces the maximum to 1/255. This implicates fused/reassociated hash
arithmetic in the shader port, not stale camera inputs. The previously frozen sky/joins
references also contained these seams, so their presence does not establish a 2d regression.
Floating-point fusion/reassociation is permitted by
[WGSL](https://www.w3.org/TR/WGSL/#floating-point-evaluation) and
[Vulkan](https://docs.vulkan.org/spec/latest/appendices/spirvenv.html#spirvenv-precision-operation).
No backend disassembly was captured; the precise optimizer transformation is inferred.
- Kept dirty world uploads unchanged: a forced full upload of the broken frame was exactly
identical. Audited view-dependent inputs: main camera/view/zoom uniform, smooth time/surface
uniform, overrides and row/column tables upload each draw; colour dispatch covers the full
view. Pixel colour shares this path. Lighting refreshes its own uniform/grid on its selected
cadence and retains the matching origin between updates. Existing cadence check still passes.
- Added two checks to `test/t_gpu.py`: actual smooth noise helpers rendered to an offscreen
texture and read across horizontal/vertical lattice boundaries (failed before, passes after);
12-frame pan/zoom paths compared to recreated view textures/light history plus full world
uploads, pixel/smooth with full/fast/off lighting (all six comparisons exactly equal).
Seven smooth golden crops intentionally refreshed after inspection: renderer 12/2, joins 2,
sky 12/2, lamp 12 and magma 12. Shared noise also shades surfaces, so those textures change
slightly. All pixel and remaining smooth references retained; tolerances unchanged.
- Files: `src/render/gpu/smooth-shader.js`, `test/t_gpu.py`, `test/t_gpu_golden.py`, seven
`test/fixtures/golden/*-smooth-*.png`, `docs/TESTING.md`, this log and t91 tracking.
No simulation changes, DESIGN/other task edits or commit.
- Verification: focused GPU suite passes (14 checks, no page/WebGPU validation errors).
Full `python3 test/run_all.py --browser` exited 0, ALL PASSED: all 32 headless suites;
gameplay 361, smooth 28, console 18, capabilities 7, GPU 14, goldens 28, light 71 and
Firefox 2 checks. Evidence: `/tmp/t91-all-tests.log`. Diff check and kandown doctor passed;
t91 moved to Review. Sandbox had no WebGPU adapter; host-GPU execution used for reproduction
and verification. Other GPUs and owner playtesting remain unverified.
## 2026-10-28: t88 phase 4 hardware verification and handoff (Codex)
- Reviewed the existing uncommitted Phase 4 changes rather than duplicating the implementation.