[PR #3486] [MERGED] Section caches, generation glue, distant terrain, minimap and flat worlds read the column #5016

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/3486
Author: @ThatCakeIsAPie
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @ludovic111

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


📝 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
  • c4e54ad Section caches, generation glue, distant terrain, minimap and flat worlds read the column
  • 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

📊 Changes

25 files changed (+992 additions, -291 deletions)

View changed files

📝 crates/horizon-client-render/src/chunk.rs (+268 -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/lod.rs (+2 -2)
📝 crates/horizon-client-render/src/mesher.rs (+2 -2)
📝 crates/horizon-client-render/src/minimap.rs (+8 -7)
📝 crates/horizon-client-render/src/streaming.rs (+7 -7)
📝 crates/horizon-client-render/src/world.rs (+26 -13)
📝 crates/horizon-client/src/flatgen.rs (+16 -12)
📝 crates/horizon-client/src/game.rs (+13 -3)
📝 crates/horizon-client/src/game/initial_spawn.rs (+1 -0)
📝 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 (+5 -4)
📝 crates/horizon-client/src/lan/chunks.rs (+51 -20)
📝 crates/horizon-client/src/lan/hub.rs (+12 -3)
📝 crates/horizon-client/src/random_tick_sections.rs (+52 -13)
📝 crates/horizon-client/src/save.rs (+132 -106)

...and 5 more files

📄 Description

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

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

What and why

Part 7 of the level-shape series: what's left of the storage side.

  • random_tick_sections: the cache keeps a section list as long as the chunk's, and Sections counts its Y from the chunk's min_y.
  • vanillagen: a generated chunk becomes a column of its level's (OverworldGenerator::level gives the dimension's build range, ColumnLayout::of_level its column) and copies the whole level range. A failed chunk gets the same column. Saved protos are restored over the level range.
  • Distant terrain from proto chunks (vanillagen/lod.rs) spans the level's range. Far tiles from resident chunks (lod::Column::from_chunk) and the minimap scan from the chunk's own bottom.
  • Flat worlds lay their layers from the Overworld's minimum up to its height (FlatTerrain::from_settings takes the level's shape).

Vanilla levels keep their column and ranges, so nothing changes there.

Open PRs nearby: #3255, #3256, #3257 and #3263 edit nearby lines of vanillagen.rs. The overlap is in text only, not in what they do; whichever lands second needs a rebase.

Vanilla reference

None

Self-check

Tests

  • a_tall_chunk_ticks_its_sections_near_the_top: a 131-section chunk with ticking blocks at y 100 and 2020 lists sections 96 and 2016. A vanilla chunk at the same key is read again.
  • The existing random-tick, minimap, flat, vanillagen, far-terrain, portal and POI tests, plus tests/generation_saves.rs, tests/lan_bot.rs and tests/tall_column.rs.

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, 25 min 54 s)

Check Result
Scope ⚠️ 30 files, +1283 −404; 1522 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 53 s)
rustfmt ✅ (13 s)
clippy ✅ (3 min 45 s)
tests: horizon-client, horizon-world ❌ 1102 passed, 3 failed (17 min 16 s)
doc tests ✅ 0 passed (2 min 39 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-6) is 10 files, +123 −55, 178 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 passes 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/3486 **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-7` --- ### 📝 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 - [`c4e54ad`](https://github.com/horizon-rust/horizon/commit/c4e54ad254e5023a6dc007f297b3bc1d5d7f11b1) Section caches, generation glue, distant terrain, minimap and flat worlds read the column - [`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 ### 📊 Changes **25 files changed** (+992 additions, -291 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/chunk.rs` (+268 -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/lod.rs` (+2 -2) 📝 `crates/horizon-client-render/src/mesher.rs` (+2 -2) 📝 `crates/horizon-client-render/src/minimap.rs` (+8 -7) 📝 `crates/horizon-client-render/src/streaming.rs` (+7 -7) 📝 `crates/horizon-client-render/src/world.rs` (+26 -13) 📝 `crates/horizon-client/src/flatgen.rs` (+16 -12) 📝 `crates/horizon-client/src/game.rs` (+13 -3) 📝 `crates/horizon-client/src/game/initial_spawn.rs` (+1 -0) 📝 `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` (+5 -4) 📝 `crates/horizon-client/src/lan/chunks.rs` (+51 -20) 📝 `crates/horizon-client/src/lan/hub.rs` (+12 -3) 📝 `crates/horizon-client/src/random_tick_sections.rs` (+52 -13) 📝 `crates/horizon-client/src/save.rs` (+132 -106) _...and 5 more files_ </details> ### 📄 Description > 🤖 Opened by ThatCakeIsAPie's AI agent (Claude), not by ThatCakeIsAPie themself. **Builds on #3485 (`feat/level-shape-6`)**: until that merges, its commits show here too; this PR's own change is the commit(s) on top. ## What and why Part 7 of the level-shape series: what's left of the storage side. - `random_tick_sections`: the cache keeps a section list as long as the chunk's, and `Sections` counts its Y from the chunk's `min_y`. - `vanillagen`: a generated chunk becomes a column of its level's (`OverworldGenerator::level` gives the dimension's build range, `ColumnLayout::of_level` its column) and copies the whole level range. A failed chunk gets the same column. Saved protos are restored over the level range. - Distant terrain from proto chunks (`vanillagen/lod.rs`) spans the level's range. Far tiles from resident chunks (`lod::Column::from_chunk`) and the minimap scan from the chunk's own bottom. - Flat worlds lay their layers from the Overworld's minimum up to its height (`FlatTerrain::from_settings` takes the level's shape). Vanilla levels keep their column and ranges, so nothing changes there. **Open PRs nearby:** #3255, #3256, #3257 and #3263 edit nearby lines of `vanillagen.rs`. The overlap is in text only, not in what they do; whichever lands second needs a rebase. ## Vanilla reference None ## Self-check **Tests** - `a_tall_chunk_ticks_its_sections_near_the_top`: a 131-section chunk with ticking blocks at y 100 and 2020 lists sections 96 and 2016. A vanilla chunk at the same key is read again. - The existing random-tick, minimap, flat, vanillagen, far-terrain, portal and POI tests, plus `tests/generation_saves.rs`, `tests/lan_bot.rs` and `tests/tall_column.rs`. 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, 25 min 54 s) | Check | Result | | --- | --- | | Scope | ⚠️ 30 files, +1283 −404; 1522 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 53 s) | | rustfmt | ✅ (13 s) | | clippy | ✅ (3 min 45 s) | | tests: horizon-client, horizon-world | ❌ 1102 passed, 3 failed (17 min 16 s) | | doc tests | ✅ 0 passed (2 min 39 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-6`) is 10 files, +123 −55, 178 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 passes 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: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#5016
No description provided.