gpu/recomp: skip shader outlining on AMD to avoid ParseAddress driver crash #21
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/zortos293--XSEmu!21
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-21"
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?
@js664 on GitHub · 2026-11-27 11:51 UTC · original
js664:fix/amd-no-outline→main· +16 −0 · 2 files · 1 commits · openFixes #20
AMD's D3D12 shader compiler (
amdxc64.dll) fails withUnknown pointer operation encountered during ParseAddressfollowed byDXGI_ERROR_DRIVER_INTERNAL_ERROR(0x887A0020) /DXGI_ERROR_DEVICE_REMOVED(0x887A0005) when compiling DXC-emitted[noinline]outlined compute shaders. Disabling memory-function outlining by default on AMD (0x1002) avoids the driver crash while leaving NVIDIA and other adapters unchanged.What is in it
crates/xcl/src/gpu/recomp/pso.rs: addis_amd()(ADAPTER_VENDOR == 0x1002) and includeno-outline-amdinshader_cache_identitywhenis_amd()andXCL_RECOMP_OUTLINE_MIN_INSTSis unset.crates/xcl/src/gpu/recomp/emit.rs: returnfalsefromoutline_from()on AMD by default unlessXCL_RECOMP_OUTLINE_MIN_INSTSor test-onlyOUTLINEexplicitly overrides it.Tested
32.0.32029.2010), AMD Ryzen 5 7600X 6-Core Processor,rustc 1.99.1 (58cf8f9c3 2026-10-13), debug (cargo test) and release (cargo build --release -p xcl --bin XSEmu,scripts/smoke.ps1).cargo test --lib -p xcl gpu::recomp::page_group_tests -- --test-threads=1: 11 passed, 0 failed, 0 ignored.cargo test --lib -p xcl outlined: 4 passed, 2 failed (gpu_outlined_memory_functions_compute_the_sameandgpu_outlined_calls_atomics_and_loops_compute_the_same, which forceOUTLINE=trueand hit AMD'sParseAddress/0x887A0005driver crash).cargo test --workspace --no-fail-fast -- --test-threads=1:console_dlls_e2e(13 passed),console_shaders(3 passed, 4 ignored),disasm_e2e(1 passed);xcl --libfailedfar_jumps_are_direct_branchesand aborted with0xc0000005aroundgpu_cube_sample_grad_min_lod;e2ehung onlauncher_uses_configured_exe_in_an_ambiguous_folder.scripts/smoke.ps1 -Seconds 60):main(5e3a27e67575) crashed with0x887a0020(3device removals,1crash,peak commit: 8222 MB); this PR (4dad1e43ed7c) completed all 60s withexit: 0x0,frames shown: 780 (PresentX 781),device removals: 0,crashes: 0(peak commit: 14994 MBas the title continued loading pastmain's crash, so the 25s runs below are used for the peak-commit ratio check).Regression run
main:
PR:
Not tested
cargo test --workspaceclean completion on this host due to pre-existingfar_jumps_are_direct_branches/gpu_cube_sample_grad_*failures andtests/e2e.rshang.AI use
ParseAddressdevice removal crash, wrote thepso::is_amd()/outline_from()change, ran local builds/scripts/smoke.ps1/targeted tests, and prepared the PR description.Summary by CodeRabbit
@coderabbitai[bot] on GitHub · 2026-11-27 11:51 UTC · original · edited 2026-11-27 15:17 UTC
Walkthrough
When
XCL_RECOMP_OUTLINE_MIN_INSTSis unset, memory-function outlining is disabled for AMD, and translated pipeline cache identities includeno-outline-amd. An explicitly set threshold retains the existing threshold behavior. The changes also add a public AMD adapter check.Changes: AMD outlining policy
crates/xcl/src/gpu/recomp/emit.rs,crates/xcl/src/gpu/recomp/pso.rsno-outline-amd.Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers:
zortos293Merge Risk:
Low · up to
4dad1The AMD outlining default works for the title and runner paths. The developer shader precompile tool with --split does not record the adapter vendor, so on AMD it can still hit the driver crash this change avoids. This is a narrow fix with a bounded impact.
Pre-merge checks:
4
#20requires that the game keep running without losing the D3D12 device when AMD rejects compute pipelines. The PR gates memory-function outlining off on AMD (0x1002) by default …Full details: Title check
Explanation
The title names the main change: skipping shader outlining on AMD to avoid the ParseAddress driver crash. The raw summary confirms that outline_from() now disables memory-function outlining on AMD when XCL_RECOMP_OUTLINE_MIN_INSTS is unset, and that pso.rs adds is_amd() and a no-outline-amd cache tag. The title is specific and matches the changeset.
Full details: Description check
Explanation
The description covers the required template sections. It explains the change and the reason for it, lists the changed files, gives hardware, driver, Rust version, and test results, and includes a main and PR smoke-run block as the regression run requires for crates/xcl/src changes. It also lists what was not tested and the AI use. Some template items are only partly filled: the cargo test line does not use the exact N passed / N failed / N ignored format for the full workspace run, and the 'Not tested' section is detailed but mixes pre-existing failures into it. These gaps are minor.
Full details: Linked Issues check
Explanation
Directly linked issue
#20requires that the game keep running without losing the D3D12 device when AMD rejects compute pipelines. The PR gates memory-function outlining off on AMD (0x1002) by default in outline_from() (emit.rs) and adds no-outline-amd to the shader-cache identity (pso.rs). The reported outlined shaders that trigger the ParseAddress / 0x887A0005 crash therefore take the non-outlined path by default. The author reports a 25s smoke run on AMD Radeon RX 9060 XT with driver 32.0.32029.2010 (same driver version as#20, different GPU): 0 device removals, 0 crashes, and a 60s run that completed with exit 0x0. Main crashed in the same test with 0x887a0020. Limits: the issue reports an RX 7800 XT, and the named shaders 269247e3dab5f171 and 249b4aa70b48b9be are not shown in the supplied test evidence. The repository diff could not be read, so the code is assessed from the PR summary and description. No automated test in the PR covers the default AMD gate itself. The issue states no test requirement.Full details: Out of Scope Changes check
Explanation
All changes are in crates/xcl/src/gpu/recomp/pso.rs and crates/xcl/src/gpu/recomp/emit.rs. They add is_amd(), the no-outline-amd cache-identity tag, and an AMD default in outline_from(). These changes implement the fix for
#20. The override paths (XCL_RECOMP_OUTLINE_MIN_INSTS, XCL_RECOMP_NO_OUTLINE, and test-only OUTLINE) keep their existing behavior. NVIDIA and other vendors keep the existing outlining path, as the PR states. No unrelated changes appear in the supplied summaries. The repository diff could not be read, so this verdict relies on the summaries and PR description.Finishing Touches
Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
CodeRabbit Verify
@coderabbitai[bot] on GitHub · 2026-11-27 11:54 UTC · original · reviewed
981e0f80-adb3-4018-9184-7bc52907b3b6Reviewing files that changed from the base of the PR and between
5e3a27e675and4dad1e43ed.crates/xcl/src/gpu/recomp/emit.rscrates/xcl/src/gpu/recomp/pso.rsIncluded review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
@js664 on GitHub · 2026-11-27 15:11 UTC · original
@coderabbitai review
@coderabbitai[bot] on GitHub · 2026-11-27 15:12 UTC · original
Action not completed
Already reviewed the last commit. Use
@coderabbitai full reviewto rerun a review of the entire changeset.@js664 on GitHub · 2026-11-27 15:13 UTC · original
@coderabbitai full review
@coderabbitai[bot] on GitHub · 2026-11-27 15:13 UTC · original · edited 2026-11-27 15:17 UTC
Action performed
Full review finished.
@ -835,1 +840,4 @@/// Whether the adapter is known to be AMD (`0x1002`).pub fn is_amd() -> bool {ADAPTER_VENDOR.load(std::sync::atomic::Ordering::Relaxed) == 0x1002@coderabbitai[bot] on GitHub · 2026-11-27 15:17 UTC · original
Set the adapter vendor in
Pipelines::newbefore the precompile translates shaders.Pipelines::newselects the first candidate adapter and creates the device, but it never records that adapter's vendor. When--splitis given, the runner calls that could set the vendor are skipped. The vendor then stays0, sois_amd()returnsfalseduring translation.outline_fromapplies the non-AMD default, and the outlined DXIL is passed toCreateComputePipelineStateon the AMD device. This can fail with the driver error that the AMD outlining default avoids.The title's runtime path is not affected. It sets the vendor before translation, and its cache identity includes
no-outline-amdonly for AMD. Entries written by this tool under vendor0use a different identity, so the AMD title does not read them.Record the vendor where the adapter is selected:
Suggested fix
@coderabbitai[bot] on GitHub · 2026-11-27 15:17 UTC · original · reviewed
Actionable comments posted: 1
29b56554-2360-48a7-9c5a-aca641dfcec9Reviewing files that changed from the base of the PR and between
5e3a27e675and4dad1e43ed.crates/xcl/src/gpu/recomp/emit.rscrates/xcl/src/gpu/recomp/pso.rsIncluded review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.