D3D12.X: with bounded pipeline waits, dispatches are not put off to the submit #2571
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2581"
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?
Imported from ivall/xcl. Originally posted by brothernog on 2026-11-26T00:02:35Z.
With
XCL_PSO_WAIT_MSset, a dispatch whose pipeline is still being built is recorded at once instead of being put off to the submit (#2118). On an RTX 3050 withXCL_PSO_WAIT_MS=1,mainlost the device in 2 of 2 runs right after the retail title's world start; with this change the title presented to the end of every 240 s run (4 runs, 0 device removals). The runs that led here and what they show about the stop after the world start are in a comment on #2088: https://github.com/xcl-dev/xcl/issues/2088#issuecomment-7178337074What changes
list_x::deferreturnsfalsewhenpso_async::waits_bounded(), soDispatchand a dispatchingExecuteIndirectwith an unbuilt pipeline take the path they took before #2118: the bind waits at mostXCL_PSO_WAIT_MS, then the call is skipped as a stand-in's.XCL_PSO_WAIT_MS, so with a bound the put-off only moves the wait, and it costs a segment (a PC command list) per call. WithXCL_PSO_WAIT_MS=1the title's world start put off thousands of calls (the log's counter passed 8,192 in one run; up to 1,024 extra segments per list), the lists'ClosereturnedE_OUTOFMEMORY(thenE_FAIL), and the device was removed (0x887a0001, "invalid call").XCL_PSO_WAIT_MS=1.Closefailure.Files
hle/d3d12x/pso_async.rs:waits_bounded().hle/d3d12x/list_x.rs: the check at the top ofdefer.Tested
main08db802+ this PR (d5d694b):cargo test --release -p xcl --lib -- --test-threads=4: 1304 passed, 0 failed, 27 ignored.cargo clippy --release -p xcl --all-targets: 838 warnings on08db802and on this branch.XCL_NETWORK=0 XCL_PAGE_BUDGET_MB=4096; XCL and NVIDIA caches warm from earlier runs):XCL_PSO_WAIT_MSmaine1d84b7maine1d84b7Close→E_OUTOFMEMORY)e1d84b7(0a3d310, with a second change switched off byXCL_SKIPPED_COMPUTE_GUARD=0)e1d84b7(0a3d310), unset, after all the runs aboved5d694b)Closefailure)The default control was repeated last because driver blobs kept piling up over the runs: the title still stops with warm caches. Past that point, with
XCL_PSO_WAIT_MS=1, the title records 1,000–10,000 dispatches per 2 s but presents only about every 2 s; that slow phase is not explained here.Regression run
Default settings (
XCL_PSO_WAIT_MSunset, where this PR changes nothing), back to back,mainfirst, one run each; frame counts vary from run to run:main08db802:This PR (
d5d694b):Overlap
waits_bounded()follow the new default.mainnow.Not tested
XCL_PSO_WAIT_MSvalues other than 1; what the title draws with skipped dispatches; runs longer than 240 s.AI use
AI-assisted.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T00:10:33Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 26 ignored.Thanks!
— Devin
Imported from ivall/xcl. Originally posted by itsSio on 2026-11-26T04:45:54Z.
Independent dual-PC NVIDIA full-workspace test report on clean head
d5d694b04b3e26abdef656af21c03d30a5027d9b.Tested
32.0.16.1088), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200,rustc 1.97.0(stable-x86_64-pc-windows-msvc), DXC1.9.2609.5, debug build (XCL_ADAPTER=NVIDIA)cargo build --workspace: exit 0cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1429 passed, 0 failed, 47 ignored (all 14 existingpso_async/defer tests pass)SKIPPED: 26 (wave64-only GPU tests,#1426wave32 f16/cvt refusals,heap_window_out_of_memory_falls_back_to_the_switch_form,pso_measurement_compiles_an_exact_synthetic_record)32.0.16.1088), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200,rustc 1.99.1(stable-x86_64-pc-windows-msvc), Windows SDK 10.0.26100 DXC1.8.2502.11, debug build (XCL_ADAPTER=NVIDIA)cargo build --workspace: exit 0cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1429 passed, 0 failed, 47 ignored (all 14 existingpso_async/defer tests pass)SKIPPED: 29 (same 26 as Machine 1 plus 3 requiringd3d12SDKLayers.dll)Not tested
scripts/smoke.ps1runs (including bounded-wait behavior underXCL_PSO_WAIT_MS)--release)AI use
Ran via Samaritan:
Imported from ivall/xcl. Originally posted by throny on 2026-11-26T16:18:16Z.
Test report: in the world on an RTX 4080 16 GB with
XCL_PSO_WAIT_MS=1. Tested together with #2422; with the two, no device loss in 2 runs against 2 of 2 without.Tested
main; they were ported by hand ontonvidia-devaf2cecc4+ #684 + #2697 + #2749 + #2729 + #2794 + #2817 (stack) + #2768 + #2782 + #2725. #2581:waits_bounded()afterwait_budget()inpso_async.rsand the early return as the first statement ofdeferinlist_x.rs. #2422: the AddRef probe and the forget-before-free order inpso_release(real.rs), keeping that branch'slate_release::hold_pipelinecall.cargo checkand a release build clean; the PRs' tests not run.XCL_PSO_WAIT_MS=1 XCL_GFX_PSO_WAIT_MS=200, world from about 170 s. Four runs, alternating: without, with, with, without.0x887a0005)0xc0000005in title code), no device loss0x887a0005)XCL_PSO_WAIT_MS(see #2688).dispatch with a pipeline still being built put off to the submitis in none of the four logs, also not in the two runs without the PR, andsplit command list … mid-list Waitappears 7–10 times in all four. So on this tree the put-off path was not what ran before the removals; if the fix works here, it is by another route, or the one that matters is #2422.E_OUTOFMEMORY/0x887a0001in any of the four.Not tested
main, their tests and the suite, AMD.AI use: Claude Code (Claude Sonnet 5.5 ported the two diffs, Claude Fable 5.2 ran the runs and wrote this).
Follow-up, same day: at default waits the two PRs do not stop the removal. Three more world runs of the same tree with both PRs and without
XCL_PSO_WAIT_MS: device removed (0x887a0005) in 3 of 3, after 76 s, 334 s and 114 s of world. So the 0 of 2 above is either specific toXCL_PSO_WAIT_MS=1or chance, and the removal this card has on this branch is a different one.Imported from ivall/xcl. Originally posted by throny on 2026-11-26T18:00:52Z.
Two contributors checked independently and found that #2547 solves the same problem in a different way: #1607, group D131. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-26T19:37:04Z.
Update: on top of #2849
Same machine, flags and warm cache as below. These runs are on top of #2849 (head
4e931734), which stops theucrtbasecrash that ended most runs below. That crash is #2841: 0 of 6 runs with #2849, against 6 of 9 without it.main+ #2849 (3a077ec6)main+ #2849 + this PR (2ceeef0a)game+0x23cf683, #662) at 257 smain+ #2849 + #2547 (77e8aa90)Closefailure.completedstayed at0x7a1/0x7a2, short of the submitted0x7a3, with queue waits timing out after 5 s). Nothing was presented or submitted for 55 s, then the title's own watchdog wrote to address 0.mainincluded) has "GPU queue.Wait … did not complete within 5000 ms" timeouts in some runs: 11 of the 21 runs had 4 to 73 of them. Usually the queues recover. In this run they did not. Amainrun (8b957bec, no PRs) also ended in this watchdog after a stall. So I don't think this PR causes the stall. One run is too few to tell whether it makes it more likely.Independent test report under Wine/Proton (not native Windows) for head
d5d694b0, merged cleanly ontomain8b957bec(test commit967bba96), compared withmainand with #2547. Part of the D131 check in #1607.Tested
AMD Radeon RX 9070 (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, 30 GiB RAM, CachyOS Linux 7.3.5
Proton Experimental
experimental-11.0-20261112,vkd3d-protonmasterec207194(dxil-spirvb540c8a2) with a local patch that drops thelpVtblidentity checks ind3d12_command_allocator_from_iface/d3d12_command_list_from_iface, DXVKv3.1.1-209, DXC1.9.2609.5, Rust 1.96.0, targetx86_64-pc-windows-gnu(debug for tests, release for the title)cargo test -p xcl --lib hle::d3d12x::pso_async:: -- --test-threads=4: 14 passed, 0 failed.cargo test -p xcl --lib hle::d3d12x::list_x:: -- --test-threads=4, 3 times per tree:main39 passed, 1 failed every time; #2581 the same; #2547 39 passed, 2 failed every time. On all three,a_dispatch_with_a_pipeline_still_building_waits_at_the_submitfails with device removed (0x887A0005).With
--test-threads=1:main40 passed, 0 failed (2 runs); #2547 41 passed, 0 failed (2 runs). That failing test passes alone onmain(2/2). So the device loss comes from the GPU list tests running in parallel under vkd3d-proton, and it already happens onmain.Retail title, release builds, 300 s per run (
XCL_RUN_SECONDS), A pressed every 10 s from 20 s. All 9 runs started from one copy of the same warm cache (DXIL, driver pipeline blobs, Mesa, vkd3d), seeded by twomainruns; shader preparation took 30 s in each. Run in rounds ofmain→ #2581 → #2547. Flags:XCL_PSO_WAIT_MS=50,XCL_DIRECT_DXIL=1,XCL_TEXTURE_LEVEL_PAGES=1,XCL_SPLIT_MIDLIST_WAIT=0,XCL_COHERENT_MB=1024,XCL_PSO_PRELOAD=1,XCL_NETWORK=0,VKD3D_CONFIG=ignore_shared_fence.main8b957becmain+ #2581 (967bba96)main+ #2547 (01e09d7f)(Put-off counts are the last power of two the log reported; dispatch counts are the last
console code so farline.)Closefailure (E_OUTOFMEMORY), or loggeddeferred dispatch skipped after waiting 30 s.0xc0000005reading inucrtbase.dll+0x1720b/+0x1724d, amemcpyof 4 KiB called from XCL. It happened on all three trees (main1/3, #2581 2/3, #2547 3/3). The same crash shows up in my runs ofmainfrom yesterday, so neither PR causes it. Three runs per tree are too few to say whether a PR changes how often it happens. It may be the XGcopy_fromcrash of #662 (on Windows it faults inVCRUNTIME140), but I have not checked the symbols.What the change does in the title: with it, no dispatch was put off to the submit (
main256–512+ per run), and 16–128 dispatches per run were skipped instead (main1–3). I could not reproduce the device removal from the description:mainwithXCL_PSO_WAIT_MS=50had noClosefailure or device removal in 3 runs. I did not testXCL_PSO_WAIT_MS=1. The change did not change the stall after the world start on this setup.Not tested
XCL_PSO_WAIT_MS=1(the setting in the description), unset, or other values; native Windows, NVIDIA/Intel, cold cachesucrtbasecrash happens: 3 runs are too fewAI use
Imported from ivall/xcl. Originally posted by Decodere on 2026-11-26T22:16:53Z.
Independent desktop NVIDIA verification of PR #2581 at head
d5d694b04b3e26abdef656af21c03d30a5027d9b(1commit; exact parent & merge-base:08db8020d323bf478964fcc586152cce54959cfc, pre-#2555ancestor ofmain).Environment
7956 MiBreported by D3D12), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200(Developer Mode off)rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC1.9.2609.5,--releaseTargeted release tests & build (
d5d694b0)cargo test --release -p xcl --lib hle::d3d12x::list_x::(3 consecutive runs)40 passed; 0 failed; 0 ignored; 1291 filtered out× 3 (0.68s,0.68s,0.68s)cargo test --release -p xcl --lib hle::d3d12x::pso_async::(3 consecutive runs)14 passed; 0 failed; 0 ignored; 1317 filtered out× 3 (1.06s,1.01s,0.71s)cargo build --release -p xcl --bin xcl1m 07s, exit0)Paired quiet 60 s retail smokes (
title: 29640639)Exact parent & merge-base (
08db8020d323bf478964fcc586152cce54959cfc, default env, cached baseline on the same machine):PR #2581 (
d5d694b04b3e26abdef656af21c03d30a5027d9b, default env —XCL_PSO_WAIT_MSunset):PR #2581 (
d5d694b04b3e26abdef656af21c03d30a5027d9b, liveXCL_PSO_WAIT_MS=1— bounded-wait path active):Runtime log observations (
xcl.log)9222lines,0[ERROR]/ device-removal / panic lines):19567 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample14002 MB committed by the process; video memory 6114 MB local, 4683 MB non-local.XCL_PSO_WAIT_MS=1(9223lines,0[ERROR]/ device-removal / panic lines,0Close: E_OUTOFMEMORYor deferred-segment failures):19555 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample13976 MB committed by the process; video memory 6115 MB local, 4652 MB non-local.Limits of coverage
XCL_PSO_WAIT_MS=160 s retail smokes ran against the existing warm shader cache ontitle: 29640639(menu capture), so neither run reproduced a cold world-start storm of thousands of unbuilt compute dispatches hittingClose: E_OUTOFMEMORY/0x887a0001.list_x::andpso_async::suites, and zero regression under both default (XCL_PSO_WAIT_MSunset) and bounded-wait (XCL_PSO_WAIT_MS=1) execution on RTX 4060.AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:36:00Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:25:16Z.
Triage (#1607) – head
d5d694bMain already has this change. Commit
79b1994("avoid deferred segments for bounded pipeline waits", merged with #2959) addspso_async::waits_bounded(), andlist_x::defer_with/defer_pipeline_waitreturnfalsewhen it is set. WithXCL_PSO_WAIT_MSthe dispatch is recorded right away and its bind waits for the same bound, which is the check this PR adds at the top ofdefer.#2547 (D131) takes the other approach and keeps the put-off dispatch waiting at the submit. It is not a duplicate of this PR.
Recommendation: close (superseded by main commit
79b1994).AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:54:32Z.
Closing as superseded: this change is already on
main(79b1994). main79b1994adds pso_async::waits_bounded() and defer_pipeline_wait(waits_bounded,..) returning false in list_x::defer_with: the same check as the PRTwo independent checks found this: Foniass's close list on #1607 and ours against current
main. If something here is still missing onmain, say so and reopen it, or ask and I will.AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.
Pull request closed