x64_recomp: the 0F SIMD ranges skip eight ModRM opcodes (X64-RECOMP-SIMD-TABLE) #1485

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

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


Claimed in the coordination issue as: X64-RECOMP-SIMD-TABLE

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

The 0F SIMD opcode list in tools/x64_recomp.py is generated from opcode ranges, and the
ranges left out eight opcodes that take a ModRM byte:

  • 7C / 7D, HADDPD/HADDPS and HSUBPD/HSUBPS (66 and F2 forms)
  • D0, ADDSUBPD/ADDSUBPS
  • D7, PMOVMSKB (66 form; the MMX form has no prefix)
  • E6, CVTDQ2PD, CVTTPD2DQ, CVTPD2DQ
  • E7, MOVNTDQ
  • F0, LDDQU
  • F7, MASKMOVDQU

With no table entry each decoded as the unknown op0f_XX of its two opcode bytes, so the byte
after them was read as the next instruction and the rest of the function was decoded from the
wrong offset.

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; .pdata VMA 0x14abcf000, file 0x6e03a00.

  1. Walking every .pdata function (299,257) with the unfixed decoder, 6 functions stop on one of
    these opcodes. The first unknown in each is op0f_7d (RVA 0x17e1060), op0f_e6
    (0x277a710, 0x3137ab0, 0x562bc40), op0f_e7 (0x3081860) and op0f_f7 (0x3e2aad0).
    With the fix they decode 852 instructions further and 3 reach the end of the function with no
    unknown left.
  2. 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). It drops 6 length mismatches, 4 F3 0F E6 (CVTDQ2PD, RVAs 0x562ad45,
    0x562ad6e, 0x562e320, 0x562e395) and 2 66 REX.W 0F D7 (PMOVMSKB, RVAs 0x564df78,
    0x565191f), and adds none. The totals are 52,638 before and 52,632 after.

Enumerating the 0F opcodes against the set of legacy SSE/MMX instructions that take a ModRM
byte leaves none out after the change; movnti (0F C3) is already its own entry.

Test

tests/test_x64_recomp.py::DecodeTests::test_simd_opcodes_outside_the_ranges_carry_modrm covers
the eight opcodes in the register and memory forms. Against the unfixed decoder the first case
(f3 0f e6 c9) decodes as unknown; with the fix each keeps its ModRM/SIB/displacement length.

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.

docs/mobile.md records both counts and the evidence ID. The differential is local analysis of
the shipped file; nothing was executed. 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:5483327789 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1485). Originally posted by [kett1m](https://github.com/kett1m) on 2026-11-25T01:27:27Z. --- Claimed in the coordination issue as: X64-RECOMP-SIMD-TABLE Depends on: #1488 (conflicts with in `tests/test_x64_recomp.py`; whichever lands second needs a rebase) The `0F` SIMD opcode list in `tools/x64_recomp.py` is generated from opcode ranges, and the ranges left out eight opcodes that take a ModRM byte: - `7C` / `7D`, HADDPD/HADDPS and HSUBPD/HSUBPS (`66` and `F2` forms) - `D0`, ADDSUBPD/ADDSUBPS - `D7`, PMOVMSKB (`66` form; the MMX form has no prefix) - `E6`, CVTDQ2PD, CVTTPD2DQ, CVTPD2DQ - `E7`, MOVNTDQ - `F0`, LDDQU - `F7`, MASKMOVDQU With no table entry each decoded as the unknown `op0f_XX` of its two opcode bytes, so the byte after them was read as the next instruction and the rest of the function was decoded from the wrong offset. ## 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`; `.pdata` VMA `0x14abcf000`, file `0x6e03a00`. 1. Walking every `.pdata` function (299,257) with the unfixed decoder, 6 functions stop on one of these opcodes. The first unknown in each is `op0f_7d` (RVA `0x17e1060`), `op0f_e6` (`0x277a710`, `0x3137ab0`, `0x562bc40`), `op0f_e7` (`0x3081860`) and `op0f_f7` (`0x3e2aad0`). With the fix they decode 852 instructions further and 3 reach the end of the function with no unknown left. 2. 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). It drops 6 length mismatches, 4 `F3 0F E6` (CVTDQ2PD, RVAs `0x562ad45`, `0x562ad6e`, `0x562e320`, `0x562e395`) and 2 `66 REX.W 0F D7` (PMOVMSKB, RVAs `0x564df78`, `0x565191f`), and adds none. The totals are 52,638 before and 52,632 after. Enumerating the `0F` opcodes against the set of legacy SSE/MMX instructions that take a ModRM byte leaves none out after the change; `movnti` (`0F C3`) is already its own entry. ## Test `tests/test_x64_recomp.py::DecodeTests::test_simd_opcodes_outside_the_ranges_carry_modrm` covers the eight opcodes in the register and memory forms. Against the unfixed decoder the first case (`f3 0f e6 c9`) decodes as `unknown`; with the fix each keeps its ModRM/SIB/displacement length. `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. `docs/mobile.md` records both counts and the evidence ID. The differential is local analysis of the shipped file; nothing was executed. 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:05 +00:00 (Migrated from github.com)

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


[KEEP]

  • The table fix looks correct and scoped: _OF_SIMD_NORM in tools/x64_recomp.py gains 7C/7D, D0, D7, E6, E7, F0 and F7, with a 12-case decode test and a measured differential recorded in docs/mobile.md.
  • CI has not finished: change-scope and no-game-data are still QUEUED, so there is no green result yet.
  • Likely textual conflicts with #1488 and #1483 (same test insertion point in tests/test_x64_recomp.py, same docs/mobile.md). #1428 also edits tools/x64_recomp.py. A maintainer should pick a merge order, then rebase the rest.
  • Suggest merging once CI is green and the stack is ordered.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7152066329 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1485#issuecomment-7152066329). Originally posted by [ytsodacan](https://github.com/ytsodacan) on 2026-11-25T03:36:05Z. --- **[KEEP]** - The table fix looks correct and scoped: `_OF_SIMD_NORM` in `tools/x64_recomp.py` gains 7C/7D, D0, D7, E6, E7, F0 and F7, with a 12-case decode test and a measured differential recorded in `docs/mobile.md`. - CI has not finished: `change-scope` and `no-game-data` are still QUEUED, so there is no green result yet. - Likely textual conflicts with #1488 and #1483 (same test insertion point in `tests/test_x64_recomp.py`, same `docs/mobile.md`). #1428 also edits `tools/x64_recomp.py`. A maintainer should pick a merge order, then rebase the rest. - Suggest merging once CI is green and the stack is ordered.
tiguan26 commented 2026-11-25 03:53:26 +00:00 (Migrated from github.com)

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

Review: APPROVED


Approving. Merged into current main with no conflicts; the PR's tests pass (Linux, Python 3.13). The eight added opcodes are all ModRM forms in the 0F map: 7C/7D haddp*/hsubp*, D0 addsubp*, D7 pmovmskb, E6 cvt*dq2pd/pd2dq, E7 movntdq/movntq, F0 lddqu, F7 maskmovdqu/maskmovq.

AI-assisted (Claude).

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6051621342 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1485#pullrequestreview-6051621342). Originally posted by [tiguan26](https://github.com/tiguan26) on 2026-11-25T03:53:26Z. **Review:** APPROVED --- Approving. Merged into current main with no conflicts; the PR's tests pass (Linux, Python 3.13). The eight added opcodes are all ModRM forms in the 0F map: 7C/7D haddp*/hsubp*, D0 addsubp*, D7 pmovmskb, E6 cvt*dq2pd/pd2dq, E7 movntdq/movntq, F0 lddqu, F7 maskmovdqu/maskmovq. AI-assisted (Claude).
kevincommits commented 2026-11-25 22:04:31 +00:00 (Migrated from github.com)

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


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 d3b8251bc into the branch locally (635 commits behind, no conflicts).

  • main alone decodes f3 0f e6 c9 as unknown op0f_e6, size 3, and 66 48 0f d7 d0 as unknown op0f_d7, size 4. This branch gives simd at sizes 4 and 5.
  • 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:7175902521 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1485#issuecomment-7175902521). Originally posted by [kevincommits](https://github.com/kevincommits) on 2026-11-25T22:04:31Z. --- 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 `d3b8251bc` into the branch locally (635 commits behind, no conflicts). - `main` alone decodes `f3 0f e6 c9` as unknown `op0f_e6`, size 3, and `66 48 0f d7 d0` as unknown `op0f_d7`, size 4. This branch gives `simd` at sizes 4 and 5. - `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:43 +00:00 (Migrated from github.com)

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


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:7243472662 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1485#issuecomment-7243472662). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T18:01:43Z. --- 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 23:06:23 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T23:06:23Z.


#1485 | head f285f09b90 (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: True is not false : f3 0f e6 c9 — _OF_SIMD_NORM omitted 0x7C/0x7D, 0xD0, 0xD7, 0xE6, 0xE7, 0xF0, and 0xF7, decoding them as 2-byte unknown op0f_XX without their ModRM 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 f285f09b90 (tools/x64_recomp.py, tests/test_x64_recomp.py, and docs/mobile.md) on Windows 11, confirming all 12 SSE/MMX ModRM encodings across 7C/7D, D0, D7, E6, E7, F0, and F7 decode with unknown == False, kind == "simd", and exact byte lengths (3..5 bytes). 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:7247203229 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1485#issuecomment-7247203229). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T23:06:23Z. --- #1485 | head f285f09b9052854fcdd4ae88553c826c13a2decc (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: True is not false : f3 0f e6 c9` — `_OF_SIMD_NORM` omitted `0x7C`/`0x7D`, `0xD0`, `0xD7`, `0xE6`, `0xE7`, `0xF0`, and `0xF7`, decoding them as 2-byte unknown `op0f_XX` without their ModRM 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 `f285f09b90` (`tools/x64_recomp.py`, `tests/test_x64_recomp.py`, and `docs/mobile.md`) on Windows 11, confirming all 12 SSE/MMX ModRM encodings across `7C`/`7D`, `D0`, `D7`, `E6`, `E7`, `F0`, and `F7` decode with `unknown == False`, `kind == "simd"`, and exact byte lengths (`3..5` bytes). 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:27 +00:00 (Migrated from github.com)

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


Tested f285f09b9 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 (f3 0f e6 c9 is still taken as a ModRM opcode).
  • Merge order: this PR conflicts with #1488 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:7248009483 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1485#issuecomment-7248009483). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T00:17:27Z. --- Tested `f285f09b9` 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 (`f3 0f e6 c9` is still taken as a ModRM opcode). - Merge order: this PR conflicts with #1488 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:59 +00:00 (Migrated from github.com)

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


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 #1488 in tests/test_x64_recomp.py, so whichever lands second needs a rebase.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7255403229 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1485#issuecomment-7255403229). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T11:51:59Z. --- 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 #1488 in `tests/test_x64_recomp.py`, so whichever lands second needs a rebase. AI-assisted (Claude Code).
TheGeogeo commented 2026-11-29 14:18:06 +00:00 (Migrated from github.com)

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


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

AI-assisted (Claude Code).

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

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


RUN comment, PR #1485 (x64_recomp: the 0F SIMD ranges skip eight ModRM opcodes)

Heads: PR f285f09b9, main 91bab934d (local merge of the PR into it, not pushed).
Kind: Python (tools/x64_recomp.py) + tests/test_x64_recomp.py + docs/mobile.md. Against current main the PR changes these 3 files (the PR's file list on GitHub also shows bcpack_tool files, which are already in main through #1422).

Commands (repo root):
python -I tests/test_x64_recomp.py
every tests/test_x64_recomp*.py, one process each (15 at the PR head, 18 on main)
the 14 docs test files (tests/test_docs_*.py, tests/test_design_contract_rows.py)

RED (behavioural, no new API): tools/x64_recomp.py and docs/mobile.md put back to the merge-base version, test kept.
test_x64_recomp.py: 1 failure, test_simd_opcodes_outside_the_ranges_carry_modrm ("True is not false : f3 0f e6 c9", i.e. decoded as unknown).
GREEN at the PR head: test_x64_recomp 46 tests OK, the new test runs (not skipped); the other 14 test_x64_recomp_* files pass; docs tests pass.
GREEN merged into main: test_x64_recomp 48 tests OK, new test runs; all 18 test_x64_recomp*.py pass; docs tests pass.
Note: most other tests in these files are skipped on this machine (qemu-system-aarch64 not installed), before and after the PR. The PR's numbers over the retail image (299,257 functions, objdump walk) cannot be reproduced here (no package).

Machine: Windows 11 Pro, RTX 3090 24 GB, NVIDIA 621.40, Python 3.13.12 (uv build), run with python -I, one process per test file.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7258119364 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1485#issuecomment-7258119364). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-29T15:28:39Z. --- RUN comment, PR #1485 (x64_recomp: the 0F SIMD ranges skip eight ModRM opcodes) Heads: PR f285f09b9, main 91bab934d (local merge of the PR into it, not pushed). Kind: Python (tools/x64_recomp.py) + tests/test_x64_recomp.py + docs/mobile.md. Against current main the PR changes these 3 files (the PR's file list on GitHub also shows bcpack_tool files, which are already in main through #1422). Commands (repo root): python -I tests/test_x64_recomp.py every tests/test_x64_recomp*.py, one process each (15 at the PR head, 18 on main) the 14 docs test files (tests/test_docs_*.py, tests/test_design_contract_rows.py) RED (behavioural, no new API): tools/x64_recomp.py and docs/mobile.md put back to the merge-base version, test kept. test_x64_recomp.py: 1 failure, test_simd_opcodes_outside_the_ranges_carry_modrm ("True is not false : f3 0f e6 c9", i.e. decoded as unknown). GREEN at the PR head: test_x64_recomp 46 tests OK, the new test runs (not skipped); the other 14 test_x64_recomp_* files pass; docs tests pass. GREEN merged into main: test_x64_recomp 48 tests OK, new test runs; all 18 test_x64_recomp*.py pass; docs tests pass. Note: most other tests in these files are skipped on this machine (qemu-system-aarch64 not installed), before and after the PR. The PR's numbers over the retail image (299,257 functions, objdump walk) cannot be reproduced here (no package). Machine: Windows 11 Pro, RTX 3090 24 GB, NVIDIA 621.40, Python 3.13.12 (uv build), run with `python -I`, one process per test file.
OreoFR commented 2026-11-29 18:22:06 +00:00 (Migrated from github.com)

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


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 f285f09b9 : red 1 failure / green 48 OK

python3.12 -I tests/test_x64_recomp.py:

  • Red: 47/48, 1 failure: test_simd_opcodes_outside_the_ranges_carry_modrm. 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 (d6e8cbda6), not this head.
  • Diff: adds 0F 7C/7D (haddp/hsubp), D0 (addsubp), D7 (pmovmskb), E6 (cvt), E7 (movntdq), F0 (lddqu), F7 (maskmovdqu) as "V W" forms with ModRM; correct (ModRM, no imm8). Plus a paragraph in docs/mobile.md. No game data.

Verdict: READY

AI-assisted: Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7260426198 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1485#issuecomment-7260426198). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T18:22:06Z. --- 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 f285f09b9 : red 1 failure / green 48 OK `python3.12 -I tests/test_x64_recomp.py`: - **Red**: 47/48, 1 failure: `test_simd_opcodes_outside_the_ranges_carry_modrm`. **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 (d6e8cbda6), not this head. - Diff: adds 0F 7C/7D (haddp/hsubp), D0 (addsubp), D7 (pmovmskb), E6 (cvt), E7 (movntdq), F0 (lddqu), F7 (maskmovdqu) as "V W" forms with ModRM; correct (ModRM, no imm8). Plus a paragraph in docs/mobile.md. No game data. **Verdict: READY** AI-assisted: Claude Code
aslan2142 commented 2026-12-01 11:42:10 +00:00 (Migrated from github.com)

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

Review: APPROVED


Reviewed the diff against main: tools/x64_recomp.py:208-211 cleanly adds the eight missing 0F SIMD ModRM opcodes (7C, 7D, D0, D7, E6, E7, F0, F7), with 12 unit cases in tests/test_x64_recomp.py and documentation 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:6130524769 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1485#pullrequestreview-6130524769). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:42:10Z. **Review:** APPROVED --- Reviewed the diff against `main`: `tools/x64_recomp.py:208-211` cleanly adds the eight missing 0F SIMD ModRM opcodes (`7C`, `7D`, `D0`, `D7`, `E6`, `E7`, `F0`, `F7`), with 12 unit cases in `tests/test_x64_recomp.py` and documentation 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:49 +00:00 (Migrated from github.com)

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


For information: this pull request is carried in #3118, which merges your head 867ce542e24982567e098f679d9ffef1f5735101 (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:7344395232 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1485#issuecomment-7344395232). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T11:46:49Z. --- For information: this pull request is carried in #3118, which merges your head `867ce542e24982567e098f679d9ffef1f5735101` (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:18 +00:00 (Migrated from github.com)

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


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:7353065559 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1485#issuecomment-7353065559). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T17:13:18Z. --- 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!1485
No description provided.