[PR #6151] [MERGED] Command-exec parity: the boxed-in orb's outcome no longer depends on its random #6681

Closed
opened 2026-11-03 06:24:50 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6151
Author: @ludovic111
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/xp-orb-command-exec


📝 Commits (1)

  • e039878 Command-exec parity: the boxed-in orb's outcome no longer depends on its random

📊 Changes

1 file changed (+14 additions, -10 deletions)

View changed files

📝 tools/command_exec_corpus.py (+14 -10)

📄 Description

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

command_exec has been red on main since #5646: the "experience orb stuck" case sometimes ends with the orb at y 215 (or z 23.25, z 22.x) on one side and at y 216 on the other.

Cause

The case is non-deterministic in vanilla itself; Horizon's orb (#5601) matches vanilla.

  • ExperienceOrb.random is RandomSource.create(): a nanoTime seed, so the push speed (nextFloat() * 0.2 + 0.1) differs from run to run, in vanilla and in Horizon.
  • #5646 assumed the draws only change how many ticks the escape takes. They don't: once the orb's middle rises past y 216 with its box still inside the 3x3 block, Entity.moveTowardsClosestSpace finds north, south, west and east free at the same 0.5, picks north (first in the list), and depending on the draws the orb slides off the block.
  • Simulating vanilla's tick over 3000 seeds with the current layout: 72% at (33.5, 216, 23.5), 15% at z 23.25, the rest scattered, a few down at y 215 on the floor (CI's failure). Locally, 5 reruns of the group with the same binary gave a Rust orb at z 23.25 once, and the full corpus once gave vanilla's at z 22.18.

Fix (test only)

A ring of stone one block higher (/fill 32 215 22 34 216 24 stone + /setblock 33 216 23 air) keeps the top the only free side all the way out. Simulated over 3000 seeds: always (33.5, 216, 23.5). The case still pins the push: without it the orb stays boxed in at y 215. #5646's other change (failures counted by position) stays as it was.

Checks

  • test_command_exec_parity.py --only "experience orb stuck": 5 reruns, 4/4 every time, the same Pos/Motion on both sides.
  • Full corpus (--binary, a main build from 16:58 that predates #6096): every group matches except 6 TNT selector lines that #6096 fixed after that build; both orb groups match. I built nothing (disk at 22–28 GB, the limit is 25). CI runs the full harness on the real merge.
  • The 10 other harnesses parity.py --changed-files lists only depend on tools/ in general; only test_command_exec_parity.py imports the corpus.

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 11427c296, 2 min 56 s)

Check Result
Scope ✅ 1 files, +14 −10
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 585 passed (2 min 55 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
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 ➖ 11 affected, to run in CI (--quick): armor_stand_frost, boat_authority, boat_paddle_reset, boat_submerged, command_exec, dragon_render, enchantment_components, item_use_order, lan_integration, spawn_egg_fluid, tick_step_network
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/6151 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/xp-orb-command-exec` --- ### 📝 Commits (1) - [`e039878`](https://github.com/horizon-rust/horizon/commit/e03987888d265b1e5db0cabc1eafdc032db30303) Command-exec parity: the boxed-in orb's outcome no longer depends on its random ### 📊 Changes **1 file changed** (+14 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `tools/command_exec_corpus.py` (+14 -10) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. `command_exec` has been red on main since #5646: the "experience orb stuck" case sometimes ends with the orb at y 215 (or z 23.25, z 22.x) on one side and at y 216 on the other. ## Cause The case is non-deterministic in vanilla itself; Horizon's orb (#5601) matches vanilla. - `ExperienceOrb.random` is `RandomSource.create()`: a nanoTime seed, so the push speed (`nextFloat() * 0.2 + 0.1`) differs from run to run, in vanilla and in Horizon. - #5646 assumed the draws only change how many ticks the escape takes. They don't: once the orb's middle rises past y 216 with its box still inside the 3x3 block, `Entity.moveTowardsClosestSpace` finds north, south, west and east free at the same 0.5, picks **north** (first in the list), and depending on the draws the orb slides off the block. - Simulating vanilla's tick over 3000 seeds with the current layout: 72% at (33.5, 216, 23.5), 15% at z 23.25, the rest scattered, a few down at **y 215** on the floor (CI's failure). Locally, 5 reruns of the group with the same binary gave a Rust orb at z 23.25 once, and the full corpus once gave vanilla's at z 22.18. ## Fix (test only) A ring of stone one block higher (`/fill 32 215 22 34 216 24 stone` + `/setblock 33 216 23 air`) keeps the top the only free side all the way out. Simulated over 3000 seeds: always (33.5, 216, 23.5). The case still pins the push: without it the orb stays boxed in at y 215. #5646's other change (failures counted by position) stays as it was. ## Checks - `test_command_exec_parity.py --only "experience orb stuck"`: 5 reruns, **4/4 every time**, the same Pos/Motion on both sides. - Full corpus (`--binary`, a main build from 16:58 that predates #6096): every group matches except 6 TNT selector lines that #6096 fixed after that build; both orb groups match. I built nothing (disk at 22–28 GB, the limit is 25). CI runs the full harness on the real merge. - The 10 other harnesses `parity.py --changed-files` lists only depend on `tools/` in general; only `test_command_exec_parity.py` imports the corpus. **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 11427c296, 2 min 56 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +14 −10 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 585 passed (2 min 55 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | 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 | ➖ 11 affected, to run in CI (--quick): armor_stand_frost, boat_authority, boat_paddle_reset, boat_submerged, command_exec, dragon_render, enchantment_components, item_use_order, lan_integration, spawn_egg_fluid, tick_step_network | | 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 06:24:50 +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#6681
No description provided.