[PR #325] [MERGED] Port report: ranked work items from a Minecraft version diff #2492

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

📋 Pull Request Information

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

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


📝 Commits (4)

  • 720e91f Design the version-port pipeline: detect, prepare, diff, regenerate, report
  • 58ad816 version_port.py: detect, prepare and diff Minecraft releases
  • 93bb113 Diff vanilla classes method by method and map them to Horizon
  • 7c0d3ce Port report: ranked work items from a version diff

📊 Changes

9 files changed (+2284 additions, -0 deletions)

View changed files

📝 docs/README.md (+1 -0)
➕ docs/version-ports.md (+301 -0)
➕ tests/test_class_index.py (+170 -0)
➕ tests/test_port_report.py (+145 -0)
➕ tests/test_version_port.py (+144 -0)
➕ tools/class_index.py (+327 -0)
➕ tools/port_report.py (+322 -0)
➕ tools/vanilla_map.py (+227 -0)
➕ tools/version_port.py (+647 -0)

📄 Description

Stacked on #324. Slice (c) of docs/version-ports.md.

What

  • tools/port_report.py turns a version diff into ranked, agent-sized work items:
    1. blocks the switch: version facts (with every site the code states them), packets (with the Horizon files naming them), the save format (new DataFixer schemas and fixes), data component types, report-format changes, and the generated tables whose inputs changed (with the generator to run);
    2. proved by a harness, rerun it (or harness failed, with --results from a tools/parity.py run against the new version): one item per Horizon file that ports changed vanilla code. The file is the one whose comments name the changed methods, else the one named after the class; classes many files mention in passing go into per-package buckets. The harnesses are those whose probes reach the file, else those covering the most of its classes;
    3. ported, no harness: the same items when no harness covers them;
    4. new content: new registry entries, and new classes in the vanilla packages Horizon ports;
    5. summaries of changed and new vanilla code Horizon doesn't port.
  • version_port.py report OLD NEW [--results state.json] writes report.md and report.json next to the diff. port NEW [--old OLD] runs prepare, diff and report in one go (37 s for 26.2 → 26.3).
  • The class map now resolves the names of both versions (a moved class only under its new name), so classes new in the target version that Horizon already names resolve.
  • docs/version-ports.md: usage, status, and the replay.

Replay 26.2 → 26.3 against ground truth (Horizon's own 26.3 code)

26.3 needed Report
protocol 777, DataVersion 5023, pack formats rank 1, with every site (PROTOCOL_VERSION, both DATA_VERSIONs, "26.3" names)
ids.rs ADD_TRANSIENT_BLOCK, POST_EFFECTS ×2, SWING_ANIMATION, PUNCH replacing SWING; packets/play.rs, lan/hub.rs rank 1: exactly those, 131 renumbered, those files, and "regenerate ids.rs". Regenerating from 26.3's report reproduces the committed ids.rs byte for byte after rustfmt (26.2's differs by 274 lines); tracking.rs likewise
DataFixers 4996–5016 (fixes_c.rs) rank 1: schemas V4996, V4996_1, V4997, V5000 and 16 fixes (MergeTerrainChunkStatus, ExplorerMapItem, SwingAnimationComponentSplit…)
swing_animation → attack/interact_animation (first_person.rs, hand.rs, item_model.rs) rank 1: component types +13 -2, those files
133 methods only in 26.3 that Horizon names 133/133 (132 with the method named in a rank 2–3 item on the porting file, 1 in save-format)
49 classes only in 26.3 that Horizon names 49/49 in rank 4 items

499 items: 10 / 311 / 96 / 80 / 2 by rank. Rank 1 is exact. Ranks 2–3 are leads: 173 of their 407 items have a changed method Horizon names. The rest include mechanical churn (GuiGraphics → GuiGraphicsExtractor, render pipeline) and 105 "widely named" buckets. Harness results against the new version are what confirm rank-2 items; the replay can't produce them, because the oracles are written against 26.3.

How tested

  • python3 -m unittest tests.test_port_report: 9 tests on synthetic diffs and maps. They cover rank and kind assignment, ids, regenerate triggers, the save-format lists, per-file grouping with harness choice, a failed harness ranking first, new content, the markdown, and helpers (primary_file, harness_results, class_names).
  • The full tests/ suite (232 tests): the same 2 pre-existing errors as origin/main on the Mac mini. tools/check_public_tree.py passes.
  • Ran port 26.3 --old 26.2 end to end on the Mac mini.

Needs Ludovic

Nothing for this PR. Next slices: regen (generators plus rustfmt in a candidate worktree), the version_consts refactor, the candidate harness run, publish (issues + Kira cards), and the launchd agent.

🤖 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/325 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/version-port-report` --- ### 📝 Commits (4) - [`720e91f`](https://github.com/horizon-rust/horizon/commit/720e91fb8cec9c7af5a530102ecde8baf7d8d748) Design the version-port pipeline: detect, prepare, diff, regenerate, report - [`58ad816`](https://github.com/horizon-rust/horizon/commit/58ad81674b383d4148daf31ed41a344fe9a4afee) version_port.py: detect, prepare and diff Minecraft releases - [`93bb113`](https://github.com/horizon-rust/horizon/commit/93bb113e0d24f5bd6d995d1838dbf4ffe99ac526) Diff vanilla classes method by method and map them to Horizon - [`7c0d3ce`](https://github.com/horizon-rust/horizon/commit/7c0d3ceea68880c545e040999aa6ab2bc2018012) Port report: ranked work items from a version diff ### 📊 Changes **9 files changed** (+2284 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/README.md` (+1 -0) ➕ `docs/version-ports.md` (+301 -0) ➕ `tests/test_class_index.py` (+170 -0) ➕ `tests/test_port_report.py` (+145 -0) ➕ `tests/test_version_port.py` (+144 -0) ➕ `tools/class_index.py` (+327 -0) ➕ `tools/port_report.py` (+322 -0) ➕ `tools/vanilla_map.py` (+227 -0) ➕ `tools/version_port.py` (+647 -0) </details> ### 📄 Description Stacked on #324. Slice (c) of docs/version-ports.md. ## What - `tools/port_report.py` turns a version diff into ranked, agent-sized work items: 1. **blocks the switch**: version facts (with every site the code states them), packets (with the Horizon files naming them), the save format (new DataFixer schemas and fixes), data component types, report-format changes, and the generated tables whose inputs changed (with the generator to run); 2. **proved by a harness, rerun it** (or **harness failed**, with `--results` from a `tools/parity.py` run against the new version): one item per Horizon file that ports changed vanilla code. The file is the one whose comments name the changed methods, else the one named after the class; classes many files mention in passing go into per-package buckets. The harnesses are those whose probes reach the file, else those covering the most of its classes; 3. **ported, no harness**: the same items when no harness covers them; 4. **new content**: new registry entries, and new classes in the vanilla packages Horizon ports; 5. summaries of changed and new vanilla code Horizon doesn't port. - `version_port.py report OLD NEW [--results state.json]` writes `report.md` and `report.json` next to the diff. `port NEW [--old OLD]` runs prepare, diff and report in one go (37 s for 26.2 → 26.3). - The class map now resolves the names of both versions (a moved class only under its new name), so classes new in the target version that Horizon already names resolve. - `docs/version-ports.md`: usage, status, and the replay. ## Replay 26.2 → 26.3 against ground truth (Horizon's own 26.3 code) | 26.3 needed | Report | | --- | --- | | protocol 777, DataVersion 5023, pack formats | rank 1, with every site (`PROTOCOL_VERSION`, both `DATA_VERSION`s, `"26.3"` names) | | `ids.rs` ADD_TRANSIENT_BLOCK, POST_EFFECTS ×2, SWING_ANIMATION, PUNCH replacing SWING; `packets/play.rs`, `lan/hub.rs` | rank 1: exactly those, 131 renumbered, those files, and "regenerate ids.rs". Regenerating from 26.3's report reproduces the committed `ids.rs` byte for byte after rustfmt (26.2's differs by 274 lines); `tracking.rs` likewise | | DataFixers 4996–5016 (`fixes_c.rs`) | rank 1: schemas V4996, V4996_1, V4997, V5000 and 16 fixes (MergeTerrainChunkStatus, ExplorerMapItem, SwingAnimationComponentSplit…) | | swing_animation → attack/interact_animation (`first_person.rs`, `hand.rs`, `item_model.rs`) | rank 1: component types +13 -2, those files | | 133 methods only in 26.3 that Horizon names | 133/133 (132 with the method named in a rank 2–3 item on the porting file, 1 in save-format) | | 49 classes only in 26.3 that Horizon names | 49/49 in rank 4 items | 499 items: 10 / 311 / 96 / 80 / 2 by rank. Rank 1 is exact. Ranks 2–3 are leads: 173 of their 407 items have a changed method Horizon names. The rest include mechanical churn (GuiGraphics → GuiGraphicsExtractor, render pipeline) and 105 "widely named" buckets. Harness results against the new version are what confirm rank-2 items; the replay can't produce them, because the oracles are written against 26.3. ## How tested - `python3 -m unittest tests.test_port_report`: 9 tests on synthetic diffs and maps. They cover rank and kind assignment, ids, regenerate triggers, the save-format lists, per-file grouping with harness choice, a failed harness ranking first, new content, the markdown, and helpers (`primary_file`, `harness_results`, `class_names`). - The full `tests/` suite (232 tests): the same 2 pre-existing errors as origin/main on the Mac mini. `tools/check_public_tree.py` passes. - Ran `port 26.3 --old 26.2` end to end on the Mac mini. ## Needs Ludovic Nothing for this PR. Next slices: `regen` (generators plus rustfmt in a candidate worktree), the `version_consts` refactor, the candidate harness run, `publish` (issues + Kira cards), and the launchd agent. 🤖 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:39 +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#2492
No description provided.