[PR #6659] [MERGED] Startup: show the title before building the world renderer #7018

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

📋 Pull Request Information

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

Base: main ← Head: perf/title-before-world-renderer


📝 Commits (3)

  • 42f7a5a Startup: the title's first frame comes before the world renderer's build
  • 0929294 Startup: the title frame's wait starts once the title artwork's renderer is built
  • 337bb3a Startup: the startup menu's test Loading has the title-frame fields; a test of the handoff's wait

📊 Changes

2 files changed (+42 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+23 -1)
📝 crates/horizon-client/src/game/startup_menu.rs (+19 -0)

📄 Description

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

The title screen waited for the world renderer. During loading, the same about_to_wait pass that swapped in the title artwork (set_ui) went on to the handoff (finish()). Whenever the world tables were ready by then, the world renderer was built on the main thread before any frame of the title had been presented. The startup trace showed it in 3 of 4 starts: the title came only after renderer.world (0.8-1.4 s on llvmpipe).

The handoff now waits for one presented title frame:

  • the wait starts once the title artwork's renderer is built;
  • it waits at most 1 s, for a window that is never asked to redraw;
  • it doesn't wait at all when a world is waiting to open (menu.pending, which is also what a --world launch sets).

The world renderer is still built on the main thread right after, so the title stays on its first frame while it builds.

A/B on playhorizon (llvmpipe, load ~24 on 8 vCPU), tools/startup_trace.py --until title, 3 alternating runs, first start each. The baseline binary includes #6658 (panorama beside atlas) and this one doesn't, so the gain shown is, if anything, understated:

before this PR
title shown 3984 / 3316 / 3510 ms, median 3510 2421 / 2482 / 2974 ms, median 2482 (−1.0 s, −29 %)
renderer.world starts before the title, every run at the title's first frame, every run
world entry, server join the handoff is one title frame later at most

pr_ready: queued on playhorizon (build slots busy); the block follows as a comment.

🤖 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/6659 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/title-before-world-renderer` --- ### 📝 Commits (3) - [`42f7a5a`](https://github.com/horizon-rust/horizon/commit/42f7a5af94586631114f713d100eac08b59b9455) Startup: the title's first frame comes before the world renderer's build - [`0929294`](https://github.com/horizon-rust/horizon/commit/09292947020b389aaebde8356cfc7dab0707c62e) Startup: the title frame's wait starts once the title artwork's renderer is built - [`337bb3a`](https://github.com/horizon-rust/horizon/commit/337bb3ad1e71e9ec4f71179d08ffc68aaa728a9e) Startup: the startup menu's test Loading has the title-frame fields; a test of the handoff's wait ### 📊 Changes **2 files changed** (+42 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+23 -1) 📝 `crates/horizon-client/src/game/startup_menu.rs` (+19 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. The title screen waited for the world renderer. During loading, the same `about_to_wait` pass that swapped in the title artwork (`set_ui`) went on to the handoff (`finish()`). Whenever the world tables were ready by then, the world renderer was built on the main thread before any frame of the title had been presented. The startup trace showed it in 3 of 4 starts: the title came only after `renderer.world` (0.8-1.4 s on llvmpipe). The handoff now waits for one presented title frame: - the wait starts once the title artwork's renderer is built; - it waits at most 1 s, for a window that is never asked to redraw; - it doesn't wait at all when a world is waiting to open (`menu.pending`, which is also what a `--world` launch sets). The world renderer is still built on the main thread right after, so the title stays on its first frame while it builds. A/B on playhorizon (llvmpipe, load ~24 on 8 vCPU), `tools/startup_trace.py --until title`, 3 alternating runs, first start each. The baseline binary includes #6658 (panorama beside atlas) and this one doesn't, so the gain shown is, if anything, understated: | | before | this PR | |---|---|---| | title shown | 3984 / 3316 / 3510 ms, median **3510** | 2421 / 2482 / 2974 ms, median **2482** (−1.0 s, −29 %) | | `renderer.world` starts | before the title, every run | at the title's first frame, every run | | world entry, server join | the handoff is one title frame later at most | | pr_ready: queued on playhorizon (build slots busy); the block follows as a comment. 🤖 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:32:12 +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#7018
No description provided.