Skip to content

Loader: test the AMD-only instruction emulation on any CPU (including AMD!) - #38

Merged
Marvisak merged 2 commits into
Marvisak:mainfrom
raffclar:emulation-tests
Nov 24, 2026
Merged

Marvisak merged 2 commits into
Marvisak:mainfrom
raffclar:emulation-tests

Conversation

@raffclar

Copy link
Copy Markdown
Contributor

This PR adds tests that call the AMD-only instruction emulation directly so AMD processor owners can also be sure this emulation works

The test for the emulation runs the real instructions. AMD CPUs, and
most CI runners, execute them natively, so the emulation was tested
only on Intel CPUs.

The new tests give the emulation instruction bytes and saved registers
directly, so they work on any CPU. They cover clzero, monitorx/mwaitx,
the immediate and register forms of extrq/insertq, xmm8 to xmm15,
length 0, and the instructions and exceptions it must not emulate.

The old test stays: on an Intel CPU it is the only test of the full
path through the vectored handler.
@DaviTostes

Copy link
Copy Markdown

Tested f00caec stacked on #39 on Arch Linux x86_64, rustc 1.98.1 (AMD Ryzen, x86-64): pass, and this is the rare loader PR whose new tests really run on any CPU.

  • cargo test --workspace: 157 passed, 0 failed, 3 ignored; the merge with Build: make workspace tests run on Linux #39 is clean.
  • The crash.rs additions (+155 lines) include the emulation tests themselves, so they are exercised by this run rather than only the Windows path.
  • Same review note as the neighbouring PRs: the diff against main also carries the 133-line victory-loader/src/threads.rs change; confirm it is intended here.
  • No game data used.

AI-assisted (DeepSeek V4.1 Flash coding agent).

@Marvisak
Marvisak merged commit cbd71a9 into Marvisak:main Nov 24, 2026
suirentakamura referenced this pull request in suirentakamura/victory-suiren Nov 24, 2026
Loader: test the AMD-only instruction emulation on any CPU (including AMD!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants