Repository navigation
BUILD-1657: Keep distant map LOD chunks visible - #5244
whattheflop wants to merge 1 commit into
Conversation
Kam471
left a comment
There was a problem hiding this comment.
Head 9554b73 · Windows 11, Node 24.22.3
node --test tests/test_viewer_streaming.cjs-> 55/55 pass, 0 fail- Main repro: ran this PR's test file against
origin/main:viewer/index.html-> 1 pass, 3 fail (the distant-LOD test and its two subtests fail on the stock 6000/2600 limits); PR head restored, worktree clean git diff --check-> clean
updateViewRange() reads def.bounds only for manifest chunks with lod set; loadManifest already validates those as six finite ordered values, so there is no undefined-destructure path. stream() runs first, so evicting the last distant LOD resets far/fog to 6000/2600 in the same frame. Trade-off: one distant LOD raises the global fog.far, so near chunks get slightly less fog; acceptable with a single global fog.
I did not reproduce the WebGL2 readback numbers in the body; evidence here is the headless suite plus the main repro.
Verdict: merge-ready.
Hiiva
left a comment
There was a problem hiding this comment.
Independent CPU review at 9554b73378883ee26cb5fb720f57346c1f878942, against upstream 3faac557b1584d39004357918e60325b4d4ff0fe. No actionable findings in this scope.
- On Windows with Node 24.18.0,
node --test tests/test_viewer_streaming.cjspasses all 55 tests. - Negative control: the same exact test source, with only its
viewer/index.htmlread redirected in memory to upstream, gives 52 passes and 3 failures. These are the distant projection (far plane 6000 versus a required corner distance of 9650.91), fog end (2600), and cached fallback coverage assertions. - Two additional in-memory controls use the PR's full-module fixture and unchanged production source. A hidden cached HD tier remains resident but stops expanding camera/fog ranges once its replacement becomes visible. An orphan HD chunk hidden within unload slack likewise restores the stock ranges. Returning makes the cached chunks visible and expands projection again without another download.
- Source review confirms that the range update follows streaming visibility selection on every frame, covers the farthest 3D corner, excludes hidden/unloaded/non-LOD chunks, and preserves the near plane and ordinary defaults.
git diff --checkis clean; the detached PR source remains unchanged.
All inputs were synthetic. This is CPU-only evidence; I did not independently rerun the GPU rendering checks.
AI-assisted: yes.
Kam471
left a comment
There was a problem hiding this comment.
Reviewed head 9554b73 (vs main 3faac55).
Commands:
node tests/test_viewer_streaming.cjs-> tests 55, pass 55, fail 0.git diff --check: clean.
updateViewRange only counts loaded, visible LOD chunks; bounds are validated finite at world load, so the hypot cannot go NaN. It expands camera.far past the farthest bound corner and keeps fog depth <= 0.85 there, and the new test asserts both the expansion and the reset to 6000/2600 after eviction (outside LOD_SLACK). Inactive distant chunks do not inflate the projection, and plain maps, a nearby hd chunk and test-terrain mode keep the stock 6000/2600 (all asserted). The node harness does not render; only the range logic is covered.
Verdict: pass, no blockers.
|
Tested 9554b73 on Linux, Python 3.13 (CPU only, no GPU, no game files): pass with notes Ran
Read Non-blocking notes:
AI-assisted (Claude Code). |
|
Tested
|
|
AI-assisted integration replay of this head with #7164 729126f on upstream 042c5f3 (dry tree a432af20). In T3 Preview, a deferred 6,800 m synthetic GLB rendered on the first controlled tick after its load completed, with the camera still. The far plane rose from 6,000 m to 6,958.19 m and fog end from 2,600 m to 8,696.49 m. Upstream loaded the same GLB but its pixel remained the background color. The 55 m control pixel matched between builds. Both builds made the same two successful GLB requests. The combined viewer scanned at startup and after each completion, then skipped all other 24 stationary ticks. Upstream scanned on all 27 ticks. Node 24.16.0 viewer suites passed 72/72 on the dry tree and 65/66 on upstream, where the keyboard fixture lacks AbortController. Synthetic assets only, Windows 11 build 26200, RTX 3080 with driver 32.0.16.1664, T3 Chromium WebGL 2 on ANGLE/D3D11 and Three.js r160. Hidden tabs used controlled ticks of the stock animation callback with ordinary HTTP, GLTFLoader and WebGL rendering. This checks the interaction between distant visibility and stationary scheduling. |
|
✅ Automated security review: CLEAN (commit
Scope: static analysis of added diff lines only; no code was executed. Please review findings manually. |
Claimed in the coordination issue as BUILD-1657.
What and why
Valid map manifests can select and load distant LOD chunks that the fixed 6,000 m camera plane clips. The fixed 2,600 m fog end also blends nearer distant chunks fully into the background.
After streaming selects the visible LOD chunks, derive the camera and fog reach from their farthest 3D bounds. Keep the existing ranges as floors and leave the load, unload and selection policy intact. Include regressions for distant, cached and ordinary chunks.
The scene-wide fog extends whenever a distant tier is visible, which reduces fog on nearby geometry in that frame. When camera movement changes the required far plane, the next frame updates the projection matrix.
Tested
node --test tests/test_viewer_streaming.cjs: 55/55. The new regressions reproduce the stock 6,000 m / 2,600 m limits on main.git diff --checkpassed.AI-assisted: yes.
Checklist