D3D12.X: a build a submit waits for is wanted from the moment its call is put off #2579
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!2579
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2579"
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?
@Royalflamejlh on GitHub · 2026-11-25 23:52 UTC · original
Royalflamejlh:fix/submit-wanted→main· +26 −20 · 3 files · 1 commits · openA pipeline that a put-off call needs (#2118) is wanted from the moment the call is put off, not from the moment the submit reaches it.
need_by_submitsetby_submitand moved the build ahead of the workers' queue, but the big-compile gate (real::big_compile_turn) reads onlywanted: untilrecord_deferredreached a call and marked the next four, those builds took the background slot one at a time. Sinceae00ec7wanted builds have a cap of their own (XCL_HUGE_PSO_WANTED_CONCURRENCY), so marking all of them no longer lets an unbounded number skip the commit headroom, and the look-ahead window of four goes.What is in it
pso_async.rs:need_by_submitcallswant();want(pso)is removed (its only caller was the window); testa_build_a_submit_needs_is_wanted: a build put off byneed_by_submithearsbuild_is_wanted(red without the one line:the build did not hear that a submit waits for it).list_x.rs:record_deferredno longer marks the next four (WANTED_AT_ONCEremoved).bind.rs:want_boundremoved.Tested
x86_64-pc-windows-gnu.cargo test --workspace --release --target x86_64-pc-windows-gnu --no-fail-fast -- --test-threads=4: lib 1300 passed, 3 failed, 27 ignored on this head against 1299, 3, 27 onmain08db802; the other binaries 122 passed, 3 failed, 20 ignored on both. The same six fail on both (directed_reference_basics,f64_programs_on_the_gpu,gpu_promoted_uav_clear_values_pass_create_committed_resource,disk_free_space_ex_reports_pls_quota,set_predication_buffer_state_and_kickoff,test_title_runs_and_game_folder_is_untouched). Two lib tests are skipped as they hang under Wine (#1706).cargo test --workspace -- pso_async:: list_x:: title_list:: bind:: alloc_pool:: dispatch_chain --test-threads=4in debug, 80 passed, 0 failed;scripts/smoke.ps1: 745 frames against 770 onmain08db802, both exit 0x0, 0 device removals, 0 crashes.XCL_DIRECT_DXIL=1 XCL_HUGE_PSO_WANTED_CONCURRENCY=6 XCL_PSO_DISK_CACHE=0 XCL_DXC_THREADS=4, noXCL_PSO_WAIT_MS. The tree is a local merge ofmaine0d93c8with #684, #751, #2082, #1860, #1599, #1798, #2404 and #2333 (so the splitExecuteIndirects are chained, not built on the title's thread), with and without this change. Each run starts from its own copy of one NVIDIA shader-cache folder (filled by one earlier run). Time the compute builds spent waiting at the big-compile gate after the first#101, summed from thedriver compile finishlines:queue.Waittimeout, no device removal in any.Regression run
Under Wine on Linux (RTX 4060 Ti;
scripts/smoke.ps1unchanged, run by PowerShell 7 withxcl.exestarted through Wine: "peak commit" reads 0 MB there,exit: 0x89is the wrapper ending Wine after XCL's ownprocess ends, andRTX 4060 Ti 8GBis the name vkd3d-proton gives this 16 GB card).main:
PR:
Not tested
XCL_HUGE_PSO_WANTED_CONCURRENCYat its default (2): the runs used 6.nvidia-dev: this does not apply there, asnvidia-dev(c044dc6d) does not have #2118, which this follows.AI use
@DavidM1911 on GitHub · 2026-11-26 00:08 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.Thanks!
— Devin
@oni-swr on GitHub · 2026-11-26 02:36 UTC · original
Test report for
93445592be144d697a0ba2323112a028502e8213, with its exact parent08db8020d323bf478964fcc586152cce54959cfcas the control. Each was a separate detached worktree with no uncommitted changes and its own target directory.Tested
XCL_ADAPTER=radeonandXCL_REQUIRE_GPU=wave64,meshwere set.cargo build --workspace -j 4: exit 0 on both.cargo test --workspace -j 4 --no-fail-fast -- --test-threads=4:gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1:seed 722: res[30] = 0x1, CPU 0x7fffffff, on 3 of 3 reruns on each commit (#2115).heap_window_out_of_memory_falls_back_to_the_switch_form(gpu_compute_e2e):no heap windows, but XCL_REQUIRE_GPU=wave64,mesh(#1651). WithoutXCL_REQUIRE_GPU, it printsSKIPPED …: no heap windowsandgpu_compute_e2eis 6 passed, 0 failed on both.SKIPPED: 6 lines, the same on both. They are thef16_programs_on_the_gpu/f32_programs_on_the_gpuper-lane forms refused for V_MUL_F16, V_PK_MUL_F16 and V_CVT_F16_F32 (#1426 semantics), in wave32 and wave64.cargo test -j 4 -p xcl --lib -- pso_async:: list_x:: bind:: --test-threads=4: head 63 passed, parent 62 passed, 0 failed on both.a_build_a_submit_needs_is_wantedon head: passed in 5 of 5 separate runs.pso_async.rs, built in a separate target dir) fails it:assertion left == right failed: the build did not hear that a submit waits for it, after the 10 s wait. So the test is red without the one-line change on this adapter.Not tested
scripts/smoke.ps1and any retail title: I used no game data, so this report has no regression run.XCL_HUGE_PSO_WANTED_CONCURRENCY, and timing of the big-compile gate.AI use
@ettehn on GitHub · 2026-11-26 12:00 UTC · original
A native Windows baseline trace that may help evaluate the default wanted cap (2). This was a retail title on an RTX 5070 Ti Laptop (12 GB), using #2220 at
419431cf, without #2579.q_execute_command_lists → record_deferred → resolve_waitfor a deferred compute PSO. A stack snapshot tied both threads to the same pending PSO object. The build was already markedwantedat that point, but both large-compile slots were occupied, and the worker was waiting inbig_compile_turn.I haven't run the #2579 head on this machine. For a default-cap comparison, I'd measure how long submit waits, whether that batch's fence is submitted, and whether another Present follows.
AI-assisted verification (OpenAI Codex).
github-bot referenced this pull request2026-11-26 12:40:17 +00:00
@Royalflamejlh on GitHub · 2026-11-26 13:03 UTC · original
In your trace the build was already wanted and waited on the cap for wanted big compiles (
XCL_HUGE_PSO_WANTED_CONCURRENCY, 2 by default). This pull request does not change that cap. What it changes is when a put-off build becomes wanted: at the moment its call is put off, instead of whenrecord_deferredcomes within three calls of it. With both slots taken, it would still wait as in your trace. The gate has no queue: when a slot frees, every waiting build is woken and the first to take the lock gets it (real.rs:4018,big_compile_turn). Onmainthe build the submit waits for already competes with the next three calls' builds. With this change it competes with every put-off build not yet built, of this batch and of any other list, so at a cap of 2 it can lose a slot more often. That is read from the code, not measured.The gate-wait numbers in the description were measured with the cap at 6, on an RTX 4060 Ti under Wine. The default of 2 was not measured. I will run the comparison you name at the default cap, with and without this head (how long the submit thread waits, whether that batch's fence is submitted, whether another Present follows), and post the numbers here.
AI use: Claude Code (Claude Opus 5.5) read the trace against the change and wrote this reply.
Posted without review by a person: the account owner was away and reads replies later.
@Prime1997 on GitHub · 2026-11-26 13:06 UTC · original · reviewed
Good within the reviewed scope; retain for integration. The deferred-bind priority fix is worth keeping. It marks the specific pending build wanted when the bind is deferred, so the compiler gate can distinguish work a title needs from background work.
PR head
93445592be144d697a0ba2323112a028502e8213integrated locally with current mainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7. The detached worktree remains at main with the combined changes staged, tree0ec9204890df8e2c269869fbec29294f8686e9d0; it is an uncommitted integration candidate, not a clean PR-head run. Source patch SHA-256cc2f36ef46e7be2a37329ec39f4394bcc8fb637f67971334c3dc4581e1466b4a.Targeted result: 1 passed, 0 failed, 0 ignored, 0 skipped. Each exact filter ran in a fresh process:
hle::d3d12x::pso_async::used_tests::a_build_a_submit_needs_is_wantedBuild:
cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated-target>. Run:<test-exe> <each-exact-filter-above> --exact --test-threads=1 --nocapture. Private executable/target paths are placeholders. Windows 11 Pro 26200, i5-10400, 32 GiB RAM, Rust 1.100.0 MSVC debug. These selected fixtures did not dispatch GPU work.Not tested: The fake-job fixture covers demand propagation. No latency improvement, actual driver-memory admission or live-title workload was measured. No whole suite or retail smoke was run for this batch; this is not merge certification.
AI use: Codex (GPT-6) reviewed source, ran the selected tests and verified raw results. Optional temporary Discord for coordinating contributor work, testing and comparing results.
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.