Repository navigation
Console CPU instructions a PC CPU lacks are emulated: clwb, clzero, r… - #151
Conversation
|
I opened #153 for the same problem without seeing this one first. I'm closing it in favour of this PR, which covers more instructions (CLWB, RDPID) and has the prefix-aware decoder. Two things from #153 that could be useful on top of this, as a follow-up once this is merged, if you want them:
The code is in |
|
tested this on my i9 14900k and rtx 4080 super (driver 32.0.16.2124). both main (956a476) and the pr parent (9add721) crashed with 0xC000001D at the same spot, before any Present calls. with 236cc74, xcl logged CLZERO emulation at that location. tried two runs with a fresh cache each time, both reached one Present and exited with code 0 at the 25-second limit. used XCL_NETWORK=0 for all runs. haven't verified the actual frame contents yet, but it definitely gets further than before. |
… render-target and texture-address fixes Open upstream pull requests applied as they are (their authors' work): - xcl-dev#151 (gbuyssens): clzero / clwb / rdpru / monitorx / mwaitx / rdpid emulated on CPUs that lack them (HANDOFF.md hunk left out, it did not apply). - xcl-dev#163, xcl-dev#170 (Sr-0w): Xbox D16S8 depth formats, depth + UAV buffers, console mesh pipeline streams, null stand-in shaders. - xcl-dev#168 (ShyVortex): GetGPUVirtualAddress of a placed texture. Local changes: - xg: XGTextureAddressComputer xcl-dev#10 as GetResourceTiling, from the layout model (not checked against the console's library). - d3d12x: a UAV of a texture made without ALLOW_UNORDERED_ACCESS is a null UAV (the real call removed the device); a committed texture gets memory when the title asks for its address; clear values and view descriptions get pc_format; formats 86 / 115 -> R8G8B8A8, 116 / 117 -> R16G16B16A16_FLOAT. - Debug layer log: 8 messages per id instead of 200 in all. - The earlier "AS slot ignored" workaround stays but is no longer reached (xcl-dev#170). - CHANGES.txt, README status and installer version for build 3. Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
I tested the CLZERO fallback on a Core i7-14700KF (Windows 11 build 26300, Rust 1.97.1 MSVC). I loaded the same standalone Rust x64 PE with
The fixture is synthetic and exercises the exception handler via the normal XCL loader. It covers the CLZERO path reported in #173. AI-assisted with Codex. |
…dpru, monitorx / mwaitx, rdpid A title compiled for the console's Zen 2 raises STATUS_ILLEGAL_INSTRUCTION on an Intel CPU before Ice Lake / Alder Lake (clwb, sha) or on any Intel CPU (clzero, rdpru, monitorx, mwaitx). insn::decode recognises them at the faulting address; the vectored handler emulates them and steps over. Other illegal instructions and ud2 are logged with their code bytes, in the first-chance handler and in the crash line.
236cc74 to
0b28a39
Compare
|
I tested a local CLZERO regression on Windows with an Intel Core i5-13600K. I ran the same synthetic console-title fixture through
The focused test used synthetic data only and covers Would you like me to submit the regression test? I can send it as a small follow-up PR once this lands, or share the patch for inclusion here. AI-assisted with Codex. |
|
AI-assisted review (Claude Code). Windows 11 (10.0.26200), Ryzen 9 9950X, Rust 1.99.0 MSVC, debug profile. Synthetic inputs only, no game files. No GPU needed. Tested Emulation vs. hardware. This is an AMD CPU, so every one of these instructions also runs natively here. That makes the CPU itself the reference. My probe registers a 64 KiB page as a mapped module, writes each encoding into it, and feeds
Totals: the PR passes 14/14 of the cases it targets and Against the reports.
From reading the diff (none of these block the PR):
Not tested:
|
|
Tested 0b28a39 on a Xeon E5-2666 v3 (Haswell-EP) with an RTX 2060 Super (driver 572.70), Windows 11. Can confirm this gets past the 0xC000001D crashes on Haswell ( A few notes from running it on older hardware: • CLZERO loop overhead: stepping one 64-byte line per exception causes an exception storm during memory allocation. On this machine it took over 18,000 VEH dispatches in a few seconds, dropping presentation to ~0.2 fps (36 frames in 180s). Catching the 12-byte loop ( Can submit the loop fast-path and NOP-patching as a follow-up PR once this gets merged. |
|
Can confirm it runs with this patch on my Intel CPU where it previously crashed |
…dpru, monitorx / mwaitx, rdpid
A title compiled for the console's Zen 2 raises STATUS_ILLEGAL_INSTRUCTION on an Intel CPU before Ice Lake / Alder Lake (clwb, sha) or on any Intel CPU (clzero, rdpru, monitorx, mwaitx). insn::decode recognises them at the faulting address; the vectored handler emulates them and steps over. Other illegal instructions and ud2 are logged with their code bytes, in the first-chance handler and in the crash line.