Recompiler: keep compute shaders on single loop budget to avoid AMD LLPC crash #2947
No reviewers
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!2947
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2947"
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?
@real-alponzo on GitHub · 2026-11-27 03:34 UTC · original
real-alponzo:fix/2874-amd-compute-single-loop-budget→amd-dev· +13 −15 · 3 files · 1 commits · merged 2026-11-27 08:38 UTCKeep real compute shaders (
Mode::Computeinrecomp/mod.rsandcomputeindxil/kernel.rs) on the single-budget loop counter instead of per-region multi-PHI loop budgets (xcl_bown/xcl_btotal), fixing theamdxc64.dll+0xd2a411(null dereference read at0x138) crash on AMD RDNA2 drivers during retail world load.Fixes #2874.
Why
00fe5aec(#2865) disabled per-region loop budgets on graphics/mesh stages to avoid AMD LLPC crashing on multi-PHI loop headers, but kept them enabled onMode::Compute.amd-dev@bf7c82eewith an AMD Radeon RX 6800 (RDNA2, driver32.0.21045.29003), three retail compute shaders (cs-2e0055c25f49848a/03f8856c87ce1c90,cs-6e148dbd563de205/5b2e76933254ac96, andcs-62b584e061c05fc5/4db60c607c5af7fb) still crashedamdxc64.dll+0xd2a411 (read at address 0x138)during world load (~157 s).Mode::Kernelenabled for unit tests) eliminated allamdxc64.dll+0xd2a411crashes completely: withdriver-crashes.txtcleared, the retail title ran for1454 s(~24.2 min) into the open world with0driver compiler crashes (driver-crashes.txtremained empty).What is in it
crates/xcl/src/gpu/recomp/mod.rsandcrates/xcl/src/gpu/dxil/kernel.rsto enablebudget_regions(&loops)only forMode::Kernel/kernel.gpu::recomp::tests::per_region_loop_budgets_are_compute_onlyincrates/xcl/src/gpu/recomp/tests.rsto assertMode::Kernelemitsxcl_bown/xcl_btotalwhileMode::Compute,Mode::Pixel, andMode::Meshkeep the single-budget CFG.Regression run
Base (
main):PR head (
bfb40311):Tested
rustc 1.100.0, DXC 1.9.2602.17.cargo test -p xcl --lib per_region_loop_budgets_are_compute_only -- --nocapture:1 passed; 0 failed; 0 ignored; 1693 filtered out..\scripts\smoke.ps1 -Game "C:\VIctory-SSD-test\game" -Seconds 60on8b957becandbfb40311(blocks above).XCL_PREPARE=0,XCL_DEVICE_TYPE=lockhart, cleandriver-crashes.txt): ran1454 s(~24.2 min) with0amdxc64.dll+0xd2a411crashes (previously crashed at ~157 s on 3 compute shaders).Not tested
cargo test --workspaceonamd-dev(noteamd-devhas pre-existing no-GPU CI failures unrelated to this change).AI use
amdxc64.dll+0xd2a411crash from live RX 6800 logs, implemented the fix and test update, ran the test and paired smoke runs, and drafted this PR description.@ettehn on GitHub · 2026-11-27 03:40 UTC · original
NVIDIA correctness check for the behavior #2793 added. I built the exact
amd-devparentbf7c82eeand PR headbfb40311and ran the same syntheticMode::Computeprogram on Windows 11 (26200), RTX 5070 Ti Laptop / 621.24, Rust 1.97.1 MSVC debug, SDK DXC 1.8.2502.11. One wave32 group runs two independent scalar loops and writes each count to a separate word per lane. The second loop should run four times. Five fresh processes per revision ran both HLSL and plain direct DXIL (XCL_DIRECT_COMPACT=0).The first count was correct in every case, and all 32 lane outputs matched. On direct DXIL the untouched word retained the initial
0xDEADBEEF, so the final store was never reached. This quantifies the trade-off if the AMD workaround is considered for other driver branches. It is a synthetic dispatch of translated compute, with no AMD crash reproduction or retail-title run.OpenAI Codex assisted with verification.
@vibryxcx on GitHub · 2026-11-27 03:44 UTC · original · edited 2026-11-27 09:50 UTC
RDNA2 data and one test-coverage point, adding to @ettehn's measurement above.
1. The spin-wait tests stay green because they run in
Mode::Kernel.gpu::recomp::tests::gpu_a_loop_after_a_spin_to_the_budget_still_runsbuilds withrunner::options(Mode::Kernel)(tests.rs:1465), and the compact-form test indxil/compact_tests.rsgoes through the kernel runner too. This PR keeps region budgets only forMode::Kernel/kernel, so those tests still pass. RealMode::Computeloses the #2793 behaviour, which is exactly what ettehn's table shows (the second loop runs 0-1 times, or the final store is never reached). Nothing in the suite now covers the spin-wait case for real compute. If this trade-off is accepted, a test that runs the same program asMode::Computeand asserts the current (single-budget) behaviour would at least document it, and would catch it if it changes.2. RDNA2 title data on this question (RX 6800, driver 32.0.21045.5002, so a different driver from the description's 29003; same retail title; the details are in my #2874 comment):
amdxc64.dll+0xd2a0f171b8e6e0(region budgets everywhere)71b8e6e0with287a931brevertedbf7c82eewith region budgets off in every stage (local patch, the same effect on compute as this PR)driver-crashes.txtstayed empty0x887a0006) 730 s into the titleThe device loss is not clearly caused by the change, because
bf7c82eeitself lost the device in 3 of 3 600 s runs on this card. But it is the failure mode one would expect from a compute spin-wait that runs out a single budget, so a longer run of this head would be worth watching for a TDR as well as for the compiler crash.3. Lib suite on this head (
bfb40311, debug,cargo test -p xcl --lib -- --test-threads=1with the tests skipped that hang or abort only inside the fullamd-devrun,xgameruntime::gamesave::testsrun on their own; see #42): main run 1642 passed, 11 failed, 27 ignored, andgamesave11 passed, 0 failed. The 11 failures are all ones basebf7c82eehas. The base's 12th,gpu_uploads_on_the_title_queue_run_before_its_later_work_and_are_released, passed here, and it is the known flaky one.per_region_loop_budgets_are_compute_only(as changed here) and the budget tests pass.Title runs of this exact head: see the update below.
AI use: Claude Code (Claude Opus 5.5) read the diff and tests, ran the suite through a local runner, and wrote this comment. The title numbers come from the runs referenced in #2874.
Update: title runs of this exact head on the RX 6800 (driver 32.0.21045.5002, release,
driver-crashes.txtmoved aside so no pipeline was skipped, A pressed every 10 s;XCL_RUN_SECONDS=600, preparation included; the list was restored afterwards).amdxc64.dllcompiler crashdriver-crashes.txtwritten0x887a0007at 493 s0x887a0007at 344 sbf7c82ee(soak run 1, same settings, list in place)0x887a0006at 226 sbf7c82ee, every long run with an empty list crashed the compiler or wrote newcs-entries (#2874), and with this head neither run did.0x887a0007) after 6-8 minutes. That is no earlier than the base's own losses (226-407 s), but not fixed either. I cannot tell from these runs whether it comes from theMode::Computespin-wait trade-off (point 1 above) or from whatever already takes the base's device down.scripts/smoke.ps1, same title, warm; blocks copied unchanged from the script output):Frames are 97 % of the base and peak commit is the same, within the limits.
After the merge:
amd-dev5fbd90f9on the RX 6800, for the open point aboutcompact.rsin the merge comment. 2 runs of 600 s,driver-crashes.txtmoved aside, A every 10 s:amdxc64.dllcompiler crash, and nodriver-crashes.txtwritten, in either run. So in these runs no compute program crashed the compiler through the compact form. That does not rule it out for a later scene.0x887a0007), at 343 s and 337 s. Last present was at 341 s and 335 s, with 9.4 and 8.5 fps while presenting.@DarkPanda69 on GitHub · 2026-11-27 03:51 UTC · original
NVIDIA run (listed as untested), with an RX 9070 XT in the same PC: the PR changes no GPU test result on either card.
Tested: head
bfb4031applied on its baseamd-devbf7c82e, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, DXC 1.9.2602.17, card picked withXCL_ADAPTER.XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- gpu:: per_region_loop_budgets loop --test-threads=4 --nocapture, base and PR one after the other on each card:No test changes result between base and PR on either card. The failures are the same with and without the PR, so they come from
amd-dev(the same set I listed on #2865):dispatch_chain_native_wave64_builds_whole,a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier,f32_programs_on_the_gpugpu_fract_f32_edgesgpu_f32_compares_with_nan,gpu_float_compares_random,fuzz_validate_and_gpu_1(#2115)This is RDNA4 and Ampere running the unit and GPU tests. It doesn't cover the LLPC crash on RDNA2 with retail shaders.
Not tested: RDNA2, a title run, release, Intel.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
github-bot referenced this pull request2026-11-27 04:03:38 +00:00
@oni-swr on GitHub · 2026-11-27 04:46 UTC · original
First RDNA3 / native-Windows data for this head: no crash on either side, so this does not show the fix.
Hardware: RX 7800 XT 16 GB (RDNA3), driver 32.0.31035.1003, 64 GB RAM, Windows 11 Pro 10.0.26200, Rust 1.100.0, release builds.
Revisions: base
amd-devbf7c82ee1b2685bb40417e09c4128177aa68d719, PR headbfb40311710ab82b54c043a3e447830dcd63e112(merges cleanly ontoamd-dev).All runs used
XCL_PREPARE=0with a warm shader cache (a fresh copy per run) and the same retail title.Unit test:
cargo test -p xcl --lib per_region_loop_budgets_are_compute_onlyon the head: 1 passed, 0 failed, 0 ignored. I did not rerun the recomp GPU module, since #2947 already has RDNA2 / RDNA4 results for it.scripts/smoke.ps1, 60 s (each block from its own commit, clean tree):Longer title runs (480 s, scripted A presses every 8 s from t=16 s through the menu, 2 runs per side, alternating):
driver-crashes.txtbf7c82eeruns on this card crashed inamdxc64.dllwith a read at 0x138, about 95 s in. That crash did not reproduce on the base in these two runs, so the head's clean runs are not evidence for the fix.Not tested: in-world play, a base build that crashes on this setup, cold-cache runs (the compiler path that crashed on RDNA2), and the
Mode::Computespin-wait trade-off from ettehn's and vibryxcx's comments above.AI use: Claude Code (Claude Sonnet 5.5) built both revisions, ran the commands above on this machine and wrote this report.
@oni-swr on GitHub · 2026-11-27 07:42 UTC · original
RDNA3 data for this PR: the AMD compiler crash in compute is gone with this head, 2 of 2 runs (and the same crash is deterministic on the base).
Setup: RX 7800 XT 16 GB (RDNA3), driver 32.0.31035.1003, Ryzen 7 5700X3D, 64 GB, Windows 11 build 26200. Release builds, no local changes, of
bf7c82ee(base) andbfb40311(this head), the same retail title.XCL_PREPARE=0 XCL_PSO_WAIT_MS=200 XCL_NETWORK=0, A pressed every 8 s, 300 s runs, each on a fresh copy of the same warm shader cache and profile (the cache'sdriver-crashes.txtkept). Runs interleaved base / head / base / head.0xc0000005inamdxc64.dll+0xdce035(read at0x18) at 233 s, compiling a compute PSO of 509,896 B DXILamd-devbf7c82eebuild from a previous session (same cache, same input, not rebuilt by me): 3 of 3 runs withXCL_PSO_WAIT_MS=200crashed on this same pipeline at 204-219 s; 0 of 5 runs without it did (240-480 s). Without the limit the title sits in pipeline waits from about 90 s and never reaches this pipeline within 300-480 s. The limit's stand-ins let it get there.Not tested: the
Mode::Computespin-wait trade-off that ettehn measured; more than 2 runs per tree; a cold cache; the title's own-code crash in run 2 (one occurrence, not reproduced in the other head run, cause unknown).AI use: Claude Code (Claude Sonnet 5.5) built the trees, ran the title, read the logs and wrote this comment. Every number comes from those runs.
@ivall on GitHub · 2026-11-27 08:38 UTC · original
Merged into
amd-dev(5fbd90f9) on the maintainer's word, on the strength of the reports in #2874: the compiler crash still onbf7c82eeon an RX 6800 (two driver versions) and an RX 7800 XT, and gone with this head in the runs reported there.Not run here before merging: no test and no title run on the maintainer's RX 9070 for this head. CI's
Build and testwas red on it; I did not check whether that is the tests that already fail onamd-dev.One thing left open:
gpu/dxil/compact.rsstill takesbudget_regionsfor every program (two places), so a compute program that goes to the compact form keeps per-region budgets. If the crash shows again on such a program, that is where to look.Written with Claude Code (Claude Fable 5.2) for the maintainer.
@oni-swr on GitHub · 2026-11-27 10:36 UTC · original
Follow-up to the merge (
5fbd90f9): the CI failures I could reproduce are not new with #2947, and two 600 s runs of the merged tree on an RX 7800 XT ended in the title's own code, not in the driver compiler.(a) CI failures.
cargo test -p xcl --libon the 9 named tests, basebf7c82eevs5fbd90f9, debug,-j 4 --test-threads=4,XCL_ADAPTER=warp(no hardware GPU; I do not know that this is exactly what the runner sees), Windows 11 build 26200, Ryzen 7 5700X3D:dispatch_chain_native_wave64_builds_whole,a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier,bitset_runs_emit_exact_contiguous_page_ranges,a_dispatch_with_a_pipeline_still_building_waits_at_the_submit,giant_driver_compiles_have_their_own_lane,title_bytes_are_used_in_place_when_all_are_readable.the_mirror_sync_copies_only_the_pages_the_title_wrote,gpu_uploads_on_the_title_queue_run_before_its_later_work_and_are_released,d32s8_targets_take_their_own_size_of_video_memory.Merged tree on RDNA3 (RX 7800 XT, driver 32.0.31035.1003, 64 GB, build 26200),
XCL_PREPARE=0 XCL_PSO_WAIT_MS=200 XCL_NETWORK=0, 600 s, A every 8 s, warm cache copy; the binary isbfb40311, whose tree is identical to5fbd90f9:amdxc64.dllcrash in either, but neither reached 600 s. Run 1:0xc0000005in the title's image at 426 s, a read at a wild address. Run 2: the same kind of read, at another offset in the title's image, at 336 s. Both are ingame_scarlett_master.exe(the title's own native code, not a recompiled shader); with the 216 s death in my earlier comment that is three different offsets in three runs. In both runs the last profile lines show DXC jobs still running and a driver compile in progress.(b) Which huge compute records take the compact form. In all 13 title runs I made today (several trees:
bf7c82ee,5fbd90f9, #2988, #2981 merged) and in 9 earlier ones, the log has exactly onedirect DXIL compact formline: 20,965 blocks of 672 kinds, at 99-132 s, and nothing else. It is the record #2796's description names. I did not map the pipeline that crashedbf7c82eeto it, so I cannot say whether the crashing pipeline took the compact path. Separately, the--directtranslation of the 5 largest compute records of the pack I looked at (0.26-2.0 MB of direct DXIL): one of them takes the compact form (257 KB, against 1.78 MB withXCL_DIRECT_COMPACT=0), the other four give the same size either way.Not tested: more than 2 runs, a cold cache, other GPUs, the full test suite.
AI use: Claude Code (Claude Sonnet 5.5) built the trees, ran the tests and the title, read the logs and wrote this comment. Every number comes from those runs.