xcl run: XCL_THREAD_DUMP_AT also logs the fences and queue waits behind #2244
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!2244
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2244"
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?
@kole07139 on GitHub · 2026-11-25 11:10 UTC · original
kole07139:dump/sync-state→main· +94 −2 · 3 files · 2 commits · openAt each
XCL_THREAD_DUMP_ATdump, XCL now also logs four things:Wait64BitValueXcells that are behind what was recorded for them.The first three are the summaries the GPU-wait watchdog logs at a time-out. The fourth is @GreemSC's diagnostic from this PR's review. Part of #1452.
A world load can stop with no time-out: presents, submits and DirectStorage requests go to 0, and every thread waits. Until now the thread dump of such a stop did not say whether a fence, a queue or a
Wait64cell was behind, because these summaries were only logged at a time-out.What is in it
06f9df8:crates/xcl/src/hle/d3d12x/list_x.rs:log_sync_state(at)logsfence_x::pending_summary(),internal_waits_summary()andARMED_GPU_WAITS, on a thread of its own, so a lock that the stall holds cannot hold up the next dump.crates/xcl/src/host.rs: theXCL_THREAD_DUMP_ATthread calls it after eacheh::dump_threads(). Without the variable nothing changes.97e22f6(co-authored by @GreemSC),crates/xcl/src/hle/d3d12x/list_x.rs:cells_behind_summary()lists theSYNC_GRAPHcells below their recorded value, or with armed waits:try_lockand logs(sync graph locked)when it cannot get it.ReadProcessMemory(dstorage::read_own, nowpub(crate), incrates/xcl/src/hle/dstorage.rs): the title can decommit the page at any time. An unreadable cell showsmem unreadable(@bmjask's review). The testthe_cells_behind_summary_reads_a_decommitted_or_protected_cell_without_faultingcovers it.The four lines, from a 60 s run of this head with
XCL_THREAD_DUMP_AT=45(the title was not stalled, so all four are empty):Tested
main72f848c.cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4on97e22f6: 1414 passed, 0 failed, 46 ignored. 26 SKIPPED:no wave64on this 32-lane card;no heap windows.Regression run (
scripts/smoke.ps1 -Game <retail title> -Seconds 60, the same title for both)main72f848c:This PR,
97e22f6:Not tested
XCL_THREAD_DUMP_AT: the 60 s run did not stall.AI use
🤖 Generated with Claude Code
https://claude.ai/code/session_01XZrhsCAiLU1tTuEBwPLaRW
@ClosetPie107 on GitHub · 2026-11-25 13:09 UTC · original
Linux / AMD RDNA4 (RADV) test report for head
8eaad18merged locally ontomain1a0bbe3(clean merge).Environment
experimental-11.0-20261112), vkd3d-proton v3.1 (#257+dxil-spirvmaster694cc674), DXVKv3.1.1-209, DXC1.9.2609.5,x86_64-pc-windows-gnucross-compileTested (debug test binary under Wine,
XCL_ADAPTER=9070 XCL_REQUIRE_GPU=wave64,--test-threads=1 --nocapture)hle::d3d12x::list_x: 34 passed, 0 failed, 0 ignored, 0 skipped (0.32 s).hle::d3d12x::real: 56 passed, 0 failed, 0 ignored, 0 skipped (1.31 s).Not tested: full workspace suite, live
XCL_THREAD_DUMP_AToutput in a retail run, native Windows.AI use: T3 Code / Antigravity (Gemini 4 Neon) merged, built, ran the tests on this machine, and drafted this report.
@DavidM1911 on GitHub · 2026-11-25 16:42 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 2 real failures, deterministic (also fail--test-threads=1):Same pair of failures across this batch of PRs — looks like a shared feature area with two broken assertions. Needs fixes before merge.
— Devin
@kole07139 on GitHub · 2026-11-25 17:10 UTC · original
@DavidM1911 thanks for the run. I could not reproduce either failure. This PR only adds logging in
list_x.rsandhost.rs, and neither test goes through those files.On an RTX 3070, Windows 11, debug, with
cargo test -p xcl --lib -- rerouted_disk_entries_follow_the_direct_translator pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa --test-threads=1, both tests pass, 2 passed, 0 failed, on each of these:main55d64c2alonemain55d64c2main68a284apc_resource_desc_strips_uav…failed onmainitself after #1991, until #2245 (11:19 UTC). Amainfrom before that would show it with or without this PR.rerouted_disk_entries_follow_the_direct_translatorreads the translated-shader disk cache. Yourleft: 68may come from anXCL_DXIL_CACHEorXCL_DIRECT_DXILset in that shell, or from a cache folder earlier runs filled. That is a guess: I have not checked what the test reads.maincommit you merged, and whether either variable was set?AI use: Claude Code (Claude Opus 5.5) ran the three checks and wrote this reply.
@GreemSC on GitHub · 2026-11-25 18:42 UTC · original
A suggestion for this PR's sync-state lines, from runs where they would not have shown what held the title.
On our runs of the retail title after the first
#101, the three lines this PR prints would readpending title ID3D12Fences: none,XCL's own queue waits unmet: none,0 GPU waits armedwhile nothing was presented any more. What showed the stop was theSYNC_GRAPHcells that are behind their recorded value:rec > subwith nothing armed means a list that writes the value was recorded and never submitted: the submitting thread is stuck. Here the thread dump showed it: a title thread inbind::execute_indirect → dispatch_chain::whole → driver_pso(the case #2404 removes), and with #2404 a title thread inpso_async::resolve_for_bindinstead. The five bridgedprod=qNonewaits of the same runs (≥ 0x620 on 0x42437fe10…fee8) were already met, so they were not the block.The function we used (in
list_x.rs, next tointernal_waits_summary), if you want to fold it in:(
try_lock, because a thread dump can come while a submitting thread holds the graph.) Two more things that helped: unwinding 28 frames instead of 14 (with 14, the title-thread callers under XCL's frames were cut off, and we first read the stop wrongly), and dumping again on its own after N seconds with no present.Setup: RX 7900 XT, Mesa 26.2.5 RADV, Linux, Proton-CachyOS Wine 11, a local vkd3d-proton build; XCL
main68a284a+ #1732 + #684 + #1860 + part of #203 (+ #2404 + #2097 for the second reading);XCL_DIRECT_DXIL=1; retail 1.0.2.1; 180 s runs: 4 on the first tree (12 thread dumps, all with the three lines at none / none / 0 and the two cells behind), 1 so far with #2404 + #2097. This is not a PR of ours: no point in a second one next to yours.AI use: Claude Code (Claude Opus 5.5) wrote the diagnostic, ran the builds and runs, read the logs and wrote this comment.
@kole07139 on GitHub · 2026-11-25 19:35 UTC · original
Thanks, @GreemSC. In something like 1-2 hours i will implement the suggestions and a Claude Reply will come right after.
@kole07139 on GitHub · 2026-11-25 20:56 UTC · original
@GreemSC thank you. That is the case these three lines cannot see. Your
cells_behind_summaryis folded in as the second commit,944dc85, with you as co-author: eachXCL_THREAD_DUMP_ATdump now also logsWait64 cells behind: ….SYNC_GRAPHwithtry_lockand logs(sync graph locked)when it cannot get the lock.Retested on the new head (RTX 3070 8 GB, Windows 11):
main72f848c; the suite gives 1413 passed, 0 failed, 46 ignored;scripts/smoke.ps1: the description has the new block;XCL_THREAD_DUMP_AT=45logged the four lines, the lastWait64 cells behind: none(the title was not stalled).AI use: Claude Code (Claude Opus 5.5) folded the function in, ran the checks and wrote this reply.
@kole07139 on GitHub · 2026-11-25 21:30 UTC · original
@bmjask thank you, you are right.
readableis only a preflight: the title can decommit or protect a recorded cell's page between the check and the read, and the dump would then fault.Fixed in
97e22f6, folded into the second commit:ReadProcessMemoryon the own process. That isdstorage::read_own, the helperDirectStoragealready uses for title memory, madepub(crate). The kernel catches the fault, so the read cannot crash the dump.mem unreadableinstead of0, so it cannot be mistaken for a zero.the_cells_behind_summary_reads_a_decommitted_or_protected_cell_without_faulting:PAGE_NOACCESS;mem unreadable.mem 0x0. The race itself cannot be forced in a test; the test covers the state the race leaves.Retested on
97e22f6(RTX 3070 8 GB, Windows 11):cargo test --workspace --no-fail-fast -- --test-threads=4: 1414 passed, 0 failed, 46 ignored;scripts/smoke.ps1again: the new block is in the description.AI use: Claude Code (Claude Opus 5.5) made the change, wrote the test, ran the checks and wrote this reply.
@DavidM1911 on GitHub · 2026-11-26 00:59 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
@xpatfussy69x on GitHub · 2026-11-26 06:08 UTC · original
Test run on exact head
97e22f6merged intomainb49be18(with #1580; merges without conflicts), retail title 1.0.2.1, at the stop in its story load on a 12 GB card: the new summary names what is behind where nothing else did.Tested
XCL_THREAD_DUMP_AT=150,180,XCL_NETWORK=0, A every 4 s from 20 s, compute pipelines built ahead; presents, submits and DirectStorage go to 0 at ~86–140 s, no time-out.pending title ID3D12Fences: none,XCL's own queue waits unmet: none,0 GPU waits armed, andWait64 cells behind: 0x70417fe08: mem 0x0 done 0x0 sub 0x0@qNone rec 0x619 cpu 0x0 armed []; 0x70417fe00: …– a list that writes the cells recorded and never submitted. A second run gave the same pattern on other cells (rec 0x647). Details on #1452.Not tested
main, a thirdXCL_THREAD_DUMP_ATdump once faulted in ntdll on the dump thread,0xc0000005 … read at 0xacf, before this PR).AI use
@bmjask on GitHub · 2026-11-25 21:11 UTC · original · reviewed
P1 diagnostic crash hazard: cells_behind_summary calls readable(va,8) then directly dereferences *(va as *const u64) for persistent SYNC_GRAPH cells. readable is only a VirtualQuery/working-set preflight and does not pin the allocation; a title can decommit/reuse a recorded Wait64 address before XCL_THREAD_DUMP_AT runs, changing protection between check and dereference. Use ReadProcessMemory/fault-safe read or omit mem when it cannot be safely snapshotted, and add a recorded-cell -> decommit/protect -> summary regression.
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.