[PR #806] [MERGED] Server players finish vanilla's FULL square, not a 1.5x circle #2824

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

📋 Pull Request Information

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

Base: main ← Head: perf/chunk-ticket-levels


📝 Commits (1)

  • c6531e4 Server players finish vanilla's FULL square, not a 1.5x circle

📊 Changes

2 files changed (+92 additions, -27 deletions)

View changed files

📝 crates/horizon-client/src/game/lan.rs (+15 -3)
📝 crates/horizon-client/src/streaming.rs (+77 -24)

📄 Description

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

What

A server's players now load vanilla's chunk area: the square that DistanceManager's ticket levels make FULL, instead of a circle 1.5 times too wide.

  • Vanilla 26.3 (DistanceManager.PlayerTicketTracker, ChunkLevel, ChunkMap.setServerViewDistance): every chunk within the server's view distance V (Chebyshev, from the player's chunk) gets a PLAYER_LOADING ticket at level 31 (ENTITY_TICKING). V is the same for every player, whatever they asked for. Levels rise by one per chunk, so:
    • FULL (level 33) is the square of radius V + 2;
    • FEATURES (34) and TERRAIN (35) are the next two rings, which ChunkPyramid.GENERATION_PYRAMID needs around FULL.
  • Horizon before: each player's streaming area (lan_update_streaming) was a circle of radius (vd + 2) × 3 / 2 + 1, finished one chunk further.
    • At view distance 12 that is radius 22. Vanilla's square reaches 14.
    • About twice the chunks were generated, decorated, lit and kept for every player: single player on its server thread, LAN guests and the dedicated server.
  • Now: Streaming::extra areas are squares (Ranges::in_extra, Chebyshev).
    • A player's area is V + 1, so chunks finish out to V + 2, exactly vanilla's FULL square.
    • Generation reaches V + 4, as vanilla's TERRAIN ring does.
    • Columns unload past that. Vanilla keeps them as lower-status holders up to ChunkLevel.MAX_LEVEL, but nothing in the game can reach a chunk that isn't FULL.
    • Everything a player tracks (ChunkTrackingView: within its view distance + 1) has its 3×3 neighbourhood finished, so it can be lit and sent.
  • The window's own area (the in-frame single player, the circle the renderer meshes) is unchanged.
  • horizon-ctl lan status now reports the server world's chunks and generated counts (world), which is how the numbers below were read.

Measured (Mac mini M4 Pro, macOS)

Method:

  • Single player on the server thread: --server-thread --offscreen, fresh world, seed 1234, creative.
  • Each run:
    • wait until the server's chunk count holds for 10 s (spawn);
    • 30 s idle;
    • the player moves 600 blocks in 20 s (/tp every 0.5 s);
    • wait until the count holds again.
  • CPU is the game process's CPU time; RSS comes from ps.
  • Order base / new / base / new. The tables give the means; the chunk counts were identical in both runs.
  • Base is main with only the lan status counts added.
  • The machine was shared with other sessions (load 70+ on 14 cores).
RD build finished chunks at spawn CPU to load spawn RSS at spawn chunks generated in the 600-block move CPU for the move RSS after
6 base 613 19.1 s 1177 MB 1073 20.2 s 1207 MB
6 new 289 (17²) 14.4 s 1104 MB 629 15.6 s 1148 MB
12 base 1653 35.6 s 1289 MB 1739 32.4 s 1340 MB
12 new 841 (29²) 25.7 s 1238 MB 1073 24.9 s 1254 MB
32 base 8809 152.8 s 2017 MB 3945 80.5 s 2203 MB
32 new 4761 (69²) 98.1 s 1750 MB 2553 57.5 s 1831 MB
  • The spawn area was stable 3 s sooner at RD 12 (10.0 → 6.9 s) and 12 s sooner at RD 32 (35.5 → 23.5 s).
  • Idle CPU did not change (13–32 %); that cost is the frame, not chunks.

LAN guests, on the same build:

  • 3 horizon-bots join the single player world opened to LAN at RD 12 (explore, flying outwards at 10 blocks/s for 60 s, equal work on both builds).
  • Counts are the server's after 60 s.
build finished chunks generated server CPU over the 60 s RSS
base 1940 4048 79.6 s 1711 MB
new 1014 2820 60.0 s 1493 MB

The finished counts are vanilla's FULL square, (2V + 5)², for one player at V = 6, 12 and 32.

Checks

Run on an integration of this PR with #793 and the other perf-ticks-6 branches (chunk ticket levels, guest death health, server titles, ask_server suggestions, dedicated no-mesh), on main ce571f78:

  • cargo fmt --check and cargo clippy --workspace --all-targets -- -D warnings: clean.
  • cargo test -p horizon-client --lib: 851 passed.
  • tools/lan_e2e.py on the integration build: titles, hazards, feedback and commands pass. With --server-thread, titles passes. hazards fails at "no hunger from moving", and it fails the same way on plain main, so this branch did not cause it.
  • tools/parity.py --changed origin/main on the first three branches together, then based on 9b97ba09: 89 passed, 0 failed. chunk_stage and chunk_generation were run on their own as well and passed. The rebase onto ce571f78 had conflicts only in remote.rs and lan_e2e.py, where both sides were kept.

Needs Ludovic

Nothing.

🤖 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/806 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/18/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/chunk-ticket-levels` --- ### 📝 Commits (1) - [`c6531e4`](https://github.com/horizon-rust/horizon/commit/c6531e4bdee77cfd85a9ae13508226e0487bb59d) Server players finish vanilla's FULL square, not a 1.5x circle ### 📊 Changes **2 files changed** (+92 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan.rs` (+15 -3) 📝 `crates/horizon-client/src/streaming.rs` (+77 -24) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What A server's players now load vanilla's chunk area: the square that `DistanceManager`'s ticket levels make FULL, instead of a circle 1.5 times too wide. - **Vanilla 26.3** (`DistanceManager.PlayerTicketTracker`, `ChunkLevel`, `ChunkMap.setServerViewDistance`): every chunk within the server's view distance V (Chebyshev, from the player's chunk) gets a `PLAYER_LOADING` ticket at level 31 (`ENTITY_TICKING`). V is the same for every player, whatever they asked for. Levels rise by one per chunk, so: - FULL (level 33) is the square of radius V + 2; - FEATURES (34) and TERRAIN (35) are the next two rings, which `ChunkPyramid.GENERATION_PYRAMID` needs around FULL. - **Horizon before:** each player's streaming area (`lan_update_streaming`) was a circle of radius (vd + 2) × 3 / 2 + 1, finished one chunk further. - At view distance 12 that is radius 22. Vanilla's square reaches 14. - About twice the chunks were generated, decorated, lit and kept for every player: single player on its server thread, LAN guests and the dedicated server. - **Now:** `Streaming::extra` areas are squares (`Ranges::in_extra`, Chebyshev). - A player's area is V + 1, so chunks finish out to V + 2, exactly vanilla's FULL square. - Generation reaches V + 4, as vanilla's TERRAIN ring does. - Columns unload past that. Vanilla keeps them as lower-status holders up to `ChunkLevel.MAX_LEVEL`, but nothing in the game can reach a chunk that isn't FULL. - Everything a player tracks (`ChunkTrackingView`: within its view distance + 1) has its 3×3 neighbourhood finished, so it can be lit and sent. - The window's own area (the in-frame single player, the circle the renderer meshes) is unchanged. - `horizon-ctl lan status` now reports the server world's `chunks` and `generated` counts (`world`), which is how the numbers below were read. ## Measured (Mac mini M4 Pro, macOS) Method: - Single player on the server thread: `--server-thread --offscreen`, fresh world, seed 1234, creative. - Each run: - wait until the server's chunk count holds for 10 s (spawn); - 30 s idle; - the player moves 600 blocks in 20 s (`/tp` every 0.5 s); - wait until the count holds again. - CPU is the game process's CPU time; RSS comes from `ps`. - Order base / new / base / new. The tables give the means; the chunk counts were identical in both runs. - Base is `main` with only the `lan status` counts added. - The machine was shared with other sessions (load 70+ on 14 cores). | RD | build | finished chunks at spawn | CPU to load spawn | RSS at spawn | chunks generated in the 600-block move | CPU for the move | RSS after | |---|---|---|---|---|---|---|---| | 6 | base | 613 | 19.1 s | 1177 MB | 1073 | 20.2 s | 1207 MB | | 6 | **new** | **289** (17²) | **14.4 s** | **1104 MB** | **629** | **15.6 s** | **1148 MB** | | 12 | base | 1653 | 35.6 s | 1289 MB | 1739 | 32.4 s | 1340 MB | | 12 | **new** | **841** (29²) | **25.7 s** | **1238 MB** | **1073** | **24.9 s** | **1254 MB** | | 32 | base | 8809 | 152.8 s | 2017 MB | 3945 | 80.5 s | 2203 MB | | 32 | **new** | **4761** (69²) | **98.1 s** | **1750 MB** | **2553** | **57.5 s** | **1831 MB** | - The spawn area was stable 3 s sooner at RD 12 (10.0 → 6.9 s) and 12 s sooner at RD 32 (35.5 → 23.5 s). - Idle CPU did not change (13–32 %); that cost is the frame, not chunks. LAN guests, on the same build: - 3 `horizon-bots` join the single player world opened to LAN at RD 12 (`explore`, flying outwards at 10 blocks/s for 60 s, equal work on both builds). - Counts are the server's after 60 s. | build | finished chunks | generated | server CPU over the 60 s | RSS | |---|---|---|---|---| | base | 1940 | 4048 | 79.6 s | 1711 MB | | **new** | **1014** | **2820** | **60.0 s** | **1493 MB** | The finished counts are vanilla's FULL square, (2V + 5)², for one player at V = 6, 12 and 32. ## Checks Run on an integration of this PR with #793 and the other perf-ticks-6 branches (chunk ticket levels, guest death health, server titles, ask_server suggestions, dedicated no-mesh), on main ce571f78: - `cargo fmt --check` and `cargo clippy --workspace --all-targets -- -D warnings`: clean. - `cargo test -p horizon-client --lib`: 851 passed. - `tools/lan_e2e.py` on the integration build: `titles`, `hazards`, `feedback` and `commands` pass. With `--server-thread`, `titles` passes. `hazards` fails at "no hunger from moving", and it fails the same way on plain main, so this branch did not cause it. - `tools/parity.py --changed origin/main` on the first three branches together, then based on 9b97ba09: 89 passed, 0 failed. `chunk_stage` and `chunk_generation` were run on their own as well and passed. The rebase onto ce571f78 had conflicts only in `remote.rs` and `lan_e2e.py`, where both sides were kept. ## Needs Ludovic Nothing. 🤖 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:59:20 +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#2824
No description provided.