Run on Intel hosts: emulate the console CPU's AMD-only instructions #18
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by ka1qux on 2026-11-23T23:12:10Z.
Problem
On a CPU without AMD's own instructions (every Intel CPU), the title died 7 s into boot with an illegal instruction (
0xC000001D) at aCLZERO. The title's code is built for Zen 2 and also uses SSE4a (INSERTQ,EXTRQ),MONITORX/MWAITXandRDPRU.Change
victory-loader::cpuinstalls a vectored exception handler, ahead of the crash reporter's, that carries the refused instruction out on the faulting thread's saved registers and resumes after it.CLZEROrun whole in one exception instead of one per 64 bytes.victory runlogs which instructions the host lacks, names each at its 1st, 2nd, 4th... use, and prints totals when the title exits.The second commit is diagnostics only (
VICTORY_D3D12_DRED): a GPU page fault is reported against every named host buffer's address range, so a fault just past a buffer's end names the buffer.Testing
cargo test -p victory-loader: 6 new tests execute the real instructions, through the handler on a CPU that lacks them and natively on one that has them.CLZEROexceptions, over 32,000MONITORX/MWAITXpairs, over 4,000INSERTQ, about 1 µs each.Limits
MWAITXyields and returns instead of sleeping, so a thread waiting with it spins.RDPRUreturns the time-stamp counter for both registers.RDPRUandEXTRQwere exercised by the tests only; the title did not reach them.CLZERO,MONITORX/MWAITXandINSERTQwere then confirmed by the run.Details are in the new "Host CPU" section of
docs/architecture.md.🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-23T23:14:43Z.
Already fixed, thanks anyways
Pull request closed