x64_recomp: in/out immediate ports need their imm8 byte (X64-RECOMP-IN-IMM8) #1488

Closed
kett1m wants to merge 0 commits from upstream-pr/1488 into main
kett1m commented 2026-11-25 01:36:23 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kett1m on 2026-11-25T01:36:23Z.


Claimed in the coordination issue as: X64-RECOMP-IN-IMM8

Depends on: #1485 (conflicts with in tests/test_x64_recomp.py; whichever lands second needs a rebase)

The primary table in tools/x64_recomp.py gives E4, E5, E6 and E7 the operand shape
sys, so the decoder consumed only the opcode and the instruction came out one byte long. These
are the immediate-port forms of in and out:

  • E4 ib = in al, imm8
  • E5 ib = in eax, imm8
  • E6 ib = out imm8, al
  • E7 ib = out imm8, eax

Each takes one immediate byte, so the instruction is two bytes; the walk read the port number as
the next opcode and the rest of the function came out at the wrong offset. The EC-EF DX-port
forms take no immediate and are unchanged.

Measurement

The image is game_scarlett_master.exe, SHA-256
e95020b2fa4a721db3df59fdecf75621730ac559d8835252f6c3b658d5a08993. REA measured the section
ranges with gnu.objdump section_headers, evidence
ev_e29cbdffd0dc7c46889b2a1f955011ce9f2795017233c97107ded73f9186dd90: .text VMA
0x140001000, file 0x400, size 0x5f3f966.

A per-instruction differential against GNU objdump over .text: objdump's linear walk and the
decoder's walk read the same bytes and the instruction lengths are compared (26,674,180 objdump
instructions). On main (b4b7756) it reports 52,638 mismatching instructions; the form is used
twice, at RVA 0x55f2ed4 (in $0x3d,%al) and RVA 0x564652c (in $0x73,%al), each one byte
short of objdump's two. With this change the count is 52,636, both of those are gone, and no new
mismatch signature appears. Both sites sit inside .pdata functions (RVAs 0x55f2ed0 and
0x5646250). out with an immediate port does not occur anywhere in .text, so it is covered by
the unit test rather than by a retail count.

Test

tests/test_x64_recomp.py::DecodeTests::test_in_out_immediate_port_consumes_imm8: E4 3d, E5 73,
E6 40 and E7 40 are two bytes with the operand shape in al, imm8 and its three siblings, and
EC/ED/EE/EF stay one byte. Against the unfixed decoder the first case decodes to size 1.

python -I tests/test_x64_recomp.py: 33 tests OK, 26 skipped (this host has no
qemu-system-aarch64). python -I tests/test_recomp_census.py: 11 tests OK.
python3 -m compileall -q make_game.py tools tests exits 0. python -I scripts/check_no_game_data.py tools/x64_recomp.py tests/test_x64_recomp.py docs/mobile.md exits
0 with no output.

The per-function .pdata walk is noisy for this change, because the other length defects still on
main leave most functions misaligned, so it is not quoted as an impact figure.

docs/mobile.md records the measurement, the two offsets and the evidence ID. No game files, no
GPU, nothing online. Tested on Linux (openSUSE Tumbleweed, Python 3.13.18, binutils 2.47), 12
cores.

GPUs tested: n/a (decoder and census are CPU-only)

AI-assisted: yes (DeepSeek V4.1 Flash)

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption, including in logs or reports quoted here.
  • No new translator rule, so no docs/design.md contract row.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5483421383 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1488). Originally posted by [kett1m](https://github.com/kett1m) on 2026-11-25T01:36:23Z. --- Claimed in the coordination issue as: X64-RECOMP-IN-IMM8 Depends on: #1485 (conflicts with in `tests/test_x64_recomp.py`; whichever lands second needs a rebase) The primary table in `tools/x64_recomp.py` gives `E4`, `E5`, `E6` and `E7` the operand shape `sys`, so the decoder consumed only the opcode and the instruction came out one byte long. These are the immediate-port forms of `in` and `out`: - `E4 ib` = `in al, imm8` - `E5 ib` = `in eax, imm8` - `E6 ib` = `out imm8, al` - `E7 ib` = `out imm8, eax` Each takes one immediate byte, so the instruction is two bytes; the walk read the port number as the next opcode and the rest of the function came out at the wrong offset. The `EC`-`EF` DX-port forms take no immediate and are unchanged. ## Measurement The image is `game_scarlett_master.exe`, SHA-256 `e95020b2fa4a721db3df59fdecf75621730ac559d8835252f6c3b658d5a08993`. REA measured the section ranges with `gnu.objdump` `section_headers`, evidence `ev_e29cbdffd0dc7c46889b2a1f955011ce9f2795017233c97107ded73f9186dd90`: `.text` VMA `0x140001000`, file `0x400`, size `0x5f3f966`. A per-instruction differential against GNU objdump over `.text`: objdump's linear walk and the decoder's walk read the same bytes and the instruction lengths are compared (26,674,180 objdump instructions). On `main` (`b4b7756`) it reports 52,638 mismatching instructions; the form is used twice, at RVA `0x55f2ed4` (`in $0x3d,%al`) and RVA `0x564652c` (`in $0x73,%al`), each one byte short of objdump's two. With this change the count is 52,636, both of those are gone, and no new mismatch signature appears. Both sites sit inside `.pdata` functions (RVAs `0x55f2ed0` and `0x5646250`). `out` with an immediate port does not occur anywhere in `.text`, so it is covered by the unit test rather than by a retail count. ## Test `tests/test_x64_recomp.py::DecodeTests::test_in_out_immediate_port_consumes_imm8`: `E4 3d`, `E5 73`, `E6 40` and `E7 40` are two bytes with the operand shape `in al, imm8` and its three siblings, and `EC`/`ED`/`EE`/`EF` stay one byte. Against the unfixed decoder the first case decodes to size 1. `python -I tests/test_x64_recomp.py`: 33 tests OK, 26 skipped (this host has no qemu-system-aarch64). `python -I tests/test_recomp_census.py`: 11 tests OK. `python3 -m compileall -q make_game.py tools tests` exits 0. `python -I scripts/check_no_game_data.py tools/x64_recomp.py tests/test_x64_recomp.py docs/mobile.md` exits 0 with no output. The per-function `.pdata` walk is noisy for this change, because the other length defects still on `main` leave most functions misaligned, so it is not quoted as an impact figure. `docs/mobile.md` records the measurement, the two offsets and the evidence ID. No game files, no GPU, nothing online. Tested on Linux (openSUSE Tumbleweed, Python 3.13.18, binutils 2.47), 12 cores. GPUs tested: n/a (decoder and census are CPU-only) AI-assisted: yes (DeepSeek V4.1 Flash) ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption, including in logs or reports quoted here. - [x] No new translator rule, so no `docs/design.md` contract row.
ytsodacan commented 2026-11-25 03:36:00 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ytsodacan on 2026-11-25T03:36:00Z.


[KEEP]

  • The change looks correct and well scoped: tools/x64_recomp.py E4-E7 go from sys to Ab Ib/Av Ib/Ib Ab/Ib Av, with a decode test covering all four plus the unchanged EC-EF forms.
  • CI has not finished: change-scope and no-game-data are still QUEUED, so there is no green result yet.
  • Likely textual conflicts with #1485 and #1483, which also add tests at the same spot (tests/test_x64_recomp.py near test_prefixes) and docs in docs/mobile.md. A maintainer should pick a merge order, then rebase the rest.
  • Suggest merging once CI is green and this is rebased after its siblings.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7152064861 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1488#issuecomment-7152064861). Originally posted by [ytsodacan](https://github.com/ytsodacan) on 2026-11-25T03:36:00Z. --- **[KEEP]** - The change looks correct and well scoped: `tools/x64_recomp.py` E4-E7 go from `sys` to `Ab Ib`/`Av Ib`/`Ib Ab`/`Ib Av`, with a decode test covering all four plus the unchanged EC-EF forms. - CI has not finished: `change-scope` and `no-game-data` are still QUEUED, so there is no green result yet. - Likely textual conflicts with #1485 and #1483, which also add tests at the same spot (`tests/test_x64_recomp.py` near `test_prefixes`) and docs in `docs/mobile.md`. A maintainer should pick a merge order, then rebase the rest. - Suggest merging once CI is green and this is rebased after its siblings.
tiguan26 commented 2026-11-25 03:52:53 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by tiguan26 on 2026-11-25T03:52:53Z.

Review: APPROVED


Approving. Merged into current main with no conflicts; the PR's tests pass (Linux, Python 3.13). E4/E5 are in AL/eAX, imm8 and E6/E7 out imm8, AL/eAX, so each carries an imm8 port byte; treating them as bare sys ended the instruction one byte early.

AI-assisted (Claude).

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6051616466 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1488#pullrequestreview-6051616466). Originally posted by [tiguan26](https://github.com/tiguan26) on 2026-11-25T03:52:53Z. **Review:** APPROVED --- Approving. Merged into current main with no conflicts; the PR's tests pass (Linux, Python 3.13). E4/E5 are `in AL/eAX, imm8` and E6/E7 `out imm8, AL/eAX`, so each carries an imm8 port byte; treating them as bare `sys` ended the instruction one byte early. AI-assisted (Claude).
kevincommits commented 2026-11-25 22:04:30 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kevincommits on 2026-11-25T22:04:30Z.


Independent run. Apple M5 Pro, macOS 27.2.1 (26B131), Python 3.14.2, QEMU 11.1.3 from Homebrew, so the 26 exec tests ran rather than skipped. I merged main at 6b843a4ad into the branch locally (633 commits behind, no conflicts).

  • main alone decodes e4 3d as ('in', size 1); this branch gives ('in', size 2).
  • tests/test_x64_recomp.py: 34/34 (33 on main), so the new test fails on main and passes here. tests/test_recomp_census.py: 11/11.
  • Every standalone tests/test_*.py under python -I: 510 run, 506 pass; the 4 that fail are the same 4 that fail on plain main.

I only ran the synthetic byte fixtures. I did not reproduce the retail-image counts in the docs/mobile.md paragraph. No game files used. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7175902208 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1488#issuecomment-7175902208). Originally posted by [kevincommits](https://github.com/kevincommits) on 2026-11-25T22:04:30Z. --- Independent run. Apple M5 Pro, macOS 27.2.1 (26B131), Python 3.14.2, QEMU 11.1.3 from Homebrew, so the 26 exec tests ran rather than skipped. I merged `main` at `6b843a4ad` into the branch locally (633 commits behind, no conflicts). - `main` alone decodes `e4 3d` as `('in', size 1)`; this branch gives `('in', size 2)`. - `tests/test_x64_recomp.py`: 34/34 (33 on `main`), so the new test fails on `main` and passes here. `tests/test_recomp_census.py`: 11/11. - Every standalone `tests/test_*.py` under `python -I`: 510 run, 506 pass; the 4 that fail are the same 4 that fail on plain `main`. I only ran the synthetic byte fixtures. I did not reproduce the retail-image counts in the `docs/mobile.md` paragraph. No game files used. AI-assisted.
MoonEyes commented 2026-11-28 18:01:39 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T18:01:39Z.


Hi @kett1m, thanks for this pull request. It currently conflicts with main (conflicting file(s): tests/test_x64_recomp.py), so it carries the needs rebase label. CONTRIBUTING.md asks authors to rebase their branch on main; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7243471828 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1488#issuecomment-7243471828). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T18:01:39Z. --- Hi @kett1m, thanks for this pull request. It currently conflicts with `main` (conflicting file(s): `tests/test_x64_recomp.py`), so it carries the `needs rebase` label. CONTRIBUTING.md asks authors to rebase their branch on `main`; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here. AI-assisted (Claude Code, Claude Opus 5.5).
zmasi commented 2026-11-28 22:49:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T22:49:40Z.


#1488 | head 6cace7d7c3 (merged cleanly with main adfb3821a2) | python -I tests/test_x64_recomp.py -v + python -I tests/test_recomp_census.py + python -I tests/test_docs_links.py + python -I tests/test_docs_repo_paths.py | red on main: FAILED (failures=1, skipped=32) (AssertionError: Tuples differ: ('in', 1) != ('in', 2) — opcodes 0xE4..0xE7 decoded as 1-byte sys instead of consuming their imm8 port byte) | green on PR+main: 46 ran, OK (skipped=32) (test_x64_recomp.py), 11 ran, OK (test_recomp_census.py), 17 ran, OK (test_docs_links.py), and 5 ran, OK (test_docs_repo_paths.py) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yes

Audited 6cace7d7c3 (tools/x64_recomp.py, tests/test_x64_recomp.py, and docs/mobile.md) on Windows 11, confirming 0xE4..0xE7 decode as 2-byte Ab Ib / Av Ib / Ib Ab / Ib Av immediate-port forms while 0xEC..0xEF remain 1-byte DX-port forms. Also verified tests/test_docs_cli_flags.py, tests/test_docs_encoding.py, tests/test_ci_registration.py, and scripts/check_no_game_data.py.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7247010611 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1488#issuecomment-7247010611). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T22:49:40Z. --- #1488 | head 6cace7d7c3dbf074546e79078f3f597a9a3132ce (merged cleanly with main adfb3821a2) | `python -I tests/test_x64_recomp.py -v` + `python -I tests/test_recomp_census.py` + `python -I tests/test_docs_links.py` + `python -I tests/test_docs_repo_paths.py` | red on main: `FAILED (failures=1, skipped=32)` (`AssertionError: Tuples differ: ('in', 1) != ('in', 2)` — opcodes `0xE4..0xE7` decoded as 1-byte `sys` instead of consuming their `imm8` port byte) | green on PR+main: `46 ran, OK (skipped=32)` (`test_x64_recomp.py`), `11 ran, OK` (`test_recomp_census.py`), `17 ran, OK` (`test_docs_links.py`), and `5 ran, OK` (`test_docs_repo_paths.py`) | Windows 11 (`10.0.26200.9974`), Python 3.12.10 | AI-assisted: yes Audited `6cace7d7c3` (`tools/x64_recomp.py`, `tests/test_x64_recomp.py`, and `docs/mobile.md`) on Windows 11, confirming `0xE4..0xE7` decode as 2-byte `Ab Ib` / `Av Ib` / `Ib Ab` / `Ib Av` immediate-port forms while `0xEC..0xEF` remain 1-byte DX-port forms. Also verified `tests/test_docs_cli_flags.py`, `tests/test_docs_encoding.py`, `tests/test_ci_registration.py`, and `scripts/check_no_game_data.py`.
TheGeogeo commented 2026-11-29 00:17:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T00:17:24Z.


Tested 6cace7d7c merged (no commit) with main 829530dbd: Python 3.12.4, Windows 11 10.0.26300, CPU only. check_no_game_data.py is clean.

  • Green: tests/test_x64_recomp.py, 46 tests pass (32 skipped: qemu-system-aarch64 not installed).
  • Red: with tools/x64_recomp.py back to main, 1 failure (('in', 1) != ('in', 2)).
  • Merge order: this PR conflicts with #1485 in tests/test_x64_recomp.py (git merge-tree), so the second to land needs a rebase.

No blocker from my side.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248008749 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1488#issuecomment-7248008749). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T00:17:24Z. --- Tested `6cace7d7c` merged (no commit) with `main` `829530dbd`: Python 3.12.4, Windows 11 10.0.26300, CPU only. `check_no_game_data.py` is clean. - Green: `tests/test_x64_recomp.py`, 46 tests pass (32 skipped: `qemu-system-aarch64 not installed`). - Red: with `tools/x64_recomp.py` back to `main`, 1 failure (`('in', 1) != ('in', 2)`). - Merge order: this PR conflicts with #1485 in `tests/test_x64_recomp.py` (`git merge-tree`), so the second to land needs a rebase. No blocker from my side. AI-assisted (Claude Code).
TheGeogeo commented 2026-11-29 11:51:58 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T11:51:58Z.


Tested green here earlier on this same head (see my comment above). Two things before a merge: your claim in the coordination issue #2570 is missing, and this PR conflicts with #1485 in tests/test_x64_recomp.py, so whichever lands second needs a rebase.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7255402906 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1488#issuecomment-7255402906). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T11:51:58Z. --- Tested green here earlier on this same head (see my comment above). Two things before a merge: your claim in the coordination issue #2570 is missing, and this PR conflicts with #1485 in `tests/test_x64_recomp.py`, so whichever lands second needs a rebase. AI-assisted (Claude Code).
TheGeogeo commented 2026-11-29 14:18:03 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T14:18:03Z.


Ready for testing: merges cleanly with main 3535eb5c4. Not in main yet: git cherry finds 1 commit(s) not there, and 1 of the 26 lines it adds are already present. No duplicate found: its claim X64-RECOMP-IN-IMM8 appears in no other open pull request and in no main commit.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257195921 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1488#issuecomment-7257195921). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T14:18:03Z. --- Ready for testing: merges cleanly with `main` `3535eb5c4`. Not in `main` yet: `git cherry` finds 1 commit(s) not there, and 1 of the 26 lines it adds are already present. No duplicate found: its claim `X64-RECOMP-IN-IMM8` appears in no other open pull request and in no `main` commit. AI-assisted (Claude Code).
enlight3d commented 2026-11-29 15:20:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T15:20:55Z.


RUN of #1488 (red/green, python -I, no build, no game, no GPU)

Heads tested: PR head 6cace7d7c3db, origin/main bd643e46e784; merged = main + PR head, git merge --no-ff, local only (merged cleanly, merge commit 1abe3635b408).

Commands, one process each, from the worktree root:
python -I tests/test_x64_recomp.py -v
Related (every test file that imports tools/x64_recomp.py, tools/bcpack_tool.py or tools/recomp_census.py, 17 files): tests/test_x64_recomp.py, test_x64_recomp_*.py (14 files), test_recomp_census.py, test_bcpack_tool.py.

  • Red (main's tools/x64_recomp.py with the PR's tests; no new API, so this is a behavioural red, not a build failure): FAILED (failures=1), test_in_out_immediate_port_consumes_imm8: AssertionError: Tuples differ: ('in', 1) != ('in', 2). On main E4 3D decodes as a one-byte in; with the PR it is two bytes with the immediate operand.
  • Green at PR head: test_x64_recomp.py Ran 46, OK (skipped=32); the new test runs (not skipped). All 17 related files exit 0.
  • Green merged into main: test_x64_recomp.py Ran 48 (main added two), OK (skipped=34); all 17 related files exit 0. Nothing fails merged that passes on main.
  • The skips are the qemu exec tests (qemu-system-aarch64 not installed on this machine); the changed decode test is a pure decode test and ran. The retail-image differential quoted in the docs paragraph cannot be re-checked here (no game data in this test); the red/green covers the decoder change only.

Machine: NVIDIA GeForce RTX 3090 (not used), Windows 11 Pro 10.0.26300, CPython 3.13.12.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7258017543 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1488#issuecomment-7258017543). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-29T15:20:55Z. --- RUN of #1488 (red/green, `python -I`, no build, no game, no GPU) Heads tested: PR head `6cace7d7c3db`, origin/main `bd643e46e784`; merged = main + PR head, `git merge --no-ff`, local only (merged cleanly, merge commit `1abe3635b408`). Commands, one process each, from the worktree root: `python -I tests/test_x64_recomp.py -v` Related (every test file that imports `tools/x64_recomp.py`, `tools/bcpack_tool.py` or `tools/recomp_census.py`, 17 files): `tests/test_x64_recomp.py`, `test_x64_recomp_*.py` (14 files), `test_recomp_census.py`, `test_bcpack_tool.py`. - Red (main's `tools/x64_recomp.py` with the PR's tests; no new API, so this is a behavioural red, not a build failure): `FAILED (failures=1)`, `test_in_out_immediate_port_consumes_imm8`: `AssertionError: Tuples differ: ('in', 1) != ('in', 2)`. On main `E4 3D` decodes as a one-byte `in`; with the PR it is two bytes with the immediate operand. - Green at PR head: `test_x64_recomp.py` Ran 46, OK (skipped=32); the new test runs (not skipped). All 17 related files exit 0. - Green merged into main: `test_x64_recomp.py` Ran 48 (main added two), OK (skipped=34); all 17 related files exit 0. Nothing fails merged that passes on main. - The skips are the qemu exec tests (`qemu-system-aarch64 not installed` on this machine); the changed decode test is a pure decode test and ran. The retail-image differential quoted in the docs paragraph cannot be re-checked here (no game data in this test); the red/green covers the decoder change only. Machine: NVIDIA GeForce RTX 3090 (not used), Windows 11 Pro 10.0.26300, CPython 3.13.12.
OreoFR commented 2026-11-29 18:22:08 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T18:22:08Z.


Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, qemu-system-aarch64 11.1.3 on PATH, main 4755667f5, PR head 6cace7d7c : red 1 failure / green 48 OK

python3.12 -I tests/test_x64_recomp.py:

  • Red: 47/48, 1 failure: test_in_out_immediate_port_consumes_imm8. Green: 48/48 OK.
  • Merge: clean (git merge-tree). main changed tests/test_x64_recomp.py (+36) and tools/x64_recomp.py since the PR base 30fc2d68c, so red = the merged test file against main's code.
  • The exec tests run here (qemu present): 0 skipped on red and green (another run skipped 32 for lack of qemu).
  • Neighbours: the 17 other tests/test_x64_recomp_*.py give identical results per file on main and on the merge (14 of them already fail on main under qemu because of run_kernel vs run_result, see the finding in #2570).
  • Note: this PR and the other PR (#1485 / #1488) conflict with each other in tests/test_x64_recomp.py / tools/x64_recomp.py; whichever lands second needs a rebase. It does not force a rebase of #2566.
  • Review: tiguan26 APPROVED an older commit (2f44dc486), not this head.
  • Diff: E4/E5 become "Ab Ib"/"Av Ib" and E6/E7 "Ib Ab"/"Ib Av", so the imm8 port byte is consumed (correct); the DX forms (EC–EF) stay 1 byte; in/out keep kind "sys" via the decoder's final else, so translation is unchanged.
  • For a maintainer: the added docs/mobile.md text cites an objdump diff on the retail image's .text (RVA, instruction counts). Worth a check against the "no game data" rule; I did not use any game file.

Verdict: READY (code); see the docs note above.

AI-assisted: Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7260426589 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1488#issuecomment-7260426589). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T18:22:08Z. --- Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, qemu-system-aarch64 11.1.3 on PATH, main 4755667f5, PR head 6cace7d7c : red 1 failure / green 48 OK `python3.12 -I tests/test_x64_recomp.py`: - **Red**: 47/48, 1 failure: `test_in_out_immediate_port_consumes_imm8`. **Green**: 48/48 OK. - Merge: clean (`git merge-tree`). main changed `tests/test_x64_recomp.py` (+36) and `tools/x64_recomp.py` since the PR base 30fc2d68c, so red = the merged test file against main's code. - The exec tests run here (qemu present): **0 skipped** on red and green (another run skipped 32 for lack of qemu). - Neighbours: the 17 other `tests/test_x64_recomp_*.py` give identical results per file on main and on the merge (14 of them already fail on main under qemu because of `run_kernel` vs `run_result`, see the finding in #2570). - Note: this PR and the other PR (#1485 / #1488) conflict with each other in `tests/test_x64_recomp.py` / `tools/x64_recomp.py`; whichever lands second needs a rebase. It does not force a rebase of #2566. - Review: tiguan26 APPROVED an older commit (2f44dc486), not this head. - Diff: E4/E5 become "Ab Ib"/"Av Ib" and E6/E7 "Ib Ab"/"Ib Av", so the imm8 port byte is consumed (correct); the DX forms (EC–EF) stay 1 byte; in/out keep kind "sys" via the decoder's final `else`, so translation is unchanged. - For a maintainer: the added docs/mobile.md text cites an `objdump` diff on the retail image's `.text` (RVA, instruction counts). Worth a check against the "no game data" rule; I did not use any game file. **Verdict: READY** (code); see the docs note above. AI-assisted: Claude Code
OreoFR commented 2026-11-29 20:06:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T20:06:48Z.


"No game data" review by OreoFR (requested for maintainers), PR head b144b06a2, merged locally on main 720bd3b4e. Note: the head moved since my earlier verification (6cace7d7c), so that verdict is stale.

  • scripts/check_no_game_data.py on the merge: rc 0; the no-game-data.yml extension filter: 0 files. The code (tools/x64_recomp.py, E4–E7) and the test fixtures (tests/test_x64_recomp.py:175, :178, hand-written standard x86 encodings) are synthetic.
  • docs/mobile.md (PR-side line numbers) cites the retail image:
    • line 40: two RVAs in the retail image (plus aggregate instruction counts of its .text, which are fine);
    • lines 44–45: two instructions disassembled from the retail file at those RVAs (i.e. bytes of the executable);
    • line 44: a REA proof identifier (SHA-256 style; a similar format already exists on main at line 80 of the same file).

Review: please remove the RVAs and the two disassembled instructions (docs/mobile.md:40, 44–45), keeping only "two sites" and the counts; the REA proof identifier is for a maintainer to decide. I am not quoting the values here on purpose.

AI-assisted: Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7261816473 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1488#issuecomment-7261816473). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T20:06:48Z. --- "No game data" review by OreoFR (requested for maintainers), PR head b144b06a2, merged locally on main 720bd3b4e. Note: the head moved since my earlier verification (6cace7d7c), so that verdict is stale. - `scripts/check_no_game_data.py` on the merge: rc 0; the `no-game-data.yml` extension filter: 0 files. The code (`tools/x64_recomp.py`, E4–E7) and the test fixtures (`tests/test_x64_recomp.py:175`, `:178`, hand-written standard x86 encodings) are synthetic. - **`docs/mobile.md`** (PR-side line numbers) cites the retail image: - line 40: two RVAs in the retail image (plus aggregate instruction counts of its `.text`, which are fine); - lines 44–45: two instructions disassembled from the retail file at those RVAs (i.e. bytes of the executable); - line 44: a REA proof identifier (SHA-256 style; a similar format already exists on main at line 80 of the same file). **Review: please remove** the RVAs and the two disassembled instructions (docs/mobile.md:40, 44–45), keeping only "two sites" and the counts; the REA proof identifier is for a maintainer to decide. I am not quoting the values here on purpose. AI-assisted: Claude Code
MoonEyes commented 2026-11-29 20:40:06 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T20:40:06Z.


Maintainer decision: the tools/x64_recomp.py change and its test look fine, but this cannot merge as it is.

docs/mobile.md (lines 40 and 44-45 on the current head) quotes addresses from the retail executable and two instructions disassembled from it. That is game data under the repository's first hard rule (AGENTS.md: no game data in commits, including quotes of it). Please remove those lines; describing the encoding rule itself (the imm8 byte of in/out) without values from the retail image is fine.

AI-assisted (Claude Code), posted for MoonEyes.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7262262881 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1488#issuecomment-7262262881). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-29T20:40:06Z. --- Maintainer decision: the `tools/x64_recomp.py` change and its test look fine, but this cannot merge as it is. `docs/mobile.md` (lines 40 and 44-45 on the current head) quotes addresses from the retail executable and two instructions disassembled from it. That is game data under the repository's first hard rule (AGENTS.md: no game data in commits, including quotes of it). Please remove those lines; describing the encoding rule itself (the `imm8` byte of `in`/`out`) without values from the retail image is fine. AI-assisted (Claude Code), posted for MoonEyes.
kett1m commented 2026-11-29 20:56:08 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kett1m on 2026-11-29T20:56:08Z.


Fixed the doc quotes MoonEyes flagged (861ca5f2). The paragraph now describes the imm8-byte rule itself: the encoding rule, the two-line objdump comparison and the counts stay, but the retail addresses (0x55f2ed4/0x564652c) and the two disassembled instructions are gone. Docs tests pass; check_no_game_data.py clean.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7262472901 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1488#issuecomment-7262472901). Originally posted by [kett1m](https://github.com/kett1m) on 2026-11-29T20:56:08Z. --- Fixed the doc quotes MoonEyes flagged (861ca5f2). The paragraph now describes the imm8-byte rule itself: the encoding rule, the two-line `objdump` comparison and the counts stay, but the retail addresses (`0x55f2ed4`/`0x564652c`) and the two disassembled instructions are gone. Docs tests pass; `check_no_game_data.py` clean.
aslan2142 commented 2026-12-01 11:42:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:42:35Z.

Review: APPROVED


Reviewed the diff against main: tools/x64_recomp.py:150 cleanly updates 0xE4..0xE7 to consume their imm8 port operand (Ab Ib/Av Ib/Ib Ab/Ib Av), keeping 0xEC..0xEF as 1-byte sys, with unit tests in tests/test_x64_recomp.py and notes in docs/mobile.md. Clean-room verified. Approving; please merge/rebase current main for a fresh green CI run before merge.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130531675 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1488#pullrequestreview-6130531675). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:42:35Z. **Review:** APPROVED --- Reviewed the diff against `main`: `tools/x64_recomp.py:150` cleanly updates `0xE4..0xE7` to consume their `imm8` port operand (`Ab Ib`/`Av Ib`/`Ib Ab`/`Ib Av`), keeping `0xEC..0xEF` as 1-byte `sys`, with unit tests in `tests/test_x64_recomp.py` and notes in `docs/mobile.md`. Clean-room verified. Approving; please merge/rebase current `main` for a fresh green CI run before merge. *(AI-assisted review.)*
MoonEyes commented 2026-12-02 11:46:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T11:46:26Z.


For information: this pull request is carried in #3118, which merges your head 861ca5f2a8847b92dc6d2092a650d01bbbd958c9 (your commits are kept) into current main and resolves the conflict in tests/test_x64_recomp.py. If you rebase this one yourself, say so and #3118 can be closed.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7344386565 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1488#issuecomment-7344386565). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T11:46:26Z. --- For information: this pull request is carried in #3118, which merges your head `861ca5f2a8847b92dc6d2092a650d01bbbd958c9` (your commits are kept) into current `main` and resolves the conflict in tests/test_x64_recomp.py. If you rebase this one yourself, say so and #3118 can be closed. AI-assisted (Claude Code).
MoonEyes commented 2026-12-02 17:13:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T17:13:24Z.


Closing: this pull request no longer applies to current main (merge conflict in tests/test_x64_recomp.py). Your work is not lost: it is carried in #3118 together with #1485, #1488 and #1246, which keeps your commits and resolves the conflict on current main.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7353067769 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1488#issuecomment-7353067769). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T17:13:24Z. --- Closing: this pull request no longer applies to current `main` (merge conflict in `tests/test_x64_recomp.py`). Your work is not lost: it is carried in #3118 together with #1485, #1488 and #1246, which keeps your commits and resolves the conflict on current `main`. AI-assisted (Claude Code).

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!1488
No description provided.