Skip to content

D3D12.X: translated compute pipelines are made with node mask 0 - #1368

Open
pr1sm-dev wants to merge 1 commit into
xcl-dev:mainfrom
pr1sm-dev:nodemask-zero
Open

pr1sm-dev wants to merge 1 commit into
xcl-dev:mainfrom
pr1sm-dev:nodemask-zero

Conversation

@pr1sm-dev

@pr1sm-dev pr1sm-dev commented Nov 24, 2026 •

Copy link
Copy Markdown

A title whose compute pipeline descriptions carry a node mask does not take the driver blobs xcl shaders --precompile --pipelines keeps for it (#744): it refuses each one, removes the file and compiles the program again. This makes the translated compute pipeline with NodeMask = 0, as the offline pass does. Follow-up to #744; the report is in #744 (comments of 2026-11-24 14:02Z and 14:23Z).

Cause: under Wine the blobs are vkd3d-proton's, and it refuses a cached blob whose description hash differs from the pipeline's (d3d12_cached_pipeline_state_validate: PSO compatibility hash mismatch; for a compute pipeline that hash is NodeMask and Flags). The offline pass makes its pipelines with mask 0, a retail title passes 1, and the blob file name covers only the DXIL and Flags, so both forms share one file and each side refuses the other's. XCL drives one adapter, where masks 0 and 1 mean the same.

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs: translated_compute_pso sets copy.NodeMask = 0 before the pipeline is made (one line and its comment).
  • crates/xcl/tests/gpu_compute_e2e.rs: a_title_pipeline_with_a_node_mask_takes_the_offline_blob runs the offline pass on a program, then makes the same pipeline through the backend hook with NodeMask = 1; the pass's blob has to stay as written.

Tested

  • Linux Mint 22.2, kernel 6.17, Wine 11.22 (winehq-devel), vkd3d-proton master 30b0eb9b with the patch of Linux: docs/linux.md, scripts/linux and Wine start-up checks for vkd3d-proton and DXVK (#154, #241) #257, DXVK 3.1.1; RTX 3070 8 GB, driver 595.91.07; Ryzen 7 5800X; Rust 1.100.0, release, target x86_64-pc-windows-gnu. No Windows machine: everything below ran under Wine.
  • The new test, on the GPU: passes on this commit; fails on main 930e8b4 (the blob is removed, one "PSO compatibility hash mismatch" from vkd3d-proton).
  • A retail title on main 930e8b4 and on main + this change, empty scratch cache (XCL_DXIL_CACHE): the title ran 100 s and built 8 compute pipelines; its blobs were removed and the offline pass wrote 8 blobs for those 8 programs; the title then ran 100 s on those files. main: 8 mismatch lines, 0 pipelines made from blobs, 0 of 8 files left. This change: 0 mismatch lines, 8 pipelines made from blobs, 8 files left.
  • All test binaries of cargo test --workspace --release --no-run, each run under Wine with --test-threads=4, on this commit and on main 930e8b4:
    • integration tests: this commit 42 passed, 3 failed, 20 ignored; main 41 passed, 3 failed, 20 ignored. The same three fail on both (e2e::test_title_runs_and_game_folder_is_untouched, pls_quota::disk_free_space_ex_reports_pls_quota, predication_e2e::set_predication_buffer_state_and_kickoff); the one more that passes is the new test.
    • library unit tests: the test binary ends under Wine without printing its result line, on both commits (this commit: 522 ok lines, 0 FAILED, 20 ignored; main: 524, 0, 20). I have not found where it stops, so I cannot give a total.
    • SKIPPED on this adapter: gpu_wave32_program_in_wave64_hardware and gpu_geometry_wave32_prefix_count_over_a_mask (no wave64).

Regression run

main:

xcl-smoke v1
commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56
gpu: NVIDIA GeForce RTX 3070
title: retail-title
seconds: 120
exit: 0x0
frames shown: 1807 (PresentX 1809)
presents per 2 s (last 3): 1 0 0
device removals: 0
crashes: 0
peak commit: 0 MB

PR:

xcl-smoke v1
commit: 0074749a9678a697455c48a95f7c4f746ccd602e
gpu: NVIDIA GeForce RTX 3070
title: retail-title
seconds: 120
exit: 0x0
frames shown: 1665 (PresentX 1666)
presents per 2 s (last 3): 10 18 3
device removals: 0
crashes: 0
peak commit: 0 MB

Not tested

  • Windows (any GPU): not built with MSVC, scripts/smoke.ps1 and scripts/test.ps1 not run. On a native D3D12 driver the title already took the offline blobs in the reports on Shaders: save offline compute pipelines to the runtime driver cache #744, so there this should change nothing; I could not check that.
  • AMD; graphics pipelines (their blobs are not kept by the offline pass); a title that needs a node mask other than 0 or 1 (more than one adapter node).
  • A full title run after a complete offline pass with this change.

Credits

AI use

  • Claude Code with Claude Fable 5.2 found the cause, wrote the change, the test, the commit message and this description, and ran the builds, tests and runs above on my machine.

A title whose compute pipeline descriptions carry a node mask did not take
the blobs `xcl shaders --precompile --pipelines` keeps for it (xcl-dev#744): the
offline pass makes its pipelines with NodeMask 0, the title's are made with
the title's mask, and both use one blob file (its name covers the DXIL and
Flags). vkd3d-proton refuses a cached blob whose description hash differs
("PSO compatibility hash mismatch"; for a compute pipeline that hash is
NodeMask and Flags), so the title refused every blob of the pass, removed
the file and compiled the program again - and the pass in turn replaced the
blobs the title had kept itself.

XCL drives one adapter, where masks 0 and 1 mean the same, so the
translated pipeline is made with 0.

Measured on main 930e8b4 with a retail title that passes mask 1 (Wine
11.22, vkd3d-proton 30b0eb9b, RTX 3070): of 8 blobs the pass wrote for the
programs the title builds in its first 100 s, the title took 0 and removed
8 before, and takes 8 with this change.

Test: a_title_pipeline_with_a_node_mask_takes_the_offline_blob runs the
offline pass on a program and then makes the same pipeline through the
backend hook with NodeMask 1; the pass's blob has to stay as written.
Under vkd3d-proton it fails without the change (the blob is removed).

Assisted-by: Claude Code (Claude Fable 5.2)
@futurepro62

futurepro62 commented Nov 24, 2026 •

Copy link
Copy Markdown

Full-suite run, since this PR has no test report yet. Tested exact head 0074749 (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: a_title_pipeline_with_a_node_mask_takes_the_offline_blob.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, no skips.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.

gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 24, 2026
ivall#1379

Integrate 22 open upstream PRs targeting world rendering, shader correctness, DirectStorage terrain loads, and crash/memory stability:
- ivall#1321 (ivall#1307): fall back to pc blocks when structured CFG HLSL grows oversized (eliminates the 148 MB HLSL / 1 GB/s commit explosion from b8b1f49 so XCL_PSO_PRELOAD=1 stays flat at ~5.4 GiB)
- ivall#549, ivall#1312: DirectStorage late page-array queue hold (fixes 0x89240009 terrain read failures) and 0-byte memory-source requests
- ivall#1365 (ivall#1361): GFX10.30 scratch SADDR 0x7F addresses the immediate offset alone instead of adding v0
- ivall#1368: translated compute PSOs use NodeMask 0
- ivall#1371 (ivall#105): deduplicate packed ISG1 vertex input struct fields
- ivall#1375 (ivall#1360): ES s_setpc_b64 ends block before gs_start
- ivall#1350, ivall#1351, ivall#1352, ivall#1353, ivall#1349: VS layer/viewport outputs, PS sample index/fixed-point position & SV_Coverage, depth+UAV initial states, console SetPredication
- ivall#1305, ivall#1306, ivall#1314, ivall#1319, ivall#1322, ivall#1334, ivall#1339, ivall#1355, ivall#1357, ivall#1379: console_list UMA hold on Release, v_cmp_class_f32 bitwise abs/neg, late_release vram queue wait, root arg clamping, empty BVH / NaN rays, NULL IASetIndexBuffer clearing, MSAA MipLevels=1, VFS lazy-page commits, coherent VirtualFree validation, cpu_writes PAGE_GUARD & stale fence wakeups
- README.md: document the integrated PRs, XCL_PSO_PRELOAD=1, and 16 GiB cap

Verified on RX 9060 XT / GE-Proton11-14: release build clean, targeted unit tests pass (75 passed, 0 failed), and 80 s run with XCL_PSO_PRELOAD=1 and XCL_MEM_LIMIT=12G stays flat at 5340-5413 MB with 512+ pipelines preloaded (1385 frames, exit 0x0).

Assisted-by: Antigravity (Google DeepMind)
gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 24, 2026
ivall#1379

Integrate 22 open upstream PRs targeting world rendering, shader correctness, DirectStorage terrain loads, and crash/memory stability:
- ivall#1321 (ivall#1307): fall back to pc blocks when structured CFG HLSL grows oversized (eliminates the 148 MB HLSL / 1 GB/s commit explosion from b8b1f49 so XCL_PSO_PRELOAD=1 stays flat at ~5.4 GiB)
- ivall#549, ivall#1312: DirectStorage late page-array queue hold (fixes 0x89240009 terrain read failures) and 0-byte memory-source requests
- ivall#1365 (ivall#1361): GFX10.30 scratch SADDR 0x7F addresses the immediate offset alone instead of adding v0
- ivall#1368: translated compute PSOs use NodeMask 0
- ivall#1371 (ivall#105): deduplicate packed ISG1 vertex input struct fields
- ivall#1375 (ivall#1360): ES s_setpc_b64 ends block before gs_start
- ivall#1350, ivall#1351, ivall#1352, ivall#1353, ivall#1349: VS layer/viewport outputs, PS sample index/fixed-point position & SV_Coverage, depth+UAV initial states, console SetPredication
- ivall#1305, ivall#1306, ivall#1314, ivall#1319, ivall#1322, ivall#1334, ivall#1339, ivall#1355, ivall#1357, ivall#1379: console_list UMA hold on Release, v_cmp_class_f32 bitwise abs/neg, late_release vram queue wait, root arg clamping, empty BVH / NaN rays, NULL IASetIndexBuffer clearing, MSAA MipLevels=1, VFS lazy-page commits, coherent VirtualFree validation, cpu_writes PAGE_GUARD & stale fence wakeups
- README.md: document the integrated PRs, XCL_PSO_PRELOAD=1, and 16 GiB cap

Verified on RX 9060 XT / GE-Proton11-14: release build clean, targeted unit tests pass (75 passed, 0 failed), and 80 s run with XCL_PSO_PRELOAD=1 and XCL_MEM_LIMIT=12G stays flat at 5340-5413 MB with 512+ pipelines preloaded (1385 frames, exit 0x0).

Assisted-by: Antigravity (Google DeepMind)
@anes66

anes66 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Native Windows/NVIDIA check of 0074749a9678a697455c48a95f7c4f746ccd602e merged locally onto main b7aa9f3bd212088e0d927439284dc5ed325ce3c7 (no merge conflicts). This is a scoped compatibility result, not a green full-suite report.

Tested

  • Windows 10 Pro 19045, RTX 3060 12 GB / driver 32.0.16.2114, Ryzen 7 9800X3D, Rust 1.100.0 MSVC, DXC 1.9.2602.17, Agility 1.620.2, debug.
  • cargo test --locked -p xcl --test gpu_compute_e2e a_title_pipeline_with_a_node_mask_takes_the_offline_blob -- --exact --show-output: 1 passed / 0 failed, no skips. The log reports 1 compute pipelines made from the driver's blob of an earlier run; the offline file stays unchanged.
  • Control with only the four-line runtime change removed, keeping your test: 1 passed / 0 failed, also an actual driver-blob hit. This NVIDIA Windows driver accepts the offline blob with the original NodeMask too; this run does not reproduce the Wine incompatibility.
  • Restored your runtime change, then cargo build --locked --workspace -j 4: passed.
  • cargo test --locked --workspace --no-fail-fast -j 4 -- --test-threads=4 --show-output: first run 769 passed / 2 failed / 41 ignored, repeat 768 / 3 / 41. Your new test passed in both.

The first full run failed list_x::tests::rotating_queue_self_deadlock_and_non_monotonic_rescue_do_not_hang (DXGI_ERROR_DEVICE_REMOVED) and mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares (E_OUTOFMEMORY) while creating queues. Both passed individually. The repeat failed write_buffer_immediate_on_open_existing_heap_visible_to_cpu, rotating_queue_self_deadlock_and_non_monotonic_rescue_do_not_hang and timestamps_outside_unified_memory_land_after_the_queue.

Both full runs printed five explicit skips: the two native-wave64 tests, gpu_placed_console_depth_target_with_clear_value, rejected_create_shader_cache_session_falls_back_to_working_in_memory_session, and the placed-texture test (no device). Samples were unset. Finally, with the runtime change removed and library source matching main, cargo test --locked -p xcl --lib -- --test-threads=4 --show-output passed 722 / 0 / 21, two wave64 skips. This is a library-only comparison, not a clean full workspace rerun; it does not establish why the full runs failed or rule out a regression.

Not tested: your exact head on its old base, release, Wine/vkd3d-proton, AMD/Intel/native wave64, or retail title smoke. The local integration was not committed or published as a merge-ready branch. Temporary control edits were removed; the original merge diff was saved before returning to a clean checkout.

AI use: Codex (GPT-6; exact variant unavailable) prepared the local integration, ran the tests and controls, and wrote this report.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored.

Thanks!

anoyarou pushed a commit to anoyarou/xcl that referenced this pull request Nov 25, 2026
…dev#1368)

A title whose compute pipeline descriptions carry a node mask did not take
the blobs `xcl shaders --precompile --pipelines` keeps for it (xcl-dev#744): the
offline pass makes its pipelines with NodeMask 0, the title's are made with
the title's mask, and both use one blob file (its name covers the DXIL and
Flags). vkd3d-proton refuses a cached blob whose description hash differs
("PSO compatibility hash mismatch"; for a compute pipeline that hash is
NodeMask and Flags), so the title refused every blob of the pass, removed
the file and compiled the program again - and the pass in turn replaced the
blobs the title had kept itself.

XCL drives one adapter, where masks 0 and 1 mean the same, so the
translated pipeline is made with 0.

Measured on main 930e8b4 with a retail title that passes mask 1 (Wine
11.22, vkd3d-proton 30b0eb9b, RTX 3070): of 8 blobs the pass wrote for the
programs the title builds in its first 100 s, the title took 0 and removed
8 before, and takes 8 with this change.

Test: a_title_pipeline_with_a_node_mask_takes_the_offline_blob runs the
offline pass on a program and then makes the same pipeline through the
backend hook with NodeMask 1; the pass's blob has to stay as written.
Under vkd3d-proton it fails without the change (the blob is removed).

Assisted-by: Claude Code (Claude Fable 5.2)
@voiceovarian1-max

Copy link
Copy Markdown

Linux + NVIDIA test: with this change the title takes the offline pass's blobs (18 of 286 before, 275 of 288 after).

Setup: RTX 4070 Ti 12 GB (NVIDIA 620.73.04), i7-14700K, 31 GB, CachyOS kernel 7.3.5, Proton Experimental's Wine (wine-11.0), vkd3d-proton v3.1 + scripts/linux/vkd3d-proton-xcl.patch, VKD3D_CONFIG=ignore_shared_fence. Release build for x86_64-pc-windows-gnu. Not this PR's head: a local stack (main 9e3831e + #1315/#1316 + #867 + #871 + #877 + #1321 + #684 + #640 + #605 + #495 + #1420 867d307), with and without this PR's copy.NodeMask = 0 line from 0074749 (the test was not applied).

Before each run: xcl shaders shaders.rpf --precompile --pipelines --only cs for the 815 compute programs the title had used (814 pipelines made, 1 left out by a local size cap). Retail 1.0.2.1, Series X profile, XCL_PSO_WAIT_MS=10 XCL_COHERENT_MB=1024 XCL_PAGE_BUDGET_MB=4096, A through XCL_PRESS_A_AT.

compute pipelines built in the run of them from a kept blob driver folder
without the line 286 18 1,768 → 1,607 files
with the line 288 275 unchanged
  • Without it, a 60 s run with VKD3D_CONFIG=ignore_shared_fence,pipeline_library_log VKD3D_DEBUG=info logged d3d12_cached_pipeline_state_validate: PSO compatibility hash mismatch 7 times; with it, 0 times in 140 s, and XCL's "a driver blob kept on disk was refused" line is gone.
  • One run each.

Not tested: this PR's test and head as a whole, Windows, AMD.

AI use: Claude Code (Claude Fable 5.2) ran the runs and wrote this report; posted with the account owner's approval.

@xpatfussy69x

Copy link
Copy Markdown

Test report for head 0074749 as pushed (not merged onto current main) – Windows, MSVC build, NVIDIA wave32.

Tested

  • NVIDIA GeForce RTX 3060 12 GB (Ampere, 32-lane waves only), driver 32.0.16.2124; AMD Ryzen 5 7500F; Windows NT 10.0.26300; Rust 1.100.0 (stable-x86_64-pc-windows-msvc); debug; DXC 1.9.2609.5
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 752 passed, 0 failed, 41 ignored
  • SKIPPED GPU tests on this adapter: 2 (no wave64)
  • this PR's test a_title_pipeline_with_a_node_mask_takes_the_offline_blob (tests/gpu_compute_e2e.rs) ran and passed on the native D3D12 driver
  • no XCL_SAMPLE_* data set (game-data tests not run)

Not tested

  • a scripts/smoke.ps1 pair on a title (so nothing here on how many offline blobs a title takes on Windows); AMD GPUs / native wave64; release build; the head merged onto current main

AI use

  • Claude (Claude Opus 5.5) wrote the script that ran the suite on my PC, read the log and wrote and posted this report with my approval; the run is mine.

@4usphs

4usphs commented Nov 25, 2026

Copy link
Copy Markdown

AMD run on the exact head 0074749 (0074749), as pushed on its base 930e8b4 (not merged onto current main), on two AMD adapters with native 64-lane waves: RDNA4 and the console's generation, RDNA2.

Tested

  • Ryzen 7 9800X3D, Windows 11 Pro 26200, Rust 1.100.0 MSVC, DXC 1.9.2602.17, debug, clean checkout, XCL_TRANSLATED_CACHE=0; adapter picked with XCL_ADAPTER.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4:
    • AMD Radeon RX 9070 XT (RDNA4), driver 32.0.32029.2010: 752 passed, 0 failed, 41 ignored
    • AMD Radeon(TM) Graphics, the 9800X3D's iGPU (RDNA2, gfx1036), driver 32.0.21045.29003: 752 passed, 0 failed, 41 ignored
  • No SKIPPED tests on either adapter.
  • This PR's test a_title_pipeline_with_a_node_mask_takes_the_offline_blob runs and passes on both adapters.
  • The new test needs native wave64, so it skips on the 32-lane NVIDIA cards of the other reports; here it runs on both adapters.

Not tested

  • smoke or a retail title (I have none), a release build, Linux.

AI use

  • Claude Code (Claude Opus 5.5) read the diff, ran the tests and the base-commit controls on my PC and wrote this report. I have not reviewed the code.

@DLampos

DLampos commented Nov 25, 2026

Copy link
Copy Markdown

Independent confirmation on Linux. This is not a run of this PR's commit: I made the same change locally on main at c160d86, setting copy.NodeMask = 0 before the driver call in translated_compute_pso_once. I did not build this PR's branch.

The retail title I run (build 1.0.2.1) passes NodeMask 1 in its compute pipeline descriptions. vkd3d-proton keys a cached pipeline on the node mask: for compute, its PSO_COMPAT check covers NodeMask and Flags. So every blob that xcl shaders --precompile --only cs --pipelines had kept was refused with E_INVALIDARG, XCL removed the file, and the program was compiled again in the game.

Tested

  • Fedora 45 (kernel 7.3), AMD Ryzen 7 9700X, 30 GB RAM, NVIDIA RTX 4070 SUPER 12 GB, driver 620.70 (open kernel module).
  • XCL cross-built for x86_64-pc-windows-gnu (release), running under Proton Experimental's Wine 11 with DXVK's dxgi and vkd3d-proton. vkd3d-proton was built from Proton's commit 2576c0b4 with two local patches for XCL's vtable swap.
  • Both runs used XCL_DIRECT_DXIL=1 and blobs from the same precompile run. The first run removed the blobs it refused, so the two sets are not identical.
  • Before the change, 117 s run:
    • 0 compute pipelines were made from a kept blob.
    • 119 were compiled in the game, 19 of them taking 1 s or more (169 s in all).
    • One program of 881 684 B DXIL took 36.1 s.
  • After the change, 40 s run:
    • 12 were made from kept blobs, in 3–72 ms each. The same 881 684 B program took 72 ms.
    • 82 were compiled, 1 of them taking 1 s or more.
  • The two runs differ in length, so the totals are not like for like. The per-program times are.

Notes for vkd3d-proton users

  • A kept blob holds the whole pipeline only with VKD3D_SHADER_CACHE_PATH=0. With vkd3d-proton's own disk cache (the default), GetCachedBlob returns a 112-byte key, and the pipeline also has to be in the driver's cache.
  • On NVIDIA 620 with vkd3d-proton's VK_EXT_descriptor_heap path, pipelines with static samplers compiled differently in every process, so their blobs were never reused. VKD3D_CONFIG=no_descriptor_heap fixed this: reloading 137 such pipelines, 4 at a time, went from 133 s to 2 s.

Not tested

  • This PR's own commit.
  • Windows and AMD GPUs.
  • The test suite with this change.

AI use

  • Claude Code with Claude Opus 5.5 did the investigation and wrote this report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants