[PR #6748] [MERGED] Terrain arriving: frames upload chunk meshes for 6 ms instead of 2 (−75 ms to the full view) #7069

Closed
opened 2026-11-03 06:33:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6748
Author: @Vaspyyy
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: perf/upload-budget-arriving


📝 Commits (1)

  • a357026 Terrain arriving: frames upload chunk meshes for 6 ms instead of 2

📊 Changes

1 file changed (+10 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+10 -1)

📄 Description

Requested by Ransom

🤖 Opened by Vaspyyy's AI agent (Claude Code), not by Vaspyyy personally.

What and why

Fixes #6742.

Without the player's Chunk Updates / Upload Budget, a frame uploads chunk meshes for at most AUTO_UPLOAD_TIME (2 ms). During a world's open that slice is too small. A per-frame trace of pending_uploads shows up to ~1300 finished meshes queued, ~1300 still waiting after every column has arrived, and world.view_full waiting on them to drain.

While the view's terrain is still arriving (ViewArrival::arriving, already computed beside the upload loop: a world's open, a teleport, a view change until its outermost columns are in), frames now upload for 6 ms (AUTO_UPLOAD_TIME_ARRIVING). The meshes waiting then are the view itself, not edits to it. Edits and ordinary play keep the 2 ms slice, and the player's own budgets are untouched.

Timings

python3 tools/startup_trace.py --world T --seed 1234 --runs 2 --warm, three rounds alternating the two builds, 6 runs each. Ryzen 7 5800X, RTX 3070, NVMe, Linux. Medians:

2 ms 6 ms while arriving
world.first_frame 1037 ms 1036 ms
world.view_full 1757 ms 1682 ms (−75; 2 of the 6 runs at ~1465)

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Horizon-only (the automatic upload slice is Horizon's own pacing).

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --base upstream/main on PunyDev, against upstream/main at 435730a40, 2 min 2 s)

Check Result
Scope ✅ 1 files, +10 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 602 passed (48 s)
rustfmt ✅ (9 s)
clippy ✅ (34 s)
tests: horizon-client ✅ 598 passed (29 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
mod API up to date ➖ native hooks untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/6748 **Author:** [@Vaspyyy](https://github.com/Vaspyyy) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/upload-budget-arriving` --- ### 📝 Commits (1) - [`a357026`](https://github.com/horizon-rust/horizon/commit/a357026d64c45e050e4997d2db43dfd16c817492) Terrain arriving: frames upload chunk meshes for 6 ms instead of 2 ### 📊 Changes **1 file changed** (+10 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+10 -1) </details> ### 📄 Description <!-- claude-projects-attribution: {"github_login":"Vaspyyy"} --> _Requested by **Ransom**_ > 🤖 Opened by Vaspyyy's AI agent (Claude Code), not by Vaspyyy personally. ## What and why Fixes #6742. Without the player's Chunk Updates / Upload Budget, a frame uploads chunk meshes for at most `AUTO_UPLOAD_TIME` (2 ms). During a world's open that slice is too small. A per-frame trace of `pending_uploads` shows up to ~1300 finished meshes queued, ~1300 still waiting after every column has arrived, and `world.view_full` waiting on them to drain. While the view's terrain is still arriving (`ViewArrival::arriving`, already computed beside the upload loop: a world's open, a teleport, a view change until its outermost columns are in), frames now upload for 6 ms (`AUTO_UPLOAD_TIME_ARRIVING`). The meshes waiting then are the view itself, not edits to it. Edits and ordinary play keep the 2 ms slice, and the player's own budgets are untouched. ### Timings `python3 tools/startup_trace.py --world T --seed 1234 --runs 2 --warm`, three rounds alternating the two builds, 6 runs each. Ryzen 7 5800X, RTX 3070, NVMe, Linux. Medians: | | 2 ms | 6 ms while arriving | |---|---|---| | `world.first_frame` | 1037 ms | 1036 ms | | `world.view_full` | 1757 ms | 1682 ms (**−75**; 2 of the 6 runs at ~1465) | ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [x] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Horizon-only (the automatic upload slice is Horizon's own pacing). ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --base upstream/main` on PunyDev, against upstream/main at 435730a40, 2 min 2 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +10 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 602 passed (48 s) | | rustfmt | ✅ (9 s) | | clippy | ✅ (34 s) | | tests: horizon-client | ✅ 598 passed (29 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | mod API up to date | ➖ native hooks untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:33:14 +07:00
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#7069
No description provided.