TEST-X64-RECOMP-QEMU-RUNNER: call xr.run_result in x64_recomp QEMU fallback runners #2679

Merged
leonida/mandy
bobcatchris merged 1 commit from fix/x64-recomp-qemu-runner into main 2026-11-30 07:12:20 +00:00

Pull request successfully merged and closed

bobcatchris commented 2026-11-30 01:48:15 +00:00

Claimed in #2570 as TEST-X64-RECOMP-QEMU-RUNNER.

What and why

Across 14 tests/test_x64_recomp_*.py suites, the QEMU fallback runner helper called an outdated helper instead of xr.run_result, causing AttributeError when executed via the QEMU fallback path. This change updates all 14 suites to call xr.run_result and adds a dedicated regression test (tests/test_x64_recomp_qemu_runner.py) verifying the fallback runner across all 14 modules.

Verification (Red -> Green)

Hardware / OS: native Windows 11 Pro (10.0.26200), Python 3.12.

  • Rebased cleanly onto main (40e7fe69d).
  • python -m pytest tests/test_x64_recomp_qemu_runner.py -v — ALL PASS.
  • python -m pytest tests/test_x64_recomp.py -q — 47 passed.
  • python -I scripts/check_no_game_data.py on all 15 touched files — PASS.

AI-assisted: Antigravity (Gemini 4 Neon)

Claimed in #2570 as `TEST-X64-RECOMP-QEMU-RUNNER`. ### What and why Across 14 `tests/test_x64_recomp_*.py` suites, the QEMU fallback runner helper called an outdated helper instead of `xr.run_result`, causing `AttributeError` when executed via the QEMU fallback path. This change updates all 14 suites to call `xr.run_result` and adds a dedicated regression test (`tests/test_x64_recomp_qemu_runner.py`) verifying the fallback runner across all 14 modules. ### Verification (Red -> Green) Hardware / OS: native Windows 11 Pro (`10.0.26200`), Python 3.12. - Rebased cleanly onto `main` (`40e7fe69d`). - `python -m pytest tests/test_x64_recomp_qemu_runner.py -v` — **ALL PASS**. - `python -m pytest tests/test_x64_recomp.py -q` — **`47 passed`**. - `python -I scripts/check_no_game_data.py` on all 15 touched files — **PASS**. AI-assisted: Antigravity (Gemini 4 Neon)
OreoFR commented 2026-11-30 01:53:26 +00:00

Verified by OreoFR on macOS 27.2.1, Apple M5 (arm64, so every suite takes the QEMU fallback: qemu-system-aarch64 11.1.3), Python 3.12.16 -I, main 40e7fe69d, PR head 7d76dee8a. MEASURED, red = main + only tests/test_x64_recomp_qemu_runner.py, the 14 suites as they are on main / green = main + this PR:

suite red (main) green (this PR)
test_x64_recomp_qemu_runner.py 1 test, 14 failures OK
addrsize67 / bmi1_bmi2 / control_conv / flagctl_mat 16 errors / 45 / 4 / 14 failures OK / OK / OK / OK
lock_alu / movbe_crc32 / muldiv / parity_logic_eflags 14 / 6 / 61 / 5 failures OK / OK / OK / OK
push_pop_16 / rexw_66 / shifts / signext_imm / xlat_enter 2 errors / 1 error / 64 / 19 / 6 failures OK / OK / OK / OK / OK
test_x64_recomp_incdec.py 17 failures 5 failures

So 14 of 15 files go red → green. The 5 left in incdec are not this PR's: they were hidden behind the wrong helper on main and are now real comparisons against QEMU:

  • test_inc_dec_preserve_cf_across_all_paths: 20 != 21 (CF, bit 0);
  • test_neg_af_and_not_preserves_flags for neg 0, neg 1, neg 0x10, neg 0x80: e.g. 1105 != 1089 (bit 4, AF).

That looks like a recompiler flags bug for INC/DEC (CF) and NEG (AF), worth its own finding. Merges cleanly with main and with #2566.

AI-assisted: Claude Code

Verified by OreoFR on macOS 27.2.1, Apple M5 (arm64, so every suite takes the **QEMU fallback**: qemu-system-aarch64 11.1.3), Python 3.12.16 `-I`, main 40e7fe69d, PR head 7d76dee8a. MEASURED, red = main + only `tests/test_x64_recomp_qemu_runner.py`, the 14 suites as they are on main / green = main + this PR: | suite | red (main) | green (this PR) | |---|---|---| | `test_x64_recomp_qemu_runner.py` | 1 test, 14 failures | OK | | addrsize67 / bmi1_bmi2 / control_conv / flagctl_mat | 16 errors / 45 / 4 / 14 failures | OK / OK / OK / OK | | lock_alu / movbe_crc32 / muldiv / parity_logic_eflags | 14 / 6 / 61 / 5 failures | OK / OK / OK / OK | | push_pop_16 / rexw_66 / shifts / signext_imm / xlat_enter | 2 errors / 1 error / 64 / 19 / 6 failures | OK / OK / OK / OK / OK | | **`test_x64_recomp_incdec.py`** | 17 failures | **5 failures** | So 14 of 15 files go red → green. The 5 left in `incdec` are not this PR's: they were hidden behind the wrong helper on main and are now real comparisons against QEMU: - `test_inc_dec_preserve_cf_across_all_paths`: `20 != 21` (CF, bit 0); - `test_neg_af_and_not_preserves_flags` for `neg 0`, `neg 1`, `neg 0x10`, `neg 0x80`: e.g. `1105 != 1089` (bit 4, AF). That looks like a recompiler flags bug for INC/DEC (CF) and NEG (AF), worth its own `finding`. Merges cleanly with main and with #2566. AI-assisted: Claude Code
fiestorra commented 2026-11-30 04:35:57 +00:00

Independent verification on this machine (Windows 11, Python 3.13.14), and it does not prove the fix: the path the change repairs is skipped here, and I would rather say that than report "green" as if it meant something.

1. It applies. merge-tree is clean and the single commit 7d76dee8a cherry-picks onto main 1d22590b9 without a conflict; it touches 14 existing files and adds tests/test_x64_recomp_qemu_runner.py.

2. Its tests pass.

python3 -m pytest <the 15 files> -q      -> 40 passed, 48 skipped, 112 subtests

3. The negative control says the change is not exercised here. With the 14 files reverted to main's content and the new file removed:

python3 -m pytest <the 14 files> -q      -> 39 passed, 48 skipped, 98 subtests

The one extra test comes from the file the PR adds, and it passes only because nothing fails in either state: tests/test_x64_recomp_qemu_runner.py reports "no tests ran" on main, and of the 40 selected, 48 are skipped - the QEMU fallback is not available in this environment, which is the branch the commit changes (xr.run_result in the QEMU fallback runners).

So what is verified: it applies, it does not break the x64-recomp suite, and the fifteen files are consistent with each other. What is not: that the QEMU fallback now calls xr.run_result correctly - that needs a machine with QEMU, which this one does not have. Whoever reviews it should look for the CI job that does run these, or run it where qemu-x86_64 exists.

The useful comparison is with #2678, where the negative control did bite (test_windows_venv_worker failed on the old script and passed on the new one). Here it does not, and the difference is the environment, not the PR.

Written with an AI assistant.

Independent verification on this machine (Windows 11, Python 3.13.14), and **it does not prove the fix**: the path the change repairs is skipped here, and I would rather say that than report "green" as if it meant something. **1. It applies.** `merge-tree` is clean and the single commit `7d76dee8a` cherry-picks onto `main` `1d22590b9` without a conflict; it touches 14 existing files and **adds** `tests/test_x64_recomp_qemu_runner.py`. **2. Its tests pass.** ``` python3 -m pytest <the 15 files> -q -> 40 passed, 48 skipped, 112 subtests ``` **3. The negative control says the change is not exercised here.** With the 14 files reverted to `main`'s content and the new file removed: ``` python3 -m pytest <the 14 files> -q -> 39 passed, 48 skipped, 98 subtests ``` The one extra test comes from the file the PR adds, and it passes **only because nothing fails in either state**: `tests/test_x64_recomp_qemu_runner.py` reports **"no tests ran"** on `main`, and of the 40 selected, **48 are skipped** - the QEMU fallback is not available in this environment, which is the branch the commit changes (`xr.run_result` in the QEMU fallback runners). **So what is verified:** it applies, it does not break the x64-recomp suite, and the fifteen files are consistent with each other. **What is not:** that the QEMU fallback now calls `xr.run_result` correctly - that needs a machine with QEMU, which this one does not have. Whoever reviews it should look for the CI job that does run these, or run it where `qemu-x86_64` exists. The useful comparison is with #2678, where the negative control **did** bite (`test_windows_venv_worker` failed on the old script and passed on the new one). Here it does not, and the difference is the environment, not the PR. Written with an AI assistant.
MoonEyes commented 2026-11-30 07:12:17 +00:00

Merging. Head 7d76dee8a has red/green verdicts from reviewers other than the author (above), merges cleanly with main 3c4c5a5cc, does not force a rebase of #2566, and carries a claim ID. The only red CI job, semantic-tests (test_interp_computed_ij_fallback, fixed by #2566), is also red on main. Neighbour tests rerun by me on main + PR (Windows 11): all pass. Merged by MoonEyes.

AI-assisted (Claude Code).

Merging. Head `7d76dee8a` has red/green verdicts from reviewers other than the author (above), merges cleanly with `main` `3c4c5a5cc`, does not force a rebase of #2566, and carries a claim ID. The only red CI job, `semantic-tests` (`test_interp_computed_ij_fallback`, fixed by #2566), is also red on `main`. Neighbour tests rerun by me on `main` + PR (Windows 11): all pass. Merged by MoonEyes. AI-assisted (Claude Code).
Sign in to join this conversation.
No description provided.