[PR #3477] [MERGED] Worldgen: the generator loads a world's data packs over the bundles #5005

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

📋 Pull Request Information

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

Base: main ← Head: feat/datapack-worldgen-2


📝 Commits (4)

  • d1ef7b4 Worldgen: data packs' entries over the prepared bundles
  • 2566257 Worldgen: the generator loads a world's data packs over the bundles
  • ad79049 Merge remote-tracking branch 'origin/main' into upd/3477
  • 8fb51b0 Merge main into the branch

📊 Changes

3 files changed (+575 additions, -37 deletions)

View changed files

📝 crates/horizon-world/src/worldgen.rs (+1 -0)
📝 crates/horizon-world/src/worldgen/generator.rs (+208 -37)
➕ crates/horizon-world/src/worldgen/overrides.rs (+366 -0)

📄 Description

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

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

What and why

Part 2 of 4 of applying a world's data packs to its world generation. Part 1 added worldgen::overrides. This part makes GeneratorData read through it:

  • GeneratorData::load_with(dir, registry, overrides) reads every bundle with the packs' entries over it, the ones read on the loader threads included (the processor lists, which go to the structures thread with a copy of the overrides). load is load_with with no packs.
  • Pack tag files join the prepared tags (build_tags). With packs, a tag naming something missing is left out on its own and logged, as vanilla's TagLoader does. Without packs the prepared tags must still all resolve, as before. GeneratorData::warnings() lists what was left out.
  • A pack's level stem (dimension/<id>.json) replaces the world preset's dimension in OverworldGenerator::build, as the world's LevelStem registry does in vanilla.
  • Noise settings that reach past the dimension's build height fill only the part inside it (NoiseSettings.clampToHeightAccessor, which NoiseBasedChunkGenerator applies). Every level keeps its vanilla height until the client can hold a taller one, so a pack's taller Overworld generates its -64..320 slice instead of failing. OverworldGenerator::noise_clamped() reports it, and part 3 logs it.

Vanilla is unchanged: no packs means every bundle reads as before, and vanilla's noise ranges are inside their levels, so the clamp does nothing.

Vanilla reference

RegistryDataLoader and TagLoader.build (a tag with an unresolved required entry is dropped and logged), WorldDimensions / LevelStem (the level stems), NoiseBasedChunkGenerator → NoiseSettings.clampToHeightAccessor.

Self-check

Tests

  • pack_tags_join_the_prepared_ones_and_broken_ones_are_dropped: pack entries add to a prepared tag, and a pack tag naming something missing is dropped and listed, while a prepared tag naming something missing still fails without packs.
  • a_pack_level_stem_names_taller_noise_which_clamps_to_the_build_height (needs the prepared bundle, skipped without it): a pack's level stem names its own noise settings, 2096 high. They load with no warnings, generate -64..320, and the generator reports the clamp. Vanilla's own settings report none.
  • Vanilla generation is unchanged: chunkgen_bench --snapshot (release) gives byte-identical terrain and decorated snapshots to upstream main 56f968e11, for seed 1234 (24 x 24 chunks around 40,-20) and seed 777 (16 x 16 around -300,200). The build tested is the series' tip (parts 1-4), which holds this part's generator.
Seed Snapshot main this series
1234 terrain d92fd1c14b5665f0 d92fd1c14b5665f0
1234 decorated f5683617d95b87b0 f5683617d95b87b0
777 terrain 633a6433eb388b45 633a6433eb388b45
777 decorated 7e168e1357224e95 7e168e1357224e95

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 (#3479).

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

Check Result
Scope ⚠️ 3 files, +575 −37; 612 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 ✅ (12 s)
clippy ✅ (27 s)
tests: horizon-world ✅ 261 passed (1 min 1 s)
doc tests ✅ 0 passed (2 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/datapack-worldgen-1) is 1 files, +208 −37, 245 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.

Suggested label: skip-release (the client doesn't pass any packs until part 3).

🤖 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/3477 **Author:** [@ThatCakeIsAPie](https://github.com/ThatCakeIsAPie) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `feat/datapack-worldgen-2` --- ### 📝 Commits (4) - [`d1ef7b4`](https://github.com/horizon-rust/horizon/commit/d1ef7b4fb0f6eb9c642837d9941ef986129b93cc) Worldgen: data packs' entries over the prepared bundles - [`2566257`](https://github.com/horizon-rust/horizon/commit/25662576ff54bf5f4e2600ae0c5a1c588c911cb6) Worldgen: the generator loads a world's data packs over the bundles - [`ad79049`](https://github.com/horizon-rust/horizon/commit/ad7904946edca85457e8db44a3a72d1a7ec459a8) Merge remote-tracking branch 'origin/main' into upd/3477 - [`8fb51b0`](https://github.com/horizon-rust/horizon/commit/8fb51b0c4a23a945a7eef50759b5fd95b5d611c4) Merge main into the branch ### 📊 Changes **3 files changed** (+575 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-world/src/worldgen.rs` (+1 -0) 📝 `crates/horizon-world/src/worldgen/generator.rs` (+208 -37) ➕ `crates/horizon-world/src/worldgen/overrides.rs` (+366 -0) </details> ### 📄 Description > 🤖 Opened by ThatCakeIsAPie's AI agent (Claude), not by ThatCakeIsAPie themself. **Builds on #3476 (`feat/datapack-worldgen-1`)**: until that merges, its commits show here too; this PR's own change is the commit(s) on top. ## What and why Part 2 of 4 of applying a world's data packs to its world generation. Part 1 added `worldgen::overrides`. This part makes `GeneratorData` read through it: - `GeneratorData::load_with(dir, registry, overrides)` reads every bundle with the packs' entries over it, the ones read on the loader threads included (the processor lists, which go to the structures thread with a copy of the overrides). `load` is `load_with` with no packs. - Pack tag files join the prepared tags (`build_tags`). With packs, a tag naming something missing is left out on its own and logged, as vanilla's `TagLoader` does. Without packs the prepared tags must still all resolve, as before. `GeneratorData::warnings()` lists what was left out. - A pack's level stem (`dimension/<id>.json`) replaces the world preset's dimension in `OverworldGenerator::build`, as the world's `LevelStem` registry does in vanilla. - Noise settings that reach past the dimension's build height fill only the part inside it (`NoiseSettings.clampToHeightAccessor`, which `NoiseBasedChunkGenerator` applies). Every level keeps its vanilla height until the client can hold a taller one, so a pack's taller Overworld generates its `-64..320` slice instead of failing. `OverworldGenerator::noise_clamped()` reports it, and part 3 logs it. Vanilla is unchanged: no packs means every bundle reads as before, and vanilla's noise ranges are inside their levels, so the clamp does nothing. ## Vanilla reference `RegistryDataLoader` and `TagLoader.build` (a tag with an unresolved required entry is dropped and logged), `WorldDimensions` / `LevelStem` (the level stems), `NoiseBasedChunkGenerator` → `NoiseSettings.clampToHeightAccessor`. ## Self-check **Tests** - `pack_tags_join_the_prepared_ones_and_broken_ones_are_dropped`: pack entries add to a prepared tag, and a pack tag naming something missing is dropped and listed, while a prepared tag naming something missing still fails without packs. - `a_pack_level_stem_names_taller_noise_which_clamps_to_the_build_height` (needs the prepared bundle, skipped without it): a pack's level stem names its own noise settings, 2096 high. They load with no warnings, generate `-64..320`, and the generator reports the clamp. Vanilla's own settings report none. - Vanilla generation is unchanged: `chunkgen_bench --snapshot` (release) gives byte-identical terrain and decorated snapshots to upstream main 56f968e11, for seed 1234 (24 x 24 chunks around 40,-20) and seed 777 (16 x 16 around -300,200). The build tested is the series' tip (parts 1-4), which holds this part's generator. | Seed | Snapshot | main | this series | |---|---|---|---| | 1234 | terrain | `d92fd1c14b5665f0` | `d92fd1c14b5665f0` | | 1234 | decorated | `f5683617d95b87b0` | `f5683617d95b87b0` | | 777 | terrain | `633a6433eb388b45` | `633a6433eb388b45` | | 777 | decorated | `7e168e1357224e95` | `7e168e1357224e95` | 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 (#3479). **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on DESKTOP-LT6RAH8, against upstream/main at 56f968e11, 3 min 1 s) | Check | Result | | --- | --- | | Scope | ⚠️ 3 files, +575 −37; 612 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 | ✅ (12 s) | | clippy | ✅ (27 s) | | tests: horizon-world | ✅ 261 passed (1 min 1 s) | | doc tests | ✅ 0 passed (2 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/datapack-worldgen-1`) is 1 files, +208 −37, 245 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. Suggested label: `skip-release` (the client doesn't pass any packs until part 3). 🤖 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:33 +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#5005
No description provided.