[PR #3480] [MERGED] Section sets past 32 sections: SectionMask replaces the u32 column masks #5012

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

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


📝 Commits (4)

  • 0c63990 Section sets past 32 sections: SectionMask replaces the u32 column masks
  • 8e0939f Merge upstream main into feat/level-shape-1
  • 3a37c32 Merge upstream main into feat/level-shape-1
  • eb3f03d Merge main into this branch (split_layout and potent_sulfur re-exports)

📊 Changes

12 files changed (+307 additions, -127 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+14 -8)
📝 crates/horizon-client-render/src/lib.rs (+1 -0)
➕ crates/horizon-client-render/src/section_mask.rs (+164 -0)
📝 crates/horizon-client-render/src/streaming.rs (+3 -13)
📝 crates/horizon-client-render/src/world.rs (+20 -15)
📝 crates/horizon-client/examples/portal_scan_bench.rs (+5 -7)
📝 crates/horizon-client/src/game/nether_portal.rs (+8 -8)
📝 crates/horizon-client/src/lan/chunks.rs (+41 -30)
📝 crates/horizon-client/src/lan/hub.rs (+3 -2)
📝 crates/horizon-client/src/lib.rs (+3 -3)
📝 crates/horizon-client/src/portal_sections.rs (+36 -27)
📝 crates/horizon-client/src/random_tick_sections.rs (+9 -14)

📄 Description

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

What and why

First step toward each level's chunks taking their height from the level's dimension type, as vanilla's LevelHeightAccessor does, instead of the fixed -64..320 column. A data pack can make a level up to 4064 blocks (254 sections) high. JJThunder's To The Max, for example, sets the Overworld to min_y -64, height 2096, which is 131 sections.

Several per-column section sets are a u32 with a bit per section, and world.rs asserts SECTIONS <= 32. This PR replaces them with section_mask::SectionMask, a 256-bit Copy set ([u64; 4]) that holds every layout a dimension type allows, plus the light sections one below and one above:

  • world::DirtySections and World::light_log (and streaming.rs's walk over them);
  • random_tick_sections::Sections, portal_sections::PortalSections::get and nether_portal.rs's y_mask;
  • gfx.rs's detail_columns and COMPLETE_COLUMN;
  • the LAN encoder's light masks (lan/chunks.rs, lan/hub.rs).

No behaviour change: the column is still 24 sections.

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

Vanilla reference

None

Self-check

Tests

section_mask.rs unit tests (sets across word boundaries, below for whole and partial words, the operators), and the existing tests of the caches above.

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

Check Result
Scope ✅ 11 files, +301 −121
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 398 run, FAILED (failures=2, errors=8, skipped=1) (1 min 15 s)
rustfmt ✅ (11 s)
clippy ✅ (1 min 32 s)
tests: horizon-client ❌ 1095 passed, 2 failed (5 min 9 s)
doc tests ✅ 0 passed (1 min 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 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/3480 **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-1` --- ### 📝 Commits (4) - [`0c63990`](https://github.com/horizon-rust/horizon/commit/0c639904f160ca8fec160a287e7aaa49156f65a9) Section sets past 32 sections: SectionMask replaces the u32 column masks - [`8e0939f`](https://github.com/horizon-rust/horizon/commit/8e0939f3e8b86888430d1073f0c28b9a5c245cfa) Merge upstream main into feat/level-shape-1 - [`3a37c32`](https://github.com/horizon-rust/horizon/commit/3a37c32d8daabb74cd8ce8cc8cadf4a25ee6879b) Merge upstream main into feat/level-shape-1 - [`eb3f03d`](https://github.com/horizon-rust/horizon/commit/eb3f03d7f3eae674a8ce8a06af51449125f5027c) Merge main into this branch (split_layout and potent_sulfur re-exports) ### 📊 Changes **12 files changed** (+307 additions, -127 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+14 -8) 📝 `crates/horizon-client-render/src/lib.rs` (+1 -0) ➕ `crates/horizon-client-render/src/section_mask.rs` (+164 -0) 📝 `crates/horizon-client-render/src/streaming.rs` (+3 -13) 📝 `crates/horizon-client-render/src/world.rs` (+20 -15) 📝 `crates/horizon-client/examples/portal_scan_bench.rs` (+5 -7) 📝 `crates/horizon-client/src/game/nether_portal.rs` (+8 -8) 📝 `crates/horizon-client/src/lan/chunks.rs` (+41 -30) 📝 `crates/horizon-client/src/lan/hub.rs` (+3 -2) 📝 `crates/horizon-client/src/lib.rs` (+3 -3) 📝 `crates/horizon-client/src/portal_sections.rs` (+36 -27) 📝 `crates/horizon-client/src/random_tick_sections.rs` (+9 -14) </details> ### 📄 Description > 🤖 Opened by ThatCakeIsAPie's AI agent (Claude), not by ThatCakeIsAPie themself. ## What and why First step toward each level's chunks taking their height from the level's dimension type, as vanilla's `LevelHeightAccessor` does, instead of the fixed `-64..320` column. A data pack can make a level up to 4064 blocks (254 sections) high. JJThunder's To The Max, for example, sets the Overworld to `min_y -64, height 2096`, which is 131 sections. Several per-column section sets are a `u32` with a bit per section, and `world.rs` asserts `SECTIONS <= 32`. This PR replaces them with `section_mask::SectionMask`, a 256-bit `Copy` set (`[u64; 4]`) that holds every layout a dimension type allows, plus the light sections one below and one above: - `world::DirtySections` and `World::light_log` (and `streaming.rs`'s walk over them); - `random_tick_sections::Sections`, `portal_sections::PortalSections::get` and `nether_portal.rs`'s `y_mask`; - `gfx.rs`'s `detail_columns` and `COMPLETE_COLUMN`; - the LAN encoder's light masks (`lan/chunks.rs`, `lan/hub.rs`). No behaviour change: the column is still 24 sections. **Open PRs nearby:** #3255, #3256, #3257 and #3263 (hectoreccles' performance PRs) edit nearby lines of `world.rs` and `streaming.rs`. The overlap is in text only, not in what they do; whichever lands second needs a rebase. ## Vanilla reference None ## Self-check **Tests** `section_mask.rs` unit tests (sets across word boundaries, `below` for whole and partial words, the operators), and the existing tests of the caches above. 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, 9 min 54 s) | Check | Result | | --- | --- | | Scope | ✅ 11 files, +301 −121 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 398 run, FAILED (failures=2, errors=8, skipped=1) (1 min 15 s) | | rustfmt | ✅ (11 s) | | clippy | ✅ (1 min 32 s) | | tests: horizon-client | ❌ 1095 passed, 2 failed (5 min 9 s) | | doc tests | ✅ 0 passed (1 min 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 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: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#5012
No description provided.