Repository navigation
D3D12.X: log how long a bind waits for a pipeline still being built - #899
isaacwingate wants to merge 1 commit into
Conversation
|
Nine world-loading runs of Tested
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). Not tested
AI use
|
|
Linux / AMD RDNA3 datapoint. Merged state: head Full suite, Not tested: retail titles (none here), Windows, RDNA4. 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 AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting. |
c3d5429 to
f3b7dd6
Compare
|
Linux (Wine + vkd3d-proton) + NVIDIA test of the rebased head 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, Tested
So 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 ( Read
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); 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. |
f3b7dd6 to
b293619
Compare
pso_async means a graphics pipeline still being built to go on with its stand-in, which draws nothing, while a worker builds it; only compute pipelines are waited for (a skipped dispatch would leave its outputs unwritten). But graphics_bound and ExecuteIndirect called resolve_wait, which waits for the build - and builds it on the title's thread when no worker has started it. With lazy pipelines that is every graphics pipeline's first draw. On an NVIDIA GPU the retail title of xcl-dev#505 had its threads held 1 - 5 s per draw in the driver's compiler as its world loaded: 25 graphics binds, 33.2 s in all within 25 s (counted with xcl-dev#899's log), and its hang watchdog ended the run. A test report on xcl-dev#889 (RTX 4080) found a title thread held in bind::execute_indirect -> resolve_wait at the abort. Draws and ExecuteIndirect now take their pipeline with resolve_for_bind: a graphics one still being built goes to the workers and the draw uses its stand-in (ExecuteIndirect skips, as it already did for a pending one); a compute one is waited for as before. With this, the same world load logged no graphics wait. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A bind of a pipeline that is not built yet waits in resolve_wait, and builds it itself when no worker has started it - until it is built unless XCL_PSO_WAIT_MS sets a limit (xcl-dev#891), and with no trace in the log. On an NVIDIA GPU a retail title's threads sat 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 (xcl-dev#505, xcl-dev#675). resolve_wait now counts the calls that found their pipeline not built, for graphics and compute apart: how many, their total and longest time, and how many built it in the call. A wait with a limit is counted with the time it waited; a late pipeline's later binds, which do not wait, are not. The counts are logged at every power of two, and each wait of a second or more is logged (the first 32). Nothing else changes. A wait still going is logged too, once it passes a second (from the thread xcl-pso-waits, which runs only while a wait is open): the wait a title's hang watchdog ends it in never returns, so it is never counted. report.json gets the counts (pipeline_waits). Measured with it on that title (RTX 5080, XCL_NETWORK=0, 240 s): 16 compute binds built their pipeline in the call, 92.7 s in all, the longest 22.7 s; no graphics bind waited. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Taken: the per-kind counters of resolve_wait (waits, total and longest time, built in the call) and their line at every power of two, which integ did not have. Left out: the per-wait "held up its caller for N ms" warning. integ logs each long wait already (try-psowait: "a bind has waited", "a bind waited ... in all", "on the binding thread"); a second line for the same event is not wanted. Conflicts: resolve_wait_for has want(), XCL_PSO_SKIP_HUGE and build_aside in integ; a call is counted when its pipeline is not built, not late and not known to be too big at entry. The PR's tests take 0x7E57_C00x stand-ins (0x7E57_8001/2 are used by a_bound_pipeline_does_not_wait_for_the_big_ compiles_of_the_ones_built_ahead) and the 3-argument resolve_wait_for.
b293619 to
734e6e7
Compare
|
@throny @Royalflamejlh thanks, you both found the same gap. Pushed
Suite and regression runs on the new head are in the description. |
|
@isaacwingate
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. |
Empirical test report (734e6e7)PR #899 adds wait diagnostics for binds that encounter a pipeline still being built. Tested detached commit Hardware / environment
Commands and results
Observed behavior
Not tested
AI use Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
A 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 D3D12.X: XCL_PSO_WAIT_MS bounds how long a bind waits for a pipeline being built (retail world renders) #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=4on 734e6e7: 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 main e50836b with 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