[PR #3484] [MERGED] Saves read and write a chunk's own column, and SaveDir takes its level's shape #5014

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

📋 Pull Request Information

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

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


📝 Commits (9)

  • 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
  • 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

14 files changed (+790 additions, -206 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/world_loading.rs (+4 -4)
📝 crates/horizon-client/src/save.rs (+129 -104)
📝 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 #3483 (feat/level-shape-4): until that merges, its commits show here too; this PR's own change is the commit(s) on top.

What and why

Part 5 of the level-shape series. #2070 made a level's saved chunks follow its LevelShape, guessed from the folder's name (LevelShape::for_dir). This part has the caller pass the shape and reads the chunk's own column:

  • SaveDir::new(root, shape). World loading passes Dim::shape() (vanilla's types for now; the data packs' come in part 9). The title screen's and the remote client's unused save folders pass the Overworld's. for_dir goes.
  • decode_with and decode_proto read a saved chunk into the level's column (SaveDir passes shape.column()). Sections outside it are left out, as before.
  • Encoding, POI sections, heightmaps (HeightmapView counts sections from the chunk's min_y, heights from the level's) and the saved light layers (load_light) span the chunk's sections.
  • Distant terrain read from saved chunks (decode_lod_surfaces, its light layers and face light) spans the level's column.

Vanilla levels pass their vanilla shapes, so saves are unchanged.

Vanilla reference

None

Self-check

Tests

  • a_tall_level_saves_and_loads_its_whole_height: a 131-section chunk saves 131 sections from yPos -4, with 12-bit heightmaps (the surface above y 2000 reads 2065). It reads back whole into its column, and into the vanilla column without the sections above y 320.
  • The existing save:: tests and tests/generation_saves.rs pass. nether_and_end_chunks_save_with_their_own_height now passes the Nether's shape to SaveDir::new.
  • tools/test_save_roundtrip_parity.py runs the game on a Linux virtual screen or macOS offscreen, so it wasn't run on this Windows machine. CI's parity job picks it up.

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, 40 min 58 s)

Check Result
Scope ⚠️ 22 files, +1089 −327; 1251 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 46 s)
rustfmt ✅ (16 s)
clippy ✅ (8 min 26 s)
tests: horizon-client ❌ 1101 passed, 2 failed (20 min 25 s)
doc tests ✅ 0 passed (9 min 57 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-4) is 5 files, +151 −77, 218 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/3484 **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-5` --- ### 📝 Commits (9) - [`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 - [`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 **14 files changed** (+790 additions, -206 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/world_loading.rs` (+4 -4) 📝 `crates/horizon-client/src/save.rs` (+129 -104) 📝 `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 #3483 (`feat/level-shape-4`)**: until that merges, its commits show here too; this PR's own change is the commit(s) on top. ## What and why Part 5 of the level-shape series. #2070 made a level's saved chunks follow its `LevelShape`, guessed from the folder's name (`LevelShape::for_dir`). This part has the caller pass the shape and reads the chunk's own column: - `SaveDir::new(root, shape)`. World loading passes `Dim::shape()` (vanilla's types for now; the data packs' come in part 9). The title screen's and the remote client's unused save folders pass the Overworld's. `for_dir` goes. - `decode_with` and `decode_proto` read a saved chunk into the level's column (`SaveDir` passes `shape.column()`). Sections outside it are left out, as before. - Encoding, POI sections, heightmaps (`HeightmapView` counts sections from the chunk's `min_y`, heights from the level's) and the saved light layers (`load_light`) span the chunk's sections. - Distant terrain read from saved chunks (`decode_lod_surfaces`, its light layers and face light) spans the level's column. Vanilla levels pass their vanilla shapes, so saves are unchanged. ## Vanilla reference None ## Self-check **Tests** - `a_tall_level_saves_and_loads_its_whole_height`: a 131-section chunk saves 131 sections from `yPos -4`, with 12-bit heightmaps (the surface above y 2000 reads 2065). It reads back whole into its column, and into the vanilla column without the sections above y 320. - The existing `save::` tests and `tests/generation_saves.rs` pass. `nether_and_end_chunks_save_with_their_own_height` now passes the Nether's shape to `SaveDir::new`. - `tools/test_save_roundtrip_parity.py` runs the game on a Linux virtual screen or macOS offscreen, so it wasn't run on this Windows machine. CI's parity job picks it up. 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, 40 min 58 s) | Check | Result | | --- | --- | | Scope | ⚠️ 22 files, +1089 −327; 1251 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 46 s) | | rustfmt | ✅ (16 s) | | clippy | ✅ (8 min 26 s) | | tests: horizon-client | ❌ 1101 passed, 2 failed (20 min 25 s) | | doc tests | ✅ 0 passed (9 min 57 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-4`) is 5 files, +151 −77, 218 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:36 +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#5014
No description provided.