D3D12.X: preserve used-pipeline key on RT-gated compute stand-ins #2755
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!2755
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2755"
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?
@Saksukella on GitHub · 2026-11-26 10:15 UTC · original
Saksukella:fix/rt-gated-used-pipeline-key→amd-dev· +19 −5 · 2 files · 1 commits · openWhat is in it
crates/xcl/src/hle/d3d12x/pso_async.rs:key: u64intosubmit_gated(standin, driver, key)instead of hardcodingkey: 0.XCL_RT_GATE=hold,resolve()/resolve_for_bind()already callp.note_use()(used::note(p.key)), so storing the real pipeline key letsused-pipelines.txtrecord bound RT compute pipelines for targeted offlinexcl shaders ... --precompile --pipelines --used-only --only csruns before switching toXCL_RT_GATE=auto. Prerequisite: this capture path applies when shared stand-in shells are enabled (defaultstandin::enabled() == true; disabled underXCL_SHARED_STANDINS=0or console-shaped lists, wheremaybe_rt_gated_compute_psotakes the rawstandin_computebranch without apso_asyncentry).submit_gated_maps_driver_without_pending_or_enqueueto assert non-zero key preservation viaentry()without touching the on-diskused-pipelines.txtcache.crates/xcl/src/hle/d3d12x/real.rs:single_shader_key(hash)(matchingshaders_key(&[blob])without cloning the shader bytes) and passsingle_shader_key(record)inmaybe_rt_gated_compute_pso.a_key_follows_the_shaders_and_their_order_and_is_never_zeroto verifysingle_shader_key(fnv64(&a)) == shaders_key(&[a]).amd-dev(wheresubmit_gated/XCL_RT_GATElive).Tested
32.0.32029.2010), 24-thread x86_64 CPU, 32 GB RAM, Windows;rustc 1.100.0 (0ef1bc386 2026-11-09); debug (tests) and release (xcl.exe).cargo test -p xcl --lib submit_gated_maps_driver_without_pending_or_enqueue: 1 passed, 0 failed (0.00s).cargo test -p xcl --lib a_key_follows_the_shaders_and_their_order_and_is_never_zero: 1 passed, 0 failed (0.00s).Regression run
Not tested
AI use
pso_async::submit_gated/used::notereachability, writing the zero-allocation key helper and unit tests, and running local tests and smoke verification. All diffs and measurements were verified locally on hardware.@luckyteagirl on GitHub · 2026-11-26 10:22 UTC · original · reviewed
The
used-pipelines.txtcapture path described here requires shared stand-in shells. At4bb6b30,maybe_rt_gated_compute_psocallssubmit_gated(..., key)only whenstandin::shellreturned a nonzerodriver; withXCL_SHARED_STANDINS=0or console-shaped lists enabled,standin::enabled()is false and creation takes the rawstandin_computebranch instead. A successful bind then has no pending key forresolve()to record. This is a scope limitation of the proposed workflow, not a new regression introduced by this patch; the new tests inject a key directly and do not cover creation with shells disabled.Could the PR description name the shared-standin prerequisite for the
XCL_RT_GATE=hold→--used-onlyworkflow? That would keep users from treating a capture in either non-shell configuration as complete. Exact-head source review assisted by Codex (GPT-6.2 Sol and GPT-6.2 Astra); I did not run a non-shell title capture.@Saksukella on GitHub · 2026-11-26 10:26 UTC · original
Good point @luckyteagirl — updated the PR description to state explicitly that the
XCL_RT_GATE=hold->--used-onlycapture path applies when shared stand-in shells are enabled (defaultstandin::enabled() == true, not underXCL_SHARED_STANDINS=0or console-shaped lists).@vibryxcx on GitHub · 2026-11-27 01:05 UTC · original · edited 2026-11-27 04:24 UTC
I tried to see the new behaviour on a retail title on Windows / RDNA2. No RT-gated key reached
used-pipelines.txtin either tree. Nothing regressed, but I could not confirm the change works in a real run either.Setup: RX 6800 (driver 32.0.21045.5002), Windows 11 Pro 26200, release. This head sits on
b5c0275f, where my shader cache is cold (about an hour of recompile), so I merged it onto the currentamd-devbf7c82ee(no conflicts) and compared that merge (adafbeb) withbf7c82ee. DefaultXCL_RT_GATE(hold), shared stand-ins on (the log haspipelines whose shaders are not compiled yet get a stand-in…).Method: each run started from an empty
used-pipelines.txt, withXCL_PREPARE=0so that the title starts at once and A pressed every 10 s. Each run lasted 120 s. The log names each held pipeline asRT-gated compute PSO <record> held back without compiling, and<record>is the samefnv64(cs)this PR passes tosingle_shader_key. So for each logged record I computedsingle_shader_key(record)and looked for it in the file afterwards.used-pipelines.txtbf7c82eebf7c82ee+ this PRWith a full file (1,892 lines from earlier runs) neither tree added a line, so that comparison says nothing.
Reading:
submit_gatedstores the key andresolve/resolve_for_bindcallnote_use, which looks right. My guess is that in these 120 s the title creates the 15 RT PSOs (at about 25 s) but never binds them, sonote_usenever runs. I could not check this, because binds are not logged. If there is a scene or switch that makes the title dispatch these (or a log line for a gated stand-in's first bind), I can rerun it.Tests on the merge, debug:
submit_gated_maps_driver_without_pending_or_enqueueanda_key_follows_the_shaders_and_their_order_and_is_never_zeropass (2 passed, 0 failed). I did not run the full suite.Not tested: this exact head on its own base (
b5c0275f);XCL_SHARED_STANDINS=0; runs longer than 120 s; NVIDIA.AI use: Claude Code (Claude Opus 5.5) merged and built the trees, ran the title, computed the keys from the logs and wrote this comment.
Update: full lib suite on this exact head (
4bb6b30f, on its own baseb5c0275f; RX 6800, debug,cargo test -p xcl --lib -- --test-threads=1, with the tests skipped that hang or abort only inside the fullamd-devrun andxgameruntime::gamesave::testsrun on their own, see #42): 1519 passed, 11 failed, 27 ignored, andgamesave11/11. The 11 failures are the setb5c0275falready has on this card (#2757):fuzz_validate_and_gpu_1,dispatch_chain_native_wave64_builds_whole,a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier,f32_programs_on_the_gpu,two_pass_binds_set_the_shared_view_heap,a_dispatch_with_a_pipeline_still_building_waits_at_the_submit,a_put_off_dispatch_runs_at_the_submit_when_its_build_outlasts_the_wait_budget,bitset_runs_emit_exact_contiguous_page_ranges,giant_driver_compiles_have_their_own_lane,title_bytes_are_used_in_place_when_all_are_readable,physical_home_without_sparse_windows_uses_coherent_window. Both tests this PR changes pass.github-bot referenced this pull request2026-11-27 02:39:22 +00:00
@andrewDoing on GitHub · 2026-11-27 04:33 UTC · original
I checked the first actual bind of a gated compute pipeline on head
4bb6b30fand its parentb5c0275f, with the same synthetic shader and test-only fixture. Both builds created a shared held pipeline shell and had no entry for the expected key immediately after creation. The fixture then created a real direct command list and calledSetPipelineState; it did not callsubmit_gatedor the resolve helper directly.On the parent, the key remained absent after the bind and the assertion failed. On the PR head, the expected key appeared in
used-pipelines.txtand the test passed with no reported skip. Both runs logged the same held shader and expected key. This verifies capture on the tested shared-shell bind path; it does not establish whether any of the 15 held retail pipelines were bound or measure cold compilation savings.AI use: OpenAI Codex with GPT-6.2 Astra constructed and ran the synthetic parent/head comparison; Codex coordinated and prepared this report.
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.