D3D12.X: a build a submit will wait for is wanted from the put-off call on #2832
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!2832
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2832"
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?
@NWProgramming00 on GitHub · 2026-11-26 16:31 UTC · original
NWProgramming00:pso/submit-wanted→main· +34 −1 · 1 files · 1 commits · closed without mergingPart of #2088. It also bears on the world-start stalls in #505, a step on the #1833 roadmap.
A call put off to the submit (
need_by_submit, from #2118's dispatches and #2611's graphicsExecuteIndirects) moves its pipeline's build before the workers' queue, but the build stays unwanted until the submit itself waits for it. A huge unwanted build waits inbig_compile_turnfor both the unwanted slot and 3 GB of commit headroom. While a title loads its world on a machine with little free commit, that headroom does not come. Put-off builds then go through the gate one at a time, each only once its submit waits for it, while the other workers sit in the gate.This makes the build wanted from the put-off call on. A submit is going to wait for it anyway. A huge one then takes a slot of the wanted cap (
XCL_HUGE_PSO_WANTED_CONCURRENCY, default 2) without the commit wait, as the build a submit already waits for does today. The cap still bounds how many huge builds the driver runs at once.@KDenKC suggested this go in its own PR (#2611 and the reply below it).
What is in it
crates/xcl/src/hle/d3d12x/pso_async.rs:need_by_submitcallswant()the first time a pipeline is needed by a submit. The rest is unchanged: theNEEDEDqueue, the wanted cap, and the commit wait for builds nothing needs yet (preloads and plain background builds).a_pipeline_a_submit_needs_is_wanted_before_the_submit_waits: a worker's build seesbuild_is_wanted()turn true afterneed_by_submit, with nobody waiting. It fails onb49be18: the build never became wanted.Tested
XCL_ADAPTER=radeon), AMD Ryzen 7 9700X, 31 GB RAM (commit limit 41.7 GB), Rust 1.100 MSVC, release.b49be18("a call put off to the submit did not make its build wanted") and passes with the change. All 15pso_asynctests and the 11big_compilegate tests pass.cargo build --release --workspace, thencargo test --release --workspace --no-fail-fast -- --test-threads=4, with and withoutXCL_DIRECT_DXIL=all, against baseb49be18on the same machine:b49be18e2ecdfa)XCL_DIRECT_DXIL=allXCL_DIRECT_DXIL=allThe +1 is the new test. The failing tests are the same on base and PR in every row:
fuzz_validate_and_gpu_0..3on NVIDIA (#1905) andfuzz_validate_and_gpu_1on the Radeon (#2115).SKIPPEDlines: 46 on NVIDIA, 28 on the Radeon, the same on base and PR.XCL_NETWORK=0 XCL_ACTIVITY=1, RTX 5070 Ti). These were made with the same change behind a local switch, onb49be18+ #2611 + #2613, from the same cache copy. Details: #2611big_compile_turnand the title's submit inrecord_deferred → resolve_wait.D3D12 device removed: 0x887a0005, with no DRED or shader-code count. I cannot tell whether that is #2403's shader-code heap, reached sooner because pipelines are made faster, so I do not claim either way.mainalone the change reaches #2118's put-off dispatches. I have no run that isolates their gate waits.Regression run
Base (
main), NVIDIA GeForce RTX 5070 Ti:This PR, same card:
These 60 s runs end in the title's menus, before the world load where put-off builds pile up, so they check that nothing else changed.
Not tested
AI use
🤖 Generated with Claude Code
@KDenKC on GitHub · 2026-11-26 16:47 UTC · original
@NWProgramming00 heads-up before reviewers find it: #2579 (@Royalflamejlh, open) makes the same one-line change,
p.want()inpso_async::need_by_submitthe first time a call is put off. It also removesWANTED_AT_ONCE/ the bound inlist_x.rsandbind.rs. Yours only touchespso_async.rsand doesn't conflict with #2611, so it may still be the easier one to merge, but the two threads should probably link each other. Our RTX 5090 contrast (base =main+ #2611 + #2613, arm = base + this PR, your recipe from 7193653105) is queued, and it applies to the line both PRs share.AI use: Claude Code (Claude Opus 5.5) compared the two diffs and wrote this.
@thehollowedone on GitHub · 2026-11-26 16:55 UTC · original
Independent Windows/NVIDIA check of current #2832 head
e2ecdfa9. Clean tracked tree; RTX 3080 Ti (driver 621.35), Ryzen 7 9800X3D, Windows 11 build 26300, rustc 1.99.1 MSVC, DXC 1.8.2502.11.XCL_ADAPTER=NVIDIAwas set.cargo test --offline --locked -p xcl --lib hle::d3d12x::pso_async::used_tests::a_pipeline_a_submit_needs_is_wanted_before_the_submit_waits -- --exact --test-threads=1 --nocapture: 1 passed, 0 failed, 0 ignored on the head. With only the newp.want()call removed locally, the same test failed, 0 passed / 1 failed after its three-second wait (a call put off to the submit did not make its build wanted). I restored the line and confirmed a clean tree before the suite.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4: 1,435 passed, 1 failed, 47 ignored across 37 test targets; 25 GPUSKIPPEDnotices, excluded from coverage. The sole failure wasconsole_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk(DXIL not compiled yet). I also ran that test alone on the PR's exact parentb49be183: 0 passed, 1 failed, same error. It reproduces without this change on this machine.I checked the overlap already raised with #2579: both add
p.want()inneed_by_submit; #2579 additionally removes the older lookahead calls. This report tests #2832's smaller current head, not the combined variants.Not tested: a cold world-load timing comparison, retail smoke, AMD/Intel, or Linux/Wine. The focused result verifies demand propagation, not faster first-frame time.
AI use: Codex (GPT-6.2 Sol) reviewed the diff and overlap, ran the tests and local control, checked the baseline failure, and drafted this report.
@NWProgramming00 on GitHub · 2026-11-26 16:57 UTC · original
Closing in favour of #2579, which makes the same
need_by_submit→want()change. It was opened first and also removes the look-ahead window that the change makes unnecessary. I put my world-load measurements and the caveat about the device removal on #2579. Thanks @KDenKC for linking the two.Pull request closed