D3D12.X: share dispatch-chain root signatures per device and key compute blobs on NodeMask #2723
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!2723
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2723"
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?
@ZekkJJ on GitHub · 2026-11-26 08:30 UTC · original
ZekkJJ:fix/dispatch-chain-rs-cache→main· +786 −40 · 5 files · 1 commits · draftCaches
dispatch_chainD3D12 root signatures per(device, static_samplers)instead of allocating a fresh root signature per split compute program, isolates per-device ABI root signatures, and includesNodeMaskinCOMPUTE_BLOBScache keys.Part of #2688 (Workstream 7) and relates to #2088. Based on
main(b49be183).What is in it
crates/xcl/src/hle/d3d12x/real/dispatch_chain.rs:ID3D12RootSignaturehandles inSIGNATURESkeyed by(device_raw, sampler_words)so split compute programs on the same device share one COM root signature (outside the lock duringCreateRootSignatureand distinct across multiple D3D12 devices).compute_containerkeysCOMPUTE_BLOBSon the pipeline'srshandle, sharing the root signature allows split compute programs that share identical pieces (or rebuild a released split PSO) to reuse compiled driver blobs fromCOMPUTE_BLOBSviaCachedPSOinstead of allocating redundant root signatures and storing duplicate driver blobs.COMPUTE_BLOBShits without duplicate entries across distinct split programs sharing a>= 16 KBcs_6_0piece and across release/rebuild.crates/xcl/src/hle/d3d12x/real.rs:ABI_RS(ABI_RS_DEV/ABI_RS_BY_DEV) inabi_rs_raw,abi_rs_cached, andabi_root_signatureso a secondID3D12Devicein the same process never receives another device'sID3D12RootSignature.copy.NodeMaskincompute_blob_key_for(used bycompute_container) while preservingcompute_blob_key(..., 0)semantics for existing callers, plus unit and GPU tests.Tested
32.0.16.1656) + Microsoft Basic Render Driver (WARP),rustc 1.98.1, DXC1.8.2502.11.cargo build --locked --workspace -j 2: passed (0errors).cargo test --locked -j 2 -p xcl --lib hle::d3d12x::real::dispatch_chain::tests -- --test-threads=1:4 passed; 0 failed; 0 ignored(1.23s;0skipped, verified on RTX 4060 + WARP).cargo test --locked -j 2 -p xcl --lib hle::d3d12x::real::compute_blob_tests -- --test-threads=1:3 passed; 0 failed; 0 ignored(0.16s;recorded_split_selects_cached_whole_or_piecesreturned early withoutXCL_SAMPLE_RUNTIME_COMPUTE;abi_rs_raw_isolates_distinct_devicespassed on RTX 4060 + WARP).cargo test --locked -j 2 -p xcl --lib hle::d3d12x:: -- --test-threads=1:257 passed; 0 failed; 2 ignored(16.36s; ignored timing benchmarksearly_commit_timingandchurn_update_tile_mappings_timing).cargo test --locked -j 2 -p xcl --test gpu_compute_e2e -- --test-threads=1:7 passed; 0 failed; 0 ignored(8.61s;SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows).cargo test --locked -j 2 -p xcl --test e2e -- --test-threads=1:4 passed; 0 failed; 0 ignored(19.14s).git diff --check: passed (0errors).Regression run
scripts/smoke.ps1execution on an unpacked retail build and full workspace test sweep before marking ready for review.Not tested
cargo test --workspaceoutsidehle::d3d12x::,gpu_compute_e2e, ande2e; pairedscripts/smoke.ps1(no unpacked retail title directory on this machine); AMD / Intel hardware; Linux / Wine.AI use
Gemini); assisted with root-cause analysis, implementation, hardware GPU tests, and PR preparation under author direction.@luckyteagirl on GitHub · 2026-11-26 08:37 UTC · original · reviewed
At exact head
859da94on current mainb49be18, the new per-device ABI signature cache is not used by the command-list fallback for a second device. This is a source-derived review; I did not run a two-device title replay.abi_rs_raw(this)now correctly stores a signature for each device, butabi_rs_cached()chooses using the process-widedevice_raw()instead of the device that owns the list.console_list::closealready has the actual PC list, yet obtains its fallback signature from that global lookup;bind.rsuses the same fallback. If device A is global and a translated PSO/list belongs to device B, a B signature can exist inABI_RS_BY_DEVwhile the list receives A's signature, orclosecan reportno XCL ABI root signaturewhen A has none. The addedabi_rs_raw_isolates_distinct_devicestest checks cache creation and a B PSO, but never binds the fallback on B's command list.Could the fallback lookup accept the owning device (for example from the list's
GetDevice) and use that in both replay/bind paths? A two-device test with global A and a B list using a translated PSO with no own/static-sampler signature would exercise the new behavior end to end.AI assistance: GPT-6.2 Sol found the missing device context; GPT-6.2 Astra independently checked the exact-head call sites and wording.
@luckyteagirl on GitHub · 2026-11-26 08:43 UTC · original
Independent focused Windows check of exact PR head
859da94ed2ba8300719bf9ec9027f2f7eba4d6a6in a clean detached checkout. Upstream main wasb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7.Tested
30.0.13002.13003), Rust 1.99.0 MSVC; debug build with an isolated Cargo target.XCL_ADAPTER=6800MandXCL_REQUIRE_GPU=1in the environment, rancargo test --locked -p xcl --lib abi_rs_raw_isolates_distinct_devices -j 1 -- --test-threads=1 --nocapture: 1 passed, 0 failed, 0 ignored, noSKIPPEDnotice, 1,338 filtered out. The test creates a default hardware device and a WARP device, verifies separate cached ABI signatures, and creates a PSO on the second device.Limitations
create_device(None)for its hardware device and does not print its adapter. The environment value alone does not prove that device was the RX 6800M. This check does not exercise the command-list fallback discussed in my review, the full workspace suite, or a retail title.AI use
@Lum7nt on GitHub · 2026-11-26 09:03 UTC · original
Tested on \
859da94ed2\ (\859da94e, clean PR head):ustc 1.100.0\ (\x86_64-pc-windows-msvc), DXC \1.8.2502.11\ (Windows SDK \10.0.26100.0), debug profile, \XCL_ADAPTER=nvidia, Windows Developer Mode off.
ecorded_split_selects_cached_whole_or_pieces\ returned early without \XCL_SAMPLE_RUNTIME_COMPUTE).
@ZekkJJ on GitHub · 2026-11-26 09:04 UTC · original
Updated PR head to
cfbaaace(cfbaaace9b2a0bffd433512b80163e2370a9c9b1) addressing all review items, including @luckyteagirl's multi-device command-list fallback finding:abi_rs_cached_for_list): Addedabi_rs_cached_for_list(&ID3D12GraphicsCommandList)incrates/xcl/src/hle/d3d12x/real.rsusinglist.GetDevice(&mut dev)(with readable and non-null vtable slot 7 guards for synthetic unit mocks) so real command lists use their owning device exclusively and never fall back to globaldevice_raw()/ABI_RS. Updated bothconsole_list::close(console_list.rs:743) andbind::bind_abi(bind.rs:1045) to callabi_rs_cached_for_list.hle::d3d12x::bind::tests::two_device_command_list_fallback_isolates_bind_abi_and_console_listincrates/xcl/src/hle/d3d12x/bind.rs, exercising global Device A + real Device B command lists and a translated compute PSO withoutPSO_RSacross both phases (None/"no XCL ABI root signature"refusal before Device B caches an ABI RS, and binding Device B'srs_bonto Device B's lists in bothbind_abiandconsole_list::close).NodeMask, and panic safety: Normalizedcanonical_device_keyacross interfaces (IUnknowncast with mock vtable guards), isolatedABI_RS_SAMPLERSper(dev_key, sampler_words), validatedSIGNATUREShits viaGetDevicewithsignature_retention_and_device_child_lifetime, addeddriver_cache::name_for_node/path_for_nodefor non-zeroNodeMaskincompute_container(keepingNodeMask == 0filenames unchanged), and replaced test fixture cleanup indispatch_chain.rswith RAIIFixtureCleanup.Remaining Draft blocker: PR #2723 remains Draft until paired
scripts/smoke.ps1runs onmain(b49be183) andcfbaaace9b2aon a host with an unpacked retail title.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.