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

Closed
github-bot wants to merge 1 commit from github-bot/gh-2868 into amd-dev AGit
Owner

@⁠GreemSC on GitHub · 2026-11-26 20:01 UTC · original
GreemSC:amd-dev-compile-gate-commit → amd-dev · +19 −6 · 2 files · 1 commits · closed without merging

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

  • RX 7900 XT (RDNA3), Mesa 26.2.5 RADV, i7-12700K, 24 GB; Linux, Proton-CachyOS Wine 11, vkd3d-proton 0bb64c5 with dxil-spirv b540c8a2; release cross-build (x86_64-pc-windows-msvc).
  • cargo test -p xcl --lib big_compile under Wine: 15 passed, 1 failed. The failure is giant_driver_compiles_have_their_own_lane at assert_eq!(parsed.len(), 2) for parse_rt_skip_hashes(…; bad) (left 3): it is in the ray-tracing skip list parsing, which this change does not touch. The whole suite was not run (on Wine it aborts at list_x::tests::a_dispatch_with_a_pipeline_still_building_waits_at_the_submit, see #2764 / #2842).
  • Retail title 1.0.2.1, 360 s runs with scripted A presses, warm caches, our Wine tree on 71b8e6e0 (#846):
    • without this change: 3 of 4 runs stuck after #101 (4 workers in big_compile_turn_with, title in resolve_wait, Wine's free RAM 0.9–2.1 GB);
    • with it: 2 of 2 runs through the world, 0 crashes; 2 998 and 2 927 frames, p99 2.05 s and 1.05 s, 1–2 frames/s in the playable part.

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

**@⁠GreemSC** on GitHub · 2026-11-26 20:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/2868) `GreemSC:amd-dev-compile-gate-commit` → `amd-dev` · +19 −6 · 2 files · 1 commits · closed without merging `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** - RX 7900 XT (RDNA3), Mesa 26.2.5 RADV, i7-12700K, 24 GB; Linux, Proton-CachyOS Wine 11, vkd3d-proton 0bb64c5 with dxil-spirv b540c8a2; release cross-build (`x86_64-pc-windows-msvc`). - `cargo test -p xcl --lib big_compile` under Wine: 15 passed, 1 failed. The failure is `giant_driver_compiles_have_their_own_lane` at `assert_eq!(parsed.len(), 2)` for `parse_rt_skip_hashes(…; bad)` (left 3): it is in the ray-tracing skip list parsing, which this change does not touch. The whole suite was not run (on Wine it aborts at `list_x::tests::a_dispatch_with_a_pipeline_still_building_waits_at_the_submit`, see #2764 / #2842). - Retail title 1.0.2.1, 360 s runs with scripted A presses, warm caches, our Wine tree on `71b8e6e0` (#846): - without this change: 3 of 4 runs stuck after `#101` (4 workers in `big_compile_turn_with`, title in `resolve_wait`, Wine's free RAM 0.9–2.1 GB); - with it: 2 of 2 runs through the world, 0 crashes; 2 998 and 2 927 frames, p99 2.05 s and 1.05 s, 1–2 frames/s in the playable part. **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](https://claude.com/claude-code)
big_compile_commit_free still asked for min(free physical memory, free
commit), the measure 71b8e6e0 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 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:11:36 +00:00
Author
Owner

@⁠GreemSC on GitHub · 2026-11-26 20:21 UTC · original

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.

**@⁠GreemSC** on GitHub · 2026-11-26 20:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/2868#issuecomment-7202570389) 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.
Author
Owner

@⁠oni-swr on GitHub · 2026-11-27 02:31 UTC · original

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

**@⁠oni-swr** on GitHub · 2026-11-27 02:31 UTC · [original](https://github.com/xcl-dev/xcl/pull/2868#issuecomment-7208206458) **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](https://claude.com/claude-code)
Author
Owner

@⁠andrewDoing on GitHub · 2026-11-27 02:38 UTC · original

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.

**@⁠andrewDoing** on GitHub · 2026-11-27 02:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/2868#issuecomment-7208306532) 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.
github-bot closed this pull request 2026-11-27 04:25:32 +00:00
Author
Owner

@⁠GreemSC on GitHub · 2026-11-27 04:23 UTC · original

Closing: ivall ported this into amd-dev as 81c04142 ("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) 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** on GitHub · 2026-11-27 04:23 UTC · [original](https://github.com/xcl-dev/xcl/pull/2868#issuecomment-7209761043) Closing: ivall ported this into `amd-dev` as 81c04142 ("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 (https://git.gtahub.st/github/xcl-dev--xcl/issues/846) 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.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.