[PR #7185] [MERGED] The save round trip covers riders #7399

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

📋 Pull Request Information

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

Base: main ← Head: test/save-order-roundtrip


📝 Commits (2)

  • 6d5ad6b Test: save and reload keeps riders
  • d550c86 Merge remote-tracking branch 'origin/main' into test/save-order-roundtrip

📊 Changes

2 files changed (+7 additions, -1 deletions)

View changed files

📝 tools/save_roundtrip_scene.py (+6 -0)
📝 tools/test_save_roundtrip_parity.py (+1 -1)

📄 Description

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

Follows the review of #7094, which asked whether a regression test that saves a chunk with several kinds, riders and a lead, then checks the reload, was worth adding. This adds the riders part.

The save round-trip scene (tools/save_roundtrip_scene.py) had no rider, so the entity save path that nests passengers in their vehicle was only covered by hand. This adds to that scene a pig with a zombie rider, a boat with a pig and a chicken, a minecart with a cow, and a horse with a skeleton that carries a bat (two levels). test_save_roundtrip_parity.py now treats the simulation fields of a passenger (Pos, Rotation, Fire and the like) as it already does for a top-level entity, since a rider's copy advances the same way.

Leads are not covered here: a first attempt to summon leashed entities on the vanilla server left no lead in the vanilla save either, so there was nothing to compare. That needs its own scene work.

Part of #6545

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 test is differential: a vanilla 26.3 server summons the scene and saves it, Horizon opens that world and saves it again, and every entity (riders included, matched by UUID) is compared with vanilla's. A dropped or changed passenger shows as a Passengers difference.

Proof

  • On current main, every entity and rider matches vanilla. The final run reports 0 unexplained differences; two earlier runs of the same test failed only on the mob spawner Delay (vanilla 20, Horizon 10), which varies from run to run.
  • With the rider code in add_passengers temporarily disabled, the run fails with four more differences, entity.Passengers on the pig, the boat, the minecart and the horse. Restored afterwards.

Harnesses

Run on this branch: cargo test -p horizon-client --lib (673 passed, 5 ignored), test_world_reopen_parity.py (pass, 3 reopens), test_server_entities_parity.py (31 entities identical), pr_ready.py --quick (pass; 612 Python tests), and test_save_roundtrip_parity.py (0 unexplained differences).

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 ba832babb, 37 s)

Check Result
Scope ✅ 2 files, +7 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 612 passed (36 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 ➖ 204 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_drop, held_item_stack and 192 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/7185 **Author:** [@HrafnaValkyrja](https://github.com/HrafnaValkyrja) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `test/save-order-roundtrip` --- ### 📝 Commits (2) - [`6d5ad6b`](https://github.com/horizon-rust/horizon/commit/6d5ad6b6c41a1f2a25e7bb5153bfdcb36989b1da) Test: save and reload keeps riders - [`d550c86`](https://github.com/horizon-rust/horizon/commit/d550c861579e66b3e423f372653e1533543f3183) Merge remote-tracking branch 'origin/main' into test/save-order-roundtrip ### 📊 Changes **2 files changed** (+7 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tools/save_roundtrip_scene.py` (+6 -0) 📝 `tools/test_save_roundtrip_parity.py` (+1 -1) </details> ### 📄 Description > 🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself. Follows the review of #7094, which asked whether a regression test that saves a chunk with several kinds, riders and a lead, then checks the reload, was worth adding. This adds the riders part. The save round-trip scene (`tools/save_roundtrip_scene.py`) had no rider, so the entity save path that nests passengers in their vehicle was only covered by hand. This adds to that scene a pig with a zombie rider, a boat with a pig and a chicken, a minecart with a cow, and a horse with a skeleton that carries a bat (two levels). `test_save_roundtrip_parity.py` now treats the simulation fields of a passenger (`Pos`, `Rotation`, `Fire` and the like) as it already does for a top-level entity, since a rider's copy advances the same way. Leads are not covered here: a first attempt to summon leashed entities on the vanilla server left no lead in the vanilla save either, so there was nothing to compare. That needs its own scene work. Part of #6545 ## 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 test is differential: a vanilla 26.3 server summons the scene and saves it, Horizon opens that world and saves it again, and every entity (riders included, matched by UUID) is compared with vanilla's. A dropped or changed passenger shows as a `Passengers` difference. ## Proof - On current main, every entity and rider matches vanilla. The final run reports 0 unexplained differences; two earlier runs of the same test failed only on the mob spawner `Delay` (vanilla 20, Horizon 10), which varies from run to run. - With the rider code in `add_passengers` temporarily disabled, the run fails with four more differences, `entity.Passengers` on the pig, the boat, the minecart and the horse. Restored afterwards. ## Harnesses Run on this branch: `cargo test -p horizon-client --lib` (673 passed, 5 ignored), `test_world_reopen_parity.py` (pass, 3 reopens), `test_server_entities_parity.py` (31 entities identical), `pr_ready.py --quick` (pass; 612 Python tests), and `test_save_roundtrip_parity.py` (0 unexplained differences). 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 ba832babb, 37 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +7 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 612 passed (36 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 | ➖ 204 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_drop, held_item_stack and 192 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>
bsakaguchi 2026-11-03 06:38: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#7399
No description provided.