x64_recomp: rcl and rcr rotate-through-carry emitters (X64-RECOMP-RCL-RCR) #1211

Merged
quietfold merged 1 commit from upstream-pr/1211 into main 2026-11-29 00:54:28 +00:00
quietfold commented 2026-11-24 20:20:18 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by quietfold on 2026-11-24T20:20:18Z.


Claimed in the coordination issue as: X64-RECOMP-RCL-RCR (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143389193)

What and why

Implements the rcl and rcr rotate-through-carry emitters called out in Next Step #2 of docs/mobile.md inside tools/x64_recomp.py (independent of #1174, #1202, and #1205, and conflict-free with all open x64_recomp PRs):

  • All operand widths and forms (_emit_rcl_rcr): supports 8/16/32/64-bit registers (including high-byte ah/ch/dh/bh), memory operands, immediate count 1 / imm8, and variable CL counts (including dst == rcx, e.g., rcl ecx, cl).
  • Exact x86-64 count reduction and no-op rule: masks count (& 0x3F for 64-bit, & 0x1F for 8/16/32-bit) and reduces modulo width + 1 (% 9 for 8-bit, % 17 for 16-bit) without clobbering NZCV so effective count 0 leaves both destination and all flags untouched.
  • Branchless shift-by-width-safe rotation: computes (orig >> 1) >> (width - c) (rcl) and (orig << 1) << (width - c) (rcr) so c = 1 and c = width never trigger arm64 shift-by-64 wraparound.
  • Exact flag contract: reads incoming CF from SUB_KIND (inverted arm C), ADD_KIND (arm C), ucomis*/comis* (lt), or materialized CTX_EFLAGS; writes outgoing CF without clobbering N/Z/V, and updates OF (V) when effective count is 1 (MSB(res) ^ new_CF for rcl, MSB(res) ^ MSB-1(res) for rcr).
  • Tests (tests/test_x64_recomp_rcl_rcr.py): covers translation of all 27 forms plus 4 end-to-end execution test suites exercising 8/16/32/64-bit imm/CL, mod-9/mod-17 wrap, zero-count no-op, multi-word shift chaining, sub borrow chaining, high-byte ah, memory operands, rcl ecx, cl, and count-1 OF.

Tested

  • Standalone on main: tests/test_x64_recomp_rcl_rcr.py, tests/test_ci_registration.py, tests/test_text_write_line_endings.py, compileall, make_game.py --help, check_no_game_data.py: all passed.
  • Exhaustive Python equivalence proof against reference (width + 1)-bit rotation across all 7,168 (width, value, cf, count) combinations: 100% match.
  • Native arm64 hardware execution on Apple M5 / macOS 27.2.1 (Python 3.14, cleanly 4-way merged with #1174, #1202, and #1205 in a scratch checkout): tests/test_x64_recomp_rcl_rcr.py 5/5 passed, tests/test_x64_recomp_bitops.py 9/9 passed, tests/test_x64_recomp_sse.py 16/16 passed, tests/test_x64_recomp.py 46/46 passed (76/76 total).
  • Verified zero conflicts (git apply --check) against open x64_recomp PRs #847, #950, #1120, #1121, #1174, #1202, and #1205.

GPUs tested: n/a (CPU x86-64 -> arm64 recompiler; tested natively on Apple M5 arm64, macOS 27.2.1)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5479677388 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1211). Originally posted by [quietfold](https://github.com/quietfold) on 2026-11-24T20:20:18Z. --- Claimed in the coordination issue as: X64-RECOMP-RCL-RCR (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143389193) ### What and why Implements the `rcl` and `rcr` rotate-through-carry emitters called out in Next Step #2 of `docs/mobile.md` inside `tools/x64_recomp.py` (independent of `#1174`, `#1202`, and `#1205`, and conflict-free with all open `x64_recomp` PRs): - **All operand widths and forms (`_emit_rcl_rcr`)**: supports 8/16/32/64-bit registers (including high-byte `ah`/`ch`/`dh`/`bh`), memory operands, immediate count `1` / `imm8`, and variable `CL` counts (including `dst == rcx`, e.g., `rcl ecx, cl`). - **Exact x86-64 count reduction and no-op rule**: masks count (`& 0x3F` for 64-bit, `& 0x1F` for 8/16/32-bit) and reduces modulo `width + 1` (`% 9` for 8-bit, `% 17` for 16-bit) without clobbering `NZCV` so effective count `0` leaves both destination and all flags untouched. - **Branchless shift-by-width-safe rotation**: computes `(orig >> 1) >> (width - c)` (`rcl`) and `(orig << 1) << (width - c)` (`rcr`) so `c = 1` and `c = width` never trigger arm64 shift-by-64 wraparound. - **Exact flag contract**: reads incoming `CF` from `SUB_KIND` (inverted arm `C`), `ADD_KIND` (arm `C`), `ucomis*`/`comis*` (`lt`), or materialized `CTX_EFLAGS`; writes outgoing `CF` without clobbering `N`/`Z`/`V`, and updates `OF` (`V`) when effective count is `1` (`MSB(res) ^ new_CF` for `rcl`, `MSB(res) ^ MSB-1(res)` for `rcr`). - **Tests (`tests/test_x64_recomp_rcl_rcr.py`)**: covers translation of all 27 forms plus 4 end-to-end execution test suites exercising 8/16/32/64-bit `imm`/`CL`, mod-9/mod-17 wrap, zero-count no-op, multi-word shift chaining, `sub` borrow chaining, high-byte `ah`, memory operands, `rcl ecx, cl`, and count-1 `OF`. ### Tested - Standalone on `main`: `tests/test_x64_recomp_rcl_rcr.py`, `tests/test_ci_registration.py`, `tests/test_text_write_line_endings.py`, `compileall`, `make_game.py --help`, `check_no_game_data.py`: all passed. - Exhaustive Python equivalence proof against reference `(width + 1)`-bit rotation across all 7,168 `(width, value, cf, count)` combinations: 100% match. - Native arm64 hardware execution on Apple M5 / macOS 27.2.1 (Python 3.14, cleanly 4-way merged with `#1174`, `#1202`, and `#1205` in a scratch checkout): `tests/test_x64_recomp_rcl_rcr.py` **5/5 passed**, `tests/test_x64_recomp_bitops.py` **9/9 passed**, `tests/test_x64_recomp_sse.py` **16/16 passed**, `tests/test_x64_recomp.py` **46/46 passed** (76/76 total). - Verified zero conflicts (`git apply --check`) against open `x64_recomp` PRs `#847`, `#950`, `#1120`, `#1121`, `#1174`, `#1202`, and `#1205`. GPUs tested: n/a (CPU x86-64 -> arm64 recompiler; tested natively on Apple M5 arm64, macOS 27.2.1) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed.
copilot-pull-request-reviewer[bot] commented 2026-11-24 20:20:28 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-24T20:20:28Z.

Review: COMMENTED


Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6046723128 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1211#pullrequestreview-6046723128). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-24T20:20:28Z. **Review:** COMMENTED --- Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
kevincommits commented 2026-11-25 23:38:03 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kevincommits on 2026-11-25T23:38:03Z.


Independent run with QEMU. Apple M5 Pro, macOS 27.2.1 (26B131), Python 3.14.2, QEMU 11.1.3 from Homebrew. I merged main at 33bd07cf8 into the branch locally (960 commits behind, no conflicts). Head tested: 621aaeefc.

The emitter matches a reference model in 640 of 656 cases, and the 16 that differ are a bug that is already on main, not one this adds.

  • python -I tests/test_x64_recomp_rcl_rcr.py: 5/5 under QEMU. This file calls x.run_result and gates on HAS_QEMU, so its exec tests really run. tests/test_x64_recomp.py 33/33, tests/test_recomp_census.py 11/11. Full standalone suite: 513 run, 509 pass; the 4 that fail are main's 4.

  • Beyond the file, I ran 656 generated cases under QEMU against a small Python model of rotate-through-carry: rcl and rcr; widths 8, 16, 32, 64; the D0/D1 (by 1), C0/C1 ib and D2/D3 (by cl) forms; counts 1, 3, 9, 17, 31, 33, 63; carry-in set by stc, clc, a borrowing cmp and a non-borrowing cmp; register and [rbx+rsi*1+8] destinations. Each case checks the full 64-bit result (so the untouched upper bits too) and the carry out.

  • 640 match. That covers the modulo-9 and modulo-17 counts, count == width, the 64-bit shifts by 63, carry-in taken from a cmp in borrow polarity, and the memory forms.

  • 16 differ, all the same shape: effective count 0 (rcl al, 9, rcl ax, 17, either form) directly after a cmp. The value is correctly left alone, but a following setc reads the carry inverted. shl/shr/sar/rol with a zero count do exactly the same on main today, so this is the existing behaviour of the flag analysis for a shift that writes no flags. I posted it with a reproducer as a finding in #1608. A fix there should cover these too.

Not tested: the OF result for count 1, and rcl/rcr feeding adc/sbb. No game files used. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7177836063 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1211#issuecomment-7177836063). Originally posted by [kevincommits](https://github.com/kevincommits) on 2026-11-25T23:38:03Z. --- Independent run with QEMU. Apple M5 Pro, macOS 27.2.1 (26B131), Python 3.14.2, QEMU 11.1.3 from Homebrew. I merged `main` at `33bd07cf8` into the branch locally (960 commits behind, no conflicts). Head tested: `621aaeefc`. **The emitter matches a reference model in 640 of 656 cases, and the 16 that differ are a bug that is already on `main`, not one this adds.** - `python -I tests/test_x64_recomp_rcl_rcr.py`: 5/5 under QEMU. This file calls `x.run_result` and gates on `HAS_QEMU`, so its exec tests really run. `tests/test_x64_recomp.py` 33/33, `tests/test_recomp_census.py` 11/11. Full standalone suite: 513 run, 509 pass; the 4 that fail are `main`'s 4. - Beyond the file, I ran 656 generated cases under QEMU against a small Python model of rotate-through-carry: `rcl` and `rcr`; widths 8, 16, 32, 64; the `D0/D1` (by 1), `C0/C1 ib` and `D2/D3` (by cl) forms; counts 1, 3, 9, 17, 31, 33, 63; carry-in set by `stc`, `clc`, a borrowing `cmp` and a non-borrowing `cmp`; register and `[rbx+rsi*1+8]` destinations. Each case checks the full 64-bit result (so the untouched upper bits too) and the carry out. - **640 match.** That covers the modulo-9 and modulo-17 counts, count == width, the 64-bit shifts by 63, carry-in taken from a `cmp` in borrow polarity, and the memory forms. - **16 differ, all the same shape:** effective count 0 (`rcl al, 9`, `rcl ax, 17`, either form) directly after a `cmp`. The value is correctly left alone, but a following `setc` reads the carry inverted. `shl`/`shr`/`sar`/`rol` with a zero count do exactly the same on `main` today, so this is the existing behaviour of the flag analysis for a shift that writes no flags. I posted it with a reproducer as a finding in #1608. A fix there should cover these too. Not tested: the OF result for count 1, and `rcl`/`rcr` feeding `adc`/`sbb`. No game files used. AI-assisted.
zmasi commented 2026-11-28 23:01:21 +00:00 (Migrated from github.com)

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


Native Windows 11 Verification & Flag-Liveness Review (621aaeefc1)

Diff-audited tools/x64_recomp.py (+122/-1) and tests/test_x64_recomp_rcl_rcr.py (+238/-0) and verified merged onto origin/main (adfb3821a2) on Windows 11 (10.0.26200, Python 3.12.10 with -I).

Test Execution Results

  • Red (origin/main adfb3821a2 with test_x64_recomp_rcl_rcr.py): FAILED (failures=1, skipped=4) (UnhandledInsn: rcl at 0x46000000: rcl).
  • Green (PR #1211 merged onto origin/main):
    • python -I tests/test_x64_recomp_rcl_rcr.py: Ran 5 tests in 0.001s — OK (skipped=4) (RclRcrTranslateTests translates all 26 rcl/rcr forms + ret with unhandled == []; RclRcrExecTests skipped on Windows x86-64 without qemu-system-aarch64).
    • python -I tests/test_x64_recomp.py: Ran 45 tests in 0.001s — OK (skipped=32).
    • scripts/check_no_game_data.py, tests/test_ci_registration.py (18/18), and tests/test_text_write_line_endings.py (3/3): OK.

Three Flag-Liveness / CTX_EFLAGS Issues Found in tools/x64_recomp.py

Inspecting the emitted ARM64 words from x64_recomp.translate_function(...) surfaced three edge cases in flag tracking/materialization that existing tests did not hit:

  1. FLAG_WRITERS["rcl"] / FLAG_WRITERS["rcr"] (line 63) still declares "C" instead of "CV" (breaks jo/jno/seto/cmovo after 1-bit rcl/rcr):

    • _emit_rcl_rcr emits _set_rc_of to set ARM V (OF) for count-1 rotates, and test_count1_overflow_flag tested OF via pushf (flags_r == "NZCVPA", which matched "C").
    • However, a direct V-only consumer (seto, jo, cmovo, where flags_r == "V") skips past rcl/rcr in _flag_analysis. Reproducer:
      # xor edx, edx; mov eax, 0x40000000; rcl eax, 1; seto dl; ret
      ft = x.translate_function(bytes.fromhex("31 d2 b8 00 00 00 40 d1 d0 0f 90 c2 c3"), 0x46000000)
      
      Here ft.arm_path[seto] resolves to xor (LOGIC_KIND, V=0), so seto dl compiles to movz w0, #0; b +2 (hardcoded dl = 0) even though rcl eax, 1 set OF = 1.
    • Note: For CL-variable or multi-bit immediate rcl/rcr, if "V" is added to FLAG_WRITERS, multi-bit immediate rotates (cval != 1) only write C (or OF is undefined per Intel SDM), whereas CL == 0 is already handled by _cond_flag_writer.
  2. Immediate cval = raw % (width + 1) == 0 (rcl al, 9, rcr ax, 17) returns early without normalizing SUB_KIND borrow polarity:

    • In _classify (lines 452-458), is_imm_zero checks (imm & mask) == 0 without % (width + 1), so rcl al, 9 (c0 d0 09) gets flags_w = "C" and becomes arm_path producer for a following jc/setb.
    • In _emit_rcl_rcr, rcl al, 9 executes cset w3, cc (reading inverted SUB_KIND borrow) and then returns at if cval == 0: return without calling self._set_cf(T3). Reproducer:
      # sub ebx, 2; rcl al, 9; setb dl; ret
      ft = x.translate_function(bytes.fromhex("83 eb 02 c0 d0 09 0f 92 c2 c3"), 0x46000000)
      
      sub leaves ARM C = 0 for borrow (CF = 1), rcl al, 9 leaves ARM C untouched, and setb dl (arm_path == rcl, not SUB_KIND) emits b.cs (0x54000002), inverting the carry! Either _classify should treat raw % (width + 1) == 0 for rcl/rcr as is_imm_zero = True (flags_w = flags_r = ""), or _emit_rcl_rcr should normalize ARM C before returning.
  3. self._maybe_mkflags(ins) (rt_mkflags) clobbers SF, ZF, PF, and AF in ctx.eflags:

    • Rotate instructions never modify SF, ZF, PF, or AF. Unlike rol/ror (lines 2621-2624, 2686-2689) and stc/clc (lines 2405-2411) — which patch CTX_EFLAGS in place with bfi — _emit_rcl_rcr calls self._maybe_mkflags(ins) (bl rt_mkflags), rebuilding the entire CTX_EFLAGS word from current ARM NZCV and stale CTX_RES/CTX_A/CTX_B (corrupting prior ZF/SF/PF/AF across basic blocks, popf, or CL-variable shifts). Patching EF_CF (bit 0) and, when c == 1, EF_OF (bit 11) directly into CTX_EFLAGS via bfi avoids touching the other flags.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7247144214 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1211#issuecomment-7247144214). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T23:01:21Z. --- ### Native Windows 11 Verification & Flag-Liveness Review (`621aaeefc1`) Diff-audited `tools/x64_recomp.py` (`+122/-1`) and `tests/test_x64_recomp_rcl_rcr.py` (`+238/-0`) and verified merged onto `origin/main` (`adfb3821a2`) on Windows 11 (`10.0.26200`, Python `3.12.10` with `-I`). #### Test Execution Results - **Red (`origin/main` `adfb3821a2` with `test_x64_recomp_rcl_rcr.py`)**: `FAILED (failures=1, skipped=4)` (`UnhandledInsn: rcl at 0x46000000: rcl`). - **Green (`PR #1211` merged onto `origin/main`)**: - `python -I tests/test_x64_recomp_rcl_rcr.py`: `Ran 5 tests in 0.001s — OK (skipped=4)` (`RclRcrTranslateTests` translates all 26 `rcl`/`rcr` forms + `ret` with `unhandled == []`; `RclRcrExecTests` skipped on Windows x86-64 without `qemu-system-aarch64`). - `python -I tests/test_x64_recomp.py`: `Ran 45 tests in 0.001s — OK (skipped=32)`. - `scripts/check_no_game_data.py`, `tests/test_ci_registration.py` (`18/18`), and `tests/test_text_write_line_endings.py` (`3/3`): **`OK`**. #### Three Flag-Liveness / `CTX_EFLAGS` Issues Found in `tools/x64_recomp.py` Inspecting the emitted ARM64 words from `x64_recomp.translate_function(...)` surfaced three edge cases in flag tracking/materialization that existing tests did not hit: 1. **`FLAG_WRITERS["rcl"]` / `FLAG_WRITERS["rcr"]` (`line 63`) still declares `"C"` instead of `"CV"` (breaks `jo`/`jno`/`seto`/`cmovo` after 1-bit `rcl`/`rcr`)**: - `_emit_rcl_rcr` emits `_set_rc_of` to set ARM `V` (`OF`) for count-1 rotates, and `test_count1_overflow_flag` tested `OF` via `pushf` (`flags_r == "NZCVPA"`, which matched `"C"`). - However, a direct `V`-only consumer (`seto`, `jo`, `cmovo`, where `flags_r == "V"`) skips past `rcl`/`rcr` in `_flag_analysis`. Reproducer: ```python # xor edx, edx; mov eax, 0x40000000; rcl eax, 1; seto dl; ret ft = x.translate_function(bytes.fromhex("31 d2 b8 00 00 00 40 d1 d0 0f 90 c2 c3"), 0x46000000) ``` Here `ft.arm_path[seto]` resolves to `xor` (`LOGIC_KIND`, `V=0`), so `seto dl` compiles to `movz w0, #0; b +2` (hardcoded `dl = 0`) even though `rcl eax, 1` set `OF = 1`. - *Note*: For `CL`-variable or multi-bit immediate `rcl`/`rcr`, if `"V"` is added to `FLAG_WRITERS`, multi-bit immediate rotates (`cval != 1`) only write `C` (or `OF` is undefined per Intel SDM), whereas `CL == 0` is already handled by `_cond_flag_writer`. 2. **Immediate `cval = raw % (width + 1) == 0` (`rcl al, 9`, `rcr ax, 17`) returns early without normalizing `SUB_KIND` borrow polarity**: - In `_classify` (`lines 452-458`), `is_imm_zero` checks `(imm & mask) == 0` without `% (width + 1)`, so `rcl al, 9` (`c0 d0 09`) gets `flags_w = "C"` and becomes `arm_path` producer for a following `jc`/`setb`. - In `_emit_rcl_rcr`, `rcl al, 9` executes `cset w3, cc` (reading inverted `SUB_KIND` borrow) and then returns at `if cval == 0: return` **without** calling `self._set_cf(T3)`. Reproducer: ```python # sub ebx, 2; rcl al, 9; setb dl; ret ft = x.translate_function(bytes.fromhex("83 eb 02 c0 d0 09 0f 92 c2 c3"), 0x46000000) ``` `sub` leaves `ARM C = 0` for borrow (`CF = 1`), `rcl al, 9` leaves `ARM C` untouched, and `setb dl` (`arm_path == rcl`, not `SUB_KIND`) emits `b.cs` (`0x54000002`), inverting the carry! Either `_classify` should treat `raw % (width + 1) == 0` for `rcl`/`rcr` as `is_imm_zero = True` (`flags_w = flags_r = ""`), or `_emit_rcl_rcr` should normalize `ARM C` before returning. 3. **`self._maybe_mkflags(ins)` (`rt_mkflags`) clobbers `SF`, `ZF`, `PF`, and `AF` in `ctx.eflags`**: - Rotate instructions never modify `SF`, `ZF`, `PF`, or `AF`. Unlike `rol`/`ror` (`lines 2621-2624, 2686-2689`) and `stc`/`clc` (`lines 2405-2411`) — which patch `CTX_EFLAGS` in place with `bfi` — `_emit_rcl_rcr` calls `self._maybe_mkflags(ins)` (`bl rt_mkflags`), rebuilding the entire `CTX_EFLAGS` word from current ARM `NZCV` and stale `CTX_RES`/`CTX_A`/`CTX_B` (corrupting prior `ZF`/`SF`/`PF`/`AF` across basic blocks, `popf`, or `CL`-variable shifts). Patching `EF_CF` (bit 0) and, when `c == 1`, `EF_OF` (bit 11) directly into `CTX_EFLAGS` via `bfi` avoids touching the other flags. AI-assisted.
enlight3d commented 2026-11-29 00:44:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T00:44:29Z.


Independent run of #1211 (python -I, no build, no game; GPU not used).

  • PR head: 621aaeefc1
  • main: 829530dbd0 (PR merged into it locally with git merge --no-ff, clean, tools/x64_recomp.py and the new test only)
  • Machine: Windows 11 Pro 10.0.26300, CPython 3.13.12, standard library only. No qemu-system-aarch64 here and not Apple Silicon, so the execution tests are skipped (4 of 5 in the new file).

Commands (one process each, from the repo root): python -I tests/test_x64_recomp_rcl_rcr.py, the 16 other tests/test_x64_recomp*.py / test_recomp_census.py files that exist on main, plus test_ci_registration.py, test_text_write_line_endings.py, test_tool_stdout_encoding.py, test_check_no_game_data.py.

  • Red: with tools/x64_recomp.py reverted to main and the new test kept: FAILED (failures=1, skipped=4). The failing test is the translation test, rcl/rcr are reported as unhandled instructions. New-feature red (instructions missing on main). The 4 skipped tests execute the result and were not exercised here.
  • Green at head: new test 5 run, OK (skipped=4); test_x64_recomp.py 32 run OK (skipped=26) and test_recomp_census.py 7 OK (the head branch is based on an older main, the other x64 test files do not exist there).
  • Green merged into main: new test 5 run, OK (skipped=4); all 16 existing x64_recomp / census files pass with the same counts as plain main (test_x64_recomp.py 45 run, OK, skipped=32, merged and on main).
  • Merged vs plain main: no new failure. test_tool_stdout_encoding.py fails identically on plain main and merged (pre-existing, 4 programs outside this PR).
  • Not checked here: the flag-liveness points raised in the earlier review comments (needs the execution tests, i.e. QEMU or Apple Silicon).
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248319318 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1211#issuecomment-7248319318). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-29T00:44:29Z. --- Independent run of #1211 (python -I, no build, no game; GPU not used). - PR head: 621aaeefc1c06aa4315ca9f81fc4ed798aab286d - main: 829530dbd0196aa817dbec74aaafc79407b94b57 (PR merged into it locally with `git merge --no-ff`, clean, `tools/x64_recomp.py` and the new test only) - Machine: Windows 11 Pro 10.0.26300, CPython 3.13.12, standard library only. No `qemu-system-aarch64` here and not Apple Silicon, so the execution tests are skipped (4 of 5 in the new file). Commands (one process each, from the repo root): `python -I tests/test_x64_recomp_rcl_rcr.py`, the 16 other `tests/test_x64_recomp*.py` / `test_recomp_census.py` files that exist on main, plus `test_ci_registration.py`, `test_text_write_line_endings.py`, `test_tool_stdout_encoding.py`, `test_check_no_game_data.py`. - Red: with `tools/x64_recomp.py` reverted to main and the new test kept: FAILED (failures=1, skipped=4). The failing test is the translation test, `rcl`/`rcr` are reported as unhandled instructions. New-feature red (instructions missing on main). The 4 skipped tests execute the result and were not exercised here. - Green at head: new test 5 run, OK (skipped=4); `test_x64_recomp.py` 32 run OK (skipped=26) and `test_recomp_census.py` 7 OK (the head branch is based on an older main, the other x64 test files do not exist there). - Green merged into main: new test 5 run, OK (skipped=4); all 16 existing x64_recomp / census files pass with the same counts as plain main (`test_x64_recomp.py` 45 run, OK, skipped=32, merged and on main). - Merged vs plain main: no new failure. `test_tool_stdout_encoding.py` fails identically on plain main and merged (pre-existing, 4 programs outside this PR). - Not checked here: the flag-liveness points raised in the earlier review comments (needs the execution tests, i.e. QEMU or Apple Silicon).
MoonEyes commented 2026-11-29 00:54:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T00:54:31Z.


Merged after enlight3d's red/green check (check) (RTX 3090, driver 621.40, Windows 11) and a local re-check here. Merged after local re-verification: this PR merged onto main d63e0b94d without conflict, and its test file(s) (tests/test_x64_recomp_rcl_rcr.py) pass there. Earlier today the same tests failed on main without the PR (red/green) and a bundle with other open PRs showed no new failures. check_no_game_data.py is clean. Windows 11, Python 3.14; no GPU needed for these tests.

AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248434114 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1211#issuecomment-7248434114). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-29T00:54:31Z. --- Merged after **enlight3d**'s red/green check ([check](https://github.com/ProjectLeonida/mandy/pull/1211#issuecomment-7248319318)) (RTX 3090, driver 621.40, Windows 11) and a local re-check here. Merged after local re-verification: this PR merged onto `main` d63e0b94d without conflict, and its test file(s) (`tests/test_x64_recomp_rcl_rcr.py`) pass there. Earlier today the same tests failed on `main` without the PR (red/green) and a bundle with other open PRs showed no new failures. `check_no_game_data.py` is clean. Windows 11, Python 3.14; no GPU needed for these tests. _AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes._
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!1211
No description provided.