D3D12.X: binds go on without big compute programs that write only images #2176
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!2176
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2176/head"
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?
@madaraXor on GitHub · 2026-11-25 07:35 UTC · original
madaraXor:d3d12x-binds-skip-image-only-cs→main· +253 −0 · 4 files · 1 commits · merged 2026-11-25 10:57 UTCA compute pipeline is waited for at its first bind, because a dispatch left out would leave its outputs unwritten. That is right for programs that write memory:
XCL_PSO_WAIT_MSgoes on without every late program, also culling passes whose counts anExecuteIndirectreads next, and ends in a GPU hang (#675). But many of the programs a retail title's world start waits on write nothing but images: ray-tracing resolves, one per material, 73 – 118 KiB of console code and about 1 MB of DXIL each, 22 – 172 s apiece in an RDNA2 driver, bound one after another. WithXCL_PSO_IMAGE_SKIP=1binds do not wait for those; everything that writes memory is waited for as before. Off by default. Part of #505 and #1269.What is in it
crates/xcl/src/gpu/effects.rs(new):of(code)reads a program's writes from its instructions. Memory: MUBUF / MTBUF / FLAT / GLOBAL / SCRATCH / SMEM stores and atomics, and the global data share (ds_append/ds_consume/ds_ordered_count/ GWS, any DS op with GDS set). Images: MIMG stores and atomics. LDS is the group's own. The whole program is read, also past an earlys_endpgm; an instruction that does not decode before the end makes the answer unknown (treated as memory).big_and_image_only(blob): the CS of a console container (FSSM or FSPX) with 16 KiB of code or more and no memory write. Not a translator source: translated caches keep their keys.crates/xcl/src/hle/d3d12x/pso_async.rs:image_skip()(XCL_PSO_IMAGE_SKIP=1);image_only(standin)marks a pending pipeline; its binds takeresolve_spared: the real pipeline once built, else the stand-in (its dispatches are left out, as for a late pipeline underXCL_PSO_WAIT_MS) with the build sent to the workers. Nobody waits for it, so the build is not "wanted" and takes its turn among the driver's compiles.crates/xcl/src/hle/d3d12x/real.rs: a compute pipeline whose shader is big and image-only is marked when it is created.gpu::effects::tests(4: images vs memory, code after an early end, GDS, code that does not decode) andpso_async::used_tests::a_bind_does_not_wait_for_a_pipeline_that_writes_only_images(fails without thesparedbranch: the bind waits for the build and the test times out after 5 s).Beside #2118, #2114, #1652, #2001. #2118 moves the wait from the bind to the submit, #2001 to the first
Dispatch; #2114 and #1652 cap how long binds wait and then go on without any late program. None chooses by what the program writes. This one goes on only without programs that write no memory, and can sit on top of any of them. It touchespso_async.rsandreal.rslike #2118; whichever merges first, I rebase.Tested
5f4d32f(this commit onmain6567c5f).cargo test --workspace --no-fail-fast -- --test-threads=4: 997 passed, 5 failed, 45 ignored. The same 5 fail onmain6567c5fin the same session (990 passed, 7 failed, 45 ignored; its two other failures aree2etests that passed in the PR's run):gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 540),hle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory(#650), andtitle_textures::tests::placed_title_textures_share_vram_and_preserve_pixels,title_textures::tests::transitions_apply_when_their_list_is_submitted,vram::tests::d32s8_targets_take_their_own_size_of_video_memory, which pass when run alone on both. SKIPPED: the six wave32 / wave64 per-lane cases off16_programs_on_the_gpu/f32_programs_on_the_gpu(refused),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).XCL_NETWORK=0, cold driver cache, on a local tree with this change and other open PRs the title needs to reach its world load (#684, #751, #1182, #1248, #1291, #1405): withXCL_PSO_IMAGE_SKIP=1, binds went on without 65 such programs by 733 s, with no device removal and no GPU wait that did not complete. The tree also had two local changes for this machine: at most two driver compiles at once, and three screen-probe programs the driver never finishes left out. The world load still stopped presenting from about 480 s, held by builds of compute pipelines that write memory and of graphics pipelines (cold caches). A 90-minute run of the same kind on a newer tree (main62265d3, also with #1809): 65 programs went on without a wait from 703 s on, no device removal and no crash in 5 400 s; the world load was still waiting on driver builds of memory-writing compute and of graphics pipelines when it ended.gpu::effects(a temporaryxcl shaderspass, not in this PR): 2 682 distinct compute programs; 1 051 have 16 KiB of code or more, and 444 of those write no memory (338 of the 801 bigCS_RaytracingResolvevariants, all 18CS_RTShadowTrace32*); none fails to decode. Of the 74 programs the driver cold-compiled one bind at a time in five earlier world-load runs (0.9 – 1.45 MB DXIL, 22 – 172 s each, 3 never finished), 30 write only images. The other 44 write a typed buffer (buffer_store_format_xyzw), 38 of them only past an earlys_endpgm, and are waited for as before.Regression run
scripts/smoke.ps1, 60 s, release builds, run back to back,XCL_PSO_IMAGE_SKIPunset (the default).main:
PR:
Not tested
AI use
🤖 Generated with Claude Code
@fromthemoonx on GitHub · 2026-11-25 08:09 UTC · original
Passes on NVIDIA (RTX 3060), at the head and merged onto current main, with and without
XCL_PSO_IMAGE_SKIP=1. The new bind test fails without thesparedbranch.5f4d32f(base6567c5f):cargo build --workspace+cargo test --workspace --no-fail-fast -- --test-threads=4: 1002 passed, 0 failed, 45 ignored.568e7db(no conflicts): 1159 passed, 0 failed, 46 ignored. The same withXCL_PSO_IMAGE_SKIP=1: 1159 passed, 0 failed, 46 ignored. 24 SKIPPED, the same as onmain(no wave64, the per-lane refusals, no heap windows).gpu::effects::tests(4) +a_bind_does_not_wait_for_a_pipeline_that_writes_only_images: 10 of 10 runs.sparedcheck inresolve_wait_fordisabled (pso_async.rs:594), the bind test fails (pso_async.rs:447, after 5 s), and it is the only lib test that fails.Hardware: RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, DXC 1.9.2602.17, debug.
Not tested: a title (no smoke run here), so not the world start this is for or how long its binds take; a release build.
AI use: Claude Code (Claude Opus 5.5) ran the tests and the mutation check and wrote this report.
@Royalflamejlh on GitHub · 2026-11-25 10:45 UTC · original
Linux (Wine + vkd3d-proton) + NVIDIA test of
5f4d32fmerged onmain568e7dbwith #684, the title, cold driver caches: in 1 of 3 runs withXCL_PSO_IMAGE_SKIP=1a bind went on without an image-only program, at 148.0 s, where the description's runs first bound one after 550 s. The binding thread did not wait, twoExecuteIndirectcalls were left out, and there was no fault or device removal by the end at 150 s. Presents had stopped long before, at 68 to 82 s in every run, while title threads built big compute programs the change does not mark; with one run each way, the table does not show whether the switch moves that.Setup: Fedora 44, Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch, RTX 4070 12 GB (driver 615.71.09). Release,
x86_64-pc-windows-gnu, Series X profile,XCL_PSO_PRELOAD=0,XCL_SKIP_BINK=1,__GL_SHADER_DISK_CACHE=0,WINEDEBUG=err+all,fixme-all; every logged driver compile haddriver blob absent. The title 1.0.2.1, the first-run screens completed once and no story progress, A at 18.2 to 18.3 s. One DXIL cache for all runs; the run without the switch was last.XCL_PSO_IMAGE_SKIP=1XCL_PSO_IMAGE_SKIP=1#101writes only images is still being builtlinesExecuteIndirect … still being built skipped1ac709a63ba53d37, 267,764 B of DXIL, 1,963 ms).resolve_spared,pso_async.rs:682), so none of those was marked. The first,2e0055c25f49848a(375,040 B), started at the stop in each run.#101by 100 s and printed 0 of the change's lines.Not tested: past 150 s, so whether leaving those dispatches out moves the world load; the preload on; the direct backend; the test suite beyond
gpu::effectsandpso_async(11 of 11 passed under Wine); Windows; AMD and Intel.AI use: Claude Code (Claude Opus 5.5) read the change, built the tree, ran the title and wrote this comment.
Posted without review by a person: the account owner was away and reads replies later.
@raylitebull on GitHub · 2026-11-25 10:47 UTC · original
Code review on
5f4d32f:gpu::effects::ofcleanly distinguishes memory/LDS-GDS/indirect-arg writers from image-only compute programs, keepingXCL_PSO_IMAGE_SKIP=1safe for memory-producing passes while preventing binds from stalling on multi-second>=16 KiBimage-only shaders.Remaining before merge:
Build and testfinishing green plus dual-vendor (AMD + NVIDIA) verification on5f4d32f.