Run on Intel hosts: emulate the console CPU's AMD-only instructions #18
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!18
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/18/head"
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?
@ka1qux on GitHub · 2026-11-23 23:12 UTC · original
ka1qux:host-cpu-emulation→main· +740 −10 · 6 files · 2 commits · closed without mergingProblem
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
@Marvisak on GitHub · 2026-11-23 23:14 UTC · original
Already fixed, thanks anyways
Pull request closed