[PR #1025] [MERGED] command_exec harness: come back from the Nether to terrain already loaded (fixes the /random reset * flake) #2997

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

📋 Pull Request Information

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

Base: main ← Head: fix/command-exec-dimension-flake


📝 Commits (1)

  • 3737425 command_exec harness: come back from the Nether to terrain that is already loaded

📊 Changes

1 file changed (+5 additions, -1 deletions)

View changed files

📝 tools/command_exec_corpus.py (+5 -1)

📄 Description

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

What

Fixes the command_exec harness flake where /random reset * reports 12 (or 13) sequences on
vanilla and 11 on Horizon. That flake fails CI merges at random.

Why it flaked

To log where each random sequence comes from, I instrumented the oracle locally (not part of this PR):
before every script op it printed the sequence map's keys whenever their number changed. On the
failing runs minecraft:blocks/kelp, minecraft:blocks/kelp_plant and minecraft:blocks/seagrass
appeared right after this step:

/execute in minecraft:the_nether positioned 80 100 -40 in minecraft:overworld run tp @s ~ ~ ~
settle            -> player at 644 100 -316 (fresh ocean chunks at seed 1)

Vanilla loads those chunks asynchronously. On some runs it broke some of their kelp and seagrass
while they loaded, and that rolled those blocks' loot tables, which creates their random sequences.
On other runs it didn't. Horizon never does, so the count only matched on some runs.

Fix

The step now goes from the Nether's 1 230 0 to the overworld's 12 230 4. That terrain has
been loaded since the start of the run, and the x and z values still check the ×8 scaling. The
command after it (overworld 80 100 -40 → Nether 10 100 -5) already lands in Nether chunks the
script loaded earlier, so it stays as it is.

How tested

python3 tools/test_command_exec_parity.py in a loop on the Mac mini while it was busy (other
harnesses and a game running):

  • before: 5 of 16 runs failed on /random reset * (kelp and seagrass sequences on the vanilla side)
  • after: 10 of 10 runs passed (780/780 commands), and kelp never appeared

The change is only in the Python corpus, so fmt, clippy and the Rust tests don't apply.

Nothing needs Ludovic.

🤖 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/1025 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/19/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/command-exec-dimension-flake` --- ### 📝 Commits (1) - [`3737425`](https://github.com/horizon-rust/horizon/commit/373742573f02c55aa4712d5cf5fd752cd4e54a68) command_exec harness: come back from the Nether to terrain that is already loaded ### 📊 Changes **1 file changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tools/command_exec_corpus.py` (+5 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What Fixes the `command_exec` harness flake where `/random reset *` reports 12 (or 13) sequences on vanilla and 11 on Horizon. That flake fails CI merges at random. ## Why it flaked To log where each random sequence comes from, I instrumented the oracle locally (not part of this PR): before every script op it printed the sequence map's keys whenever their number changed. On the failing runs `minecraft:blocks/kelp`, `minecraft:blocks/kelp_plant` and `minecraft:blocks/seagrass` appeared right after this step: ``` /execute in minecraft:the_nether positioned 80 100 -40 in minecraft:overworld run tp @s ~ ~ ~ settle -> player at 644 100 -316 (fresh ocean chunks at seed 1) ``` Vanilla loads those chunks asynchronously. On some runs it broke some of their kelp and seagrass while they loaded, and that rolled those blocks' loot tables, which creates their random sequences. On other runs it didn't. Horizon never does, so the count only matched on some runs. ## Fix The step now goes from the Nether's `1 230 0` to the overworld's `12 230 4`. That terrain has been loaded since the start of the run, and the x and z values still check the ×8 scaling. The command after it (overworld `80 100 -40` → Nether `10 100 -5`) already lands in Nether chunks the script loaded earlier, so it stays as it is. ## How tested `python3 tools/test_command_exec_parity.py` in a loop on the Mac mini while it was busy (other harnesses and a game running): - before: 5 of 16 runs failed on `/random reset *` (kelp and seagrass sequences on the vanilla side) - after: 10 of 10 runs passed (780/780 commands), and kelp never appeared The change is only in the Python corpus, so fmt, clippy and the Rust tests don't apply. Nothing needs Ludovic. 🤖 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-02 16:00:43 +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#2997
No description provided.