D3D12.X: clamp single-adapter NodeMask on CreateRootSignature #3387
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3387"
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?
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-29T12:26:24Z.
What is in it
NodeMaskvalues above1to1indev_create_root_signature(crates/xcl/src/hle/d3d12x/real.rs) before calling PCCreateRootSignature(for the primary call, theE_NOINTERFACEIID retry, and the empty-root-signature fallback). Without this, a valid root signature blob passed withNodeMask > 1fails both the real creation and the empty fallback withE_INVALIDARG(0x80070057).dev_create_root_signature_sanitizes_node_maskinhle::d3d12x::real::root_signature_testsverifying that unhooked PCCreateRootSignaturerejectsNodeMask = 2, whiledev_create_root_signaturecreates the real root signature preserving parameter 0 (verified viaCreateCommandSignature) and also succeeds on the empty fallback path for an invalid blob withNodeMask = 0xff.Tested
dev_create_root_signature_sanitizes_node_maskfails before the fix on WARP with0x80070057(E_INVALIDARG) forNodeMask = 2.cargo test -p xcl --lib -j 4 -- dev_create_root_signature_ --nocapture): 2 passed, 0 failed, 0 ignored.cargo test --workspace -j 2 -- --test-threads=4 --skip test_title_runs_and_game_folder_is_untouched --skip uma_driver::tests::withXCL_DXC_DIRset to DXC 1.9 on RTX 5070 Ti): 41 test binaries, 2610 passed, 0 failed, 49 ignored, 9 filtered out.SKIPPEDbreakdown (26 total): 21no wave64(RTX 5070 Ti is wave32), 3refused(V_MUL_F16,V_PK_MUL_F16,V_CVT_F16_F32#1426semantics), 2no heap windows(XCL_HEAP_WINDOWS=1opt-in).Regression run
Not tested
NodeMask > 1toCreateRootSignaturewere not run directly; those paths are covered by the synthetic WARP test.test_title_runs_and_game_folder_is_untouched,uma_driver::tests::, wave64 GPU tests, andXCL_HEAP_WINDOWS=1opt-in unit tests were not run in the workspace suite.AI use
Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-29T14:20:57Z.
Reviewed and tested at
bbb55ad2.Looks clean and well-tested (proves unhooked PC rejects
NodeMask > 1while both the valid blob and empty fallback succeed). One minor nit:dev_create_root_signature_sanitizes_node_maskcallsadopt(dev.as_raw(), Kind::Device)in-process rather than spawning an isolated child process like #3403/#3400/#3386.Tested locally
32.0.16.2140), AMD Ryzen 7 7800X3D,rustc 1.100.0.cargo test -p xcl --lib hle::d3d12x::real::root_signature_tests:: -- --test-threads=1: 2 passed, 0 failed.AI use
Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-30T16:03:07Z.
Test report for #3387 at
bbb55ad2e725b0ebdb4a5f7d3b28bcf0bc1b6a31, against its merge-base withmain,d8bd9a38, under Wine on AMD.Tested
experimental-11.0-20261112, stock vkd3d-protonmaster71cae091. Debug build,x86_64-pc-windows-gnu, under Wine. It wasn't run on Windows.cargo test --locked -p xcl --lib --target x86_64-pc-windows-gnu -- <filter>.--test-threads=1 <name>):dev_create_root_signature_sanitizes_node_maskfails:unhooked PC D3D12 must reject NodeMask 2, got 0x0(real.rs:11031). The test first checks that plain D3D12 refusesNodeMask 2, but vkd3d-proton accepts it, so the test fails under Wine before it reaches XCL's hook. The precondition holds for Microsoft's runtime, not for every D3D12 implementation; the test could skip that part (or the whole test) when the driver accepts the mask.--test-threads=2, with--skip gpu::and these six:failed_restore_stops_before_importing_an_unbacked_window,grooming_leaves_a_window_under_1_gib_only_its_hole(both run out of memory here),write_buffer_immediate_on_open_existing_heap_visible_to_cpu,coherent_buffer_sanitizes_console_flags_and_state,serialize_root_signature_strips_console_flags_and_preserves_pc_flagsandexecute_indirect_reads_the_arguments_written_before_it. Under Wine each of the last four ends the process or makes RADV reject later submissions (#3067), so without them the suite reaches its summary:bbb55ad2: 1510 passed, 113 failed, 5 ignoredd8bd9a38: 1510 passed, 112 failed, 5 ignoredmain's known ones on stock vkd3d-proton: list creation refused (E_INVALIDARG, #175 / #1701) and the tests after it (#3067).Not tested
gpu::tests in the suite runs-p xcl --lib)AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:24:30Z.
Review (head
b149d263, diff read, not a merge-check: thePR descriptioncheck fails, so not built or run here yet):bbb55ad2, not the headb149d263, which is whyPR descriptionfails. The two commits differ only in the test (the unhooked-rejection assert became a conditional for vkd3d-proton), but the smoke run has to be redone on the head.real.rs~10857 is another inline copy of "0 stays 0, anything else becomes 1".pc_queue_descandcreate_listalready do it inline, and #3400, #3385 and #3403 each add their own copy. The same file also hascanonical_node_maskwith the opposite convention (1 -> 0). One shared helper for this series would be easier to keep consistent.uma_driver::tests::andtest_title_runs_and_game_folder_is_untouched.Fine: on main a NodeMask > 1 made both the real call and the empty fallback fail, and the PR clamps the first call, the
E_NOINTERFACEretry and the fallback. The test fails without the fix on Microsoft's D3D12, checks that root parameter 0 is kept (through CreateCommandSignature), covers the fallback, and usesskip_test. Masks 0 and 1 reach the PC unchanged.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T15:51:08Z.
Test report (not a merge-check:
PR descriptionred)base:
b2b1f109d2head:
b149d2631bmerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2903 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: not repeated here; my review of this same head is at https://github.com/xcl-dev/xcl/pull/3387#issuecomment-7299673623, and its findings stand. This run adds what reading couldn't: whether the change merges, builds and passes the whole suite on current main.
performance: no smoke run.
assessment: merges, builds and passes the whole suite on current main; the findings in my review stand
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
AI-written and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T03:13:24Z.
Review: COMMENTED
Review of
b149d263: 1 finding(s). 1 are inline.These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T03:13:25Z.
Code review location:
crates/xcl/src/hle/d3d12x/real.rs; line 10857Not certain about this one:
if mask > 1 { 1 } else { mask }never checks the device's node count, so it also rewrites masks that are valid on a linked multi-node adapter. With GetNodeCount() == 2, NodeMask 2 (node 1) or 3 (both) becomes 1, so the root signature exists only on node 0, and PSOs/lists the title creates on node 1 with it fail. Masking against the real node set (mask & ((1 << GetNodeCount()) - 1), falling back when nothing is left) would only change masks the device can't satisfy. Relatedly, CreateCommandQueue/List, descriptor and query heaps, command signatures and the PSO NodeMask fields (e.g. ~9047/9104/9347, 3907, 1746) still forward the title's mask unchanged. A title passing 2 here likely passes it there too and fails one call later, so a sharedpc_node_mask(dev, mask)used by every hook would cover it.Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-02T19:39:33Z.
Closing: part of the
NodeMaskseries (0 safe checks) that needs to be built onmain'scanonical_node_maskwithGetNodeCount()gating; will re-open a single clean PR only if a title needs it.Pull request closed