D3D12.X: with XCL_PSO_WAIT_MS set, a put-off dispatch waits for its pipeline at the submit instead of being dropped #2547
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!2547
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2547"
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?
@grahamster2 on GitHub · 2026-11-25 22:36 UTC · original
grahamster2:pso-wait-deferred-no-drop→main· +368 −3 · 3 files · 2 commits · openWith
XCL_PSO_WAIT_MSset, a dispatch put off to the submit (#2118) can be left out for good while the list's labels still fire. This makes the submit wait for the put-off call's pipeline, with a long bound and a logged fallback. Part of #505 and #1452. It does not get the retail title past its world start: in the one world run below the title still stops presenting, at about 72 s.A
Dispatch, or anExecuteIndirectthat dispatches, whose pipeline is still being built gets a segment of its own and is recorded atExecuteCommandLists/KickoffX(list_x::record_deferred). That recording went throughresolve_wait, with the same budget a bind has while the title records. A pipeline that a bind had already foundlategot the stand-in at once, and one still building got it after the budget. Either way the dispatch was counted as skipped and dropped, and nothing said so beyond the skip count. Its segment sits between the list's other segments, so theWrite64labels, EOP writes and fence signals after it still ran: the title read the work as done, but the dispatch's UAV outputs, counters and indirect argument buffers were never written. #891 made skipping opt-in for binds as the title records ("skipped dispatches leave their outputs unwritten") because the title's watchdog ends it when its main thread stands still for about 30 s.At the submit the waiting thread counts as held (
title_held). That stops two clocks:kernelx::Sleepdoes not count the time, and the GPU-wait watchdog does not release waits meanwhile. It does not stop every clock a title can read, so a long wait at the submit can still reach the title's own watchdog. The change therefore bounds the wait, and the bound is the escape.What the submit does now (
pso_async::wait_for_submit, called byrecord_deferredbefore it records each put-off call)XCL_PSO_WAIT_MSunset: it waits until the pipeline is built, as the submit already did.XCL_PSO_WAIT_MSset:SUBMIT_WAIT_MOST, the time #891 measured the title's watchdog allowing). Past that the call goes on with the stand-in as before, with a WARNdeferred dispatch skipped after waiting 30 s for its pipeline (N so far)and a count of its own.lateno longer matters at the submit.XCL_PSO_WAIT_MSstill bounds binds while the title records.resolve_for_bindwaits only for those.catch_unwindaround the job). Before, it leftdoneunset and whoever waited for it waited for good. A lock the job held when it panicked can still be left poisoned.From reading the code, not from a test: a build that fails still gets the stand-in and its dispatch is skipped, and a program binds do not wait for (
XCL_PSO_IMAGE_SKIP=1) is still left out. A call that cannot be put off (deferfails: bundle, predication, segments used up, no allocator) still binds with the budget where it is.dispatch_droppedinrecord_deferredis not changed. It counts the two cases where the put-off call cannot be recorded at all: the list's own allocator is gone, or the segment'sResetfailed. Waiting does not help there, because the call has already been taken out of the title's list and there is no PC list to record it on.What is in it
crates/xcl/src/hle/d3d12x/pso_async.rs:wait_for_submit,SUBMIT_WAIT_MOSTand its counter,catch_unwindin a worker's build, and test-only per-thread overrides of the budget and the bound. Testsa_submit_builds_a_late_pipeline_no_worker_has_started,a_submit_waits_for_a_build_on_a_worker_no_longer_than_its_bound,a_build_that_panics_on_a_worker_ends_as_failed.crates/xcl/src/hle/d3d12x/bind.rs:wait_for_bound(the pipeline a segment has bound); test helperset_args_for_test.crates/xcl/src/hle/d3d12x/list_x.rs:record_deferredwaits throughwait_for_boundbefore it records the call; testa_put_off_dispatch_runs_at_the_submit_when_its_build_outlasts_the_wait_budget.Tested
cargo test -p xcl --lib -- --test-threads=4on the head commit: 1302 passed, 0 failed, 26 ignored. 24 SKIPPED lines, allno wave64(or wave32 per-lane forms refused) on this card; the four new tests ran.alloc_pool, andmid_list_write64_wait64_split_avoids_cycle_and_reuses_sparesandcross_queue_cycle_and_same_queue_fifo_do_not_deadlockforget theirs before use, because another test's stale allocator type at a reused address made them fail in a whole-module run.cargo test -p xcl --lib hle::d3d12x::list_x::tests:: -- --test-threads=4, 3 sets of 100 runs on the head: 7, 2 and 6 failed runs, none in those two tests (maine1d84b7, 2 sets: 2 and 3 failed runs,mid_list_...1 time andcross_queue_cycle_...2 times). The other failures are the module's flaky tests:a_dispatch_with_a_pipeline_still_building_waits_at_the_submit(also on main), and a cluster ofcpu_watchdog_...,cpu_cycle_break_...anda_reset_while_the_last_submit_runs_...failing together in one run (6 of the 300 runs on the head; on main the same cluster, withouta_reset_while_..., came up once in 200). Not looked into. Fullcargo test -p xcl --libon the head: 1302 passed, 0 failed, 26 ignored, with and without--test-threads=4.a_put_off_dispatch_runs_at_the_submit_when_its_build_outlasts_the_wait_budget(GPU): a translated console compute program stores a constant through a pointer in its argument table. Its stand-in's build ends 400 ms into the submit, the budget is 50 ms, and a bind has already found it late. The dispatch is put off, aWrite64BitValueBottomOfPipeXfollows it in the same list, and the list runs on a queue. With the change both the store and the label reach memory. With thewait_for_boundcall removed it fails:the put-off dispatch was left out (the submit waited 487.1µs), while the label was written.a_submit_builds_a_late_pipeline_no_worker_has_started: with every worker busy and a 30 ms budget, the submit's wait for a late pipeline builds it on the waiting thread. Withwait_for_submitdoing what the submit did before (resolve_wait), it fails:the submit's wait ended without the pipeline(it got the stand-in).a_submit_waits_for_a_build_on_a_worker_no_longer_than_its_bound: a worker's build that does not end, a 20 ms budget and a 300 ms bound. The submit returns after the bound, counts it and logs the WARN. With the bound raised to 8 s it fails on the time it waited.a_build_that_panics_on_a_worker_ends_as_failed: without thecatch_unwindthe build never ends (the test fails after 10 s).89a8267. That head had the same change without the 30 s bound, the compute check and thecatch_unwind. It used the world start settings of the earlier runs (XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_DRED=1 XCL_PSO_WAIT_MS=50 XCL_NETWORK=0, A pressed at 14, 17, 21, 25, 31 s, cold driver cache and a seeded DXIL cache). It is compared with one earlier run ofmain6d12f58with the same settings (e1d84b7, this branch's base, differs from it only inREADME.md). One run each. The thread dumps show no title thread inrecord_deferredor in a bind, so this run is context for where the title stands, not evidence for the change.6d12f5889a826789a8267, from 2 s to 72 s: 0 16 60 54 39 43 60 56 59 60 60 61 60 60 57 46 46 60 60 60 60 45 58 33 1 4 3 0 2 6 23 42 56 23 11 11; then 0 to the end of the run. Onmain: 0 15 61 54 40 41 60 56 60 60 60 60 60 60 56 45 43 60 60 61 60 44 59 32 6 4 6 0 7 50 48 31 11 13; then 0.xcl-psoworker was building at 100 or 185 s (2 of 11 at 269 s). From 79 s on, XCL loggedWait64BitValueXwaits bridged toqueue.Waitwith no producing queue (prod=qNone), the pattern of #1452.Dispatch with a pipeline that has no translated console shaderwarnings. The log does not say which caller they came from, and no failed or rejected pipeline was logged. Binds of late pipelines that could not be put off fit the timing; this change leaves those as they were.Regression run
Default settings (
XCL_PSO_WAIT_MSunset), so these runs check that nothing else changed. They do not exercise the budget or the bound.main:
PR:
Not tested
cargo test --workspace); only thexcllib tests ran.XCL_PSO_WAIT_MSunset. No world run enteredrecord_deferredwith a pipeline still building.ExecuteIndirectandKickoffXat the submit with a pipeline built after the budget (the tests useDispatchthroughrecord_deferred).XCL_PSO_IMAGE_SKIPcases at the submit (read from the code, not tested).AI use
AI-assisted (Claude Code).
@DavidM1911 on GitHub · 2026-11-25 22:46 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!
@emirduran707 on GitHub · 2026-11-25 22:52 UTC · original
Independent AMD RDNA4 (native wave64) verification of exact PR head
ec538f118a185eda91bdd7da6e63e6d0d40ed5dfon Windows 11 Pro 26300 (AMD Radeon RX 9060 XT 16 GB, driver32.0.31044.16, Ryzen 5 5600, Rust 1.100.0 MSVC, DXC1.9.2602.17).Tested
cargo build --workspace(debug): passed (0errors).cargo test --workspace --no-fail-fast -- --test-threads=4:1425 passed, 2 failed, 46 ignored(8 SKIPPED: 6 per-lane DXIL forms refused by host adapter/driver, 1heap_window_out_of_memory_falls_back_to_the_switch_formno heap windows, 1pso_measurement_compiles_an_exact_synthetic_recordWindows Developer Mode off).hle::d3d12x::list_x::tests::a_put_off_dispatch_runs_at_the_submit_when_its_build_outlasts_the_wait_budgethle::d3d12x::pso_async::used_tests::a_build_that_panics_on_a_worker_ends_as_failedhle::d3d12x::pso_async::used_tests::a_submit_builds_a_late_pipeline_no_worker_has_startedhle::d3d12x::pso_async::used_tests::a_submit_waits_for_a_build_on_a_worker_no_longer_than_its_boundgpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1andfuzz_validate_and_gpu_3) are pre-existing on unmodifiedmainon this RX 9060 XT / driver32.0.31044.16.cargo build --release -p xcl+ 60 s retail-title smoke test (scripts/smoke.ps1, offline):(Compare against
main68a284aon this machine:1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)Not tested
XCL_PSO_WAIT_MSexplicitly set to a non-default value.AI use
@SlopTart on GitHub · 2026-11-25 23:33 UTC · original
Tested: current PR head merged onto current
origin/main(clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo targetx86_64-pc-windows-gnurun under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).gpu_suite (cold cache): 165 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.Targeted run of the four new deferred-dispatch tests (
a_submit_builds_a_late_pipeline_no_worker_has_started,a_submit_waits_for_a_build_on_a_worker_no_longer_than_its_bound,a_put_off_dispatch_runs_at_the_submit_when_its_build_outlasts_the_wait_budget,a_build_that_panics_on_a_worker_ends_as_failed): 4 passed, including the timing-sensitive wait-bound ones.Not tested: retail titles (no title data on this lane, counts only).
AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
@grahamster2 on GitHub · 2026-11-26 02:39 UTC · original
Thanks for the runs. I reproduced it: on
ec538f1mid_list_...failed 12 times in 100 here. Forgetting the new test's own allocator did not change that (12 in 100 again). A debug print showed why: the stale DIRECT type at the address the new compute allocator got was left bycpu_cycle_break_..., another test in the module, so the new test mostly changes which addresses get reused. The test side fix is in60349e5: the put-off dispatch test now callsalloc_pool::forgeton its allocator, andmid_list_write64_wait64_split_...andcross_queue_cycle_...forget theirs before use. The runtime code is unchanged, so this does not depend on #2333.list_x::tests::,--test-threads=4, 3 sets of 100 runs on60349e5: 7, 2 and 6 failed runs,mid_list_...andcross_queue_cycle_...0 times in 300.maine1d84b7, 2 sets: 2 and 3 failed runs,mid_list_...1 time andcross_queue_cycle_...2 times. The remaining failures are the module's flaky ones (a_dispatch_with_a_pipeline_still_building_waits_at_the_submitand a cpu_watchdog / cpu_cycle_break / a_reset_while cluster), not looked into. Fullcargo test -p xcl --libpasses on the head (1302 passed).AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this.
@DarkPanda69 on GitHub · 2026-11-25 22:40 UTC · original · edited 2026-11-26 02:46 UTC
Update for head
60349e5: rerun onmainb49be18, same filters, cards and--nocapture.pso_async17 passed,put_off_dispatch1 passed,a_submit_3 passed on both the RX 9070 XT and the RTX 3060, 0 failed, no SKIPPED.AMD run on RDNA4, a GPU with native 64-lane waves (listed as untested), plus an RTX 3060: the new tests pass on both cards, with no skips.
Head
ec538f1applied onmaine1d84b7, debug, Windows 11 Pro 26200, card chosen withXCL_ADAPTER, each filter run with--nocaptureso that skips show:cargo test -p xcl --lib -- <filter>pso_asyncput_off_dispatch(a_put_off_dispatch_runs_at_the_submit_when_its_build_outlasts_the_wait_budget)a_submit_(the 3 submit tests)The put-off dispatch test passed its
no GPU/no wave64/no unified memorychecks on both cards and made itsCreateComputePipelineStatethrough the backend hook on each. Thepanicked at pso_async.rs:1014line in the output comes froma_build_that_panics_on_a_worker_ends_as_failed, which passes.Which wave width the runtime picked for the test's 64-thread program on the RX 9070 XT is not checked by the test or by this run.
Not tested:
cargo test --workspace, a world run, Intel.AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
@fromthemoonx on GitHub · 2026-11-25 23:18 UTC · original · edited 2026-11-26 03:10 UTC
Rerun on the new head
60349e5:mid_list_write64_wait64_split_avoids_cycle_and_reuses_sparesno longer fails in parallel here (0 in 200 runs, was 15 in 200), andcross_queue_cycle_and_same_queue_fifo_do_not_deadlockfails less (3 in 200, was 9 in 200). Thanks for tracing the stale type tocpu_cycle_break_….cargo test --workspace --no-fail-fast -- --test-threads=4,60349e5merged ontomainb49be18(clean)SKIPPEDlineshle::d3d12x::list_x::tests::,--test-threads=4, 2 × 100 runsa_dispatch_with_a_pipeline_still_building_waits_at_the_submit11× (as onmain),cross_queue_cycle_…3× (all in the first 100; I did not keep their messages, earlier ones wereE_OUTOFMEMORY),mid_list_…0×First run, on
ec538f1: Whole suite on NVIDIA passed; the new tests passed 30 of 30 alone, but in parallel two olderlist_xtests became flakier.Tested:
ec538f1(its base ismaine1d84b7, so head = merged). RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug.cargo test --workspace --no-fail-fast -- --test-threads=4SKIPPEDlines; the 4 new tests ran and passedhle::d3d12x::pso_async::(17 tests),--test-threads=8, 30 runshle::d3d12x::list_x::tests::,--test-threads=4, 100 runs:mainmainalready (a_dispatch_with_a_pipeline_still_building_waits_at_the_submit11×,rotating_queue_…1×)mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares15× (E_INVALIDARGfrom thereset_fn(wrap_c, a_comp…)atlist_x.rs:7290) andcross_queue_cycle_and_same_queue_fifo_do_not_deadlock9× (E_OUTOFMEMORYatlist_x.rs:6256)--skip a_put_off_dispatch_runs_at_the_submit, 100 runsmainoness.types.insert(raw, ty)inalloc_pool::created_on(scratch), 100 runsmainones,cross_queue_cycle_…once (E_OUTOFMEMORY) andcross_queue_wait64_…once; nomid_list_…So the runtime change looks fine: without the new test, the PR's
list_xruns fail likemain's. The new test seems to leave a stale allocator type inalloc_pool, the cause @ivall found in #2333, andmid_list_…then resets a compute list on a direct backing allocator. Paired with only the new test, neither older test fails (40 runs each, 2 threads); it takes the whole module running alongside. Once #2333 is merged that part should go away. Thecross_queue_…out-of-memory failures look like several GPU tests at once.Not tested: a world run with
XCL_PSO_WAIT_MS, a release build, AMD (covered above).AI use: Claude Code (Claude Opus 5.5) ran the suite, the repeats and the scratch change, and wrote this report.
@luckyteagirl on GitHub · 2026-11-26 07:00 UTC · original · reviewed
wait_for_submitcan take an unstarted job after the wait budget and callcomplete(&p, job())on the submitting thread. A build closure that panics there bypasses the newcatch_unwindin the worker'sbuild()path, so the submit unwinds beforecompletepublishes the failed result. This path is new whenXCL_PSO_WAIT_MSis set and workers are busy; the existing panic regression runs only on a worker.Could this submit-owned job use the same panic-to-failure handling as
build()? Combining the saturated-worker fixture with a panicking target would verify thatwait_for_submitreturns and the pending entry becomes failed. This is an exact-head source review of60349e51011d8fd4295c00776b2617b229b32d27; I did not run that interleaving on a GPU. AI-assisted review with Codex.@Aniseto on GitHub · 2026-11-26 07:07 UTC · original
Ran the deferred-dispatch submit tests at
60349e51:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build.
Results
cargo test -p xcl --lib pso_async -- --test-threads=4: 17 passed, 0 failed (exit 0)cargo test -p xcl --lib list_x -- --test-threads=4: 41 passed, 0 failed (exit 0)The author's four new tests pass here:
a_submit_builds_a_late_pipeline_no_worker_has_started,a_submit_waits_for_a_build_on_a_worker_no_longer_than_its_bound,a_build_that_panics_on_a_worker_ends_as_failed, and the GPU testa_put_off_dispatch_runs_at_the_submit_when_its_build_outlasts_the_wait_budget(the log confirms the real adapter and the deferred dispatch being executed at submit). The author notes some flaky tests inlist_x; this run was clean at 4 threads.What this adds: the author tested on an Ampere RTX 3080; this is a Blackwell wave32 part with a different driver and DXC version. The thread has no report from another machine.
Not tested: a retail world run (the author's still stalls), a paired 60 s smoke run, the whole workspace suite, AMD and Intel GPUs, native wave64, Wine, release profile, title data.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
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.