[PR #3139] [MERGED] Port ledger: every vanilla method next to the Rust code that ports it, with a verdict for all of them #4819

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3139
Author: @kacpherek
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: tools/port-ledger


📝 Commits (10+)

  • e36fd24 Add the port ledger: vanilla methods next to the Rust functions that port them
  • ef304f3 Document the port ledger
  • cd42938 Port ledger: bytecode calls, wider matching, drift, issue and check
  • 2dd963a Document the port ledger's new matching, gaps and commands
  • 12c503e Port ledger: class homes, structural matches and the verdict map
  • 0f7036f Map the first three batches: animals, inventory screens, world generation
  • 5a8b968 Document class homes, structural matches and the verdict map
  • 969749d Map 13 game-logic batches and add map-check
  • 91358d8 Map the rest of the game logic: classes with no Rust trace, then method batches
  • c045245 Map client packet handling, entity renderers and models, block renderers

📊 Changes

109 files changed (+17613 additions, -0 deletions)

View changed files

➕ .claude/skills/vanilla-parity/SKILL.md (+76 -0)
📝 AGENTS.md (+3 -0)
📝 docs/README.md (+1 -0)
➕ docs/port-ledger.md (+137 -0)
➕ tools/port_ledger.py (+2730 -0)
➕ tools/port_map/animal-1.tsv (+143 -0)
➕ tools/port_map/classes-01.tsv (+220 -0)
➕ tools/port_map/classes-02.tsv (+158 -0)
➕ tools/port_map/classes-03.tsv (+316 -0)
➕ tools/port_map/classes-04.tsv (+231 -0)
➕ tools/port_map/classes-05.tsv (+227 -0)
➕ tools/port_map/classes-06.tsv (+188 -0)
➕ tools/port_map/classes-07.tsv (+189 -0)
➕ tools/port_map/classes-08.tsv (+154 -0)
➕ tools/port_map/classes-09.tsv (+156 -0)
➕ tools/port_map/classes-10.tsv (+18 -0)
➕ tools/port_map/client-001.tsv (+117 -0)
➕ tools/port_map/client-002.tsv (+147 -0)
➕ tools/port_map/client-003.tsv (+150 -0)
➕ tools/port_map/client-004.tsv (+149 -0)

...and 80 more files

📄 Description

What this gives you

  • Every one of vanilla 26.3's 42,365 methods (outside the skipped packages) now has an answer: the Rust fn that ports it, the bigger fn it is folded into, missing, a reason it needs no port (skip:java|data|ui|debug|service|server|other), or trivial. For the 17,922 worth porting, 88% have a port located; 2,192 are confirmed missing.
  • Fix work starts from one command instead of a grep session: python3 tools/port_ledger.py issue 3236 reads the issue, finds the vanilla classes it names (including registry names: "mooshroom" is MushroomCow), and lists where each method lives in Rust and the known gaps around it. where Class.method and what file:line answer the two directions.
  • Bugs before players report them: 795 missing/gap rows are tagged player: (what a player would see). Several match issues opened today and yesterday, with the cause already written down:
    • #3236 red mooshroom stays red after lightning: the mooshroom type is never saved or read;
    • #3248, #1474, #1486 leaving the world on a horse: ServerPlayer.saveParentVehicle / loadAndSpawnParentVehicle have no port;
    • #3199 camel sitting bugs: a sitting camel keeps its standing hitbox;
    • #3044 right-clicking redstone ore: no light-up or particles on interact;
    • #3039 block displays: block display entities are never drawn;
    • #3008 phantom hitbox: phantom size is never read;
    • #3178 ocelot, #3091 parrot, #2697 horse taming, #2760 wind charge, #3204 dialog clicks, #2925 worn heads.
  • PRs stay honest: check --base origin/main lists the ports a branch touches, their open gaps, citations to add, and the gaps it opens and closes against its base.

How it works

  • tools/port_ledger.py reads the 26.3 jar's bytecode (exact call targets, constants, ids) and the decompiled sources, and the Rust tree (typed calls through self, params, lets, fields, traits). It matches methods to fns by doc citation (/// `Class.method`), by name in a file or impl named for the class, through the call graph, by the fields and calls they share, and by rare shared ids and numbers. It also finds wiring gaps: seam (ported on two paths, wired on one), client (client-only effects the server path never reaches), drift (a port missing a sound, particle, item or constant vanilla uses), class, callee, stale.
  • What none of that finds is answered in tools/port_map/*.tsv (Class.method<TAB>verdict<TAB>file.rs::Owner::fn<TAB>note). Rows name fns by file, impl and name, not line, so they survive edits; map-check rejects any row whose class, method or fn doesn't exist, without a rebuild.
  • .claude/skills/vanilla-parity/SKILL.md (linked from AGENTS.md) tells agents to start parity fixes from the ledger and run check before the PR.
  • report writes an offline report.html with a search over every method; docs/port-ledger.md has the details.

How it was checked

  • All 14,666 map rows pass map-check against current main (this branch is synced with it; 5 furnace rows followed the move to furnace.rs).
  • Accuracy: on one 148-method batch answered independently by two models, 92% of verdicts agree on the category; a random sample of 16 rows read against the code held for 15 (the 16th is marked unsure in its note). Treat a row as a lead to read, not a verdict: roughly 1 in 12 may be wrong.
  • On main before this week's fixes it re-finds the bugs reported this week (hand dip after placing, horse feeding particles, shulker bullet model, elytra sound, pearls after a jump, spear on a horse).
  • python -m unittest discover -s tests and tools/check_public_tree.py pass. No game code changes. Nothing from the jar or the decompiled sources is committed: the map holds only vanilla class and method names, and the build writes to .local/.

Why one big PR

About 17.6k lines, of which ~14.7k are generated map rows in tools/port_map/ that no one needs to read line by line (map-check validates them). The reviewable part is the tool, its docs and the skill. They only make sense together; if you'd rather take the tool first and the map after, I'll split it.


🔄 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/3139 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `tools/port-ledger` --- ### 📝 Commits (10+) - [`e36fd24`](https://github.com/horizon-rust/horizon/commit/e36fd240089ceafb93e6f355372b1229a680c0d1) Add the port ledger: vanilla methods next to the Rust functions that port them - [`ef304f3`](https://github.com/horizon-rust/horizon/commit/ef304f30c93653ce1f7a2d4362c801bf22473c78) Document the port ledger - [`cd42938`](https://github.com/horizon-rust/horizon/commit/cd42938b884a1682ed4ce52ba67ae42a4222b650) Port ledger: bytecode calls, wider matching, drift, issue and check - [`2dd963a`](https://github.com/horizon-rust/horizon/commit/2dd963a5390ce9af4a12f3ededfef936f67fe9a8) Document the port ledger's new matching, gaps and commands - [`12c503e`](https://github.com/horizon-rust/horizon/commit/12c503e154b6426ac0fbb8046f0fd02410d1a0c8) Port ledger: class homes, structural matches and the verdict map - [`0f7036f`](https://github.com/horizon-rust/horizon/commit/0f7036f9b161763387d3202b9309de1c804eff60) Map the first three batches: animals, inventory screens, world generation - [`5a8b968`](https://github.com/horizon-rust/horizon/commit/5a8b9687e5c5ac9cbc8299e67a3f049ea4151121) Document class homes, structural matches and the verdict map - [`969749d`](https://github.com/horizon-rust/horizon/commit/969749da3dc698dfe3db94abf4abb0c6bdbab591) Map 13 game-logic batches and add map-check - [`91358d8`](https://github.com/horizon-rust/horizon/commit/91358d8088135871e70053934fa10c9e3681d33d) Map the rest of the game logic: classes with no Rust trace, then method batches - [`c045245`](https://github.com/horizon-rust/horizon/commit/c045245e8ed11298a5b668804f4a4f7421100b1a) Map client packet handling, entity renderers and models, block renderers ### 📊 Changes **109 files changed** (+17613 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `.claude/skills/vanilla-parity/SKILL.md` (+76 -0) 📝 `AGENTS.md` (+3 -0) 📝 `docs/README.md` (+1 -0) ➕ `docs/port-ledger.md` (+137 -0) ➕ `tools/port_ledger.py` (+2730 -0) ➕ `tools/port_map/animal-1.tsv` (+143 -0) ➕ `tools/port_map/classes-01.tsv` (+220 -0) ➕ `tools/port_map/classes-02.tsv` (+158 -0) ➕ `tools/port_map/classes-03.tsv` (+316 -0) ➕ `tools/port_map/classes-04.tsv` (+231 -0) ➕ `tools/port_map/classes-05.tsv` (+227 -0) ➕ `tools/port_map/classes-06.tsv` (+188 -0) ➕ `tools/port_map/classes-07.tsv` (+189 -0) ➕ `tools/port_map/classes-08.tsv` (+154 -0) ➕ `tools/port_map/classes-09.tsv` (+156 -0) ➕ `tools/port_map/classes-10.tsv` (+18 -0) ➕ `tools/port_map/client-001.tsv` (+117 -0) ➕ `tools/port_map/client-002.tsv` (+147 -0) ➕ `tools/port_map/client-003.tsv` (+150 -0) ➕ `tools/port_map/client-004.tsv` (+149 -0) _...and 80 more files_ </details> ### 📄 Description ## What this gives you - **Every one of vanilla 26.3's 42,365 methods (outside the skipped packages) now has an answer**: the Rust fn that ports it, the bigger fn it is folded into, `missing`, a reason it needs no port (`skip:java|data|ui|debug|service|server|other`), or trivial. For the 17,922 worth porting, 88% have a port located; 2,192 are confirmed missing. - **Fix work starts from one command instead of a grep session**: `python3 tools/port_ledger.py issue 3236` reads the issue, finds the vanilla classes it names (including registry names: "mooshroom" is `MushroomCow`), and lists where each method lives in Rust and the known gaps around it. `where Class.method` and `what file:line` answer the two directions. - **Bugs before players report them**: 795 `missing`/`gap` rows are tagged `player:` (what a player would see). Several match issues opened today and yesterday, with the cause already written down: - #3236 red mooshroom stays red after lightning: the mooshroom type is never saved or read; - #3248, #1474, #1486 leaving the world on a horse: `ServerPlayer.saveParentVehicle` / `loadAndSpawnParentVehicle` have no port; - #3199 camel sitting bugs: a sitting camel keeps its standing hitbox; - #3044 right-clicking redstone ore: no light-up or particles on interact; - #3039 block displays: block display entities are never drawn; - #3008 phantom hitbox: phantom size is never read; - #3178 ocelot, #3091 parrot, #2697 horse taming, #2760 wind charge, #3204 dialog clicks, #2925 worn heads. - **PRs stay honest**: `check --base origin/main` lists the ports a branch touches, their open gaps, citations to add, and the gaps it opens and closes against its base. ## How it works - `tools/port_ledger.py` reads the 26.3 jar's bytecode (exact call targets, constants, ids) and the decompiled sources, and the Rust tree (typed calls through `self`, params, lets, fields, traits). It matches methods to fns by doc citation (`` /// `Class.method` ``), by name in a file or `impl` named for the class, through the call graph, by the fields and calls they share, and by rare shared ids and numbers. It also finds wiring gaps: `seam` (ported on two paths, wired on one), `client` (client-only effects the server path never reaches), `drift` (a port missing a sound, particle, item or constant vanilla uses), `class`, `callee`, `stale`. - What none of that finds is answered in `tools/port_map/*.tsv` (`Class.method<TAB>verdict<TAB>file.rs::Owner::fn<TAB>note`). Rows name fns by file, impl and name, not line, so they survive edits; `map-check` rejects any row whose class, method or fn doesn't exist, without a rebuild. - `.claude/skills/vanilla-parity/SKILL.md` (linked from `AGENTS.md`) tells agents to start parity fixes from the ledger and run `check` before the PR. - `report` writes an offline `report.html` with a search over every method; docs/port-ledger.md has the details. ## How it was checked - All 14,666 map rows pass `map-check` against current main (this branch is synced with it; 5 furnace rows followed the move to `furnace.rs`). - Accuracy: on one 148-method batch answered independently by two models, 92% of verdicts agree on the category; a random sample of 16 rows read against the code held for 15 (the 16th is marked `unsure` in its note). Treat a row as a lead to read, not a verdict: roughly 1 in 12 may be wrong. - On main before this week's fixes it re-finds the bugs reported this week (hand dip after placing, horse feeding particles, shulker bullet model, elytra sound, pearls after a jump, spear on a horse). - `python -m unittest discover -s tests` and `tools/check_public_tree.py` pass. No game code changes. Nothing from the jar or the decompiled sources is committed: the map holds only vanilla class and method names, and the build writes to `.local/`. ## Why one big PR About 17.6k lines, of which ~14.7k are generated map rows in `tools/port_map/` that no one needs to read line by line (`map-check` validates them). The reviewable part is the tool, its docs and the skill. They only make sense together; if you'd rather take the tool first and the map after, I'll split it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:08:10 +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#4819
No description provided.