[PR #1087] [MERGED] Title backdrop: build its generator on a worker #3036

Closed
opened 2026-11-02 16:00:59 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1087
Author: @ludovic111
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @ludovic111

Base: main ← Head: fix/backdrop-worker


📝 Commits (1)

  • 0a19590 Title backdrop: build its generator on a worker

📊 Changes

1 file changed (+87 additions, -40 deletions)

View changed files

📝 crates/horizon-client/src/game/backdrop.rs (+87 -40)

📄 Description

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

What and why

With Menu style: Horizon, start_backdrop built the backdrop's VanillaTerrain on the event loop, so the title stopped drawing until it was done (#896, found while checking rdbtCVS's #878). A worker now builds the generator, then finds the ice-spikes spot as before. The title keeps drawing its panorama until the generator is installed. Installing it (the streaming, a few threads) stays on the event loop and is cheap. The world is still reset when the backdrop starts, as before. If the build fails, the panorama stays up and a warning is logged; before, the error ended the game.

Classic menus (the default) never start the backdrop and are unchanged.

Numbers

Mac mini (M4 Pro), --profile fast, --offscreen, HORIZON_MENU_STYLE=horizon HORIZON_SPIKES=40, a fresh game folder (cold .horizon-cache), then the same folder again (warm):

main d128289c this branch
Frame where the backdrop starts, cold 2,100 ms (slow frame 2100.6 ms) 25 ms (first frame after 25 ms)
Frame where the backdrop starts, warm 864 ms 26 ms
Worst frame after that, cold 870 ms (inside renderer) 61 ms (weather 32.4, renderer 27.4, clouds 23.0: their first draw)
Worst frame after that, warm none over 40 ms none over 40 ms
Generator build, now on the worker (on the event loop) 1.8 s cold, 1.7 s warm

The issue's 50 s was a debug build. Slow CPUs lose proportionally more than the M4 Pro.

Not covered

No harness exercises the backdrop: a control socket or --frames forces Classic menus and synchronous startup. The issue's suggestion of a smoke test for the progressive startup path is listed in FEATURES.md's LATER.

Self-check

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at d128289ca, 6 min 39 s)

Check Result
Scope ✅ 1 files, +87 −40
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (6 s)
clippy ✅ (1 min 28 s)
tests: horizon-client ✅ 1051 passed (5 min 2 s)
doc tests ✅ 0 passed (2 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 320 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 308 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Parity: no harness reaches this code (see above); CI's parity job runs the 320 affected ones.

Fixes #896

🤖 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/1087 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/backdrop-worker` --- ### 📝 Commits (1) - [`0a19590`](https://github.com/horizon-rust/horizon/commit/0a1959077c4016bfb5eb3b82b068ef5720868346) Title backdrop: build its generator on a worker ### 📊 Changes **1 file changed** (+87 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/backdrop.rs` (+87 -40) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What and why With Menu style: Horizon, `start_backdrop` built the backdrop's `VanillaTerrain` on the event loop, so the title stopped drawing until it was done (#896, found while checking rdbtCVS's #878). A worker now builds the generator, then finds the ice-spikes spot as before. The title keeps drawing its panorama until the generator is installed. Installing it (the streaming, a few threads) stays on the event loop and is cheap. The world is still reset when the backdrop starts, as before. If the build fails, the panorama stays up and a warning is logged; before, the error ended the game. Classic menus (the default) never start the backdrop and are unchanged. ## Numbers Mac mini (M4 Pro), `--profile fast`, `--offscreen`, `HORIZON_MENU_STYLE=horizon HORIZON_SPIKES=40`, a fresh game folder (cold `.horizon-cache`), then the same folder again (warm): | | main d128289c | this branch | | --- | --- | --- | | Frame where the backdrop starts, cold | **2,100 ms** (`slow frame 2100.6 ms`) | **25 ms** (`first frame after 25 ms`) | | Frame where the backdrop starts, warm | **864 ms** | **26 ms** | | Worst frame after that, cold | 870 ms (inside `renderer`) | 61 ms (`weather 32.4, renderer 27.4, clouds 23.0`: their first draw) | | Worst frame after that, warm | none over 40 ms | none over 40 ms | | Generator build, now on the worker | (on the event loop) | 1.8 s cold, 1.7 s warm | The issue's 50 s was a debug build. Slow CPUs lose proportionally more than the M4 Pro. ## Not covered No harness exercises the backdrop: a control socket or `--frames` forces Classic menus and synchronous startup. The issue's suggestion of a smoke test for the progressive startup path is listed in FEATURES.md's LATER. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at d128289ca, 6 min 39 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +87 −40 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (6 s) | | clippy | ✅ (1 min 28 s) | | tests: horizon-client | ✅ 1051 passed (5 min 2 s) | | doc tests | ✅ 0 passed (2 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 320 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 308 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Parity: no harness reaches this code (see above); CI's parity job runs the 320 affected ones. Fixes #896 🤖 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-02 16:00:59 +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#3036
No description provided.