[PR #1448] [MERGED] tools: one copy of the helpers harnesses share, in lab.py #3529

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

📋 Pull Request Information

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

Base: main ← Head: chore/python-helpers-lab


📝 Commits (1)

  • 3960c09 tools: one copy of the helpers harnesses share, in lab.py

📊 Changes

20 files changed (+189 additions, -317 deletions)

View changed files

📝 tools/datafix_scene_12.py (+5 -3)
📝 tools/datafix_worlds.py (+16 -51)
📝 tools/lab.py (+64 -1)
📝 tools/server_bench.py (+1 -8)
📝 tools/test_ambient_sound_parity.py (+5 -9)
📝 tools/test_auto_jump_parity.py (+12 -22)
📝 tools/test_camera_parity.py (+35 -43)
📝 tools/test_dedicated_server_parity.py (+2 -6)
📝 tools/test_first_person_parity.py (+4 -12)
📝 tools/test_friends.py (+1 -7)
📝 tools/test_game_loop_parity.py (+11 -21)
📝 tools/test_save_roundtrip_parity.py (+1 -7)
📝 tools/test_secure_chat_parity.py (+5 -15)
📝 tools/test_server_dimension_players_parity.py (+1 -12)
📝 tools/test_server_player_targets_parity.py (+2 -23)
📝 tools/test_sound_engine_parity.py (+4 -8)
📝 tools/upgrade_world.py (+1 -8)
📝 tools/vanilla_client.py (+1 -10)
📝 tools/vanilla_login.py (+12 -43)
📝 tools/vanilla_world_check.py (+6 -8)

📄 Description

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

What

Workstream 7 (review-plan.md §1 Duplication, Python): one copy of the helpers harnesses and tools had copied, in tools/lab.py:

helper copies removed from
free_port 7 datafix_worlds, server_bench, test_dedicated_server_parity, test_friends, test_save_roundtrip_parity, upgrade_world, vanilla_world_check
offline_uuid 4 datafix_worlds, test_server_player_targets_parity, vanilla_client, vanilla_login
varint / parse_varint 3 / 2 datafix_worlds, vanilla_login, test_secure_chat_parity
dbits / fbits 6 / 4 test_ambient_sound, test_auto_jump, test_camera, test_first_person, test_game_loop, test_sound_engine
settled 2 test_server_dimension_players_parity, test_server_player_targets_parity
  • Callers use lab.<name>. varint is the copy that masks to 32 bits (Java's int); the unmasked one in test_secure_chat looped forever on a negative. offline_uuid returns a uuid.UUID (test_server_player_targets formats it in an f-string, same text).
  • datafix_scene_12 took varint/parse_varint/free_port from the datafix_worlds module: now from lab.
  • test_dedicated_server_parity imports free_port from lab, so the 5 harnesses that import it from there (locator_bar, online_mode, world_spawn, user_cache, server_world_gen) are untouched: world_spawn is in #1444.
  • Imports the moved code left unused go (and an unused os/math in two of the touched files).
  • net_capture's read_varint stays: it is signed and bounds-checked, a different contract.

20 files, +189 / −317.

Self-check

  • Every touched module imports (python3 -c "import <module>" for all 24 that use or re-export the helpers); py_compile on all changed files; an AST pass finds no name left undefined and no import left unused.
  • Helper outputs equal main's (offline_uuid('Bob'), varint(-1), parse_varint round trip).
  • python3 -m unittest discover -s tests: 293 run, the same 2 errors as on main on this Mac (java not on PATH for OracleReuse; /private/var tmp path).
  • Harnesses that call the moved helpers, on the Mac mini: parity.py camera first_person game_loop auto_jump ambient_sound sound_engine secure_chat server_player_targets server_dimension_players dedicated_server save_roundtrip user_cache online_mode server_world_gen: 14 passed, 0 failed (14.0 min); light (vanilla_world_check): passed.
  • Not run locally: datafix (needs datafix_worlds to regenerate old-version worlds into the shared data, which agents mustn't rewrite; the shared worlds exist, so the harness itself doesn't call the changed bot code).
  • No Rust change.

Needs Ludovic / orchestrator

tools/parity.py --changed selects all 329 harnesses: every harness reads lab.py, as the brief asked. If a full CI parity run is too costly right now, the helpers can move to a small new module instead (then only the ~25 files above rerun); say so and I'll change it.

🤖 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/1448 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `chore/python-helpers-lab` --- ### 📝 Commits (1) - [`3960c09`](https://github.com/horizon-rust/horizon/commit/3960c09159e17ae88ecd3bfc437a6947b5a00ad9) tools: one copy of the helpers harnesses share, in lab.py ### 📊 Changes **20 files changed** (+189 additions, -317 deletions) <details> <summary>View changed files</summary> 📝 `tools/datafix_scene_12.py` (+5 -3) 📝 `tools/datafix_worlds.py` (+16 -51) 📝 `tools/lab.py` (+64 -1) 📝 `tools/server_bench.py` (+1 -8) 📝 `tools/test_ambient_sound_parity.py` (+5 -9) 📝 `tools/test_auto_jump_parity.py` (+12 -22) 📝 `tools/test_camera_parity.py` (+35 -43) 📝 `tools/test_dedicated_server_parity.py` (+2 -6) 📝 `tools/test_first_person_parity.py` (+4 -12) 📝 `tools/test_friends.py` (+1 -7) 📝 `tools/test_game_loop_parity.py` (+11 -21) 📝 `tools/test_save_roundtrip_parity.py` (+1 -7) 📝 `tools/test_secure_chat_parity.py` (+5 -15) 📝 `tools/test_server_dimension_players_parity.py` (+1 -12) 📝 `tools/test_server_player_targets_parity.py` (+2 -23) 📝 `tools/test_sound_engine_parity.py` (+4 -8) 📝 `tools/upgrade_world.py` (+1 -8) 📝 `tools/vanilla_client.py` (+1 -10) 📝 `tools/vanilla_login.py` (+12 -43) 📝 `tools/vanilla_world_check.py` (+6 -8) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What Workstream 7 (review-plan.md §1 Duplication, Python): one copy of the helpers harnesses and tools had copied, in `tools/lab.py`: | helper | copies removed | from | |---|---|---| | `free_port` | 7 | datafix_worlds, server_bench, test_dedicated_server_parity, test_friends, test_save_roundtrip_parity, upgrade_world, vanilla_world_check | | `offline_uuid` | 4 | datafix_worlds, test_server_player_targets_parity, vanilla_client, vanilla_login | | `varint` / `parse_varint` | 3 / 2 | datafix_worlds, vanilla_login, test_secure_chat_parity | | `dbits` / `fbits` | 6 / 4 | test_ambient_sound, test_auto_jump, test_camera, test_first_person, test_game_loop, test_sound_engine | | `settled` | 2 | test_server_dimension_players_parity, test_server_player_targets_parity | - Callers use `lab.<name>`. `varint` is the copy that masks to 32 bits (Java's int); the unmasked one in test_secure_chat looped forever on a negative. `offline_uuid` returns a `uuid.UUID` (test_server_player_targets formats it in an f-string, same text). - datafix_scene_12 took `varint`/`parse_varint`/`free_port` from the datafix_worlds module: now from lab. - test_dedicated_server_parity imports `free_port` from lab, so the 5 harnesses that import it from there (locator_bar, online_mode, world_spawn, user_cache, server_world_gen) are untouched: world_spawn is in #1444. - Imports the moved code left unused go (and an unused `os`/`math` in two of the touched files). - net_capture's `read_varint` stays: it is signed and bounds-checked, a different contract. 20 files, +189 / −317. ## Self-check - Every touched module imports (`python3 -c "import <module>"` for all 24 that use or re-export the helpers); `py_compile` on all changed files; an AST pass finds no name left undefined and no import left unused. - Helper outputs equal main's (`offline_uuid('Bob')`, `varint(-1)`, `parse_varint` round trip). - `python3 -m unittest discover -s tests`: 293 run, the same 2 errors as on main on this Mac (java not on PATH for OracleReuse; `/private/var` tmp path). - Harnesses that call the moved helpers, on the Mac mini: `parity.py camera first_person game_loop auto_jump ambient_sound sound_engine secure_chat server_player_targets server_dimension_players dedicated_server save_roundtrip user_cache online_mode server_world_gen`: **14 passed, 0 failed** (14.0 min); `light` (vanilla_world_check): passed. - Not run locally: datafix (needs datafix_worlds to regenerate old-version worlds into the shared data, which agents mustn't rewrite; the shared worlds exist, so the harness itself doesn't call the changed bot code). - No Rust change. ## Needs Ludovic / orchestrator `tools/parity.py --changed` selects **all 329 harnesses**: every harness reads lab.py, as the brief asked. If a full CI parity run is too costly right now, the helpers can move to a small new module instead (then only the ~25 files above rerun); say so and I'll change it. 🤖 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:10:11 +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#3529
No description provided.