Skip to content

D3D12.X: a big driver compile waits for free commit, not free RAM - #2868

Closed
GreemSC wants to merge 1 commit into
xcl-dev:amd-devfrom
GreemSC:amd-dev-compile-gate-commit
Closed

GreemSC wants to merge 1 commit into
xcl-dev:amd-devfrom
GreemSC:amd-dev-compile-gate-commit

Conversation

@GreemSC

@GreemSC GreemSC commented Nov 26, 2026

Copy link
Copy Markdown

big_compile_commit_free (real.rs) still waits for min(ullAvailPhys, ullAvailPageFile), the measure 71b8e6e0 took out of pso_async's worker throttle. Free physical memory is not what a driver compile can allocate, and under Wine it is the whole machine's free RAM. In a retail world load on Linux it sat at 1–2 GB with ~45 GB of commit free, every xcl-pso-* worker waited in big_compile_turn_with for a compute pipeline's 3 GB, and the title waited in pso_async::resolve_wait for one of them: 0 presents for the rest of the run. This makes the big-compile gate read pso_async::avail_commit_bytes, like the worker throttle. Found while testing amd-dev under Wine (#846, #175).

What is in it

  • real.rs: big_compile_commit_free uses pso_async::avail_commit_bytes (now pub(super)); the comparison is a small big_compile_room with a test (big_compile_room_is_free_commit_not_free_ram).

Tested

Regression run

  • Not done: scripts/smoke.ps1 needs Windows, which I do not have. A Windows run of amd-dev and of this head would be welcome.

Not tested

  • Windows (there, free physical memory and free commit differ less, so the change should matter only with little RAM free); NVIDIA; the whole test suite.

AI use

  • Claude Code (Claude Opus 5.5) found the stall from thread dumps of the runs, wrote the change, the test and this description.

🤖 Generated with Claude Code

big_compile_commit_free still asked for min(free physical memory, free
commit), the measure 71b8e6e took out of pso_async's worker throttle.
Free physical memory is not what a compile can allocate, and under Wine
it is the whole machine's: in a retail world load on Linux it sat at
1-2 GB with 45 GB of commit free, every xcl-pso worker waited in
big_compile_turn_with for a compute pipeline's 3 GB, and the title
waited in resolve_wait for one of them (0 presents for the rest of the
run, 3 of 4 runs).

It now uses pso_async::avail_commit_bytes, so both throttles read the
same thing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@GreemSC

GreemSC commented Nov 26, 2026

Copy link
Copy Markdown
Author

cc @ivall (the pso_async half of this is your 71b8e6e0) and @raylitebull (amd-dev): under Wine this gate held every xcl-pso-* worker after #101 in 3 of 4 runs, so 71b8e6e0 cannot get into the world there without it; with it, 2 of 2 runs went through (numbers above and on #846). On Windows it only matters with little free RAM.

AI use: Claude Code (Claude Opus 5.5) wrote this comment.

ivall added a commit that referenced this pull request Nov 26, 2026
Port #2868. Use the pipeline workers' free-commit measure so low free RAM alone does not stall big compiles.

Assisted-by: Claude (exact model unknown), Codex (GPT-6 family, exact model unknown)
rootw0rm pushed a commit to rootw0rm/xcl that referenced this pull request Nov 26, 2026
@oni-swr

oni-swr commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Tested: native Windows, AMD RDNA3. Both exact SHAs: 8edc0e0315fe9a8f8055b9be3ecdb0873f55c460 (this head) and its parent 71b8e6e05eddff84b044e0300497f80329a21912 (amd-dev base of this PR; amd-dev has since moved on to bf7c82ee, which I did not test).

Hardware / build: Radeon RX 7800 XT (16 GB), Adrenalin driver 32.0.31035.1003, Ryzen 8-core, 64 GB RAM, Windows 11 build 26200.9974, Rust 1.100.0 MSVC, release build.

Unit tests (CPU only, head): cargo test --release -p xcl --lib big_compile -j 4: 15 passed, 1 failed, 0 ignored. big_compile_room_is_free_commit_not_free_ram passes. The failure is giant_driver_compiles_have_their_own_lane (real.rs:5470, left 3 / right 2), the same as on Wine, so it also fails on native Windows with this PR. The whole suite was not run.

Regression run (retail title, 240 s, same settings and warm shader cache for both, XCL_PREPARE=0, scripted A presses, one run each, run one after the other):

xcl-smoke v1
commit: 71b8e6e05eddff84b044e0300497f80329a21912
gpu: AMD Radeon RX 7800 XT
title: retail-amd
seconds: 240
exit: 0xc0000005
frames shown: none logged (the run did not reach its end)
presents per 2 s (last 3): 17 13 0
device removals: 0
crashes: 2
peak commit: 20198 MB
xcl-smoke v1
commit: 8edc0e0315fe9a8f8055b9be3ecdb0873f55c460
gpu: AMD Radeon RX 7800 XT
title: retail-amd
seconds: 240
exit: 0xc0000005
frames shown: none logged (the run did not reach its end)
presents per 2 s (last 3): 20 20 0
device removals: 0
crashes: 2
peak commit: 20287 MB

Both runs end the same way: an access violation inside the AMD driver (amdxc64.dll+0xdc5a21, read at 0x138) at about 94 s (base) and 98 s (head). So this head does not regress, but this run does not show whether it helps: the title never reached the point where the big-compile gate matters, there were plenty of free RAM and commit on this machine, and the crash already happens on the base. I can not tell whether the crash is the same as the ones other reports on amd-dev describe.

Not tested: low free-RAM conditions (where this change is meant to matter); repeated runs (one per side, so the 2 s counts are not a statistical result); NVIDIA; the full test suite.

AI use: run and report by Claude Code (Claude Sonnet 5.5).

🤖 Generated with Claude Code

@andrewDoing

Copy link
Copy Markdown

I reproduced the reported giant_driver_compiles_have_their_own_lane test failure on head 8edc0e0315fe9a8f8055b9be3ecdb0873f55c460. Its purported invalid hex token bad is valid hexadecimal (0xBAD), so the parser returns three hashes where the test expects two. The lane-selection assertions before that point passed.

Changing only the fixture token from bad to not_hex made the exact test pass (1/1); the big_compile_tests module then passed 16/16, with zero failures or ignored tests. This does not change the production parser or scheduler. The check used native Windows and did not require a GPU.

AI use: OpenAI Codex with GPT-6.2 Astra inspected the fixture and ran the comparisons; Codex coordinated and prepared this report.

@GreemSC

GreemSC commented Nov 27, 2026

Copy link
Copy Markdown
Author

Closing: ivall ported this into amd-dev as 81c0414 ("Port #2868", same diff: real.rs +18 −5, pso_async.rs +1 −1), now under bf7c82ee.

@oni-swr thanks for the RX 7800 XT A/B. Agreed: no regression, and no evidence it helps, since the gate never bound on a 64 GB machine. @andrewDoing thanks. giant_driver_compiles_have_their_own_lane isn't touched by this PR (the diff has no bad fixture), so the bad → not_hex fix goes against amd-dev itself.

A caveat for whoever follows this on amd-dev: xpatfussy69x showed on #846 (#846 (comment)) that with a system-managed Windows page file, a gate on free commit can hold big compiles forever. Workers that wait never allocate, so the page file never grows (14 holds in one run with 6–10 GB of RAM free; a fixed 32–64 GB page file fixed it). amd-dev now has the same gate as main, so the same issue applies there.

AI use: Claude Code (Claude Opus 5.5) checked the port and wrote this; I read it before posting.

@GreemSC GreemSC closed this Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants