[PR #4242] [MERGED] Dedicated server: bake no block models, which only the renderer draws #5512

Closed
opened 2026-11-03 05:13:05 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: perf/dedicated-no-block-models


📝 Commits (1)

  • 3a11501 Dedicated server: bake no block models, which only the renderer draws

📊 Changes

3 files changed (+15 additions, -5 deletions)

View changed files

📝 crates/horizon-client-render/src/assets.rs (+11 -5)
📝 crates/horizon-client-render/src/models.rs (+1 -0)
📝 crates/horizon-client-render/src/models/catalog.rs (+3 -0)

📄 Description

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

Server-next W4 (idle memory, plan #3989). A dedicated server still bound and baked every block model: StateModels, quads, elements and compiled choices, about 24 MB in the heap profile. The only readers are the mesher, the LOD mesher, item and block-entity drawing, the block outline, and the particle and falling-block sprites. All of them are client drawing, and each already handles a state without a model (collect returns an error, particle returns None).

  • RenderAssets::load_with(root, assets, draws): when draws is false (Assets::reload_for_server, dedicated server only), PreparedModels stays empty (#[derive(Default)] on it and on StateModels). The item model library and the sprite layers load as before.
  • The integrated server shares the window's resources, and every client path is unchanged.

Idle memory A/B

Dedicated server, --profile fast --no-default-features, on playhorizon (--cpus 0-3 --exclusive). RSS 10 s after the first status ping (sn_idle.py), 3 interleaved rounds against the parent b1dfde280:

Build Round 1 Round 2 Round 3 Ready
main b1dfde280 341 MB 341 MB 341 MB 3.73–3.79 s
this PR 321 MB 319 MB 322 MB 3.50–3.60 s

−20 MB idle, −0.2 s to ready.

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at b1dfde280, 4 min 49 s)

Check Result
Scope ✅ 3 files, +15 −5
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 480 passed (1 min 15 s)
rustfmt ✅ (4 s)
clippy ✅ (45 s)
tests: horizon-client-render ✅ 574 passed (47 s)
doc tests ✅ 0 passed (9 s)
content root tests ✅ 5 passed (1 min 40 s)
Parity ➖ 109 affected, run in CI (run-parity); dedicated_server covers this path

🤖 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/4242 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/dedicated-no-block-models` --- ### 📝 Commits (1) - [`3a11501`](https://github.com/horizon-rust/horizon/commit/3a11501e2302ed03a98bf54ff6f4f9ea22666ea6) Dedicated server: bake no block models, which only the renderer draws ### 📊 Changes **3 files changed** (+15 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/assets.rs` (+11 -5) 📝 `crates/horizon-client-render/src/models.rs` (+1 -0) 📝 `crates/horizon-client-render/src/models/catalog.rs` (+3 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Server-next W4 (idle memory, plan #3989). A dedicated server still bound and baked every block model: `StateModels`, quads, elements and compiled choices, about 24 MB in the heap profile. The only readers are the mesher, the LOD mesher, item and block-entity drawing, the block outline, and the particle and falling-block sprites. All of them are client drawing, and each already handles a state without a model (`collect` returns an error, `particle` returns `None`). - `RenderAssets::load_with(root, assets, draws)`: when `draws` is false (`Assets::reload_for_server`, dedicated server only), `PreparedModels` stays empty (`#[derive(Default)]` on it and on `StateModels`). The item model library and the sprite layers load as before. - The integrated server shares the window's resources, and every client path is unchanged. ## Idle memory A/B Dedicated server, `--profile fast --no-default-features`, on playhorizon (`--cpus 0-3 --exclusive`). RSS 10 s after the first status ping (`sn_idle.py`), 3 interleaved rounds against the parent b1dfde280: | Build | Round 1 | Round 2 | Round 3 | Ready | |---|---|---|---|---| | main b1dfde280 | 341 MB | 341 MB | 341 MB | 3.73–3.79 s | | this PR | 321 MB | 319 MB | 322 MB | 3.50–3.60 s | −20 MB idle, −0.2 s to ready. **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at b1dfde280, 4 min 49 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +15 −5 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 480 passed (1 min 15 s) | | rustfmt | ✅ (4 s) | | clippy | ✅ (45 s) | | tests: horizon-client-render | ✅ 574 passed (47 s) | | doc tests | ✅ 0 passed (9 s) | | content root tests | ✅ 5 passed (1 min 40 s) | | Parity | ➖ 109 affected, run in CI (`run-parity`); `dedicated_server` covers this path | 🤖 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 05:13:05 +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#5512
No description provided.