Repository navigation
Conversation
kacper-serewis
left a comment
There was a problem hiding this comment.
At 15eeaf1 a 160-frame CPU trace through the production callback yielded identical HUD markup on every frame. DOM assignments fell from 160 to 13, one initial assignment and one per visible change. Streaming and rendering each ran 160 times on both revisions. When integrating #3598 or #3687, retain the movement label in nextHud so a movement-mode change at a fixed position refreshes the display. That integration note comes from source inspection. AI-assisted.
|
Tested 15eeaf1 on Linux, Node v22.23.5 (CPU only, no GPU, no game files): pass with notes Ran
Read
AI-assisted (Claude Code). |
|
Windows test result for head 15eeaf1. Windows 11 Home (10.0.26300), Node v24.21.0, CPython 3.14.10, CPU only, no game files.
AI-assisted (Claude Code) |
|
Tested
|
Kam471
left a comment
There was a problem hiding this comment.
Diff: viewer/index.html only. Caches the HUD markup in lastHud and skips the hud.innerHTML write when it is unchanged; all per-frame state still updates.
Tested:
node --test tests/test_viewer_streaming.cjs→ 47 passed, 0 failed (PR head).- After
git merge origin/main(merge 98bf56202): same command → 51 passed, 0 failed. git diff --check→ clean.
Verdict: PASS. No automated test exercises the skip itself, so the suite only proves no regression; the body's Chrome benchmark is the direct evidence. Adjacent HUD work in #3598/#3687 may need a rebase, as noted; no blocker here.
|
Thanks for the coverage suggestion. dc12c72 adds a test that runs the production frame callback and counts DOM writes. It verifies the initial HUD, FPS stabilization, unchanged and sub-rounding frames, visible position and draw-count changes, and one stream/render call per frame. 48/48 pass on the branch and 52/52 after integration with current main. The test fails on the old unconditional write (9 writes vs 2). AI-assisted (OpenAI Codex). |
|
Tested
AI-assisted. |
|
AI-assisted Windows integration check for A separate synthetic trace flipped between cached LOD tiers while keeping the displayed position and HUD markup unchanged. The camera and fog ranges still responded and the HUD made no writes. Displayed FPS and rounded position changes each triggered exactly one write. Bypassing the guard in memory produced two extra writes at the cached LOD switch. This checks behavior across the three patches; it does not measure browser speed. |
What changes
The viewer builds the HUD text from the same frame data and only replaces the DOM when the displayed markup changes. Camera movement, streaming, rendering and the FPS counter still run every frame.
BUILD-1297 — claimed in coordination and carried forward to #5256. Independent of navigation PRs #3598 and #3687. If either lands first, the adjacent HUD change for the movement label may need a small rebase.
Validation
node --test tests/test_viewer_streaming.cjsafter locally merging with current main.AI-assisted (OpenAI Codex). Synthetic viewer state. CPU-backed callback benchmark.
Depends on: #3598, #3687
These are viewer HUD merge overlaps. Retain the movement label in the cached markup if either navigation PR lands before this one.
Current head
dc12c72cincludes a dedicated regression test for suppressed duplicate HUD writes. The local integration with main passed 52 tests.