D3D12.X: log how long a bind waits for a pipeline still being built #899
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!899
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-899"
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?
@isaacwingate on GitHub · 2026-11-24 07:58 UTC · original
isaacwingate:resolve-wait-diagnostics→main· +243 −3 · 2 files · 1 commits · openA bind of a pipeline that is not built yet waits in
resolve_wait. When no worker has started the build, the bind does it itself. The wait lasts until the pipeline is built, unlessXCL_PSO_WAIT_MSsets a limit (#891), and it leaves no trace in the log. On an NVIDIA GPU, the retail title of #505 had its threads sit there for 3–23 s at a time in the driver's compiler. It took a profiler of the title's threads to see it, and the title's hang watchdog ended the run (#505, #675). This change counts those waits and logs them, so a run's log says whether pipeline builds held the title up. It also logs a wait that is still going past a second, so the wait a watchdog ends the run in is in the log. Nothing else changes. Part of #505.What is in it
crates/xcl/src/hle/d3d12x/pso_async.rs:resolve_waitcounts the calls that found their pipeline not built, graphics and compute apart (blocked()): how many, their total and longest time, and how many built the pipeline in the call.pipelines waited for at a bind so far: N graphics (… ms, longest … ms, … built in the call), M compute (…).a_wait_that_builds_the_pipeline_is_counted_with_its_time,a_bounded_wait_is_counted_with_the_time_it_waited.a compute pipeline has held up its caller for 1000 ms so far (being built in the call | waiting for a worker).xcl-pso-waitswrites these lines. It checks every 250 ms, runs only while a wait is open, and writes at most 32 lines.a_wait_is_open_while_it_runs,an_open_wait_is_logged_once_when_it_passes_a_second.crates/xcl/src/hle/d3d12x/real.rs:report.jsongets the counts at the end of the run asd3d12.pipeline_waits: graphics, then compute, each as (waits, total µs, longest µs, built in the call).mainwith #891: a wait withXCL_PSO_WAIT_MSis counted with the time it waited. The later binds of a late pipeline, which do not wait, are not counted.Heldguard in the same place: both stay, andHeldtakes thealreadyflag the count uses.main1d027e5.Tested
cargo test --workspace -- --test-threads=4on734e6e7: 963 passed, 0 failed, 43 ignored. The 23 SKIPPED lines:no wave64: the wave64 forms of thelower/lower_dxilGPU tests,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwaref16_programs_on_the_gpu/f32_programs_on_the_gpuheap_window_out_of_memory_falls_back_to_the_switch_form: no heap windowspso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cacheXCL_NETWORK=0, 240 s, on maine50836bwith the first version of this change:16 compute (92695 ms, longest 22694 ms, 16 built in the call),0 graphics, and a line for each long wait (a compute pipeline held up its caller for 22694 ms (built in the call)).1 compute (2 ms …).Regression run
Both with
XCL_COHERENT_MB=4095(without it the window is 512 MB or 4 GB, depending on the commit free at the start, #284), one after the other, with no input, so both stay in the title's menus.main:
PR:
Not tested
report.json's counts are covered by their tests only: I have not yet run the world load with this head.XCL_PSO_WAIT_MSset: the bounded path is covered by its test only.AI use
🤖 Generated with Claude Code
@throny on GitHub · 2026-11-24 08:54 UTC · original
Nine world-loading runs of
c3d5429on an RTX 4080: the new lines show what holds the title up here, with one gap worth knowing about.Tested
stable-x86_64-pc-windows-msvc; release.c3d5429merged ontomain09940bb(clean merge), one build, run nine times in a row.xcl run <folder>withXCL_NETWORK=0,XCL_ACTIVITY=1, one key press at the profile prompt; DXIL and driver-blob caches warm and kept between the runs.held up its callerlines after itso farline of each run counts 128–256 compute binds that found their pipeline not built, 0.9–2.5 s in all, the longest 36–84 ms (run 5 apart: its last such line already includes the stall).main(my #232 comment) show two title threads insideresolve_waitat that point. A line when a wait passes, say, 1 s, or the waits still open in the thread dump at the crash, would show it.One more observation, which I cannot tie to this PR: in 4 of the 9 runs the process did not exit after the exception (the log ends at the exception line, no thread list; my runner killed it after its timeout).
mainexited in all 11 runs I made without a debugger today; I have seen the same hang once with #754 and once onmainafter attaching a debugger earlier in the run.Not tested
AI use
@SlopTart on GitHub · 2026-11-24 09:34 UTC · original
Linux / AMD RDNA3 datapoint.
Merged state: head
c3d5429onto main09940bb, clean merge.Full suite,
cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 710 passed, 7 failed, 41 ignored; failures are the known Wine-lane set from my #42 rows. pipeline-build wait logging green.Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile,--test-threads=4. My Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
@Royalflamejlh on GitHub · 2026-11-24 14:53 UTC · original
Linux (Wine + vkd3d-proton) + NVIDIA test of the rebased head
f3b7dd6onmain67a3735+ #684, 2 runs of 130 s: the new lines put numbers on the stall of #662 here, but the wait the title is stuck in when a run ends is not logged, because a wait is only counted when it returns.Setup: Fedora 44 (kernel 7.2.9), Wine 11.21 Staging (Wayland driver), vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch,
VKD3D_CONFIG=ignore_shared_fence. RTX 4070 12 GB (driver 615.71.09, 32-lane waves), Ryzen 9 9950X3D, 64 GB RAM. Release, cross-compiled tox86_64-pc-windows-gnu(rustc 1.98.0), DXC 1.9.2609.5,XCL_NETWORK=0,XCL_PSO_PRELOAD=0,XCL_PSO_WAIT_MSunset. Retail title 1.0.2.1, the first-run screens completed once and no story progress, one A press at 44.8 s throughXCL_PRESS_AT. #684 (e56dbc3) is merged under it, becausemainalone faults incopy_frombefore this point;f3b7dd6merged onto that without conflicts.Tested
cargo test --release -p xcl --lib a_wait_that_buildsunder Wine: 1 passed, 0 failed.pipelines waited for at a bind so farlineheld up its callerlinesSo up to 102 s the title waited about 470 times for 2 to 3.5 s in all, and then one compute build held a thread for 25 s. Two runs of the head before the rebase (
c3d5429onmain09940bb) showed the same: about 450 short waits by 96 s, one wait of 23,678 ms logged in one run and none in the other, and the title's null write atgame+0x23cf68330 s after the last present.Read
pso_async.rs:466(note_blocked) is called at:386and:401, after the wait has returned, so a wait that is still going when the run ends leaves no line. Run 1 has noheld up its callerline although the title presented nothing for its last 28 s; in run 2 the 25.2 s wait is logged only when it ends, at 127.7 s. On the earlier head the run without a line ended with a title thread inpso_async::resolve_wait→real::build_compute→real::translated_compute_psoin XCL's end-of-process thread dump. Would a line when a wait passes one second, while it is still waiting, be in scope? It would name the wait that ends the run.pso_async.rs:484: the summary line comes at every power of two of one kind's count, so the last one before the stall is from 101 s to 102 s and the counts at the end of a run are not in the log. They are available throughblocked(); I did not find them added toreport.jsonin this diff.Not tested: the preload of #690 on (with it on, the title did not reach its world load in 100 s on this machine, so both runs had it off);
XCL_PSO_WAIT_MSset; the rest of the test suite; AMD and Intel.AI use: Claude Code (Claude Fable 5.2) read the diff, built the tree, ran the test and the title, read the logs and the thread dump and wrote this report.
@isaacwingate on GitHub · 2026-11-24 22:10 UTC · original
@throny @Royalflamejlh thanks, you both found the same gap. Pushed
734e6e7, rebased ontomain1d027e5:D3D12.X: a compute pipeline has held up its caller for 1000 ms so far (being built in the call). A thread namedxcl-pso-waitswrites it; the thread runs only while a wait is open and writes at most 32 such lines. The wait that runs into the watchdog now shows up in the log before the stop. Tests:a_wait_is_open_while_it_runs,an_open_wait_is_logged_once_when_it_passes_a_second.report.jsonhas the counts at the end of the run,d3d12.pipeline_waits(graphics, then compute: waits, total µs, longest µs, built in the call).Suite and regression runs on the new head are in the description.
@Royalflamejlh on GitHub · 2026-11-24 23:42 UTC · original
@isaacwingate
734e6e7closes the gap here: the waits that are open when the title stops presenting are now in the log, and the counts are inreport.json. Linux (Wine + vkd3d-proton) + NVIDIA,734e6e7merged ontomain689f2db+ #684, 1 run of 120 s, setup otherwise as in my comment above (A at 18.4 s this time).being built in the calland 11waiting for a worker. One of the five at 119.2 s, a build in the call open since 118.0 s, had not returned when the run ended at 120.0 s, so the new line is its only trace in the log. For examplereport.jsonhas"pipeline_waits": [[23, 1651887, 457996, 10], [57, 163356355, 18448678, 34]]: 23 graphics waits of 1.7 s in all, and 57 compute waits of 163.4 s in all (summed over the waiting threads, up to five at once), the longest 18.4 s, 34 of them built in the call. The 57 are waits that returned: the one still open at the end is not in them.Not tested: more than this 1 run; a run the title's watchdog ends (this one ended at the 120 s asked for); the cap of 32 lines; the suite on this head.
AI use: Claude Code (Claude Fable 5.2) built the new head, ran the title and wrote this reply.
Posted without review by a person: the account owner was away and reads replies later.
@JJAutoCompare on GitHub · 2026-11-25 05:50 UTC · original
Empirical test report (
734e6e78)PR #899 adds wait diagnostics for binds that encounter a pipeline still being built. Tested detached commit
734e6e78b0049cf1192d2ed2e18ecd2ebb8adc63with a clean worktree.Hardware / environment
10.0.26200.0on an AMD64 Family 23 Model 113 Stepping 0 CPU with 12 logical processors. The fixtures use CPU threads and synthetic pipeline jobs. No GPU adapter was used.rustc 1.100.0 (0ef1bc386 2026-11-09)and DXC1.9.2609.5 (01b62ad47). Cargo used the test profile with debug information and incremental compilation disabled.Commands and results
cargo test --workspace --no-runcompiled the workspace test executables (exit 0).cargo test -p xcl --lib pso_async::tests::ran withXCL_ADAPTER=NONE_CPU_ONLYandRUST_TEST_NOCAPTURE=1outsideInvoke-ArcTest.ps1. The focused log contained 4 passed, 0 failed, 0 ignored, 0 skipped and reported a test duration of 0.40s.Observed behavior
Not tested
report.jsongeneration in a game.AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr899-focused.logand published.@DavidM1911 on GitHub · 2026-11-25 09:41 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.