Intel CPUs: AMD-only CLZERO / MONITORX / MWAITX cause 0xC000001D (STATUS_ILLEGAL_INSTRUCTION) #184
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl#184
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@jrod0117-hub on GitHub · 2026-11-23 19:32 UTC · original
Summary
On an Intel CPU, a retail Xbox Series X|S (GDK) title dies with
0xC000001D(STATUS_ILLEGAL_INSTRUCTION) because the console code containsAMD-only instructions that XCL passes through natively (by design, no CPU emulation):
0F 01 FCCLZERO0F 01 FAMONITORX0F 01 FBMWAITXThe title was compiled for Zen 2 (RSG-LLVM); it uses
CLZEROin a 64-byte-strideclear loop and
MONITORX/MWAITXin spin-wait code.Reproduction
main(cargo build --release -p xcl).XCL_NETWORK=0 xcl run <game folder>.0xC000001Datgame.exe+0x4e8aa70, bytes0f 01 fc=clzero(verified against the exe on disk; minidump exception address matches).
System InittoGame Init(6,960 CLZERO emulations), then crash 2 at
game.exe+0x4fb0bd7,bytes
0f 01 fa=monitorx.Fix (tested here)
A first-chance vectored exception handler in the host process. Only fires on #UD,
so there is no cost in normal execution.
crates/xcl/src/eh.rs:Result
After both emulations the same title runs at a steady 30 fps (19,500+ frames
presented, 3840x2160 display target) on the Intel machine. No other #UD has appeared.
Notes / caveats
CLZEROmust actually zero the line — a plain NOP would leave stale data.MWAITXas a no-op turns the wait into a spin;_mm_pause()keeps it from pegging a core.RDPRU0F 01 FD,STGI/CLGI/SKINIT/INVLPGA0F 01 DC-DF)are not handled yet.
Happy to turn it into a PR if you want the patch upstream.
@ivall on GitHub · 2026-11-23 20:58 UTC · original
Fixed on main by #151 (merged in
2abc562): CLZERO, MONITORX / MWAITX and the other console instructions a PC CPU lacks are emulated in a vectored handler (insn.rs). Testers there went from this crash to exit 0 on an i9-14900K, i7-14700KF and i5-13600K. Please reopen if it still happens on current main.@jrod0117-hub on GitHub · 2026-11-24 01:28 UTC · original
Real-run data (the
called_stubslist from HANDOFF "Next steps 1")Title: retail Xbox GDK build
1.0.2.1(RockstarGamesInc.28872443D20A7)Machine: Intel i9-14900HX, RTX 4090 Laptop 16 GB, Windows 11 26300
Backend: D3D12 real. Run ended normally (
crash: null, exit 0), 30 fps, image still black (known mesh/AS limitation).Shaders in this run: 4,624 unique / 219,509 submitted — stages
as599,cs2,742,ps108,317,vs107,724,rootsig127.RDNA2: 16,634,641 instructions decoded, 0 undecoded, 0 Xbox errors.
called_stubs(calls × interface::slot, first caller):ID3D12CommandAllocator::#9 (not on PC)ID3D12GraphicsCommandList10::#126 (not on PC)ID3D12GraphicsCommandList10::#142 (not on PC)ID3D12GraphicsCommandList10::#75 (console extension)XGTextureAddressComputer::#10ID3D12CommandQueue::#31 (newer layout)ID3D12GraphicsCommandList10::#131 (not on PC)ID3D12GraphicsCommandList10::#132 (not on PC)#131#132Other counters: audio all zero (no voices yet — the title did not reach audio), VFS no writes/whiteouts.
The four high-count stubs (#9 allocator, #126/#142/#75 list) fire ~6,300× each in ~3 minutes of presenting — likely worth mapping next. #131/#132 and queue #31 match the slots already listed as open in HANDOFF.
No game files or links included; this is just the run report.
@jrod0117-hub on GitHub · 2026-11-24 01:51 UTC · original
Follow-up: the console's mesh subobject is in slot 24, not 25
Instrumented a real run. The 5 mesh streams that were rejected carry these subobjects:
Current code looks for
D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS(25) intranslated_mesh_stream; not found → returnsNone→ falls through tostream_pipeline/finish_psowith console bytecode → the driver rejects it with0x80070057(the "PSO stream rejected, the fallback version too" errors).Local change that fixes the rejection:
After it:
PSO stream rejectederrors are gone;4,096 draws with translated pipelines (0 skipped, 0 with PC pipelines).Image is still black, but the title is still on a loading screen with ~2,200 pipelines queued, so this is not yet a picture claim — just the slot mapping. Patch available if you want it.