[PR #1736] [MERGED] YUNG's API jigsaw draws: yung_jigsaw and yung_single_element read as written #3729

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

📋 Pull Request Information

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

Base: main ← Head: feat/yung-jigsaw-draws


📝 Commits (1)

  • 41f8cfa YUNG's API jigsaw draws: yung_jigsaw structures and yung_single_element read as written

📊 Changes

3 files changed (+307 additions, -22 deletions)

View changed files

📝 crates/horizon-world/src/worldgen/structure/jigsaw.rs (+205 -11)
📝 crates/horizon-world/src/worldgen/structure/start.rs (+13 -3)
📝 tools/test_structure_layout_parity.py (+89 -8)

📄 Description

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

Clean-room: implemented from cleanroom/structures/spec-yungsapi.md §2.1, §3, §3.1 and spec-betterdungeons.md §1, §3.1; no mod source read. Decisions where the spec is open: cleanroom/structures/impl-questions.md IQ-1 to IQ-6.

Stacked on #1717 (the layout harness); review the second commit.

What

Step 2 of the structure-mod clean room: YUNG's API's jigsaw, read from the mod's data as written.

  • yungsapi:yung_jigsaw structures lay out with the jigsaw assembler and YUNG's draws (jigsaw::Draws::Yung): the start pool's file entries shuffled, then the rotation, then a weighted pick in the shuffled order; each jigsaw's target pool drawn by weight from its shuffled entries, without replacement; an element whose name already has max_count pieces in the start is skipped and costs no other draw.
  • yungsapi:yung_single_element places what a single element places; the pool entry keeps its name and max_count (Pool::limits).
  • Vanilla jigsaws draw exactly as before (Candidates::Listed is the old target-then-fallback shuffle).
  • Harness: --profile betterdungeons builds an overlay of the 26.3 resources with the mod jar's structures, sets, pools, processor lists, biome tags and templates (read from the player's jar at run time, never copied into the repo; 1.21.1 block-state JSON upgraded to 26.3's shape; the mod's own processors left out because they change blocks, not which pieces are placed), then compares the mod world's saved pieces.

Result

  • Better Dungeons: 82 of 84 starts match piece for piece: small dungeons 60/62, skeleton dungeons 11/11 (35 to 46 pieces), zombie dungeons 11/11 (758 to 790 pieces). The 2 others sit in 26.3's sulfur_caves, a biome 1.21.1 doesn't have, so the mod's 1.21.1 tag can't list it (version difference).
  • The skeleton and zombie layouts go through many failed fits and many depths, so they also settle the spec's open Y13 (non-fitting candidates, queue order) as the vanilla path. I've noted that for the spec team.
  • Vanilla unchanged: lithostitched profile still 22 of 31 plus 9 known version differences.

How tested

python3 tools/test_structure_layout_parity.py --profile betterdungeons (82 + 2 known, 0 fail) and python3 tools/test_structure_layout_parity.py (22 + 9 known, 0 fail).

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 4bb7f96f8, 12 min 47 s)

Check Result
Scope ✅ 7 files, +570 −18
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ❌ 252 run, FAILED (errors=2) (1 min 26 s)
rustfmt ✅ (13 s)
clippy ✅ (2 min 0 s)
tests: horizon-world ✅ 236 passed (7 min 37 s)
doc tests ✅ 0 passed (2 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 310 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 298 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Python tests: the same 2 macOS-only errors as on main (see #1717).

Needs Ludovic / the orchestrator

  • Players' packs don't use this path yet. horizon-port-pack converts YUNG's data into horizon:yungsapi keys for the old assembler (structure/yung.rs). Switching the port to pass YUNG's files through as written, and then deleting yung.rs unread, means changing horizon-port-pack's worldgen.rs, which this clean-room team may not open. Someone needs to decide who does that step.
  • The mod's processors (spec-betterdungeons §3.2) aren't implemented yet: this PR covers layout only.

🤖 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/1736 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/yung-jigsaw-draws` --- ### 📝 Commits (1) - [`41f8cfa`](https://github.com/horizon-rust/horizon/commit/41f8cfa3bc1f3205fe624a5e162d3a6509fa1b5c) YUNG's API jigsaw draws: yung_jigsaw structures and yung_single_element read as written ### 📊 Changes **3 files changed** (+307 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-world/src/worldgen/structure/jigsaw.rs` (+205 -11) 📝 `crates/horizon-world/src/worldgen/structure/start.rs` (+13 -3) 📝 `tools/test_structure_layout_parity.py` (+89 -8) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Clean-room: implemented from cleanroom/structures/spec-yungsapi.md §2.1, §3, §3.1 and spec-betterdungeons.md §1, §3.1; no mod source read. Decisions where the spec is open: cleanroom/structures/impl-questions.md IQ-1 to IQ-6. Stacked on #1717 (the layout harness); review the second commit. ## What Step 2 of the structure-mod clean room: YUNG's API's jigsaw, read from the mod's data as written. - `yungsapi:yung_jigsaw` structures lay out with the jigsaw assembler and YUNG's draws (`jigsaw::Draws::Yung`): the start pool's file entries shuffled, then the rotation, then a weighted pick in the shuffled order; each jigsaw's target pool drawn by weight from its shuffled entries, without replacement; an element whose `name` already has `max_count` pieces in the start is skipped and costs no other draw. - `yungsapi:yung_single_element` places what a single element places; the pool entry keeps its `name` and `max_count` (`Pool::limits`). - Vanilla jigsaws draw exactly as before (`Candidates::Listed` is the old target-then-fallback shuffle). - Harness: `--profile betterdungeons` builds an overlay of the 26.3 resources with the mod jar's structures, sets, pools, processor lists, biome tags and templates (read from the player's jar at run time, never copied into the repo; 1.21.1 block-state JSON upgraded to 26.3's shape; the mod's own processors left out because they change blocks, not which pieces are placed), then compares the mod world's saved pieces. ## Result - **Better Dungeons: 82 of 84 starts match piece for piece**: small dungeons 60/62, skeleton dungeons 11/11 (35 to 46 pieces), zombie dungeons 11/11 (758 to 790 pieces). The 2 others sit in 26.3's `sulfur_caves`, a biome 1.21.1 doesn't have, so the mod's 1.21.1 tag can't list it (version difference). - The skeleton and zombie layouts go through many failed fits and many depths, so they also settle the spec's open Y13 (non-fitting candidates, queue order) as the vanilla path. I've noted that for the spec team. - Vanilla unchanged: `lithostitched` profile still 22 of 31 plus 9 known version differences. ## How tested `python3 tools/test_structure_layout_parity.py --profile betterdungeons` (82 + 2 known, 0 fail) and `python3 tools/test_structure_layout_parity.py` (22 + 9 known, 0 fail). **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 4bb7f96f8, 12 min 47 s) | Check | Result | | --- | --- | | Scope | ✅ 7 files, +570 −18 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ❌ 252 run, FAILED (errors=2) (1 min 26 s) | | rustfmt | ✅ (13 s) | | clippy | ✅ (2 min 0 s) | | tests: horizon-world | ✅ 236 passed (7 min 37 s) | | doc tests | ✅ 0 passed (2 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 310 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 298 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Python tests: the same 2 macOS-only errors as on main (see #1717). ## Needs Ludovic / the orchestrator - Players' packs don't use this path yet. horizon-port-pack converts YUNG's data into `horizon:yungsapi` keys for the old assembler (`structure/yung.rs`). Switching the port to pass YUNG's files through as written, and then deleting `yung.rs` unread, means changing horizon-port-pack's `worldgen.rs`, which this clean-room team may not open. Someone needs to decide who does that step. - The mod's processors (spec-betterdungeons §3.2) aren't implemented yet: this PR covers layout only. 🤖 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:47 +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#3729
No description provided.