[PR #6422] [MERGED] Title panorama: on the GPU only while the title shows, its faces kept as their files (−28 MiB RAM, −24 MiB VRAM in worlds) #6863

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

📋 Pull Request Information

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

Base: main ← Head: mem-panorama-on-title


📝 Commits (2)

  • 7a46389 Title panorama: the cube only while the title shows, its faces kept as their files
  • 4fb8955 Merge main into #6422

📊 Changes

5 files changed (+200 additions, -98 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+6 -7)
📝 crates/horizon-client-render/src/gfx/panorama.rs (+182 -70)
📝 crates/horizon-client/src/game.rs (+7 -12)
📝 crates/horizon-client/src/game/no_resources.rs (+2 -5)
📝 crates/horizon-client/src/game/startup_menu.rs (+3 -4)

📄 Description

🤖 Opened by rdbtCVS's AI agent (Claude Code, Claude Opus 5.5), not by rdbtCVS personally.

Part of #6418.

What

The title panorama was held twice for the whole game: its six 1024x1024 faces decoded in UiResources.panorama (24 MiB of texels in a Vec grown by doubling: 32 MiB in the heap profile), and the cube texture on the GPU (24 MiB), which no frame draws once a world is open.

  • Faces keeps the six PNG files as read (4 MiB) and decodes them, side by side on six threads, each time the cube is made. The texels decoded while loading (which checks the faces, as before) are kept only for the first cube, which takes them: startup decodes once, as before. A failed load or a server gets Faces::colour, a one-texel cube.
  • The renderer makes the cube in the first title frame that needs it and drops it in the first frame that isn't the title screen; back at the title the files are decoded again (a few tens of ms while the world closes).

Measured

How it was measured. Arch Linux (zen kernel), Ryzen 5 5600X (12 threads), 32 GB, RTX 4060 8 GB (Vulkan, NVIDIA 615.78), --profile fast, --offscreen 1280x720, fresh scratch homes per start, render distance 12. A start goes to the title screen, creates the perf_bench world (seed 1234, creative), waits for spawn to load, then teleports to and flies tools/perf_bench.py's village and forest paths (12 s each) and samples after each. Video memory: what nvidia-smi attributes to the process, and the game's own allocator totals (status: gpu_allocated_bytes / gpu_reserved_bytes); RSS from /proc/<pid>/status. Three alternated starts per build, medians (range in brackets); main = dea6dea98.

main this PR
live heap in Faces::load (sampling profiler, in a world) 32 MiB 3.9 MiB (the files)
RSS at the title screen 626 [621-628] MB 609 [603-609] MB (−17)
GPU memory in use in a world (allocator) 500 MiB 476 MiB (−24)

Whether the 24 MiB in a world goes back to the driver depends on what else shares its allocator block; with #6419 it is a 32 MiB block shared with the offscreen frame and depth.

Checked by hand: the title screen draws the panorama at start and again after Save and Quit to Title (screenshots of both were identical in look, the rotation advanced).

Tests

  • original_resolution_texels_and_vanilla_cube_orientation_are_preserved: the texels the first cube takes and the ones decoded again for the next cube are equal, and every texel is checked as before.
  • placeholders_load_and_incomplete_or_mismatched_cubes_fall_back: the fallback cube is the one-colour cube.

pr_ready (tools/pr_ready.py --quick on archlinux, against origin/main at 80dfb5f35, 3 min 3 s)

Check Result
Scope ✅ 6 files, +179 −100
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 594 passed (33 s)
rustfmt ✅ (7 s)
clippy ✅ (49 s)
tests: horizon-client, horizon-client-render ✅ 1504 passed (1 min 30 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 375 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, armor_stand_frost, arrow, arrow_wind_charge, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes and 363 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/6422 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `mem-panorama-on-title` --- ### 📝 Commits (2) - [`7a46389`](https://github.com/horizon-rust/horizon/commit/7a4638971e0f0e66c6d514ceefbd1138ea90d2bc) Title panorama: the cube only while the title shows, its faces kept as their files - [`4fb8955`](https://github.com/horizon-rust/horizon/commit/4fb8955bf4469124444d51a4fdea7b80782a9ab2) Merge main into #6422 ### 📊 Changes **5 files changed** (+200 additions, -98 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+6 -7) 📝 `crates/horizon-client-render/src/gfx/panorama.rs` (+182 -70) 📝 `crates/horizon-client/src/game.rs` (+7 -12) 📝 `crates/horizon-client/src/game/no_resources.rs` (+2 -5) 📝 `crates/horizon-client/src/game/startup_menu.rs` (+3 -4) </details> ### 📄 Description > 🤖 Opened by rdbtCVS's AI agent (Claude Code, Claude Opus 5.5), not by rdbtCVS personally. Part of #6418. ## What The title panorama was held twice for the whole game: its six 1024x1024 faces decoded in `UiResources.panorama` (24 MiB of texels in a `Vec` grown by doubling: 32 MiB in the heap profile), and the cube texture on the GPU (24 MiB), which no frame draws once a world is open. - `Faces` keeps the six PNG files as read (4 MiB) and decodes them, side by side on six threads, each time the cube is made. The texels decoded while loading (which checks the faces, as before) are kept only for the first cube, which takes them: startup decodes once, as before. A failed load or a server gets `Faces::colour`, a one-texel cube. - The renderer makes the cube in the first title frame that needs it and drops it in the first frame that isn't the title screen; back at the title the files are decoded again (a few tens of ms while the world closes). ## Measured **How it was measured.** Arch Linux (zen kernel), Ryzen 5 5600X (12 threads), 32 GB, RTX 4060 8 GB (Vulkan, NVIDIA 615.78), `--profile fast`, `--offscreen` 1280x720, fresh scratch homes per start, render distance 12. A start goes to the title screen, creates the perf_bench world (seed 1234, creative), waits for spawn to load, then teleports to and flies `tools/perf_bench.py`'s village and forest paths (12 s each) and samples after each. Video memory: what `nvidia-smi` attributes to the process, and the game's own allocator totals (`status`: `gpu_allocated_bytes` / `gpu_reserved_bytes`); RSS from `/proc/<pid>/status`. Three alternated starts per build, medians (range in brackets); `main` = dea6dea98. | | main | this PR | |---|---|---| | live heap in `Faces::load` (sampling profiler, in a world) | 32 MiB | 3.9 MiB (the files) | | RSS at the title screen | 626 [621-628] MB | 609 [603-609] MB (−17) | | GPU memory in use in a world (allocator) | 500 MiB | 476 MiB (−24) | Whether the 24 MiB in a world goes back to the driver depends on what else shares its allocator block; with #6419 it is a 32 MiB block shared with the offscreen frame and depth. Checked by hand: the title screen draws the panorama at start and again after Save and Quit to Title (screenshots of both were identical in look, the rotation advanced). ## Tests - `original_resolution_texels_and_vanilla_cube_orientation_are_preserved`: the texels the first cube takes and the ones decoded again for the next cube are equal, and every texel is checked as before. - `placeholders_load_and_incomplete_or_mismatched_cubes_fall_back`: the fallback cube is the one-colour cube. **pr_ready** (`tools/pr_ready.py --quick` on archlinux, against origin/main at 80dfb5f35, 3 min 3 s) | Check | Result | | --- | --- | | Scope | ✅ 6 files, +179 −100 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 594 passed (33 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (49 s) | | tests: horizon-client, horizon-client-render | ✅ 1504 passed (1 min 30 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 375 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, armor_stand_frost, arrow, arrow_wind_charge, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes and 363 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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:28:19 +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#6863
No description provided.