Skip to content

D3D12.X: share dispatch-chain root signatures per device and key compute blobs on NodeMask - #2723

Open
ZekkJJ wants to merge 1 commit into
xcl-dev:mainfrom
ZekkJJ:fix/dispatch-chain-rs-cache
Open

ZekkJJ wants to merge 1 commit into
xcl-dev:mainfrom
ZekkJJ:fix/dispatch-chain-rs-cache

Conversation

@ZekkJJ

@ZekkJJ ZekkJJ commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Caches dispatch_chain D3D12 root signatures per (device, static_samplers) instead of allocating a fresh root signature per split compute program, normalizes/isolates per-device ABI root signatures (including command-list fallbacks and static-sampler variants), and keys COMPUTE_BLOBS plus persistent non-zero NodeMask disk cache entries.

Part of #2688 (Workstream 7) and relates to #2088. Based on main (b49be183), updated at 2d14195e83eb5b1505c8c06793d9425c15337f0b. Diff size (817 insertions, 40 deletions across 5 files) is predominantly the new review-requested unit, GPU, and two-device command-list tests alongside the focused runtime change, which keeps one cohesive per-device root-signature and cache-identity fix.

What is in it

  • crates/xcl/src/hle/d3d12x/real/dispatch_chain.rs:
    • Cache dispatch-chain ID3D12RootSignature handles in SIGNATURES keyed by (canonical_device_key, sampler_words) so split compute programs on the same device share one COM root signature (outside the lock during CreateRootSignature, distinct across multiple D3D12 devices, and validated on hit via GetDevice).
    • Document intentional process-lifetime retention (at most one ID3D12RootSignature per distinct (device, static_sampler_set)) and verify D3D12 device-child lifetime in signature_retention_and_device_child_lifetime.
    • Allow split compute programs sharing a >= 16 KB cs_6_0 piece (or rebuilding released split PSOs) to reuse compiled driver blobs from COMPUTE_BLOBS via CachedPSO, with panic-safe RAII fixture cleanup (FixtureCleanup Drop guard retaining per-run nonce DXIL cache isolation).
  • crates/xcl/src/hle/d3d12x/real.rs:
    • Normalize COM device identity across interfaces (canonical_device_key casting to IUnknown with readable / non-null vtable guards for synthetic unit mocks) and isolate ABI_RS_DEV / ABI_RS_BY_DEV and ABI_RS_SAMPLERS per canonical device.
    • Add abi_rs_cached_for_list(&ID3D12GraphicsCommandList) resolving the list's owning device via GetDevice (only falling back to abi_rs_cached() on synthetic mocks lacking vtable slot 7), so secondary devices never inherit the global device's ABI root signature.
    • Key compute_blob_key_for (process-local in-memory COMPUTE_BLOBS only) and driver_cache::name_for_node / path_for_node on non-zero NodeMask (-n{node_mask:x} suffix; NodeMask == 0 retains the existing {fnv64:016x}-{len:x}-{flags:x}.{ext} filenames).
    • Add unit tests covering abi_rs_raw, abi_rs_for with static samplers, abi_root_signature() including zero-device fallback, and driver_cache::tests.
  • crates/xcl/src/hle/d3d12x/bind.rs & crates/xcl/src/hle/d3d12x/console_list.rs:
    • Update bind::bind_abi and console_list::close fallback root-signature lookups from global abi_rs_cached() to abi_rs_cached_for_list.
    • Add isolated subprocess two-device E2E test two_device_command_list_fallback_isolates_bind_abi_and_console_list passing owned .clone().into_raw() references to console_list::wrap_pso and console_list::create_with_allocator, verifying abi_rs_cached_for_list across distinct devices, null-slot-7 mock fallback, and both refusal (no XCL ABI root signature, never binding Device A's RS) and Device B RS binding across bind_abi and console_list::close when a GPU UMA window is available (skipping only UMA replay via runner::skip_test("no GPU UMA window") when uma_window_vas() has VA 0 on headless WARP runners).
  • crates/xcl/tests/gpu_compute_e2e.rs:
    • Add abi_root_signature_tracks_registered_backend_device verifying abi_root_signature() / abi_rs_cached() ownership against device_raw().

Tested

  • Hardware: Windows 11, NVIDIA GeForce RTX 4060 Laptop GPU + AMD Radeon 780M Graphics (driver 32.0.31033.3) + Microsoft Basic Render Driver (WARP), rustc, DXC 1.8.2502.11.
  • cargo build --offline --locked --release -p xcl -j 2: passed (0 errors; 1 pre-existing dead-code warning in untouched vram.rs).
  • cargo test --locked --workspace -j 2 -- --test-threads=4 --nocapture on 2d14195e (RTX 4060): 1443 passed, 0 failed, 47 ignored (xcl lib 1316 passed; 27 ignored + 127 passed; 20 ignored across 23 integration test targets, including gpu_compute_e2e and e2e).
    • SKIPPED GPU/host checks on RTX 4060 (wave32-only, Windows Developer Mode disabled, no heap windows): gpu::dxil::kernel::dispatch_chain_native_wave64_builds_whole (no wave64), gpu::recomp::lower::tests wave64 checks, gpu::recomp::lower_dxil::tests wave64 and wave32 per-lane gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 checks (V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32), gpu::recomp::tests wave64 checks, shaders::tests::pso_measurement_compiles_an_exact_synthetic_record (0x887A002D), and gpu_compute_e2e::heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • Targeted hle::d3d12x::bind::tests on 2d14195e (RTX 4060): 9 passed; 0 failed; 0 ignored (1.47s).
  • AMD Radeon 780M Graphics (XCL_ADAPTER=780M, 2d14195e source):
    • two_device_command_list_fallback_isolates_bind_abi_and_console_list: 1 passed; 0 failed (0.52s, resolving 0xc0000005 double-Release crash).
    • hle::d3d12x::bind::tests: 9 passed; 0 failed; 0 ignored (1.05s).
    • hle::d3d12x::: 261 passed; 0 failed; 2 ignored (13.58s).
    • gpu_compute_e2e: 8 passed; 0 failed; 0 ignored (4.77s; SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows).
  • Headless WARP simulation (XCL_ADAPTER=warp): two_device_command_list_fallback_isolates_bind_abi_and_console_list (1 passed; 0 failed, SKIPPED ...: no GPU UMA window), dispatch_chain::tests (5 passed; 0 failed), compute_blob_tests (5 passed; 0 failed), gpu_compute_e2e (8 passed; 0 failed).

Regression run
Paired 60-second scripts/smoke.ps1 runs (same title 9bb0e164 on RTX 4060 Laptop GPU, release target\release\xcl.exe, XCL_NETWORK=0):

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 4060 Laptop GPU
title: 9bb0e164
seconds: 60
exit: 0x0
frames shown: 1478 (PresentX 1478)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14210 MB
xcl-smoke v1
commit: 2d14195e83eb5b1505c8c06793d9425c15337f0b
gpu: NVIDIA GeForce RTX 4060 Laptop GPU
title: 9bb0e164
seconds: 60
exit: 0x0
frames shown: 1265 (PresentX 1266)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14060 MB
  • PR vs main: 1265 vs 1478 frames shown (85.6%, min 80%), 0 device removals, 0 crashes, 14060 MB vs 14210 MB peak commit (98.9%, max 125%).

Not tested

  • In the 60s boot/intro smoke window of title 9bb0e164, compute split stayed at 0 programs split, 0 pieces built, 0 chained dispatches issued (split-compute RS reuse and COMPUTE_BLOBS hits are tested directly by dispatch_chain::tests and gpu_compute_e2e).
  • Linux / Wine and Intel GPUs.

AI use

  • Google Antigravity (Gemini); assisted with root-cause analysis, COM/D3D12 device-isolation and wrapper-ownership fixes, targeted NVIDIA/AMD/WARP tests, smoke validation, and PR preparation under author direction.

@luckyteagirl luckyteagirl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At exact head 859da94 on current main b49be18, 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, but abi_rs_cached() chooses using the process-wide device_raw() instead of the device that owns the list. console_list::close already has the actual PC list, yet obtains its fallback signature from that global lookup; bind.rs uses the same fallback. If device A is global and a translated PSO/list belongs to device B, a B signature can exist in ABI_RS_BY_DEV while the list receives A's signature, or close can report no XCL ABI root signature when A has none. The added abi_rs_raw_isolates_distinct_devices test 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

Copy link
Copy Markdown
Contributor

Independent focused Windows check of exact PR head 859da94ed2ba8300719bf9ec9027f2f7eba4d6a6 in a clean detached checkout. Upstream main was b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7.

Tested

  • Windows 11 Home build 26200 on a Ryzen 9 5980HX laptop with Radeon RX 6800M (driver 30.0.13002.13003), Rust 1.99.0 MSVC; debug build with an isolated Cargo target.
  • With XCL_ADAPTER=6800M and XCL_REQUIRE_GPU=1 in the environment, ran cargo test --locked -p xcl --lib abi_rs_raw_isolates_distinct_devices -j 1 -- --test-threads=1 --nocapture: 1 passed, 0 failed, 0 ignored, no SKIPPED notice, 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

  • The test calls 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

  • OpenAI Codex (GPT-6.2 Astra) ran the exact-head test, verified the test source and log, and wrote this report.

@Lum7nt

Lum7nt commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Tested on \859da94ed2ba8300719bf9ec9027f2f7eba4d6a6\ (\859da94e, clean PR head):

  • Hardware / OS / Toolchain: NVIDIA GeForce RTX 3060 12 GB (driver \32.0.15.8142\ / 581.42, wave32), Intel Core i5-10400, Windows 11 (NT \10.0.22631.0),
    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.
  • Focused runs:
    • \cargo test -p xcl --lib hle::d3d12x::real::compute_blob_tests -- --test-threads=1 --nocapture: 3 passed, 0 failed, 0 ignored (\�bi_rs_raw_isolates_distinct_devices\ passed on RTX 3060 + WARP;
      ecorded_split_selects_cached_whole_or_pieces\ returned early without \XCL_SAMPLE_RUNTIME_COMPUTE).
    • \cargo test -p xcl --lib hle::d3d12x::real::dispatch_chain::tests -- --test-threads=1 --nocapture: 3 passed, 1 failed, 0 ignored — \split_programs_sharing_large_piece_hit_compute_blobs_and_reuse_root_signature\ panicked at \crates/xcl/src/hle/d3d12x/real/dispatch_chain.rs:436:13\ (\shared piece driver blob should be stored once in COMPUTE_BLOBS: left: 0, right: 1). On this driver (\581.42), \ID3D12PipelineState::GetCachedBlob()\ fails (\

@ZekkJJ
ZekkJJ force-pushed the fix/dispatch-chain-rs-cache branch from 859da94 to cfbaaac Compare November 26, 2026 09:04
@luckyteagirl

Copy link
Copy Markdown
Contributor

Independent Windows check of exact PR head cfbaaace9b2a0bffd433512b80163e2370a9c9b1, clean detached checkout on main b49be183. AMD Radeon RX 6800M, driver 30.0.13002.13003, Ryzen 9 5980HX, Windows 11 Home build 26200, Rust 1.99.0 MSVC, debug.

Tested

  • With XCL_ADAPTER=6800M, XCL_WARP unset, and a dedicated Cargo target, ran cargo test --locked -p xcl --lib two_device_command_list_fallback_isolates_bind_abi_and_console_list -j 1 -- --test-threads=1 --nocapture. Exit 101, 0 passed, 1 failed, 0 ignored, 1,342 filtered. The child logged backend 'real' – AMD Radeon RX 6800M (11987 MiB VRAM) and exited 0xc0000005.
  • Reran the same binary directly with XCL_ADAPTER=6800M, XCL_TEST_TWO_DEVICE_LIST_FALLBACK=1, and RUST_BACKTRACE=1, using --exact hle::d3d12x::bind::tests::two_device_command_list_fallback_isolates_bind_abi_and_console_list --test-threads=1 --nocapture. It logged the same adapter and exited 0xc0000005 again, before final harness counts. The fixture tries WARP for device B first and does not print which device it picked.

Source review

Both production fallback callers now use the list’s owning device when GetDevice succeeds. Separately, the fixture passes borrowed PSO and list pointers to wrappers at bind.rs:1983–1984 and :2008–2009. Both wrapper destructors release the underlying pointers. Use clone().into_raw() for each wrapper’s owned reference and retain the original list handles while their spies are active. The access violation’s exact site is unknown. I did not test this ownership change, run the full suite, or launch a title.

AI use

OpenAI Codex (GPT-6.2 Sol) checked the live refs and source, ran both commands, and drafted this report.

@ZekkJJ

ZekkJJ commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Updated PR head to 033df826 (033df826125a5ae4050bdd9d4fcfc60e12789f28):

  1. Fixed the headless no-GPU CI test guard in two_device_command_list_fallback_isolates_bind_abi_and_console_list (crates/xcl/src/hle/d3d12x/bind.rs): open_uma yields [0] when sparse VRAM reservation returns 0x8007000E on headless WARP runners, so the test now checks uma_window_vas().first().copied().unwrap_or(0) == 0 (running non-UMA abi_rs_cached_for_list device-isolation checks and skipping only the UMA command-list replay via runner::skip_test("no GPU UMA window")). Verified under XCL_ADAPTER=warp (1/1 lib test + 8/8 gpu_compute_e2e) and on RTX 4060 (1443 passed, 0 failed, 47 ignored across --workspace).
  2. Added paired retail scripts/smoke.ps1 regression validation (title 9bb0e164, 60s, RTX 4060 Laptop GPU, release builds): main (b49be183) 1478 frames / 14210 MB peak commit / 0 removals / 0 crashes; PR (033df826) 1568 frames / 14025 MB peak commit / 0 removals / 0 crashes (description ok locally via scripts/pr_check.py --local). Note that the 60s startup smoke window did not enter compute split; split-compute reuse is verified by dispatch_chain::tests and gpu_compute_e2e.

@ZekkJJ
ZekkJJ marked this pull request as ready for review November 26, 2026 10:02
…ABI/cache keys (xcl-dev#2688)

Part of xcl-dev#2688 (Workstream 7); relates to xcl-dev#2088.

- Cache dispatch_chain ID3D12RootSignature handles per (canonical device identity, static samplers) with GetDevice ownership validation and documented intentional process-lifetime retention, enabling COMPUTE_BLOBS hits across split programs sharing >= 16 KB pieces or rebuilt PSOs.
- Normalize COM device identity via canonical_device_key (IUnknown cast with readable/non-null vtable guards), isolate ABI_RS and ABI_RS_SAMPLERS per device, and resolve command-list ABI fallbacks via abi_rs_cached_for_list(&ID3D12GraphicsCommandList) in bind::bind_abi and console_list::close.
- Key non-zero NodeMask in persistent compute driver_cache paths while keeping NodeMask == 0 filenames unchanged, verify compute_blob_key process-locality, make split GPU fixture cleanup panic-safe via RAII Drop guard, and add unit/GPU/two-device command-list fallback tests.
@Aniseto

Aniseto commented Nov 26, 2026

Copy link
Copy Markdown

Ran the dispatch-chain and bind tests at 033df826 on an NVIDIA host:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

Results

  • cargo test -p xcl --lib hle::d3d12x::real::dispatch_chain::tests -- --test-threads=4: 5 passed, 0 failed (exit 0), including the new root-signature reuse and COMPUTE_BLOBS tests.
  • cargo test -p xcl --lib hle::d3d12x::bind::tests -- --test-threads=4: 8 passed, 1 failed (exit 101). The failure is two_device_command_list_fallback_isolates_bind_abi_and_console_list: the spawned child test exits with 0xc0000005 after the real adapter and UMA window are set up.
  • The same filter with --test-threads=1 also fails that one test (8/9), but running just that test with --exact passes (1/1). So the failure is order-dependent within the module on this host, not a deterministic failure of the test in isolation.

What this adds: the author ran the batch on an RTX 4060 Laptop GPU and the two-device test on headless WARP, where the UMA replay steps are skipped. Here the child process reaches the real RTX 5070 Ti and a GPU UMA window, and the module run fails. I did not check the same batch on unmodified main, so I am not attributing this failure to the PR; it is a datapoint for the author to investigate.

Not tested: the unmodified-main control, the full workspace suite, a paired 60 s smoke run, AMD and Intel GPUs, native wave64, Wine, release profile, title data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

@ZekkJJ

ZekkJJ commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Updated PR head to 2d14195e (2d14195e83eb5b1505c8c06793d9425c15337f0b) fixing the 0xc0000005 (STATUS_ACCESS_VIOLATION) reported by @luckyteagirl on AMD:

  • Root cause & fix: Reproduced the 0xc0000005 exit locally on AMD Radeon 780M Graphics (XCL_ADAPTER=780M). In two_device_command_list_fallback_isolates_bind_abi_and_console_list (crates/xcl/src/hle/d3d12x/bind.rs), borrowed .as_raw() pointers were passed to console_list::wrap_pso and console_list::create_with_allocator, whose Release destructors decrement and drop the underlying ID3D12PipelineState / ID3D12GraphicsCommandList while local Rust handles and ListSetRsSpy still held references. Switched all four wrapper calls to pass .clone().into_raw() owned references.
  • AMD Radeon 780M verification (XCL_ADAPTER=780M, DriverVersion 32.0.31033.3):
    • two_device_command_list_fallback_isolates_bind_abi_and_console_list (--exact --test-threads=1): 1 passed; 0 failed (0.52s)
    • hle::d3d12x::bind::tests: 9 passed; 0 failed; 0 ignored (1.05s)
    • hle::d3d12x::: 261 passed; 0 failed; 2 ignored (13.58s)
    • gpu_compute_e2e: 8 passed; 0 failed; 0 ignored (4.77s; SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows)
  • RTX 4060 Laptop GPU (2d14195e):
    • hle::d3d12x::bind::tests: 9 passed; 0 failed; 0 ignored (1.47s)
    • cargo build --offline --locked --release -p xcl -j 2: passed (0 errors)

Running the full --workspace suite and paired 60s scripts/smoke.ps1 (title: 9bb0e164) on 2d14195e next to refresh the PR description's xcl-smoke block.

@ZekkJJ
ZekkJJ force-pushed the fix/dispatch-chain-rs-cache branch from 033df82 to 2d14195 Compare November 26, 2026 10:23
@oni-swr

oni-swr commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Independent amd-win test report for exact PR head 2d14195e83eb5b1505c8c06793d9425c15337f0b (clean detached checkout), with b49be183 (the merge-base, main at test time) as the control. I started on 033df826, and the head moved to 2d14195e while I was testing, so both are reported. Claim: #1607 (comment)

Result: on the RX 7800 XT, 2d14195e passes every test this PR adds or changes. 033df826 did not: two_device_command_list_fallback_isolates_bind_abi_and_console_list crashed its child with 0xc0000005 every time, and 2d14195e fixes that. One lib test, fuzz_validate_and_gpu_1, fails on this adapter at the PR head and at main alike.

Tested

  • Hardware / OS: AMD Radeon RX 7800 XT (16176 MiB), driver 32.0.31035.1003, Ryzen 7 5700X3D, 64 GB, Windows 11 Pro build 26200, debug build.
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09), stable-x86_64-pc-windows-msvc; DXC dxcompiler/dxil 1.8.2502.11 (Windows SDK 10.0.26100.0).
  • Env: XCL_ADAPTER=7800 XCL_REQUIRE_GPU=1, cargo ... -j 4. Nothing else used the GPU during the runs reported here. At the start of one early run I saw a few cargo/rustc processes that were not mine; I discarded that run and, before every later one, waited until none were running.

Head 2d14195e (all cargo test -p xcl --lib -j 4 <filter> -- --test-threads=1 unless noted):

  • two_device: 1 passed / 0 failed. It ran its UMA path to the end: no SKIPPED line was printed.
  • dispatch_chain: 13 / 0. compute_blob: 6 / 0 (includes split_programs_sharing_large_piece_hit_compute_blobs_and_reuse_root_signature). abi_rs: 2 / 0. abi_root: 1 / 0. signature_: 6 / 0 (includes signature_for_reuses_root_signature_per_device_and_separates_devices_and_samplers, signature_retention_and_device_child_lifetime). d3d12x::bind: 9 / 0.
  • d3d12x:: (--test-threads=4): 261 passed, 0 failed, 2 ignored.
  • Full lib (cargo test -p xcl --lib -j 4 -- --test-threads=4): 1315 passed, 1 failed, 27 ignored. The failure is gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 (seed 722: res[30] = 0x1, CPU 0x7fffffff). It is not touched by this PR and fails identically on main (control below).
  • cargo test -p xcl --test gpu_compute_e2e -j 4 -- --test-threads=1: 8 passed, 0 failed, 0 ignored (includes the PR's abi_root_signature_tracks_registered_backend_device). SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows.
  • SKIPPED lines in the lib run: 6, all lower_dxil f16/f32-conversion programs refused as unsupported (unrelated to this PR). Not counted as coverage.

Earlier head 033df826 (same machine and env):

  • Full lib: 1314 passed, 2 failed, 27 ignored (same on two runs): the fuzz_validate_and_gpu_1 failure above, and two_device_command_list_fallback_isolates_bind_abi_and_console_list with child test failed (exit code: 0xc0000005). Run directly, the child dies after the ID3D12GraphicsCommandList10 wrapper line on the real backend. It also failed with XCL_ADAPTER unset and passed with XCL_ADAPTER=warp. This machine opens the UMA window, so the test took the has_uma branch. d3d12x:: was 260 passed / 1 failed. The other targeted filters and gpu_compute_e2e (8/0) passed as above. The 4-line bind.rs change in 2d14195e is what turns this from a crash into a pass here; I did not debug the crash itself.

Control b49be183 (same machine, env and commands):

  • Full lib: 1308 passed, 1 failed (the same fuzz_validate_and_gpu_1, seed 722), 27 ignored. dispatch_chain: 10 / 0. d3d12x::: 254 / 0 / 2 ignored.
  • The PR adds 7 lib tests (1309 → 1316 run). All 7 pass at 2d14195e.

Not tested

  • scripts/smoke.ps1 regression run on a title (no game files used); cargo test --workspace; release build.
  • NVIDIA, Intel, or other AMD generations. Other reports cover the RX 6800M and the RTX 5070 Ti at other heads.
  • Why fuzz_validate_and_gpu_1 fails on this adapter (it fails on main too, so it is not from this PR).

AI use

  • Claude Code (Claude Sonnet 5.5) ran the commands and wrote this report; coordinated by Claude Code (Claude Opus 5.5). All numbers come from runs on the hardware named; no game data, dumps, shader names or hashes were used.

@Aniseto

Aniseto commented Nov 26, 2026

Copy link
Copy Markdown

Re-ran the dispatch-chain and bind tests at 2d14195 after the head moved (4 lines changed in bind.rs).

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

XCL_ADAPTER=nvidia cargo test -p xcl --lib hle::d3d12x::bind::tests -- --test-threads=4
9 passed; 0 failed; 0 ignored; 1334 filtered out      (exit 0)

XCL_ADAPTER=nvidia cargo test -p xcl --lib hle::d3d12x::real::dispatch_chain::tests -- --test-threads=4
5 passed; 0 failed; 0 ignored; 1338 filtered out      (exit 0)

This resolves the datapoint from my earlier report at 033df826: two_device_command_list_fallback_isolates_bind_abi_and_console_list now passes in the full bind module run on this RTX 5070 Ti (previously the child process exited with 0xc0000005 in the module run, while passing alone). The change between the heads is confined to bind.rs. This is a new report following that one, not an edit.

Not tested: an unmodified-main control, the full workspace suite, a paired 60 s smoke run, AMD and Intel GPUs, native wave64, Wine, release profile, title data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

@Royalflamejlh

Copy link
Copy Markdown
Contributor

Under Wine + vkd3d-proton on an RTX 4070, this pull request's tests passed at head 2d14195e, except 4 new ones that need a second D3D12 device and skipped: DXVK's DXGI here has no WARP, and its EnumWarpAdapter returns the RTX 4070, so the second device is the first one again. One of the two whole-lib runs at 2d14195e lost the device partway through, after a copy-engine MMU fault; every other run here logged a different fault (a graphics read at the same address) and went on. I cannot yet say whether this comes from this pull request.

Setup: main b49be18 + this pull request, release, cargo test --release -p xcl --target x86_64-pc-windows-gnu, Wine 11.21 Staging + vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch, DXVK 3.1.1 (DXGI), RTX 4070 12 GB, driver 615.71.09.

Tree --lib -- --test-threads=4 --test gpu_compute_e2e
main b49be18 8 runs: 3 failed in all 8 (directed_reference_basics, f64_programs_on_the_gpu, gpu_promoted_uav_clear_values_pass_create_committed_resource), one run also writes_land_after_the_queue; 1306 passed, 27 ignored in the other 7 7 passed
this pull request's earlier head 033df826 2 runs: 1313 passed, the same 3 failed 8 passed
this pull request at 2d14195e run 1: 1284 passed, 32 failed (the device was removed, 0x887A0005); run 2: 1313 passed, the same 3 failed 8 passed
  • The 4 that skipped, in all 4 lib runs: abi_root_signature_respects_device_identity_and_zero_fallback, abi_rs_for_with_samplers_isolates_distinct_devices, abi_rs_raw_isolates_distinct_devices (real::compute_blob_tests) and signature_for_reuses_root_signature_per_device_and_separates_devices_and_samplers (real::dispatch_chain::tests), each with second distinct D3D12 device unavailable (they count as passed in the table). Their second device comes from EnumWarpAdapter (real.rs:4906, real/dispatch_chain.rs:341); falling back to EnumAdapters1 as the bind test does (bind.rs:1917) would run them here, where that test found a distinct second device.
  • The new abi_root_signature_tracks_registered_backend_device in gpu_compute_e2e passed in both runs.
  • two_device_command_list_fallback_isolates_bind_abi_and_console_list, which 2d14195e changes, passed in all 4 lib runs, at the earlier head 033df826 too, with a GPU UMA window open (no SKIPPED line from its child).
  • In 11 of the 12 whole-lib runs here (all 8 on main, both at 033df826, run 2 at 2d14195e), the NVIDIA driver logged Xid 31 … MMU Fault: ENGINE GRAPHICS … GPCCLIENT_GCC faulted @ 0x0_04400000 … VIRT_READ from a gpu::dxil::comp… test thread, and the suite went on. In run 1 at 2d14195e it logged ENGINE CE2 HUBCLIENT_CE0 faulted @ 0x0_04400000 … VIRT_WRITE instead, and 29 more tests failed after it. One run in four is not enough to say whether that is this pull request's; I have not found which test faults.

Not tested: title runs (in our 120 s title runs on this card no compute program was split); Windows; the 4 tests above.

AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this comment.

Posted without review by a person: the account owner was away and reads replies later.

@Prime1997 Prime1997 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read-through and GPU run of 2d14195. An AI tool (Claude Code) helped with the reading and ran the tests; each point below was checked against the code at this head.

Test results (RTX 3060 Ti 8 GB, NVIDIA 617.14 / 32.0.16.1714, i5-10400, Windows 11 26200.9974, rustc 1.100.0, DXC 1.9.2609.5, debug, isolated cache and data roots):

  • dispatch_chain: 5 passed, 0 failed.
  • compute_blob_tests: 5 passed, 0 failed.
  • gpu_compute_e2e: 8 passed, 0 failed. heap_window_out_of_memory_falls_back_to_the_switch_form reported SKIPPED (no heap windows on this setup).
  • The two-device test: 1 passed, 0 failed.
  • The earlier head 859da94 also passed here (4 + 3 + 7).

Two things I saw while reading the earlier head 859da94 are fixed in this one: the sampler ABI cache is now keyed by (usize, Vec<u32>) rather than the sampler list alone, and name_for_node puts the node mask in the disk name.

Points for the author

  1. In split_programs_sharing_large_piece_hit_compute_blobs_and_reuse_root_signature the spy records only whether CachedPSO.pCachedBlob is non-null (line 497), and compute_container falls back to the disk blob when the in-memory lookup misses. So the two assertions that say the shared piece came from COMPUTE_BLOBS (lines 537 and 550) also pass on a disk hit. The root-signature equality and key-count assertions next to them do pin the sharing itself. Running the fixture with XCL_PSO_DISK_CACHE=0, or recording which cache answered, would make those two lines prove what they say.
  2. The chain file name still has no sampler key. Same question as on #2711: what happens when a blob built under one static sampler set is offered to a pipeline with another?
  3. A root-signature failure calls note_translation_error even though the whole-program fallback then succeeds. That will show up as an error in logs for a case that worked.
  4. The benefit is narrower than the description suggests. Main already gets a disk hit for the second program when the first build took 250 ms or more, so the gain is for the faster builds and for runs with the disk cache off. A sentence saying so would set expectations.

No defect found at this head. Point 1 is about test precision, not a blocker.


Generated by Claude Code

bmjask pushed a commit to bmjask/xcl that referenced this pull request Nov 26, 2026
A fresh dispatch-chain root signature made the in-memory compute blob key unique for every split program, preventing programs with common pieces from sharing their driver-compiled blobs.

Cache signatures by device and exact static-sampler layout. PR xcl-dev#2723 measured shared-piece reuse on Windows; the integrated stage passed the Windows GNU cross-target cargo check, but native GPU execution was unavailable here.

Assisted-by: Codex (GPT-5.6-sol)
@CryingLaughing

Copy link
Copy Markdown

Paired native D3D12 check on RTX 4080 driver 621.01. For this fixture, main already reused the live root signature and accepted the shared cached blob on the second build. The PR head matched that behavior.

Revision with the same test-only fixture First shared-piece create Second shared-piece create Live root signature
Base b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 Cold CachedPSO accepted Same pointer
PR head 2d14195e83eb5b1505c8c06793d9425c15337f0b Cold CachedPSO accepted Same pointer

Each run built two successful native chains with distinct tails and a shared 26,816-byte DXIL piece. Both chains stayed live while measured. There were exactly two native creates per chain and no retries. Each confirmed run was 1 passed, 0 failed, 0 ignored, 0 capability skips. The first control run failed my expectation that the second base build would be cold. A repeat confirmed the warm result.

Tested with the DXGI-verified RTX 4080, Core i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 x64 MSVC and DXC/DXIL 1.8.2502.11. I ran hle::d3d12x::real::dispatch_chain::pr2723_native_cache::shared_piece_native_cached_pso --exact --test-threads=1 --nocapture --ignored in separate fresh processes with private cache roots and XCL_PSO_DISK_CACHE=0.

Not tested were dispatch output, compile-time savings, retail behavior, and other drivers. This comparison found no additional cache hit from the PR in this case.

@Prime1997 Prime1997 mentioned this pull request Nov 26, 2026
@ZekkJJ

ZekkJJ commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@CryingLaughing Thanks for the paired control. The per-device isolation and NodeMask identity fixes should be evaluated separately from incremental cache performance. Your fixture provides useful evidence for narrowing the performance claims.

bmjask pushed a commit to bmjask/xcl that referenced this pull request Nov 26, 2026
A fresh dispatch-chain root signature made the in-memory compute blob key unique for every split program, preventing programs with common pieces from sharing their driver-compiled blobs.

Cache signatures by device and exact static-sampler layout. PR xcl-dev#2723 measured shared-piece reuse on Windows; the integrated stage passed the Windows GNU cross-target cargo check, but native GPU execution was unavailable here.

Assisted-by: Codex (GPT-5.6-sol)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants