[GH-ISSUE #4605] Chunk uploads are unbounded per frame by default: frame spikes while flying into new terrain #1394

Closed
opened 2026-11-02 15:46:37 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @apeirs on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4605

Originally assigned to: @apeirs on GitHub.

🤖 Filed by apeirs's AI agent (Claude Code, Claude Opus 5.5), not by apeirs personally.

What happens: flying fast into new terrain (spectator at full speed, ~50 blocks/s) stutters. With the default Chunk Updates = 0 and Upload Budget = 0, update_world uploads every mesh that finished this frame (the unbudgeted branch). When a burst of meshes lands together, one frame pays for all of them.

Evidence (nightly 587f81f, i7-11850H + RTX A3000 laptop, Linux, render distance 24, HORIZON_SPIKES=25, a fixed 20 s flight through new terrain):

  • The upload span sits inside the slow frames, e.g. update_world 42.3/8.4, upload 33.3/4.3 (wall/CPU ms).
  • A lower frame cap makes it worse, because each frame receives a bigger pile: at maxFps 120, 58 frames over 25 ms and 448 ms of uploads inside slow frames, against 15 frames and 130 ms at 260.

Expected: the default should spread a burst over a few frames, nearest sections first, the way the Chunk Updates / Upload Budget path already does when the player sets one (and the way Sodium caps uploads to a share of the frame time).

PR with a fix and an A/B follows.

Originally created by @apeirs on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4605 Originally assigned to: @apeirs on GitHub. > 🤖 Filed by apeirs's AI agent (Claude Code, Claude Opus 5.5), not by apeirs personally. **What happens:** flying fast into new terrain (spectator at full speed, ~50 blocks/s) stutters. With the default Chunk Updates = 0 and Upload Budget = 0, `update_world` uploads **every** mesh that finished this frame (the unbudgeted branch). When a burst of meshes lands together, one frame pays for all of them. **Evidence** (nightly 587f81f, i7-11850H + RTX A3000 laptop, Linux, render distance 24, `HORIZON_SPIKES=25`, a fixed 20 s flight through new terrain): - The `upload` span sits inside the slow frames, e.g. `update_world 42.3/8.4, upload 33.3/4.3` (wall/CPU ms). - A lower frame cap makes it worse, because each frame receives a bigger pile: at maxFps 120, 58 frames over 25 ms and 448 ms of uploads inside slow frames, against 15 frames and 130 ms at 260. **Expected:** the default should spread a burst over a few frames, nearest sections first, the way the Chunk Updates / Upload Budget path already does when the player sets one (and the way Sodium caps uploads to a share of the frame time). PR with a fix and an A/B follows.
Author
Owner

@apeirs commented on GitHub (Oct 30, 2026):

/claim

🤖 Agent: fix and A/B ready, PR follows.

<!-- gh-comment-id:6531573076 --> @apeirs commented on GitHub (Oct 30, 2026): /claim 🤖 Agent: fix and A/B ready, PR follows.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#1394
No description provided.