[PR #6761] [MERGED] Startup trace: the world's fill as counters, and the steps of the open's gaps #7079

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

📋 Pull Request Information

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

Base: main ← Head: perf/startup-trace-world-fill


📝 Commits (2)

  • 49f441f Startup trace: the world's fill as counters, and the steps of the open's gaps
  • b1feecf Merge main into #6761

📊 Changes

6 files changed (+67 additions, -9 deletions)

View changed files

📝 crates/horizon-client-render/src/spans.rs (+24 -0)
📝 crates/horizon-client/src/game.rs (+8 -0)
📝 crates/horizon-client/src/game/integrated.rs (+2 -2)
📝 crates/horizon-client/src/game/world_loading.rs (+3 -0)
📝 crates/horizon-client/src/lan/data.rs (+28 -7)
📝 tests/test_startup_trace.py (+2 -0)

📄 Description

Requested by Ransom

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

What and why

Fixes #6759.

HORIZON_STARTUP_TRACE left a world's slowest stretches without steps: ~100 ms of the server thread after server.open_world, and the ~700 ms from world.first_frame to world.view_full. This adds:

  • world.fill: a counter track written each frame from arm until the view is full. It holds chunks queued and at each streaming stage (Streaming::stages), resident columns, meshes waiting to upload and packets waiting from the server. Perfetto draws it as lines. tools/startup_trace.py's timeline ignores it (test added).
  • Server thread: server.sync_adopt, server.start_mods.
  • SyncData::load: sync.registries, sync.tags, sync.content_identity, sync.commands, sync.network_recipes, sync.advancements, sync.update_recipes.
  • "World initialization": world.prepare, world.make_streaming.

With the trace off, each costs one relaxed load (startup::on / startup::filling).

These found #6726 / #6729 (the sync data read twice, the server waiting ~100 ms on the second read) and #6742 / #6748 (meshes queued behind the 2 ms upload slice). The counters also show the server's chunk batches: resident columns climb ~64 per 50 ms tick.

Example (--world T --seed 1234 --warm --floor 0, before #6729):

 752  179 ms  server.open_world   [Server thread]
 897  ~120 ms sync.*              [World data preload]
 931   85 ms  server.sync_adopt   [Server thread]
1016    4 ms  server.lan_host     [Server thread]
1020   75 ms  server.settle_spawn [Server thread]

No timing change: trace-only.

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

none

Other projects' code

none

Self-check

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

Check Result
Scope ✅ 6 files, +64 −8
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 602 passed (47 s)
rustfmt ✅ (9 s)
clippy ✅ (21 s)
tests: horizon-client, horizon-client-lib, horizon-client-render ✅ 2983 passed (4 min 46 s)
doc tests ✅ 0 passed (3 s)
content root tests ➖ content root untouched
mod API up to date ❌ failed (5 s)
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)

"mod API up to date" fails on upstream/main 435730a40 without this change too (one doc line of native_block_placement_state in mod_api/generated.rs, untouched here).

🤖 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/6761 **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/startup-trace-world-fill` --- ### 📝 Commits (2) - [`49f441f`](https://github.com/horizon-rust/horizon/commit/49f441fd7fb36234d1883eed6ec15e56583d68bf) Startup trace: the world's fill as counters, and the steps of the open's gaps - [`b1feecf`](https://github.com/horizon-rust/horizon/commit/b1feecff54bce1333b4a833a208f4e1306a7bf5c) Merge main into #6761 ### 📊 Changes **6 files changed** (+67 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/spans.rs` (+24 -0) 📝 `crates/horizon-client/src/game.rs` (+8 -0) 📝 `crates/horizon-client/src/game/integrated.rs` (+2 -2) 📝 `crates/horizon-client/src/game/world_loading.rs` (+3 -0) 📝 `crates/horizon-client/src/lan/data.rs` (+28 -7) 📝 `tests/test_startup_trace.py` (+2 -0) </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 #6759. `HORIZON_STARTUP_TRACE` left a world's slowest stretches without steps: ~100 ms of the server thread after `server.open_world`, and the ~700 ms from `world.first_frame` to `world.view_full`. This adds: - **`world.fill`**: a counter track written each frame from `arm` until the view is full. It holds chunks queued and at each streaming stage (`Streaming::stages`), resident columns, meshes waiting to upload and packets waiting from the server. Perfetto draws it as lines. `tools/startup_trace.py`'s timeline ignores it (test added). - **Server thread**: `server.sync_adopt`, `server.start_mods`. - **`SyncData::load`**: `sync.registries`, `sync.tags`, `sync.content_identity`, `sync.commands`, `sync.network_recipes`, `sync.advancements`, `sync.update_recipes`. - **"World initialization"**: `world.prepare`, `world.make_streaming`. With the trace off, each costs one relaxed load (`startup::on` / `startup::filling`). These found #6726 / #6729 (the sync data read twice, the server waiting ~100 ms on the second read) and #6742 / #6748 (meshes queued behind the 2 ms upload slice). The counters also show the server's chunk batches: resident columns climb ~64 per 50 ms tick. Example (`--world T --seed 1234 --warm --floor 0`, before #6729): ``` 752 179 ms server.open_world [Server thread] 897 ~120 ms sync.* [World data preload] 931 85 ms server.sync_adopt [Server thread] 1016 4 ms server.lan_host [Server thread] 1020 75 ms server.settle_spawn [Server thread] ``` No timing change: trace-only. ## 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 - [x] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference none ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --base upstream/main` on PunyDev, against upstream/main at 435730a40, 6 min 11 s) | Check | Result | | --- | --- | | Scope | ✅ 6 files, +64 −8 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 602 passed (47 s) | | rustfmt | ✅ (9 s) | | clippy | ✅ (21 s) | | tests: horizon-client, horizon-client-lib, horizon-client-render | ✅ 2983 passed (4 min 46 s) | | doc tests | ✅ 0 passed (3 s) | | content root tests | ➖ content root untouched | | mod API up to date | ❌ failed (5 s) | | 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) | "mod API up to date" fails on upstream/main 435730a40 without this change too (one doc line of `native_block_placement_state` in `mod_api/generated.rs`, untouched here). 🤖 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:27 +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#7079
No description provided.