D3D12.X: name XCL's own tile-mapping lists and say when a wait for a queue gives up #873

Manually merged
github merged 1 commit from gh-pr/873/head into gh-pr/873/base 2026-11-26 04:35:18 +00:00
Owner

@⁠theaustinayers on GitHub · 2026-11-24 07:09 UTC · original
theaustinayers:queue-wait-diagnostics → main · +15 −0 · 2 files · 1 commits · merged 2026-11-24 07:12 UTC

Diagnostics for a queue that stands still; no behaviour change. With the debug layer on, a retail title's device was removed with "The command allocator was reset after the command list was recorded" (id 541) on an Unnamed ID3D12GraphicsCommandList Object, and nothing in the log said whose list it was, or that a wait had given up just before.

What is in it

  • crates/xcl/src/hle/d3d12x/sparse.rs: XCL's tile-mapping queue, its upload lists and allocators and its readback list and allocator get names (SetName), so a debug-layer message about one of them says so; a list that stays "Unnamed" is the title's.
  • sparse.rs wait_for: a warning when the tile-mapping queue has not reached the fence value after its 5 s limit (it carried on silently, and the caller then resets the allocator).
  • crates/xcl/src/hle/d3d12x/cpu_writes.rs: a warning (the 1st, 2nd, 4th, … time) when the writes after the GPU are done although their queue had not got there after WAIT_MS (10 s): the title then reads a progress value its queue has not reached.

No test: names and log lines only.

Tested

  • NVIDIA GeForce RTX 5090 (driver 621.14), Ryzen 9 9950X3D, Windows 11 build 26300, rustc 1.100.0, debug build for tests, release for the runs
  • cargo build --workspace, then cargo test --workspace -- --test-threads=4: 715 passed, 0 failed, 41 ignored; no SKIPPED tests on this adapter
  • A retail title with XCL_D3D12_DEBUG=1, on a build of main at beaa245 plus these lines: the two debug-layer reports about a command list (id 553) named an "Unnamed" list, so not one of the named ones here.

Regression run

main (e7da8a1 is the commit of #866, merged as a1672ef):

xcl-smoke v1
commit: e7da8a18afd45d41d37ec44056b5b21bc68b4727
gpu: NVIDIA GeForce RTX 5090
title: NYCMain
seconds: 60
exit: 0x0
frames shown: 1623 (PresentX 1623)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16397 MB

PR:

xcl-smoke v1
commit: dbe932400410828fd0490f86714a1f397d4a1504
gpu: NVIDIA GeForce RTX 5090
title: NYCMain
seconds: 60
exit: 0x0
frames shown: 1627 (PresentX 1627)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16291 MB

Not tested

  • Neither warning has been seen to fire: the one run with these lines was ended at 71 s, before a 10 s wait could run out, and the 60 s regression run does not reach the place.
  • AMD and Intel GPUs, Wine / vkd3d-proton.

AI use

  • Claude Code, Claude Fable 5.2: wrote the lines and this description. The runs above were made on the hardware named.

🤖 Generated with Claude Code

**@⁠theaustinayers** on GitHub · 2026-11-24 07:09 UTC · [original](https://github.com/xcl-dev/xcl/pull/873) `theaustinayers:queue-wait-diagnostics` → `main` · +15 −0 · 2 files · 1 commits · merged 2026-11-24 07:12 UTC Diagnostics for a queue that stands still; no behaviour change. With the debug layer on, a retail title's device was removed with "The command allocator was reset after the command list was recorded" (id 541) on an `Unnamed ID3D12GraphicsCommandList Object`, and nothing in the log said whose list it was, or that a wait had given up just before. **What is in it** - `crates/xcl/src/hle/d3d12x/sparse.rs`: XCL's tile-mapping queue, its upload lists and allocators and its readback list and allocator get names (`SetName`), so a debug-layer message about one of them says so; a list that stays "Unnamed" is the title's. - `sparse.rs` `wait_for`: a warning when the tile-mapping queue has not reached the fence value after its 5 s limit (it carried on silently, and the caller then resets the allocator). - `crates/xcl/src/hle/d3d12x/cpu_writes.rs`: a warning (the 1st, 2nd, 4th, … time) when the writes after the GPU are done although their queue had not got there after `WAIT_MS` (10 s): the title then reads a progress value its queue has not reached. No test: names and log lines only. **Tested** - NVIDIA GeForce RTX 5090 (driver 621.14), Ryzen 9 9950X3D, Windows 11 build 26300, rustc 1.100.0, debug build for tests, release for the runs - `cargo build --workspace`, then `cargo test --workspace -- --test-threads=4`: 715 passed, 0 failed, 41 ignored; no SKIPPED tests on this adapter - A retail title with `XCL_D3D12_DEBUG=1`, on a build of main at beaa245 plus these lines: the two debug-layer reports about a command list (id 553) named an "Unnamed" list, so not one of the named ones here. **Regression run** main (e7da8a1 is the commit of #866, merged as a1672ef): ``` xcl-smoke v1 commit: e7da8a18afd45d41d37ec44056b5b21bc68b4727 gpu: NVIDIA GeForce RTX 5090 title: NYCMain seconds: 60 exit: 0x0 frames shown: 1623 (PresentX 1623) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16397 MB ``` PR: ``` xcl-smoke v1 commit: dbe932400410828fd0490f86714a1f397d4a1504 gpu: NVIDIA GeForce RTX 5090 title: NYCMain seconds: 60 exit: 0x0 frames shown: 1627 (PresentX 1627) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16291 MB ``` **Not tested** - Neither warning has been seen to fire: the one run with these lines was ended at 71 s, before a 10 s wait could run out, and the 60 s regression run does not reach the place. - AMD and Intel GPUs, Wine / vkd3d-proton. **AI use** - Claude Code, Claude Fable 5.2: wrote the lines and this description. The runs above were made on the hardware named. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Diagnostics for a queue that stands still. With the debug layer on, a retail
title's device was removed with "The command allocator was reset after the
command list was recorded" (id 541) on an 'Unnamed ID3D12GraphicsCommandList
Object': the title's list or one of XCL's could not be told apart. XCL's
tile-mapping queue, its upload lists and its readback list now carry names.

Two waits end after a time limit and carry on without a word: the
tile-mapping queue's wait for its own fence (5 s), and the wait of the writes
after the GPU for their queue (10 s; the title then reads a progress value
its queue has not reached). Both now log a warning.

Assisted-by: Claude Code (Claude Fable 5.2)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:35:17 +00:00
github manually merged commit dbe9324004 into gh-pr/873/base 2026-11-26 04:35:18 +00:00
Author
Owner

@⁠woreksami on GitHub · 2026-11-24 07:13 UTC · original

Data on the same id 541 from a second machine, in case it saves you a step: here it is not one of XCL's lists either, and the submit comes from the D3D12 runtime's own thread, after a CPU cycle break.

Setup

  • NVIDIA GeForce RTX 3060 8 GB (driver 610.88) · Intel i9-14900K · 32 GB · Windows 11 (26200) · release builds · the newer retail title from the README, 1.0.2.1
  • Tree: main beaa245 (so #795 + #797 in) + #214, #267, #456, #468, #503, #533, #572, #640, #825, #850, plus local changes: draws of a frame share one XCL_PSO_WAIT_MS budget, empty texture-page pools released, and a mid-list split takes a new PC list instead of a spare. XCL_D3D12_DEBUG=1 on the runs below unless said.

What the runs show

  • The id 541 is raised on thread "Internal D3D12 Sync Thread" (name from XCL's crash thread dump), 10 ms before the removal: 100.567 id 541 … ExecuteCommandList: The command allocator was reset after the command list was recorded → 100.577 device removed 0x887a0001. So it is a submit the runtime held back behind a queue.Wait and released later, not a call XCL or the title made at that moment.
  • Every 541 run has the #795 cycle breaker firing just before, e.g. with #850 in:
    78.145 Write64 Signal at 0x70416ab00 = 0x5d2 on q3/ty2 would close a GPU cycle (waiters=[q2]) – signalled on CPU
    78.220 Write64 Signal at 0x70416aaf8 = 0x5d2 on q2/ty0 would close a GPU cycle (waiters=[q3]) – signalled on CPU
    80.641 id 541 (ExecuteCommandList, unnamed)
    80.652 device removed 0x887a0001
    
    My reading: the CPU signal lets the title see its progress value, it resets the allocator, and the runtime then submits lists it was still holding for that allocator. #850 alone did not change it here (same sequence at 80.6 s).
  • Without the debug layer the same build ends the same way at 137.8 s, after a burst of GPU queue.Wait at 0x70416ac60 >= 0xbd4 did not complete within 5000 ms (…) – released at 136.2 s.
  • Separately, id 553 (fence has not advanced past previous executions) shows up once per run on an unnamed list, e.g. at 62.2 s, before any mid-list split had happened, so not #797's segments; it looks like KickoffX resetting a list right after its submit and submitting it again while the first is in flight.
  • With #797 and the split logging, splits happened in bursts right before the 541 (8 within 97.3–100.0 s, one title list splitting twice in one recording, two title lists on one allocator). I first suspected spare reuse (a split re-recording a spare that was still in flight) and switched that to a new list each time: the 541 stayed, so the spares were not it.
  • A build without #795 / #797 (main 6c98f92 + the same PRs) did not get the 541, but the GPU hung at 53.4 s (0x887a0006, in a title-texture copy). That matches what #866 describes; I have not yet run it with #866.

Not tested

  • This PR itself (its names would tell whose list the 541 is about; I'll add a run with it); AMD; the title without my local changes.

AI use

  • Claude Code with Claude Opus 5.5: merged the branches, ran the title with the debug layer, read the logs and thread dumps and wrote this comment from those runs.
**@⁠woreksami** on GitHub · 2026-11-24 07:13 UTC · [original](https://github.com/xcl-dev/xcl/pull/873#issuecomment-7124750748) Data on the same id 541 from a second machine, in case it saves you a step: here it is not one of XCL's lists either, and the submit comes from the D3D12 runtime's own thread, after a CPU cycle break. **Setup** - NVIDIA GeForce RTX 3060 8 GB (driver 610.88) · Intel i9-14900K · 32 GB · Windows 11 (26200) · release builds · the newer retail title from the README, 1.0.2.1 - Tree: `main` beaa245 (so #795 + #797 in) + #214, #267, #456, #468, #503, #533, #572, #640, #825, #850, plus local changes: draws of a frame share one `XCL_PSO_WAIT_MS` budget, empty texture-page pools released, and a mid-list split takes a new PC list instead of a spare. `XCL_D3D12_DEBUG=1` on the runs below unless said. **What the runs show** - The id 541 is raised on **thread "Internal D3D12 Sync Thread"** (name from XCL's crash thread dump), 10 ms before the removal: `100.567 id 541 … ExecuteCommandList: The command allocator was reset after the command list was recorded` → `100.577 device removed 0x887a0001`. So it is a submit the runtime held back behind a `queue.Wait` and released later, not a call XCL or the title made at that moment. - Every 541 run has the #795 cycle breaker firing just before, e.g. with #850 in: ``` 78.145 Write64 Signal at 0x70416ab00 = 0x5d2 on q3/ty2 would close a GPU cycle (waiters=[q2]) – signalled on CPU 78.220 Write64 Signal at 0x70416aaf8 = 0x5d2 on q2/ty0 would close a GPU cycle (waiters=[q3]) – signalled on CPU 80.641 id 541 (ExecuteCommandList, unnamed) 80.652 device removed 0x887a0001 ``` My reading: the CPU signal lets the title see its progress value, it resets the allocator, and the runtime then submits lists it was still holding for that allocator. #850 alone did not change it here (same sequence at 80.6 s). - Without the debug layer the same build ends the same way at 137.8 s, after a burst of `GPU queue.Wait at 0x70416ac60 >= 0xbd4 did not complete within 5000 ms (…) – released` at 136.2 s. - Separately, id 553 (`fence has not advanced past previous executions`) shows up once per run on an unnamed list, e.g. at 62.2 s, before any mid-list split had happened, so not #797's segments; it looks like `KickoffX` resetting a list right after its submit and submitting it again while the first is in flight. - With #797 and the split logging, splits happened in bursts right before the 541 (8 within 97.3–100.0 s, one title list splitting twice in one recording, two title lists on one allocator). I first suspected spare reuse (a split re-recording a spare that was still in flight) and switched that to a new list each time: the 541 stayed, so the spares were not it. - A build **without** #795 / #797 (main 6c98f92 + the same PRs) did not get the 541, but the GPU hung at 53.4 s (`0x887a0006`, in a title-texture copy). That matches what #866 describes; I have not yet run it with #866. **Not tested** - This PR itself (its names would tell whose list the 541 is about; I'll add a run with it); AMD; the title without my local changes. **AI use** - Claude Code with Claude Opus 5.5: merged the branches, ran the title with the debug layer, read the logs and thread dumps and wrote this comment from those runs.
Author
Owner

@⁠woreksami on GitHub · 2026-11-24 07:18 UTC · original

Follow-up with this PR (dbe9324) in the tree from my comment above, plus #866, XCL_D3D12_DEBUG=1, same machine and title.

  • The 541 again comes from thread "Internal D3D12 Sync Thread" and the message names no list at all (ID3D12CommandQueue::ExecuteCommandList: The command allocator was reset after the command list was recorded.), so the names here cannot tell whose it is from that message. The names do show up elsewhere: 8 of the id 1047 messages name xcl sparse queue.
  • The new cpu_writes warning (… writes after the GPU so far … had not got there after 10000 ms) did not fire in the run, and neither did the sparse-queue wait warning. So XCL did not publish a progress value early through cpu_writes here.
  • What did happen right before, as in every 541 run:
    87.78–89.84 split command list … (#2 … #6), five title lists
    89.898 Write64 Signal at 0x70416ab00 = 0x614 on q1/ty2 would close a GPU cycle (waiters=[q3]) – signalled on CPU
    89.924 Write64 Signal at 0x70416aaf8 = 0x614 on q3/ty0 would close a GPU cycle (waiters=[q1,q2]) – signalled on CPU
    90.016 id 541 (Internal D3D12 Sync Thread)
    90.042 device removed 0x887a0001
    
  • With #866 in, no id 921, and the earlier GPU hang at 53 s (seen without #795 / #797) did not come back; the run ended at the 541 instead.

So the only early "done" left in these runs is the #795 cycle break signalling the fences on the CPU: the waiters' queues go on, and lists the runtime was still holding behind a queue.Wait reach the GPU after the title has reset their allocator.

Not tested

  • Whether the waiting lists in those two cycles are the ones the 541 is about (the message has no name), AMD, a build without my local changes.

AI use

  • Claude Code with Claude Opus 5.5: built and ran the tree, read the log and thread dump and wrote this comment from that run.
**@⁠woreksami** on GitHub · 2026-11-24 07:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/873#issuecomment-7124843619) Follow-up with this PR (dbe9324) in the tree from my comment above, plus #866, `XCL_D3D12_DEBUG=1`, same machine and title. - The 541 again comes from **thread "Internal D3D12 Sync Thread"** and the message names no list at all (`ID3D12CommandQueue::ExecuteCommandList: The command allocator was reset after the command list was recorded.`), so the names here cannot tell whose it is from that message. The names do show up elsewhere: 8 of the id 1047 messages name `xcl sparse queue`. - The new cpu_writes warning (`… writes after the GPU so far … had not got there after 10000 ms`) did **not** fire in the run, and neither did the sparse-queue wait warning. So XCL did not publish a progress value early through `cpu_writes` here. - What did happen right before, as in every 541 run: ``` 87.78–89.84 split command list … (#2 … #6), five title lists 89.898 Write64 Signal at 0x70416ab00 = 0x614 on q1/ty2 would close a GPU cycle (waiters=[q3]) – signalled on CPU 89.924 Write64 Signal at 0x70416aaf8 = 0x614 on q3/ty0 would close a GPU cycle (waiters=[q1,q2]) – signalled on CPU 90.016 id 541 (Internal D3D12 Sync Thread) 90.042 device removed 0x887a0001 ``` - With #866 in, no id 921, and the earlier GPU hang at 53 s (seen without #795 / #797) did not come back; the run ended at the 541 instead. So the only early "done" left in these runs is the #795 cycle break signalling the fences on the CPU: the waiters' queues go on, and lists the runtime was still holding behind a `queue.Wait` reach the GPU after the title has reset their allocator. **Not tested** - Whether the waiting lists in those two cycles are the ones the 541 is about (the message has no name), AMD, a build without my local changes. **AI use** - Claude Code with Claude Opus 5.5: built and ran the tree, read the log and thread dump and wrote this comment from that run.
Author
Owner

@⁠woreksami on GitHub · 2026-11-24 07:32 UTC · original

A correction to my two comments above: the CPU cycle break is not the only way to this removal here.

Same machine and title, tree from above plus #851 (4bf6d60):

  • Without the debug layer: the device was removed (0x887a0001) at 87.4 s with no would close a GPU cycle – signalled on CPU line and no did not complete within 5000 ms – released line in the whole run. Just before it there were splits (#5–#11 in 86.26–86.75 s) and Wait64BitValueX … bridged to GPU queue.Wait (…; wait-before-signal) lines, four of them with prod=qNone between 85.0 and 87.4 s. The CreateCommandList … → 0x887a0005 lines that follow are after the removal, not its cause. Without the debug layer I can't say which call it was.
  • With the debug layer, same build: id 541 at 135.960 on "Internal D3D12 Sync Thread", 39 ms after two cycle breaks (135.897 / 135.921), then removal at 135.966 and two more 541s from the sync thread.

So across five debug-layer runs every 541 came within ~100 ms of a CPU cycle break, but one run without the debug layer reset with neither a cycle break nor a watchdog release, so "the cycle break causes it" in my earlier comment was too strong. What the runs do share is runtime-held submits (a queue.Wait before its signal) going out from the sync thread after the title has recycled the allocator; the cycle break is one way such a wait ends early.

Not tested

  • The removal without the debug layer under the debug layer (it changes the timing), DRED (it stalls this title in its first seconds, as XCL_DRED's comment says for another title), AMD.

AI use

  • Claude Code with Claude Opus 5.5: built and ran the tree, read the logs and wrote this correction from those runs.
**@⁠woreksami** on GitHub · 2026-11-24 07:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/873#issuecomment-7125105711) A correction to my two comments above: the CPU cycle break is not the only way to this removal here. Same machine and title, tree from above plus #851 (4bf6d60): - **Without the debug layer**: the device was removed (0x887a0001) at 87.4 s with **no** `would close a GPU cycle – signalled on CPU` line and **no** `did not complete within 5000 ms – released` line in the whole run. Just before it there were splits (#5–#11 in 86.26–86.75 s) and `Wait64BitValueX … bridged to GPU queue.Wait (…; wait-before-signal)` lines, four of them with `prod=qNone` between 85.0 and 87.4 s. The `CreateCommandList … → 0x887a0005` lines that follow are after the removal, not its cause. Without the debug layer I can't say which call it was. - **With the debug layer**, same build: id 541 at 135.960 on "Internal D3D12 Sync Thread", 39 ms after two cycle breaks (135.897 / 135.921), then removal at 135.966 and two more 541s from the sync thread. So across five debug-layer runs every 541 came within ~100 ms of a CPU cycle break, but one run without the debug layer reset with neither a cycle break nor a watchdog release, so "the cycle break causes it" in my earlier comment was too strong. What the runs do share is runtime-held submits (a `queue.Wait` before its signal) going out from the sync thread after the title has recycled the allocator; the cycle break is one way such a wait ends early. **Not tested** - The removal without the debug layer under the debug layer (it changes the timing), DRED (it stalls this title in its first seconds, as `XCL_DRED`'s comment says for another title), AMD. **AI use** - Claude Code with Claude Opus 5.5: built and ran the tree, read the logs and wrote this correction from those runs.
Author
Owner

@⁠dcastell1 on GitHub · 2026-11-24 07:51 UTC · original

Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on clean main@beaa245 (713 passed, 0 failed, 41 ignored on this box):

patch -p1 < this PR            # clean, no fuzz
cargo test --workspace -- --test-threads=4
713 passed; 0 failed; 41 ignored   (exit 0)

Same count as main (the change is naming plus the wait message), so the existing tests exercise it and nothing regresses.

Tree restored afterwards (md5 and a full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.

**@⁠dcastell1** on GitHub · 2026-11-24 07:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/873#issuecomment-7125440022) Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on clean `main@beaa245` (713 passed, 0 failed, 41 ignored on this box): ``` patch -p1 < this PR # clean, no fuzz cargo test --workspace -- --test-threads=4 713 passed; 0 failed; 41 ignored (exit 0) ``` Same count as main (the change is naming plus the wait message), so the existing tests exercise it and nothing regresses. Tree restored afterwards (md5 and a full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
This discussion has been locked. Commenting is limited to contributors.
No description provided.