[PR #1753] [MERGED] Structure blocks harness: Horizon's structure-mod blocks against the clean-room oracle #3742

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

📋 Pull Request Information

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

Base: main ← Head: feat/structure-blocks-harness


📝 Commits (6)

  • 066f079 Merge remote-tracking branch 'origin/refactor/port-pack-legacy-structure-mods' into feat/yung-port-as-written
  • 379692f Port YUNG's worldgen as written; delete the old YUNG conversion and assembler
  • f80f4e0 Structure blocks harness: the blocks Horizon's structure mods place against the structure oracle's
  • 3bc38ce YUNG jigsaws: the start is not counted, priority, depth and bounds rules run
  • 35e047f Merge origin/main into feat/yung-port-as-written
  • 355df65 Merge feat/yung-port-as-written into feat/structure-blocks-harness

📊 Changes

16 files changed (+516 additions, -2382 deletions)

View changed files

📝 crates/horizon-port-pack/src/carry.rs (+0 -1)
📝 crates/horizon-port-pack/src/legacy_structure_mods/mod.rs (+0 -1)
➖ crates/horizon-port-pack/src/legacy_structure_mods/yung.rs (+0 -1055)
📝 crates/horizon-port-pack/src/lib.rs (+1 -0)
📝 crates/horizon-port-pack/src/processors.rs (+10 -9)
📝 crates/horizon-port-pack/src/worldgen.rs (+4 -3)
➕ crates/horizon-port-pack/src/yung.rs (+102 -0)
📝 crates/horizon-world/src/worldgen/structure.rs (+0 -1)
📝 crates/horizon-world/src/worldgen/structure/enhanced_terrain.rs (+0 -1)
📝 crates/horizon-world/src/worldgen/structure/jigsaw.rs (+111 -65)
📝 crates/horizon-world/src/worldgen/structure/piece_limited.rs (+0 -1)
📝 crates/horizon-world/src/worldgen/structure/start.rs (+3 -68)
➖ crates/horizon-world/src/worldgen/structure/yung.rs (+0 -1122)
📝 docs/mods.md (+3 -3)
➕ tools/test_structure_blocks_parity.py (+180 -0)
📝 tools/test_structure_layout_parity.py (+102 -52)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Stacked on #1746 (base feat/yung-port-as-written). It adds one harness and no game code. It is part of the clean-room structure-mods series.

What it checks

tools/test_structure_blocks_parity.py compares the blocks that Horizon's structure mods place with the blocks a real server saved. The reference is the clean-room structure oracle: 1.21.1 NeoForge runs the mods as black boxes, over 3 seeds. For every start, the oracle kept two things:

  • the blocks in the start's box;
  • every position around the box where the mod world differs from the no-mod world of the same seed (changed_vs_vanilla).

Horizon side:

  • The chunk_dump probe generates the chunks around each start in full (terrain, structures, features) twice: once from the 26.3 resources, and once with the mods carried by horizon-port-pack carry (the path players' packs take; overlay from test_structure_layout_parity.py).
  • A position is compared only where Horizon's no-mod world equals the oracle's. Elsewhere 1.21.1 and 26.3 differ (newer terrain features).
  • Where the oracle saw no change, Horizon's mod world must equal its no-mod world. Overlapping structures need no special case, because both worlds have them.
  • A mismatch is counted by its no-mod block, the expected block and Horizon's block, so a missing processor rule shows up as one line.
  • KNOWN names what the implementation does not cover yet, with the reason. Those are reported, not failed.
  • The harness skips when the oracle data or the mod jars are missing (CI).

Oracle counts (Better Dungeons, 3 seeds, 96 complete starts)

Structure Starts Positions matching Why the rest differ
small_dungeon 58 1,157,337 / 1,166,181 placeholder processors (glass/terracotta markers), the monster-room removal biome modifier (spec-betterdungeons §1.2, §3.2)
skeleton_dungeon 10 747,823 / 763,624 same
zombie_dungeon 10 9,631,484 / 9,695,352 same
spider_dungeon 9 6,004,160 / 6,083,503 the mod's own procedural type (spec §5, OPEN-B14): not generated
small_nether_dungeon 9 228,911 / 248,966 the mod's own type (spec §6, OPEN-B15): not generated

All five are listed in KNOWN. The Better Dungeons processors PR in this series is meant to bring the first three to exact or distribution-level matches.

Self-check

python3 tools/pr_ready.py --quick on the Mac mini, against origin/main, so its scope covers the whole stack:

  • rustfmt, clippy and tests (horizon-port-pack, horizon-world: 290 passed; launcher: 118 passed) all pass.
  • Python tests: 2 errors that are not from this branch:
    • test_parity_runner runs java with an empty PATH;
    • test_rust_parity trips on macOS's /private/var temp path.

This PR's own diff is one file: tools/test_structure_blocks_parity.py, +180 lines.

🤖 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/1753 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/structure-blocks-harness` --- ### 📝 Commits (6) - [`066f079`](https://github.com/horizon-rust/horizon/commit/066f07968bab4d557bbfc2c205dea38ee5978d0c) Merge remote-tracking branch 'origin/refactor/port-pack-legacy-structure-mods' into feat/yung-port-as-written - [`379692f`](https://github.com/horizon-rust/horizon/commit/379692f35545e149cc323f48966697b00a24fffa) Port YUNG's worldgen as written; delete the old YUNG conversion and assembler - [`f80f4e0`](https://github.com/horizon-rust/horizon/commit/f80f4e01e762a32a06eca5b5f6b8592b8c478cac) Structure blocks harness: the blocks Horizon's structure mods place against the structure oracle's - [`3bc38ce`](https://github.com/horizon-rust/horizon/commit/3bc38cebb4aa90bb791f7e3244cf1c0767b625f8) YUNG jigsaws: the start is not counted, priority, depth and bounds rules run - [`35e047f`](https://github.com/horizon-rust/horizon/commit/35e047fb8ecc581cd71174b300f004a137956772) Merge origin/main into feat/yung-port-as-written - [`355df65`](https://github.com/horizon-rust/horizon/commit/355df65240f227988a7537877623e7db7f7c9ec2) Merge feat/yung-port-as-written into feat/structure-blocks-harness ### 📊 Changes **16 files changed** (+516 additions, -2382 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-port-pack/src/carry.rs` (+0 -1) 📝 `crates/horizon-port-pack/src/legacy_structure_mods/mod.rs` (+0 -1) ➖ `crates/horizon-port-pack/src/legacy_structure_mods/yung.rs` (+0 -1055) 📝 `crates/horizon-port-pack/src/lib.rs` (+1 -0) 📝 `crates/horizon-port-pack/src/processors.rs` (+10 -9) 📝 `crates/horizon-port-pack/src/worldgen.rs` (+4 -3) ➕ `crates/horizon-port-pack/src/yung.rs` (+102 -0) 📝 `crates/horizon-world/src/worldgen/structure.rs` (+0 -1) 📝 `crates/horizon-world/src/worldgen/structure/enhanced_terrain.rs` (+0 -1) 📝 `crates/horizon-world/src/worldgen/structure/jigsaw.rs` (+111 -65) 📝 `crates/horizon-world/src/worldgen/structure/piece_limited.rs` (+0 -1) 📝 `crates/horizon-world/src/worldgen/structure/start.rs` (+3 -68) ➖ `crates/horizon-world/src/worldgen/structure/yung.rs` (+0 -1122) 📝 `docs/mods.md` (+3 -3) ➕ `tools/test_structure_blocks_parity.py` (+180 -0) 📝 `tools/test_structure_layout_parity.py` (+102 -52) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Stacked on #1746 (base `feat/yung-port-as-written`). It adds one harness and no game code. It is part of the clean-room structure-mods series. ## What it checks `tools/test_structure_blocks_parity.py` compares the blocks that Horizon's structure mods place with the blocks a real server saved. The reference is the clean-room structure oracle: 1.21.1 NeoForge runs the mods as black boxes, over 3 seeds. For every start, the oracle kept two things: - the blocks in the start's box; - every position around the box where the mod world differs from the no-mod world of the same seed (`changed_vs_vanilla`). Horizon side: - The `chunk_dump` probe generates the chunks around each start in full (terrain, structures, features) twice: once from the 26.3 resources, and once with the mods carried by `horizon-port-pack carry` (the path players' packs take; overlay from `test_structure_layout_parity.py`). - A position is compared only where Horizon's no-mod world equals the oracle's. Elsewhere 1.21.1 and 26.3 differ (newer terrain features). - Where the oracle saw no change, Horizon's mod world must equal its no-mod world. Overlapping structures need no special case, because both worlds have them. - A mismatch is counted by its no-mod block, the expected block and Horizon's block, so a missing processor rule shows up as one line. - `KNOWN` names what the implementation does not cover yet, with the reason. Those are reported, not failed. - The harness skips when the oracle data or the mod jars are missing (CI). ## Oracle counts (Better Dungeons, 3 seeds, 96 complete starts) | Structure | Starts | Positions matching | Why the rest differ | |---|---|---|---| | `small_dungeon` | 58 | 1,157,337 / 1,166,181 | placeholder processors (glass/terracotta markers), the monster-room removal biome modifier (spec-betterdungeons §1.2, §3.2) | | `skeleton_dungeon` | 10 | 747,823 / 763,624 | same | | `zombie_dungeon` | 10 | 9,631,484 / 9,695,352 | same | | `spider_dungeon` | 9 | 6,004,160 / 6,083,503 | the mod's own procedural type (spec §5, OPEN-B14): not generated | | `small_nether_dungeon` | 9 | 228,911 / 248,966 | the mod's own type (spec §6, OPEN-B15): not generated | All five are listed in `KNOWN`. The Better Dungeons processors PR in this series is meant to bring the first three to exact or distribution-level matches. ## Self-check `python3 tools/pr_ready.py --quick` on the Mac mini, against origin/main, so its scope covers the whole stack: - rustfmt, clippy and tests (horizon-port-pack, horizon-world: 290 passed; launcher: 118 passed) all pass. - Python tests: 2 errors that are not from this branch: - `test_parity_runner` runs `java` with an empty PATH; - `test_rust_parity` trips on macOS's `/private/var` temp path. This PR's own diff is one file: `tools/test_structure_blocks_parity.py`, +180 lines. 🤖 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:11:57 +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#3742
No description provided.