[PR #3485] [MERGED] Chunk packets map between the level and the client's column by the level's shape #5015

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

📋 Pull Request Information

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

Base: main ← Head: feat/level-shape-6


📝 Commits (10+)

  • 46c62bd LevelShape: each level's shape as one value, and the column its chunks hold
  • a6d8409 Light reads the chunk's column: flood fill, layers and relighting span its sections
  • c2b5547 World, streaming, meshing and the renderer read the level's column
  • fdb4e91 Saves read and write a chunk's own column, and SaveDir takes its level's shape
  • 9e91278 Chunk packets map between the level and the client's column by the level's shape
  • bc3383d Merge remote-tracking branch 'origin/main' into pt1-3481
  • 536c3b9 LevelShape helpers are pub, and for_dir sits beside the type
  • c18e893 Merge branch 'pt1-3481' into pt1-3482
  • 0c149c7 Merge main (through the carried #3482) into level-shape-4
  • c2db12a Merge main (through the carried #3483) into level-shape-5

📊 Changes

17 files changed (+875 additions, -242 deletions)

View changed files

📝 crates/horizon-client-render/src/chunk.rs (+263 -18)
📝 crates/horizon-client-render/src/chunk_map.rs (+3 -0)
📝 crates/horizon-client-render/src/gfx.rs (+28 -13)
📝 crates/horizon-client-render/src/gfx/resident.rs (+18 -10)
📝 crates/horizon-client-render/src/light.rs (+130 -27)
📝 crates/horizon-client-render/src/mesher.rs (+2 -2)
📝 crates/horizon-client-render/src/streaming.rs (+7 -7)
📝 crates/horizon-client-render/src/world.rs (+26 -13)
📝 crates/horizon-client/src/game.rs (+13 -3)
📝 crates/horizon-client/src/game/remote.rs (+4 -3)
📝 crates/horizon-client/src/game/remote_chunks.rs (+19 -11)
📝 crates/horizon-client/src/game/world_loading.rs (+4 -4)
📝 crates/horizon-client/src/lan/chunks.rs (+51 -20)
📝 crates/horizon-client/src/lan/hub.rs (+12 -3)
📝 crates/horizon-client/src/save.rs (+132 -106)
📝 crates/horizon-client/tests/generation_saves.rs (+8 -2)
➕ crates/horizon-client/tests/tall_column.rs (+155 -0)

📄 Description

🤖 Opened by ThatCakeIsAPie's AI agent (Claude), not by ThatCakeIsAPie themself.

Builds on #3484 (feat/level-shape-5): until that merges, its commits show here too; this PR's own change is the commit(s) on top.

What and why

Part 6 of the level-shape series. On the network, both sides used the fixed -64..320 window. The host cut each level's sections out of it (set_dimension(min_y, height, sky)), and the remote client shifted a server's sections into it, dropping what fell outside.

  • ChunkEncoder::set_dimension(shape): the level's chunks hold shape.column(), and the level's own sections go on the wire. The heightmaps it sends count the column's sections from the chunk's min_y (save::client_heightmaps_in takes it). A section's block entities sit at the chunk's min_y.
  • The remote client's ChunkFormat decodes chunk and light packets into the column it holds, the vanilla one until part 9 sets it from the server's dimension types, instead of the constants.
  • lan/hub.rs builds the level's shape from the dimension type it already has.

Vanilla levels keep the vanilla column on both sides, so packets are unchanged.

Vanilla reference

None

Self-check

Tests

  • a_tall_column_sends_its_whole_height: a 131-section column encodes all its sections, and its sky light layers reach one above its top (132).
  • The existing lan:: tests (the Nether's 16 sections without sky light now go through set_dimension(LevelShape::NETHER)), the remote_chunks tests, and tests/lan_bot.rs (4 passed).

Run before this branch was rebased from upstream/main 56f968e11 onto fe3333f3f. After the rebase, CI's two clippy commands pass on it again, and pr_ready was re-run at the top of its series (#3490).

pr_ready (tools/pr_ready.py --quick --base upstream/main on DESKTOP-LT6RAH8, against upstream/main at 56f968e11, 28 min 21 s)

Check Result
Scope ⚠️ 23 files, +1174 −363; 1372 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 398 run, FAILED (failures=2, errors=8, skipped=1) (1 min 33 s)
rustfmt ✅ (13 s)
clippy ✅ (4 min 41 s)
tests: horizon-client ❌ 1102 passed, 2 failed (18 min 35 s)
doc tests ✅ 0 passed (3 min 12 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 ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The Scope row counts the whole stack against upstream main; this PR's own part (over feat/level-shape-5) is 4 files, +88 −39, 127 lines of code.

The Python tests fail on upstream main on this Windows machine too, more often there (main 56f968e11: failures=3, errors=13; path separators, symlink privilege). CI runs them on Linux.

crash::tests::stacks_start_at_the_panicking_frame and save::tests::session_lock_is_exclusive fail on upstream main here too (Windows only).

Suggested label: skip-release.

🤖 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/3485 **Author:** [@ThatCakeIsAPie](https://github.com/ThatCakeIsAPie) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/level-shape-6` --- ### 📝 Commits (10+) - [`46c62bd`](https://github.com/horizon-rust/horizon/commit/46c62bdf2a307b633d1ba6ea32b471ec0316c6d9) LevelShape: each level's shape as one value, and the column its chunks hold - [`a6d8409`](https://github.com/horizon-rust/horizon/commit/a6d8409466af6393be67ad2bf3a86b2fe8165906) Light reads the chunk's column: flood fill, layers and relighting span its sections - [`c2b5547`](https://github.com/horizon-rust/horizon/commit/c2b55479f119bb18bcd6fbbef33a1e23b8492086) World, streaming, meshing and the renderer read the level's column - [`fdb4e91`](https://github.com/horizon-rust/horizon/commit/fdb4e917c0be2d9f253883030e3df86a4490e0b6) Saves read and write a chunk's own column, and SaveDir takes its level's shape - [`9e91278`](https://github.com/horizon-rust/horizon/commit/9e912787941669987a711359429e2f0aee4d157c) Chunk packets map between the level and the client's column by the level's shape - [`bc3383d`](https://github.com/horizon-rust/horizon/commit/bc3383d1bfd77ab68ddb6c22d14e6ff826f74468) Merge remote-tracking branch 'origin/main' into pt1-3481 - [`536c3b9`](https://github.com/horizon-rust/horizon/commit/536c3b90fd77a059d46a93b6ccecbe1f216cd307) LevelShape helpers are pub, and for_dir sits beside the type - [`c18e893`](https://github.com/horizon-rust/horizon/commit/c18e893143f91b995c89c471432a99dab5eacc81) Merge branch 'pt1-3481' into pt1-3482 - [`0c149c7`](https://github.com/horizon-rust/horizon/commit/0c149c7d1c15c58357409376068f66cff69e1b26) Merge main (through the carried #3482) into level-shape-4 - [`c2db12a`](https://github.com/horizon-rust/horizon/commit/c2db12a1a0f6450076b3ac1133885aa4e0b43163) Merge main (through the carried #3483) into level-shape-5 ### 📊 Changes **17 files changed** (+875 additions, -242 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/chunk.rs` (+263 -18) 📝 `crates/horizon-client-render/src/chunk_map.rs` (+3 -0) 📝 `crates/horizon-client-render/src/gfx.rs` (+28 -13) 📝 `crates/horizon-client-render/src/gfx/resident.rs` (+18 -10) 📝 `crates/horizon-client-render/src/light.rs` (+130 -27) 📝 `crates/horizon-client-render/src/mesher.rs` (+2 -2) 📝 `crates/horizon-client-render/src/streaming.rs` (+7 -7) 📝 `crates/horizon-client-render/src/world.rs` (+26 -13) 📝 `crates/horizon-client/src/game.rs` (+13 -3) 📝 `crates/horizon-client/src/game/remote.rs` (+4 -3) 📝 `crates/horizon-client/src/game/remote_chunks.rs` (+19 -11) 📝 `crates/horizon-client/src/game/world_loading.rs` (+4 -4) 📝 `crates/horizon-client/src/lan/chunks.rs` (+51 -20) 📝 `crates/horizon-client/src/lan/hub.rs` (+12 -3) 📝 `crates/horizon-client/src/save.rs` (+132 -106) 📝 `crates/horizon-client/tests/generation_saves.rs` (+8 -2) ➕ `crates/horizon-client/tests/tall_column.rs` (+155 -0) </details> ### 📄 Description > 🤖 Opened by ThatCakeIsAPie's AI agent (Claude), not by ThatCakeIsAPie themself. **Builds on #3484 (`feat/level-shape-5`)**: until that merges, its commits show here too; this PR's own change is the commit(s) on top. ## What and why Part 6 of the level-shape series. On the network, both sides used the fixed `-64..320` window. The host cut each level's sections out of it (`set_dimension(min_y, height, sky)`), and the remote client shifted a server's sections into it, dropping what fell outside. - `ChunkEncoder::set_dimension(shape)`: the level's chunks hold `shape.column()`, and the level's own sections go on the wire. The heightmaps it sends count the column's sections from the chunk's `min_y` (`save::client_heightmaps_in` takes it). A section's block entities sit at the chunk's `min_y`. - The remote client's `ChunkFormat` decodes chunk and light packets into the column it holds, the vanilla one until part 9 sets it from the server's dimension types, instead of the constants. - `lan/hub.rs` builds the level's shape from the dimension type it already has. Vanilla levels keep the vanilla column on both sides, so packets are unchanged. ## Vanilla reference None ## Self-check **Tests** - `a_tall_column_sends_its_whole_height`: a 131-section column encodes all its sections, and its sky light layers reach one above its top (132). - The existing `lan::` tests (the Nether's 16 sections without sky light now go through `set_dimension(LevelShape::NETHER)`), the `remote_chunks` tests, and `tests/lan_bot.rs` (4 passed). Run before this branch was rebased from upstream/main 56f968e11 onto fe3333f3f. After the rebase, CI's two clippy commands pass on it again, and pr_ready was re-run at the top of its series (#3490). **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on DESKTOP-LT6RAH8, against upstream/main at 56f968e11, 28 min 21 s) | Check | Result | | --- | --- | | Scope | ⚠️ 23 files, +1174 −363; 1372 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 398 run, FAILED (failures=2, errors=8, skipped=1) (1 min 33 s) | | rustfmt | ✅ (13 s) | | clippy | ✅ (4 min 41 s) | | tests: horizon-client | ❌ 1102 passed, 2 failed (18 min 35 s) | | doc tests | ✅ 0 passed (3 min 12 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 | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The Scope row counts the whole stack against upstream main; this PR's own part (over `feat/level-shape-5`) is 4 files, +88 −39, 127 lines of code. The Python tests fail on upstream main on this Windows machine too, more often there (main 56f968e11: failures=3, errors=13; path separators, symlink privilege). CI runs them on Linux. `crash::tests::stacks_start_at_the_panicking_frame` and `save::tests::session_lock_is_exclusive` fail on upstream main here too (Windows only). Suggested label: `skip-release`. 🤖 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:09:37 +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#5015
No description provided.