[PR #4257] [MERGED] Dedicated server: no render face visibility, which only the mesher and block entity renderer read #5520

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

📋 Pull Request Information

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

Base: main ← Head: perf/dedicated-no-face-visibility


📝 Commits (6)

  • c24f9a1 Dedicated server: no render face visibility, which only the mesher and block entity renderer read
  • fb2fb00 MeshTables: no occlusion faces from a server's empty visibility
  • 9ea981a Merge remote-tracking branch 'origin/main' into perf/dedicated-no-face-visibility
  • 714f7a7 Merge main into perf/dedicated-no-face-visibility
  • 890e625 Merge remote-tracking branch 'origin/main' into HEAD
  • a672a51 Merge remote-tracking branch 'origin/main' into HEAD

📊 Changes

3 files changed (+49 additions, -1 deletions)

View changed files

📝 crates/horizon-client-render/src/mesher.rs (+6 -1)
📝 crates/horizon-client/src/game.rs (+5 -0)
📝 crates/horizon-world/src/block_render.rs (+38 -0)

📄 Description

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

Server-next W4 (idle memory, plan #3989). PackResources::load built the render FaceVisibility on a dedicated server too: the occlusion table's six faces for every state (Face::new in models::load_visibility), about 19 MB in the heap profile. Its only readers are client drawing: the mesher's face culling, the fluid mesher's face/cover (set from it in MeshTables::new), and the block-entity renderer. Worldgen uses its own occlusion faces (block_properties), so it is unaffected.

  • PackResources::load(…, draws): the dedicated server (load_resources' headless) gets FaceVisibility::empty(); clients and the resource-pack reload pass true and are unchanged. The integrated server shares the window's resources.
  • FaceVisibility::empty() / is_empty(): every lookup errors ("unknown render state") instead of panicking.
  • MeshTables::new leaves face/cover unset for an empty visibility (a server meshes no fluid). For a client, a missing face is still an error. My first head crashed the server at load on exactly that check; the A/B below is on the fixed head.
  • New unit test empty_visibility_knows_no_state.

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 bb6406719:

Build Round 1 Round 2 Round 3
main bb6406719 343 MB 340 MB 339 MB
this PR 317 MB 314 MB 320 MB

−24 MB idle. Ready time 3.6–4.0 s, unchanged. CI's dedicated_server harness covers a real client joining.

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

Check Result
Scope ✅ 4 files, +62 −4
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 480 passed (1 min 25 s)
rustfmt ✅ (7 s)
clippy ✅ (32 s)
tests: horizon-client, horizon-client-render, horizon-world ✅ 1825 passed (4 min 44 s)
doc tests ✅ 0 passed (5 s)
Parity ➖ 110 affected, run in CI (run-parity)

🤖 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/4257 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/dedicated-no-face-visibility` --- ### 📝 Commits (6) - [`c24f9a1`](https://github.com/horizon-rust/horizon/commit/c24f9a169383d074070f46d6dceaa8f8a13f4bbd) Dedicated server: no render face visibility, which only the mesher and block entity renderer read - [`fb2fb00`](https://github.com/horizon-rust/horizon/commit/fb2fb00ec4ca181f5d10bbdf167c4e5f7898710b) MeshTables: no occlusion faces from a server's empty visibility - [`9ea981a`](https://github.com/horizon-rust/horizon/commit/9ea981a2f3727f82286cb70167a15d78d1255720) Merge remote-tracking branch 'origin/main' into perf/dedicated-no-face-visibility - [`714f7a7`](https://github.com/horizon-rust/horizon/commit/714f7a76da7d76372a5d8dc7e853d814b6b80b39) Merge main into perf/dedicated-no-face-visibility - [`890e625`](https://github.com/horizon-rust/horizon/commit/890e625fc7d3e3ae2a3cdb1ae121cb9bb7251b3c) Merge remote-tracking branch 'origin/main' into HEAD - [`a672a51`](https://github.com/horizon-rust/horizon/commit/a672a51ebd9cb9dab7628af4b91dc15ebcca8b06) Merge remote-tracking branch 'origin/main' into HEAD ### 📊 Changes **3 files changed** (+49 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/mesher.rs` (+6 -1) 📝 `crates/horizon-client/src/game.rs` (+5 -0) 📝 `crates/horizon-world/src/block_render.rs` (+38 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Server-next W4 (idle memory, plan #3989). `PackResources::load` built the render `FaceVisibility` on a dedicated server too: the occlusion table's six faces for every state (`Face::new` in `models::load_visibility`), about 19 MB in the heap profile. Its only readers are client drawing: the mesher's face culling, the fluid mesher's `face`/`cover` (set from it in `MeshTables::new`), and the block-entity renderer. Worldgen uses its own occlusion faces (`block_properties`), so it is unaffected. - `PackResources::load(…, draws)`: the dedicated server (`load_resources`' `headless`) gets `FaceVisibility::empty()`; clients and the resource-pack reload pass `true` and are unchanged. The integrated server shares the window's resources. - `FaceVisibility::empty()` / `is_empty()`: every lookup errors ("unknown render state") instead of panicking. - `MeshTables::new` leaves `face`/`cover` unset for an empty visibility (a server meshes no fluid). For a client, a missing face is still an error. My first head crashed the server at load on exactly that check; the A/B below is on the fixed head. - New unit test `empty_visibility_knows_no_state`. ## 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 bb6406719: | Build | Round 1 | Round 2 | Round 3 | |---|---|---|---| | main bb6406719 | 343 MB | 340 MB | 339 MB | | this PR | 317 MB | 314 MB | 320 MB | −24 MB idle. Ready time 3.6–4.0 s, unchanged. CI's `dedicated_server` harness covers a real client joining. **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at bb6406719, 7 min 7 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +62 −4 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 480 passed (1 min 25 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (32 s) | | tests: horizon-client, horizon-client-render, horizon-world | ✅ 1825 passed (4 min 44 s) | | doc tests | ✅ 0 passed (5 s) | | Parity | ➖ 110 affected, run in CI (`run-parity`) | 🤖 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:10 +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#5520
No description provided.