[PR #2434] [MERGED] Force-loaded chunks decorate in vanilla's order #4312

Closed
opened 2026-11-03 04:16:16 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2434
Author: @FusselTV
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/forced-decoration-order


📝 Commits (1)

  • 705e3d1 Force-loaded chunks decorate in vanilla's order

📊 Changes

5 files changed (+71 additions, -16 deletions)

View changed files

📝 crates/horizon-client/src/game/commands/pregen.rs (+5 -1)
📝 crates/horizon-client/src/game/commands/terrain_cmds.rs (+3 -0)
📝 crates/horizon-client/src/game/levels.rs (+2 -1)
📝 crates/horizon-client/src/streaming.rs (+8 -0)
📝 crates/horizon-world/src/worldgen/decoration_order.rs (+53 -14)

📄 Description

🤖 Opened by FusselTV's AI agent (Claude Code, Opus 5.5), not by FusselTV personally.

What and why

Decoration is order dependent. A chunk's features write into its neighbours, so the chunk decorated first decides which tree, ore blob, geode or dungeon fits at a border. Horizon already decorates chunks around a player in vanilla's order (DecorationOrder). Force-loaded chunks had no rank and went last, nearest the centre first.

Vanilla's ForceLoadCommand adds a FORCED ticket per chunk, x-outer and z-inner. The FULL tasks then run in that order, so a chunk decorates before its neighbour at higher x or z. The two orders only agree in the +x, +z quarter of the map. Everywhere else, features crossing chunk borders overwrote each other the other way round:

  • a geode in the chunk next door ate a trial chamber's dispensers,
  • sculk veins or a lush cave clay pool closed a dungeon's opening, so the dungeon was never placed,
  • andesite, diorite and granite blobs, ores and trees swapped.

What changes:

  • decoration_order::forced_order replays vanilla's scheduler for FORCED tickets added at once.
  • It shares one core (ticket_order) with vanilla_order, which keeps its throttle of four player tickets.
  • /forceload add ranks the chunks it adds in that order. Chunks without a rank still go last, nearest first. rank_or_append never moves a rank that was already given.

Vanilla reference

  • ForceLoadCommand.changeForceLoad: tickets x-outer, z-inner.
  • TicketType.FORCED, level 31.
  • ChunkGenerationTask: decorates its square x-outer, z-inner.
  • ChunkLevel: FULL up to 33, INITIALIZE_LIGHT at 34.

Tests

  • New unit test decoration_order::tests::forced_chunks_decorate_x_outer_z_inner. It uses two pairs from seed 8675309 where a geode and a trial chamber meet across a chunk border. The existing dense_grids_keep_the_hashed_order still holds for vanilla_order after the shared core.
  • End to end, seed 8675309, Overworld, 1,024 × 1,024 blocks, pre-generated with /forceload batches and compared with vanilla 26.3:
    • Dungeon chests and trial chamber dispensers: 0 missing, 1 extra. A second vanilla run has the same extra one. Before: 8 dungeon chests and 3 dispensers missing. Paper with Chunky: 5 missing, 2 extra.
    • Blocks that differ only in Horizon (vanilla, a second vanilla run and Paper all agree): 74,694. Before: about 571,000. A second vanilla run against the first: 87,529.
    • Andesite, diorite and granite differences per quarter (++/+-/-+/--) are now 225 / 477 / 4,133 / 128. A second vanilla run has 2,255 / 2,532 / 2,542 / 1,562. The -x/+z quarter still has more, mostly buried blobs near a mineshaft; not traced further.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on 8fb525d8b187, against upstream/main at 68db8847e, 5 min 46 s)

Check Result
Scope ✅ 5 files, +71 −16
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (7 s)
clippy ✅ (39 s)
tests: horizon-client, horizon-world ✅ 1578 passed (4 min 55 s)
doc tests ✅ 0 passed (3 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 331 affected, to run in CI (--quick): arrow, attribute_map_queries, auto_jump, biome_source_codec, biome_temperature, biome_weather, biome_zoom, block_blob, block_collision_scan, block_column, block_entity_anim, block_entity_render and 319 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/2434 **Author:** [@FusselTV](https://github.com/FusselTV) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/forced-decoration-order` --- ### 📝 Commits (1) - [`705e3d1`](https://github.com/horizon-rust/horizon/commit/705e3d10cf00e1fd4e504c6a974432531f5f983a) Force-loaded chunks decorate in vanilla's order ### 📊 Changes **5 files changed** (+71 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/commands/pregen.rs` (+5 -1) 📝 `crates/horizon-client/src/game/commands/terrain_cmds.rs` (+3 -0) 📝 `crates/horizon-client/src/game/levels.rs` (+2 -1) 📝 `crates/horizon-client/src/streaming.rs` (+8 -0) 📝 `crates/horizon-world/src/worldgen/decoration_order.rs` (+53 -14) </details> ### 📄 Description > 🤖 Opened by FusselTV's AI agent (Claude Code, Opus 5.5), not by FusselTV personally. ## What and why Decoration is order dependent. A chunk's features write into its neighbours, so the chunk decorated first decides which tree, ore blob, geode or dungeon fits at a border. Horizon already decorates chunks around a player in vanilla's order (`DecorationOrder`). Force-loaded chunks had no rank and went last, nearest the centre first. Vanilla's `ForceLoadCommand` adds a FORCED ticket per chunk, x-outer and z-inner. The FULL tasks then run in that order, so a chunk decorates before its neighbour at higher x or z. The two orders only agree in the +x, +z quarter of the map. Everywhere else, features crossing chunk borders overwrote each other the other way round: - a geode in the chunk next door ate a trial chamber's dispensers, - sculk veins or a lush cave clay pool closed a dungeon's opening, so the dungeon was never placed, - andesite, diorite and granite blobs, ores and trees swapped. What changes: - `decoration_order::forced_order` replays vanilla's scheduler for FORCED tickets added at once. - It shares one core (`ticket_order`) with `vanilla_order`, which keeps its throttle of four player tickets. - `/forceload add` ranks the chunks it adds in that order. Chunks without a rank still go last, nearest first. `rank_or_append` never moves a rank that was already given. ## Vanilla reference - `ForceLoadCommand.changeForceLoad`: tickets x-outer, z-inner. - `TicketType.FORCED`, level 31. - `ChunkGenerationTask`: decorates its square x-outer, z-inner. - `ChunkLevel`: FULL up to 33, INITIALIZE_LIGHT at 34. ## Tests - New unit test `decoration_order::tests::forced_chunks_decorate_x_outer_z_inner`. It uses two pairs from seed 8675309 where a geode and a trial chamber meet across a chunk border. The existing `dense_grids_keep_the_hashed_order` still holds for `vanilla_order` after the shared core. - End to end, seed 8675309, Overworld, 1,024 × 1,024 blocks, pre-generated with `/forceload` batches and compared with vanilla 26.3: - Dungeon chests and trial chamber dispensers: 0 missing, 1 extra. A second vanilla run has the same extra one. Before: 8 dungeon chests and 3 dispensers missing. Paper with Chunky: 5 missing, 2 extra. - Blocks that differ only in Horizon (vanilla, a second vanilla run and Paper all agree): 74,694. Before: about 571,000. A second vanilla run against the first: 87,529. - Andesite, diorite and granite differences per quarter (++/+-/-+/--) are now 225 / 477 / 4,133 / 128. A second vanilla run has 2,255 / 2,532 / 2,542 / 1,562. The -x/+z quarter still has more, mostly buried blobs near a mineshaft; not traced further. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on 8fb525d8b187, against upstream/main at 68db8847e, 5 min 46 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +71 −16 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (7 s) | | clippy | ✅ (39 s) | | tests: horizon-client, horizon-world | ✅ 1578 passed (4 min 55 s) | | doc tests | ✅ 0 passed (3 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 331 affected, to run in CI (--quick): arrow, attribute_map_queries, auto_jump, biome_source_codec, biome_temperature, biome_weather, biome_zoom, block_blob, block_collision_scan, block_column, block_entity_anim, block_entity_render and 319 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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 04:16:16 +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#4312
No description provided.