[PR #359] [MERGED] Version ports: regen, a candidate worktree with every table regenerated for the new version #2520

Closed
opened 2026-11-02 15:56:52 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/version-port-regen


📝 Commits (3)

  • 938e6b1 version_port.py regen: a candidate worktree pinned to the new version, every table regenerated
  • 3b5eaba regen: command_parse_fixture exports Horizon's registration order; javac errors summarized
  • b3bc3c0 docs/version-ports.md: regen, its replay, status

📊 Changes

9 files changed (+520 additions, -35 deletions)

View changed files

📝 crates/horizon-client/examples/command_parse_fixture.rs (+1 -1)
📝 crates/horizon-client/src/command/vanilla.rs (+8 -1)
📝 docs/version-ports.md (+55 -16)
➕ tests/test_port_regen.py (+52 -0)
📝 tests/test_port_report.py (+23 -2)
📝 tools/generate_command_order.py (+1 -1)
➕ tools/port_regen.py (+311 -0)
📝 tools/port_report.py (+32 -8)
📝 tools/version_port.py (+37 -6)

📄 Description

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

Version ports, port-2 slice 1c: version_port.py regen NEW (docs/version-ports.md, "Regenerate"). Stacked on #357 (→ #356).

What

tools/port_regen.py, run as version_port.py regen NEW [--base REF] [--only NAME...] (and by port NEW after diff):

  1. Candidate: worktree of port/NEW (from --base, default origin/main) in ~/code/horizon-parity/ports/NEW, research-lock.json pinned to NEW (version JSON sha1, jar sha1s, Java; the same version keeps its block and accepted republished JSONs).
  2. Its .local/ (a real directory): minecraft/NEW prepared by tools/lab.py prepare itself, from a launcher-shaped copy of the download (versions/NEW/launcher: version JSON, client jar, client libraries verified by sha1) into versions/NEW/game; datagen/out/reports → NEW's reports; tools → shared tools. Nothing is written into shared-local/.
  3. Only the classes the generators parse (EntityTypes, BlockStateData) decompiled, each alone with the full jar and libraries on Vineflower's path (seconds, not a 10-minute full run).
  4. Every generator (version_consts, packet_ids, entity_tracking, block_state_data, lan_command_order, command_suggestions via VanillaCommandSuggestionsExporter, vanilla_command_order via VanillaCommandParseOracle + command_parse_fixture), each recorded in diff-OLD-NEW/regen.json as unchanged / regenerated (numstat) / failed (output tail, and javac's errors one per line). The pin and what regenerated are committed on port/NEW locally, never pushed.
  5. The report reads regen.json: failed generators are rank-1 items ("its vanilla exporter no longer compiles", with the javac lines), regenerated ones go in the summary with their stat, instead of the "Regenerate X" guesses.

One Rust change, behaviour-preserving: command::vanilla::registered(dev) is the tree in Horizon's registration order and build_with = registered + apply_vanilla_order (as before). command_parse_fixture tree exports registered(false): it exported the already-reordered tree, so generate_command_order.py could no longer regenerate vanilla_order.rs ("expected the root's order to differ").

Replay 26.2 → 26.3 (both downloaded from Mojang)

regen 26.2 from this branch, then regen 26.3 --base port/26.2:

Generator 26.3 → 26.2 26.2 → 26.3
version_consts regenerated +8 −8 regenerated, = committed
packet_ids regenerated +134 −142 regenerated, = committed
entity_tracking regenerated +10 −13 regenerated, = committed
block_state_data regenerated +1 −1 (header only) regenerated, = committed
lan_command_order, vanilla_command_order failed: VanillaCommandParseOracle.java:81: no suitable constructor found for CommandSourceStack(...) +2 unchanged
command_suggestions failed: ParityData.java:45: cannot find symbol: variable WORLD (class RegistryLayer), WORLD_REGISTRIES unchanged

After the round trip git diff <this branch> port/26.3 is only research-lock.json's 5 lines of accepted republished 26.3 JSONs (a port cannot know them). Every committed table is exactly what the generators make from vanilla's data, and the reverse direction fails exactly where the oracles use 26.3-only API, with javac naming it. The 26.2 → 26.3 report now has 5 rank-1 items (was 10: the stale-table guesses became the regen summary). Each regen took < 3 min, mostly building command_parse_fixture.

How tested

Unit tests: lock pinning (new version, same version, republished JSON), javac error summaries, the report with regen results. Replay above.

pr_ready (tools/pr_ready.py --quick --base feat/tools-follow-lock on ludovics-mac-mini, against feat/tools-follow-lock at 7334a86c8, 5 min 20 s)

Check Result
Scope ✅ 9 files, +520 −35
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 242 run, FAILED (errors=2) (22 s)
rustfmt ✅ (4 s)
clippy ✅ (36 s)
tests: horizon-client ❌ 700 passed, 1 failed (4 min 3 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 81 affected, to run in CI (--quick): ambient_sound, arrow, audio_attributes, auto_jump, block_entity_anim, block_entity_render, block_particles, block_removal, block_transformer, breaking_model, camera, cauldron and 69 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Python test errors: the same 2 as on origin/main on macOS. Parity: the 80 harnesses the command/vanilla.rs split affects run on the integration commit with #356/#357; draft until then.

Rebased with the stack. title::tests::delete_refuses_an_open_world_then_removes_it_with_its_lock failed once in this run ("World is already open in another instance") and passes alone 3/3: a flaky session-lock test under parallel load, unrelated to this change (it passed in #356's full run).

Integration audit (Mac mini)

One integration commit for the stack, as the rules ask:

  • #356 + #357 merged on main (68cbad54): tools/parity.py --all, 306 of 306 harnesses pass. mob_ai passes too, so #290's drowned cases didn't show here. The run was resumed after interruptions, reusing passes. No harness failed at any point.
  • Stack tip (adds #359's command-tree split, the datafix scope fix, and the Python-only #388–#390): every horizon-client probe depends on vanilla.rs, so --changed lists 290 harnesses. I reran the ones the changes reach: command_exec, command_parse, lan, datafix (6 shards), options, world. 11 of 11 runs pass. The "PARITY_RUST_SCOPE not applied" note is gone from datafix.
  • The 26.3 candidate (#359's regen output) passed the 17 port harnesses in #388's forward replay.

Needs Ludovic

Nothing. Vanilla jars, the store and the candidates stay on the Mac mini (~/code/horizon-parity/{versions,ports}); nothing decompiled is committed.

🤖 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/359 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/version-port-regen` --- ### 📝 Commits (3) - [`938e6b1`](https://github.com/horizon-rust/horizon/commit/938e6b1191d07da24615e49487ea544ef88f81f6) version_port.py regen: a candidate worktree pinned to the new version, every table regenerated - [`3b5eaba`](https://github.com/horizon-rust/horizon/commit/3b5eabaf5f96501cf9b1e6dd926cbc52ca140d42) regen: command_parse_fixture exports Horizon's registration order; javac errors summarized - [`b3bc3c0`](https://github.com/horizon-rust/horizon/commit/b3bc3c076831513b69ee362f278218849a42d0b8) docs/version-ports.md: regen, its replay, status ### 📊 Changes **9 files changed** (+520 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/command_parse_fixture.rs` (+1 -1) 📝 `crates/horizon-client/src/command/vanilla.rs` (+8 -1) 📝 `docs/version-ports.md` (+55 -16) ➕ `tests/test_port_regen.py` (+52 -0) 📝 `tests/test_port_report.py` (+23 -2) 📝 `tools/generate_command_order.py` (+1 -1) ➕ `tools/port_regen.py` (+311 -0) 📝 `tools/port_report.py` (+32 -8) 📝 `tools/version_port.py` (+37 -6) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Version ports, port-2 slice 1c: `version_port.py regen NEW` (docs/version-ports.md, "Regenerate"). Stacked on #357 (→ #356). ## What `tools/port_regen.py`, run as `version_port.py regen NEW [--base REF] [--only NAME...]` (and by `port NEW` after `diff`): 1. **Candidate**: worktree of `port/NEW` (from `--base`, default `origin/main`) in `~/code/horizon-parity/ports/NEW`, `research-lock.json` pinned to NEW (version JSON sha1, jar sha1s, Java; the same version keeps its block and accepted republished JSONs). 2. **Its `.local/`** (a real directory): `minecraft/NEW` prepared by `tools/lab.py prepare` itself, from a launcher-shaped copy of the download (`versions/NEW/launcher`: version JSON, client jar, client libraries verified by sha1) into `versions/NEW/game`; `datagen/out/reports` → NEW's reports; `tools` → shared tools. Nothing is written into `shared-local/`. 3. **Only the classes the generators parse** (`EntityTypes`, `BlockStateData`) decompiled, each alone with the full jar and libraries on Vineflower's path (seconds, not a 10-minute full run). 4. **Every generator** (`version_consts`, `packet_ids`, `entity_tracking`, `block_state_data`, `lan_command_order`, `command_suggestions` via `VanillaCommandSuggestionsExporter`, `vanilla_command_order` via `VanillaCommandParseOracle` + `command_parse_fixture`), each recorded in `diff-OLD-NEW/regen.json` as unchanged / regenerated (numstat) / failed (output tail, and javac's errors one per line). The pin and what regenerated are committed on `port/NEW` locally, never pushed. 5. **The report** reads `regen.json`: failed generators are rank-1 items ("its vanilla exporter no longer compiles", with the javac lines), regenerated ones go in the summary with their stat, instead of the "Regenerate X" guesses. One Rust change, behaviour-preserving: `command::vanilla::registered(dev)` is the tree in Horizon's registration order and `build_with` = `registered` + `apply_vanilla_order` (as before). `command_parse_fixture tree` exports `registered(false)`: it exported the already-reordered tree, so `generate_command_order.py` could no longer regenerate `vanilla_order.rs` ("expected the root's order to differ"). ## Replay 26.2 → 26.3 (both downloaded from Mojang) `regen 26.2` from this branch, then `regen 26.3 --base port/26.2`: | Generator | 26.3 → 26.2 | 26.2 → 26.3 | | --- | --- | --- | | version_consts | regenerated +8 −8 | regenerated, = committed | | packet_ids | regenerated +134 −142 | regenerated, = committed | | entity_tracking | regenerated +10 −13 | regenerated, = committed | | block_state_data | regenerated +1 −1 (header only) | regenerated, = committed | | lan_command_order, vanilla_command_order | **failed**: `VanillaCommandParseOracle.java:81: no suitable constructor found for CommandSourceStack(...)` +2 | unchanged | | command_suggestions | **failed**: `ParityData.java:45: cannot find symbol: variable WORLD (class RegistryLayer)`, `WORLD_REGISTRIES` | unchanged | After the round trip `git diff <this branch> port/26.3` is only `research-lock.json`'s 5 lines of accepted republished 26.3 JSONs (a port cannot know them). Every committed table is exactly what the generators make from vanilla's data, and the reverse direction fails exactly where the oracles use 26.3-only API, with javac naming it. The 26.2 → 26.3 report now has 5 rank-1 items (was 10: the stale-table guesses became the regen summary). Each regen took < 3 min, mostly building `command_parse_fixture`. ## How tested Unit tests: lock pinning (new version, same version, republished JSON), javac error summaries, the report with regen results. Replay above. **pr_ready** (`tools/pr_ready.py --quick --base feat/tools-follow-lock` on ludovics-mac-mini, against feat/tools-follow-lock at 7334a86c8, 5 min 20 s) | Check | Result | | --- | --- | | Scope | ✅ 9 files, +520 −35 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 242 run, FAILED (errors=2) (22 s) | | rustfmt | ✅ (4 s) | | clippy | ✅ (36 s) | | tests: horizon-client | ❌ 700 passed, 1 failed (4 min 3 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 81 affected, to run in CI (--quick): ambient_sound, arrow, audio_attributes, auto_jump, block_entity_anim, block_entity_render, block_particles, block_removal, block_transformer, breaking_model, camera, cauldron and 69 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Python test errors: the same 2 as on origin/main on macOS. Parity: the 80 harnesses the `command/vanilla.rs` split affects run on the integration commit with #356/#357; draft until then. Rebased with the stack. `title::tests::delete_refuses_an_open_world_then_removes_it_with_its_lock` failed once in this run ("World is already open in another instance") and passes alone 3/3: a flaky session-lock test under parallel load, unrelated to this change (it passed in #356's full run). ## Integration audit (Mac mini) One integration commit for the stack, as the rules ask: - **#356 + #357 merged on `main` (68cbad54):** `tools/parity.py --all`, **306 of 306 harnesses pass**. `mob_ai` passes too, so #290's drowned cases didn't show here. The run was resumed after interruptions, reusing passes. No harness failed at any point. - **Stack tip (adds #359's command-tree split, the datafix scope fix, and the Python-only #388–#390):** every horizon-client probe depends on `vanilla.rs`, so `--changed` lists 290 harnesses. I reran the ones the changes reach: `command_exec`, `command_parse`, `lan`, `datafix` (6 shards), `options`, `world`. **11 of 11 runs pass.** The "PARITY_RUST_SCOPE not applied" note is gone from datafix. - The 26.3 candidate (#359's regen output) passed the 17 port harnesses in #388's forward replay. ## Needs Ludovic Nothing. Vanilla jars, the store and the candidates stay on the Mac mini (`~/code/horizon-parity/{versions,ports}`); nothing decompiled is committed. 🤖 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 15:56:52 +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#2520
No description provided.