[PR #3481] [MERGED] LevelShape: each level's shape as one value, and the column its chunks hold #5010

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

📋 Pull Request Information

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

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


📝 Commits (3)

  • 46c62bd LevelShape: each level's shape as one value, and the column its chunks hold
  • bc3383d Merge remote-tracking branch 'origin/main' into pt1-3481
  • 536c3b9 LevelShape helpers are pub, and for_dir sits beside the type

📊 Changes

2 files changed (+268 additions, -64 deletions)

View changed files

📝 crates/horizon-client-render/src/chunk.rs (+267 -18)
📝 crates/horizon-client/src/save.rs (+1 -46)

📄 Description

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

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

What and why

#2070 added save::LevelShape (skylight, min_y, height per dimension) so Nether and End chunks save at their own height. The same facts are also kept in Dim::min_y/max_y/logical_height, DimensionType::vanilla (which says the End has no skylight, where 26.3's the_end.json says it has), lan/chunks.rs's set_dimension and the generator's dimension_type_height. This series makes LevelShape the one value every subsystem reads, taken from the level's dimension type, so a data pack's taller level works everywhere.

This part:

  • moves LevelShape to chunk.rs (save::LevelShape still names it) and adds logical_height. LevelShape::new checks a dimension type as its codec does: multiples of 16, at least 16 high, inside -2032..=2031, and logical_height <= height;
  • adds ColumnLayout, the span of sections a chunk holds, and LevelShape::column: the level's range widened to the vanilla Overworld's -64..320. Vanilla's Nether and End keep the 24 sections they have always had, so their light and saves stay byte-identical. Giving them exactly their own 16 sections is a separate change for later, because the light flood fill would also need a one-section border (vanilla's light sections) to stay identical;
  • has Chunk record its own min_y, with get, set, highest, light, biome and the heightmap cache reading the chunk's own sections. Chunk::empty is the vanilla column and Chunk::with_layout takes another one.

Nothing makes a chunk of another column yet, so vanilla is unchanged. The next parts move light, the world and meshing, saves, the network, the section caches and gameplay to the chunk's column and the level's shape.

Vanilla reference

None

Self-check

Tests

shapes_follow_the_dimension_type_codec, vanilla_levels_keep_the_overworld_column (all three vanilla levels give the vanilla column, and a 2096-high level its own) and a_tall_column_stores_its_whole_height (get/set/heightmaps/light/biomes at y 2031 of a 131-section chunk).

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, 6 min 44 s)

Check Result
Scope ⚠️ 13 files, +558 −172; 730 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 16 s)
rustfmt ✅ (11 s)
clippy ✅ (1 min 9 s)
tests: horizon-client ❌ 1097 passed, 3 failed (3 min 21 s)
doc tests ✅ 0 passed (43 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-1) is 2 files, +257 −51, 308 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). gfx::end_sky::tests::separate_draws_match_combined_celestial_pixels (GPU) failed once in the full run and passed 3 of 3 alone, as on main.

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/3481 **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-2` --- ### 📝 Commits (3) - [`46c62bd`](https://github.com/horizon-rust/horizon/commit/46c62bdf2a307b633d1ba6ea32b471ec0316c6d9) LevelShape: each level's shape as one value, and the column its chunks hold - [`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 ### 📊 Changes **2 files changed** (+268 additions, -64 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/chunk.rs` (+267 -18) 📝 `crates/horizon-client/src/save.rs` (+1 -46) </details> ### 📄 Description > 🤖 Opened by ThatCakeIsAPie's AI agent (Claude), not by ThatCakeIsAPie themself. **Builds on #3480 (`feat/level-shape-1`)**: until that merges, its commits show here too; this PR's own change is the commit(s) on top. ## What and why #2070 added `save::LevelShape` (skylight, `min_y`, `height` per dimension) so Nether and End chunks save at their own height. The same facts are also kept in `Dim::min_y`/`max_y`/`logical_height`, `DimensionType::vanilla` (which says the End has no skylight, where 26.3's `the_end.json` says it has), `lan/chunks.rs`'s `set_dimension` and the generator's `dimension_type_height`. This series makes `LevelShape` the one value every subsystem reads, taken from the level's dimension type, so a data pack's taller level works everywhere. This part: - moves `LevelShape` to `chunk.rs` (`save::LevelShape` still names it) and adds `logical_height`. `LevelShape::new` checks a dimension type as its codec does: multiples of 16, at least 16 high, inside `-2032..=2031`, and `logical_height <= height`; - adds `ColumnLayout`, the span of sections a chunk holds, and `LevelShape::column`: the level's range widened to the vanilla Overworld's `-64..320`. Vanilla's Nether and End keep the 24 sections they have always had, so their light and saves stay byte-identical. Giving them exactly their own 16 sections is a separate change for later, because the light flood fill would also need a one-section border (vanilla's light sections) to stay identical; - has `Chunk` record its own `min_y`, with `get`, `set`, `highest`, `light`, `biome` and the heightmap cache reading the chunk's own sections. `Chunk::empty` is the vanilla column and `Chunk::with_layout` takes another one. Nothing makes a chunk of another column yet, so vanilla is unchanged. The next parts move light, the world and meshing, saves, the network, the section caches and gameplay to the chunk's column and the level's shape. ## Vanilla reference None ## Self-check **Tests** `shapes_follow_the_dimension_type_codec`, `vanilla_levels_keep_the_overworld_column` (all three vanilla levels give the vanilla column, and a 2096-high level its own) and `a_tall_column_stores_its_whole_height` (get/set/heightmaps/light/biomes at y 2031 of a 131-section chunk). 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, 6 min 44 s) | Check | Result | | --- | --- | | Scope | ⚠️ 13 files, +558 −172; 730 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 16 s) | | rustfmt | ✅ (11 s) | | clippy | ✅ (1 min 9 s) | | tests: horizon-client | ❌ 1097 passed, 3 failed (3 min 21 s) | | doc tests | ✅ 0 passed (43 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-1`) is 2 files, +257 −51, 308 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). `gfx::end_sky::tests::separate_draws_match_combined_celestial_pixels` (GPU) failed once in the full run and passed 3 of 3 alone, as on main. 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:35 +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#5010
No description provided.