cpu: skip native ADOX in cpu_aot_x87_compare on hosts without ADX #563

Manually merged
github merged 1 commit from gh-pr/563/head into gh-pr/563/base 2026-11-26 22:02:07 +00:00
Owner

@⁠lukaslw-lab on GitHub · 2026-11-22 12:43 UTC · original
lukaslw-lab:cpu/x87-compare-adx-skip → main · +33 −11 · 4 files · 1 commits · merged 2026-11-22 12:51 UTC

Change

cpu_aot_x87_compare no longer crashes on CPUs without ADX. Fixes #562.

add_fcomi_of (#535) executes adox natively, which faults with 0xc000001d without ADX; the translated DLL doesn't need ADX. The CPUID check that cpu_aot_adx already uses (leaf 7 EBX bit 19) becomes a shared HOST_HAS_ADX constant in tests/cpu/adx.py and is also exported from the translated x87_compare DLL. Without ADX, only the native add_fcomi_of is left out: every other native and translated case, the x87_call preservation check, the seven controls and the rejections still run and still fail on a mismatch. The test then exits 77 (SKIP_RETURN_CODE added). With ADX nothing changes.

Overlap: #548 edits check_rejections() in tests/cpu/x87_compare.py; this change doesn't touch that function.

Verification

Commit 97f9322 (on upstream/main b1be506), Windows 10 22H2 (build 19045), Intel Core i7-4790K (no ADX), Visual Studio 2026 18.12 (MSVC 19.52), Windows SDK 10.0.26100, CMake 4.3.1, Python 3.13.7.

ctest --preset dev --no-tests=error -R '^cpu_aot_x87_compare$' -V
12230 cases over 12 exports (output block and guards) matched the reference in native and translated DLLs; ...
control keepof: 211/12230 mismatches
Host CPU lacks ADX (CPUID leaf 7 EBX bit 19): native add_fcomi_of not run; every other check passed. Skipping.
cpu_aot_x87_compare ...***Skipped

Before this change, at c4d5e8e: OSError: [WinError -1073741795] Windows Error 0xc000001d in the native add_fcomi_of; the other 11 native exports and all 12 translated exports ran.

Negative control: the keepof control DLL passed as the translated DLL still fails without ADX (AssertionError: lifted: 211/12230 mismatches, exit 1), so the skip can't hide a translation error.

With ADX: the same change at a5a4c67 (before the rebase) on the windows-2025 runner in my fork: all four workflow jobs pass, and cpu_aot_adx and cpu_aot_x87_compare report Passed in both Windows jobs (219/219).

CPU area locally at 97f9322: ctest --preset dev --no-tests=error -R '^cpu_': 111 tests, 108 passed, 0 failed, 3 skipped (capability, exit 77): cpu_aot_crypto_sha, cpu_aot_adx and cpu_aot_x87_compare.

Evidence and follow-up

  • No new fixture. The detection is the existing cpu_aot_adx code, moved into a constant.
  • Other tests that execute native ADX or other optional ISA extensions without a CPUID check would fail the same way on older CPUs. In a full local run on this PC, cpu_aot_x87_compare was the only failure of that kind.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted: prepared with Claude Code; the commands and results above were run on the author's PC.

🤖 Generated with Claude Code

**@⁠lukaslw-lab** on GitHub · 2026-11-22 12:43 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/563) `lukaslw-lab:cpu/x87-compare-adx-skip` → `main` · +33 −11 · 4 files · 1 commits · merged 2026-11-22 12:51 UTC ## Change `cpu_aot_x87_compare` no longer crashes on CPUs without ADX. Fixes #562. `add_fcomi_of` (#535) executes `adox` natively, which faults with `0xc000001d` without ADX; the translated DLL doesn't need ADX. The CPUID check that `cpu_aot_adx` already uses (leaf 7 EBX bit 19) becomes a shared `HOST_HAS_ADX` constant in `tests/cpu/adx.py` and is also exported from the translated x87_compare DLL. Without ADX, only the native `add_fcomi_of` is left out: every other native and translated case, the `x87_call` preservation check, the seven controls and the rejections still run and still fail on a mismatch. The test then exits 77 (`SKIP_RETURN_CODE` added). With ADX nothing changes. Overlap: #548 edits `check_rejections()` in `tests/cpu/x87_compare.py`; this change doesn't touch that function. ## Verification Commit `97f9322` (on `upstream/main` `b1be506`), Windows 10 22H2 (build 19045), Intel Core i7-4790K (no ADX), Visual Studio 2026 18.12 (MSVC 19.52), Windows SDK 10.0.26100, CMake 4.3.1, Python 3.13.7. ```powershell ctest --preset dev --no-tests=error -R '^cpu_aot_x87_compare$' -V ``` ```text 12230 cases over 12 exports (output block and guards) matched the reference in native and translated DLLs; ... control keepof: 211/12230 mismatches Host CPU lacks ADX (CPUID leaf 7 EBX bit 19): native add_fcomi_of not run; every other check passed. Skipping. cpu_aot_x87_compare ...***Skipped ``` Before this change, at `c4d5e8e`: `OSError: [WinError -1073741795] Windows Error 0xc000001d` in the native `add_fcomi_of`; the other 11 native exports and all 12 translated exports ran. **Negative control:** the `keepof` control DLL passed as the translated DLL still fails without ADX (`AssertionError: lifted: 211/12230 mismatches`, exit 1), so the skip can't hide a translation error. **With ADX:** the same change at `a5a4c67` (before the rebase) on the `windows-2025` runner in my fork: all four workflow jobs pass, and `cpu_aot_adx` and `cpu_aot_x87_compare` report Passed in both Windows jobs (219/219). CPU area locally at `97f9322`: `ctest --preset dev --no-tests=error -R '^cpu_'`: 111 tests, 108 passed, 0 failed, 3 skipped (capability, exit 77): `cpu_aot_crypto_sha`, `cpu_aot_adx` and `cpu_aot_x87_compare`. ## Evidence and follow-up - No new fixture. The detection is the existing `cpu_aot_adx` code, moved into a constant. - Other tests that execute native ADX or other optional ISA extensions without a CPUID check would fail the same way on older CPUs. In a full local run on this PC, `cpu_aot_x87_compare` was the only failure of that kind. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. _AI-assisted: prepared with Claude Code; the commands and results above were run on the author's PC._ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
add_fcomi_of (#535) executes ADOX natively, which faults with
0xc000001d on CPUs without ADX. Share cpu_aot_adx's CPUID check
(HOST_HAS_ADX), export it from the translated x87_compare DLL, and leave
out only the native add_fcomi_of on such hosts. Every other check still
runs and fails on a mismatch; the test then exits 77.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:02:07 +00:00
github manually merged commit 97f9322d8a into gh-pr/563/base 2026-11-26 22:02:07 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.