[PR #7808] A harness measures where entity tick order differs from vanilla #7840

Open
opened 2026-11-03 07:25:09 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7808
Author: @HrafnaValkyrja
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: test/entity-tick-order


📝 Commits (2)

  • 5f327b3 Add a tick order parity harness: where join order changes what entities do
  • 5936df9 Merge remote-tracking branch 'origin/main' into test/entity-tick-order

📊 Changes

1 file changed (+459 additions, -0 deletions)

View changed files

➕ tools/test_tick_order_parity.py (+459 -0)

📄 Description

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

Part of #6509 (measurement only; no game behaviour changes). Adds tools/test_tick_order_parity.py, a harness that shows where the order entities joined the level changes what they do, tick by tick, in ticking chunks, against the real 26.3 server.

What this adds

82 cells (41 pairs of kinds, each summoned in both join orders) on a vanilla dedicated server and on Horizon's (--dedicated --nogui), flat world, nobody on it, every entity inside force-loaded chunks. Ticking is frozen and stepped one tick at a time; after each tick the Pos and Motion (plus Health, fuse, orb value, item count) of every entity are read. Families: a wind charge bursting beside each kind; primed TNT exploding beside each kind; an arrow, snowball or trident flying into a pig, boat or minecart; a pig riding a boat, minecart or pig; boats, minecarts and pigs running into each other, and items and orbs merging.

The 38 cells where Horizon still differs are listed in KNOWN with a reason and printed on every run, so they stay visible and do not fail CI. A new difference fails, a KNOWN cell that starts to match is reported, and a cell where nothing moves on vanilla fails (it would match vacuously).

Part of #6509

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

The reference is the pinned 26.3 server jar itself, run beside Horizon in the same frozen steps. Vanilla ran twice and differed from itself in 0 of 82 cells, so no value is dropped as noise. Vanilla's result depends on which entity joined first in 46 of the 82 cells; Horizon's depends on it only for the same-kind pairs (TNT/TNT, boat/boat, minecart/minecart: 6 cells), because it ticks one kind after another.

Proof

Run on current main (tolerance 1e-6):

family cells vanilla depends on join order Horizon differs from vanilla
wind charge beside a kind 22 18 9
primed TNT beside a kind 22 12 7
projectile into a mover 18 10 14
rider and vehicle 6 0 6 (all at tick 0, not order)
push, collision, merge 14 6 2
  • Wind, charge joined first: trident, rocket, arrow, boat, minecart, snowball differ from tick 3 (12 values each, largest 0.49 to 1.24). Charge joined last: TNT, falling block, orb differ from tick 3 (12 values each, largest 0.48 to 0.59). The other 13 match in both orders.
  • TNT blast, TNT joined first: trident, rocket, arrow, falling block, snowball and pig differ from tick 2 (largest 0.72 to 0.84 where both sides have the value); TNT joined last: only the pig differs. Items, boats, minecarts, orbs and a second TNT match in both orders.
  • Projectile hits, first difference at tick 6: a trident into a pig, boat or minecart differs in both orders; an arrow or snowball into a pig differs only when the projectile joined first; arrow and snowball into a boat or minecart differ in both orders although vanilla does not depend on the order there (the boat is gone in vanilla at tick 6, still there in Horizon: damage, not order).
  • Rider and vehicle: vanilla does not depend on the order; Horizon differs in all 6 cells at tick 0, right after /ride (the rider's position, and 25 values for the minecart). Not an order result; recorded.
  • Push: boat or minecart into a pig, boat/boat, minecart/minecart, item/item and orb/orb match in both orders. Pig into pig differs from tick 5 (largest 0.24).

Not covered: eight ticks per cell; pigs are the only mobs; no player; item pickup, hoppers, pistons, lightning and bobbers are not in these cells.

Harnesses

python3 tools/test_tick_order_parity.py --noise: 44 of 82 cells identical, the 38 others recorded in KNOWN, vanilla self-difference 0 of 82.
python3 tools/pr_ready.py --quick: see the block below.

pr_ready (tools/pr_ready.py --quick on Valhalla, against origin/main at 873b04b1a, 34 s)

Check Result
Scope ✅ 1 files, +459 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 614 passed (34 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
content root tests ➖ content root untouched
mod API up to date ➖ native hooks untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 196 affected, to run in CI (--quick): anvil_turtle_egg, forced_end, free_space, generation_tick, geometry, ghost_recipe, ground_support, hardcore_respawn, height_provider, heightmap, held_item_stack, hotbar and 184 more
Label skip-release

A refactor with no behaviour change; proved by script, no human played this change.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick on Valhalla, against origin/main at f1d6576b3, 31 s)

Check Result
Scope ✅ 1 files, +459 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 614 passed (31 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
content root tests ➖ content root untouched
mod API up to date ➖ native hooks untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 196 affected, to run in CI (--quick): anvil_turtle_egg, forced_end, free_space, generation_tick, geometry, ghost_recipe, ground_support, hardcore_respawn, height_provider, heightmap, held_item_stack, hotbar and 184 more
Label skip-release

🤖 Generated with Claude Code

https://claude.ai/code/session_018zuDTsnyHkP28bzn3u7S3m


🔄 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/7808 **Author:** [@HrafnaValkyrja](https://github.com/HrafnaValkyrja) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `test/entity-tick-order` --- ### 📝 Commits (2) - [`5f327b3`](https://github.com/horizon-rust/horizon/commit/5f327b380603168894d8aa527ac83570beb1fce7) Add a tick order parity harness: where join order changes what entities do - [`5936df9`](https://github.com/horizon-rust/horizon/commit/5936df96486ffab643633007a18c9ed0264dd844) Merge remote-tracking branch 'origin/main' into test/entity-tick-order ### 📊 Changes **1 file changed** (+459 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `tools/test_tick_order_parity.py` (+459 -0) </details> ### 📄 Description > 🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself. Part of #6509 (measurement only; no game behaviour changes). Adds `tools/test_tick_order_parity.py`, a harness that shows where the order entities joined the level changes what they do, tick by tick, in ticking chunks, against the real 26.3 server. ## What this adds 82 cells (41 pairs of kinds, each summoned in both join orders) on a vanilla dedicated server and on Horizon's (`--dedicated --nogui`), flat world, nobody on it, every entity inside force-loaded chunks. Ticking is frozen and stepped one tick at a time; after each tick the Pos and Motion (plus Health, fuse, orb value, item count) of every entity are read. Families: a wind charge bursting beside each kind; primed TNT exploding beside each kind; an arrow, snowball or trident flying into a pig, boat or minecart; a pig riding a boat, minecart or pig; boats, minecarts and pigs running into each other, and items and orbs merging. The 38 cells where Horizon still differs are listed in `KNOWN` with a reason and printed on every run, so they stay visible and do not fail CI. A new difference fails, a `KNOWN` cell that starts to match is reported, and a cell where nothing moves on vanilla fails (it would match vacuously). Part of #6509 ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [x] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference The reference is the pinned 26.3 server jar itself, run beside Horizon in the same frozen steps. Vanilla ran twice and differed from itself in 0 of 82 cells, so no value is dropped as noise. Vanilla's result depends on which entity joined first in 46 of the 82 cells; Horizon's depends on it only for the same-kind pairs (TNT/TNT, boat/boat, minecart/minecart: 6 cells), because it ticks one kind after another. ## Proof Run on current main (tolerance 1e-6): | family | cells | vanilla depends on join order | Horizon differs from vanilla | |---|---|---|---| | wind charge beside a kind | 22 | 18 | 9 | | primed TNT beside a kind | 22 | 12 | 7 | | projectile into a mover | 18 | 10 | 14 | | rider and vehicle | 6 | 0 | 6 (all at tick 0, not order) | | push, collision, merge | 14 | 6 | 2 | - Wind, charge joined first: trident, rocket, arrow, boat, minecart, snowball differ from tick 3 (12 values each, largest 0.49 to 1.24). Charge joined last: TNT, falling block, orb differ from tick 3 (12 values each, largest 0.48 to 0.59). The other 13 match in both orders. - TNT blast, TNT joined first: trident, rocket, arrow, falling block, snowball and pig differ from tick 2 (largest 0.72 to 0.84 where both sides have the value); TNT joined last: only the pig differs. Items, boats, minecarts, orbs and a second TNT match in both orders. - Projectile hits, first difference at tick 6: a trident into a pig, boat or minecart differs in both orders; an arrow or snowball into a pig differs only when the projectile joined first; arrow and snowball into a boat or minecart differ in both orders although vanilla does not depend on the order there (the boat is gone in vanilla at tick 6, still there in Horizon: damage, not order). - Rider and vehicle: vanilla does not depend on the order; Horizon differs in all 6 cells at tick 0, right after `/ride` (the rider's position, and 25 values for the minecart). Not an order result; recorded. - Push: boat or minecart into a pig, boat/boat, minecart/minecart, item/item and orb/orb match in both orders. Pig into pig differs from tick 5 (largest 0.24). Not covered: eight ticks per cell; pigs are the only mobs; no player; item pickup, hoppers, pistons, lightning and bobbers are not in these cells. ## Harnesses `python3 tools/test_tick_order_parity.py --noise`: 44 of 82 cells identical, the 38 others recorded in `KNOWN`, vanilla self-difference 0 of 82. `python3 tools/pr_ready.py --quick`: see the block below. **pr_ready** (`tools/pr_ready.py --quick` on Valhalla, against origin/main at 873b04b1a, 34 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +459 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 614 passed (34 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | content root tests | ➖ content root untouched | | mod API up to date | ➖ native hooks untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 196 affected, to run in CI (--quick): anvil_turtle_egg, forced_end, free_space, generation_tick, geometry, ghost_recipe, ground_support, hardcore_respawn, height_provider, heightmap, held_item_stack, hotbar and 184 more | | Label | `skip-release` | A refactor with no behaviour change; proved by script, no human played this change. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on Valhalla, against origin/main at f1d6576b3, 31 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +459 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 614 passed (31 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | content root tests | ➖ content root untouched | | mod API up to date | ➖ native hooks untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 196 affected, to run in CI (--quick): anvil_turtle_egg, forced_end, free_space, generation_tick, geometry, ghost_recipe, ground_support, hardcore_respawn, height_provider, heightmap, held_item_stack, hotbar and 184 more | | Label | `skip-release` | 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018zuDTsnyHkP28bzn3u7S3m --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7840
No description provided.