[PR #6496] [MERGED] Startup trace: HORIZON_STARTUP_TRACE and tools/startup_trace.py #6911

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

📋 Pull Request Information

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

Base: main ← Head: perf/startup-trace


📝 Commits (3)

  • cd593e1 Startup trace: HORIZON_STARTUP_TRACE writes the start's steps per thread; tools/startup_trace.py
  • 54afdf6 startup_trace.py: scratch folders through lab.game_env
  • ef56d07 Startup trace: keep finish_open_world's line as native_lifecycle's test reads it

📊 Changes

9 files changed (+500 additions, -47 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+10 -1)
📝 crates/horizon-client-render/src/spans.rs (+155 -0)
📝 crates/horizon-client-render/src/telemetry.rs (+9 -4)
📝 crates/horizon-client/src/entry.rs (+1 -0)
📝 crates/horizon-client/src/game.rs (+98 -38)
📝 crates/horizon-client/src/game/integrated.rs (+11 -4)
📝 crates/horizon-client/src/game/remote.rs (+3 -0)
➕ tests/test_startup_trace.py (+32 -0)
➕ tools/startup_trace.py (+181 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

The start's timeline, step by step and per thread, to find what keeps the title, a world or a server's view waiting.

  • HORIZON_STARTUP_TRACE=FILE makes the game write each named step of the start as a Chrome trace event (one JSON line each; Perfetto opens the file wrapped in [...]). Steps: the menu bundle, the core tables (assets, block models and sprites, visibility, block facts, light, motion, collisions...), the pack tables, the handoff's CPU work, each world table of the rest loader, the window, each renderer build (device, terrain pipelines, entity pipelines), the server thread's world open (game, open, LAN host, spawn). Marks: loading screen shown, title shown, world opening, first world frame, view full (nothing pending and perf_bench's share of the view resident), dimension change.
  • Off (the default) a step costs one relaxed load.
  • tools/startup_trace.py starts the game the way a player does (no control socket, so the title shows while the world tables load), in lab.game_env scratch folders, and prints the timeline. --world, --server, --runs N, --warm (later starts), --keep FILE.

First finding (playhorizon, llvmpipe, 4 shared cores, --world T RD 8): the main thread builds the renderer three times before the title (boot 4.0 s, title artwork 4.8 s, world 2.05 s), each compiling the same pipelines again. The follow-up PR keeps them.

     139     4006 ms  renderer.boot  [main]
    1279     1605 ms  renderer.terrain_pipelines  [main]
    4325     4799 ms  renderer.title_artwork  [main]
    6065     3276 ms  rest  [world-rest-loader]
    9124     2054 ms  renderer.world  [main]
   11733            * title.shown
   13862    12288 ms  server.settle_spawn  [Server thread]
   26834            * world.first_frame
   56741            * world.view_full

No player-visible change: skip-release.

pr_ready: queued on playhorizon (all build slots busy); the block follows as a comment. Done so far on this head's tree: Python tests pass (596), rustfmt pass, tests of horizon-client + horizon-client-render passed except native_lifecycle's source-text test, fixed in 8e78cf05c.

🤖 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/6496 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/startup-trace` --- ### 📝 Commits (3) - [`cd593e1`](https://github.com/horizon-rust/horizon/commit/cd593e15b90fffbcec0ef0d940095296afbb5677) Startup trace: HORIZON_STARTUP_TRACE writes the start's steps per thread; tools/startup_trace.py - [`54afdf6`](https://github.com/horizon-rust/horizon/commit/54afdf67353c6a78c79cdc1e224c9092e2a22abd) startup_trace.py: scratch folders through lab.game_env - [`ef56d07`](https://github.com/horizon-rust/horizon/commit/ef56d07869f2fe56f4807da9153dcb6472355f0d) Startup trace: keep finish_open_world's line as native_lifecycle's test reads it ### 📊 Changes **9 files changed** (+500 additions, -47 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+10 -1) 📝 `crates/horizon-client-render/src/spans.rs` (+155 -0) 📝 `crates/horizon-client-render/src/telemetry.rs` (+9 -4) 📝 `crates/horizon-client/src/entry.rs` (+1 -0) 📝 `crates/horizon-client/src/game.rs` (+98 -38) 📝 `crates/horizon-client/src/game/integrated.rs` (+11 -4) 📝 `crates/horizon-client/src/game/remote.rs` (+3 -0) ➕ `tests/test_startup_trace.py` (+32 -0) ➕ `tools/startup_trace.py` (+181 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. The start's timeline, step by step and per thread, to find what keeps the title, a world or a server's view waiting. - `HORIZON_STARTUP_TRACE=FILE` makes the game write each named step of the start as a Chrome trace event (one JSON line each; Perfetto opens the file wrapped in `[...]`). Steps: the menu bundle, the core tables (assets, block models and sprites, visibility, block facts, light, motion, collisions...), the pack tables, the handoff's CPU work, each world table of the rest loader, the window, each renderer build (device, terrain pipelines, entity pipelines), the server thread's world open (game, open, LAN host, spawn). Marks: loading screen shown, title shown, world opening, first world frame, view full (nothing pending and perf_bench's share of the view resident), dimension change. - Off (the default) a step costs one relaxed load. - `tools/startup_trace.py` starts the game the way a player does (no control socket, so the title shows while the world tables load), in `lab.game_env` scratch folders, and prints the timeline. `--world`, `--server`, `--runs N`, `--warm` (later starts), `--keep FILE`. First finding (playhorizon, llvmpipe, 4 shared cores, `--world T` RD 8): the main thread builds the renderer three times before the title (boot 4.0 s, title artwork 4.8 s, world 2.05 s), each compiling the same pipelines again. The follow-up PR keeps them. ``` 139 4006 ms renderer.boot [main] 1279 1605 ms renderer.terrain_pipelines [main] 4325 4799 ms renderer.title_artwork [main] 6065 3276 ms rest [world-rest-loader] 9124 2054 ms renderer.world [main] 11733 * title.shown 13862 12288 ms server.settle_spawn [Server thread] 26834 * world.first_frame 56741 * world.view_full ``` No player-visible change: `skip-release`. pr_ready: queued on playhorizon (all build slots busy); the block follows as a comment. Done so far on this head's tree: Python tests pass (596), rustfmt pass, tests of horizon-client + horizon-client-render passed except `native_lifecycle`'s source-text test, fixed in 8e78cf05c. 🤖 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:29:02 +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#6911
No description provided.