Repository navigation
D3D12.X: clamp single-adapter NodeMask and guard null riid in CreateCommandSignature - #3400
Conversation
|
Reviewed and tested at Looks clean and tightly scoped — Tested locally
AI use
|
|
Test report for #3400 at Tested
Not tested
AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report. |
|
merge-check AI-written and posted by Foniass without a human check of each point. |
|
merge-check |
|
Merged at the checked head after a combined trial of #3400, #3386, #3393 and #3535 on AI use: Claude Code (Claude Opus 5.5). |
Clamp multi-bit
D3D12_COMMAND_SIGNATURE_DESC::NodeMaskvalues to single-adapter1and guard nullriidincreate_command_signature_x.Previously,
device_x::create_command_signature_xforwardedD3D12_COMMAND_SIGNATURE_DESC::NodeMaskunchanged to PCCreateCommandSignature(and copied it into theDISPATCH_MESHcompanionDISPATCHsignature). On single-adapter PC D3D12, anyNodeMask > 1(for example0x3or0xFFFF_FFFF) is rejected withE_INVALIDARG(0x80070057), unlikepc_queue_descandcreate_listin the same module which already clamp nonzero node masks to1. It also did not guard a nullriidpointer before forwarding to the PC runtime.What is in it
crates/xcl/src/hle/d3d12x/device_x.rs:pc_command_signature_node_maskclamping nonzeroNodeMaskvalues to1while keeping0as0.pc_command_signature_node_masktopc[16..20]increate_command_signature_xbefore callingreal::dev_create_command_signature(so both the main signature and anyDISPATCH_MESHcompanion signature use the clamped mask), log both original and clamped masks on failure, guardriid.is_null()alongsidedesc.is_null() || ppv.is_null(), and check!(*ppv).is_null()before recording companion state.pc_command_signature_node_mask_clamps_to_single_adapterand child-process-isolated WARP testcreate_command_signature_x_clamps_node_mask_and_guards_null_argsverifying consoleDispatchXwithNodeMask = 0x3,DRAWwithNodeMask = 0xFFFF_FFFF, nulldesc/riid/ppvhandling, and rejection of undersizedByteStride.Tested
rustc 1.99.0 (b940084d7 2026-09-28), DXC 1.9 (XCL_DXC_DIR), debug for tests and release forxcl-smoke.cargo test -p xcl --lib -- hle::d3d12x::device_x::tests:: --nocapture):create_command_signature_x_clamps_node_mask_and_guards_null_argsfailed before the fix (NodeMask 0x3 must clamp to 1 on single-adapter PC D3D12, got 0x80070057), and all 22device_xtests passed after (22 passed, 0 failed,0.14s,0skips).cargo test --workspace -j 2 -- --test-threads=4 --skip test_title_runs_and_game_folder_is_untouched --skip uma_driver::tests::): 2663 passed, 0 failed, 49 ignored, 9 filtered across 41 test binaries.SKIPPEDGPU tests on this wave32 adapter (26 total across--nocaptureworkspace baseline): 21no wave64(RTX 5070 Ti is wave32), 3 wave32 per-lane#1426f16/cvt-f16 refusals, 2no heap windows(opt-inXCL_HEAP_WINDOWS=1).ea3b5e4d) 150 s regression run below (0device removals,0crashes,1620frames vs1695onmain,33840 MBpeak commit vs31546 MBonmain).Regression run
Not tested
NodeMask > 1is clamped to1for single-adapter PC D3D12 parity withpc_queue_descandcreate_list) and AMD RDNA / wave64 GPUs.uma_driver::tests::(skipped locally due to pre-existing0x7C10003exit on NVIDIA) andtest_title_runs_and_game_folder_is_untouched.AI use