d3d12: handle AMD-only insertq on Intel CPUs #153
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/brcly--TuxBox!153
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/153/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?
@3kynox on GitHub · 2026-11-25 08:56 UTC · original
3kynox:pr-insertq→main· +285 −4 · 3 files · 1 commits · merged 2026-11-25 09:06 UTCSummary
Fixes #152.
ProjectScarlett 1.0.2.1 executes
insertq(SSE4a), which raisesEXCEPTION_ILLEGAL_INSTRUCTIONon Intel CPUs. This adds a handler next to theclzeroandmwaitxones from #146, called from the same vectored exception handler insurvey.rs:runtime/d3d12/src/insertq.rs): only the form the title uses,F2 [REX] 0F 78 /r ib ibwith register operands.extrqandinsertqwithout immediates are left to fault. Neither occurs in the title.No Intel instruction of the same length does this, so the site is not rewritten in place. The handler acts only when CPUID reports no SSE4a and the fault is inside the title image.
On an i9-12900K with this change on top of
0a8d2eethe title gets past the first site: the log showsemulated unsupported insertq at RVA 0x2e7ff1 (host lacks SSE4a), the player-selection prompt is presented, and the run continued to its 240 s time limit (12,078 frames) with no unhandled illegal instruction.Checks
All commands from CONTRIBUTING.md pass:
python -m unittest discover -s tests -qcargo testfortools/shader-compiler,tuxbox-dxbc(withnative-bindings) andtuxbox-xg-layoutcargo check --target x86_64-pc-windows-msvc -p tuxbox-d3d12The new unit tests are Windows-only, like the
clzeroones. I ran thetuxbox-d3d12test binary under Proton's Wine on the Intel host, rebased on53bb4d6: 95/95 passed, five of them new.No evidence JSON changed.
@copilot-pull-request-reviewer[bot] on GitHub · 2026-11-25 08:58 UTC · original · reviewed
🟢 Approval recommended
No active review issues are reported for the insertq fallback that extends unsupported-instruction handling on Intel CPUs.
No open issues 🎉
What changed in this PR
Adds an
insertqfallback to the D3D12 runtime so ProjectScarlett can continue past this AMD-only instruction on Intel CPUs, extending the existing unsupported-instruction handling for issue #152.Changes:
insertqusing saved XMM state.runtime/d3d12/src/survey.rsruntime/d3d12/src/lib.rsinsertqmodule.runtime/d3d12/src/insertq.rsReview effort: Balanced