[PR #569] [MERGED] Integrated server: build only the font, not the whole HUD atlas #2649

Closed
opened 2026-11-02 15:57:55 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: perf/sp-server-fonts-atlas


📝 Commits (1)

  • bd0dd97 Integrated server: build only the font, not the whole HUD atlas

📊 Changes

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

View changed files

📝 crates/horizon-client/src/game/integrated.rs (+2 -1)
📝 crates/horizon-client/src/hud.rs (+108 -41)

📄 Description

What and why

On its server thread (#544), single player's world runs in a second Game that draws nothing, but it still built the window's whole HUD atlas: GUI, item, block, entity, particle and effect textures plus the run-time slots. That is a 4096x4096 RGBA image (64 MB) held for the whole session, and about 150 ms of PNG decoding on the server thread while the world opens.

The server now builds HudAtlas::fonts: an atlas of the font sheets only. It reads the glyph widths from them, then drops the pixels, since nothing uploads them. Text measures exactly as with the full atlas. The server needs that for books, which split their pages by width.

HudAtlas::build is unchanged. Its folder list and run-time slots moved into pack and slots, so both atlases share one packer.

Measurements

Mac mini (M4 Pro), release build, the prepared 26.3 resources:

full atlas (before) fonts only (after)
Atlas pixels held by the server 64 MB (4096x4096) 0 MB
Build time on the server thread at world open 151 ms 5 ms
Width of "Hello, world" 57 57

Checks

  • cargo fmt --all --check: ok
  • cargo clippy -p horizon-client --all-targets -- -D warnings: ok
  • cargo test -p horizon-client --lib: 772 passed, 0 failed (new: the_fonts_only_atlas_measures_text_like_the_full_one)
  • Smoke run: --server-thread, the world opens and plays, and the pause menu draws.
  • Local parity on the top of my stack: see the last PR of the stack.

Part of step 3 for the server thread (perf-ticks-3). skip-release until single player uses the server thread by default.

🤖 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/569 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/16/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/sp-server-fonts-atlas` --- ### 📝 Commits (1) - [`bd0dd97`](https://github.com/horizon-rust/horizon/commit/bd0dd979a014f68fdc43188ef1dcdfbfc3b98186) Integrated server: build only the font, not the whole HUD atlas ### 📊 Changes **2 files changed** (+110 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/integrated.rs` (+2 -1) 📝 `crates/horizon-client/src/hud.rs` (+108 -41) </details> ### 📄 Description ## What and why On its server thread (#544), single player's world runs in a second `Game` that draws nothing, but it still built the window's whole HUD atlas: GUI, item, block, entity, particle and effect textures plus the run-time slots. That is a 4096x4096 RGBA image (64 MB) held for the whole session, and about 150 ms of PNG decoding on the server thread while the world opens. The server now builds `HudAtlas::fonts`: an atlas of the font sheets only. It reads the glyph widths from them, then drops the pixels, since nothing uploads them. Text measures exactly as with the full atlas. The server needs that for books, which split their pages by width. `HudAtlas::build` is unchanged. Its folder list and run-time slots moved into `pack` and `slots`, so both atlases share one packer. ## Measurements Mac mini (M4 Pro), release build, the prepared 26.3 resources: | | full atlas (before) | fonts only (after) | |---|---|---| | Atlas pixels held by the server | 64 MB (4096x4096) | 0 MB | | Build time on the server thread at world open | 151 ms | 5 ms | | Width of "Hello, world" | 57 | 57 | ## Checks - `cargo fmt --all --check`: ok - `cargo clippy -p horizon-client --all-targets -- -D warnings`: ok - `cargo test -p horizon-client --lib`: 772 passed, 0 failed (new: `the_fonts_only_atlas_measures_text_like_the_full_one`) - Smoke run: `--server-thread`, the world opens and plays, and the pause menu draws. - Local parity on the top of my stack: see the last PR of the stack. Part of step 3 for the server thread (perf-ticks-3). `skip-release` until single player uses the server thread by default. 🤖 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 15:57:55 +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#2649
No description provided.