Skip to content

D3D12.X: clamp single-adapter NodeMask on CreateRootSignature - #3387

Open
Kalmarv wants to merge 1 commit into
xcl-dev:mainfrom
Kalmarv:samplers/rootsig-nodemask-sanitize
Open

Kalmarv wants to merge 1 commit into
xcl-dev:mainfrom
Kalmarv:samplers/rootsig-nodemask-sanitize

Conversation

@Kalmarv

@Kalmarv Kalmarv commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

What is in it

  • Clamp single-adapter NodeMask values above 1 to 1 in dev_create_root_signature (crates/xcl/src/hle/d3d12x/real.rs) before calling PC CreateRootSignature (for the primary call, the E_NOINTERFACE IID retry, and the empty-root-signature fallback). Without this, a valid root signature blob passed with NodeMask > 1 fails both the real creation and the empty fallback with E_INVALIDARG (0x80070057).
  • Add WARP integration test dev_create_root_signature_sanitizes_node_mask in hle::d3d12x::real::root_signature_tests verifying that unhooked PC CreateRootSignature rejects NodeMask = 2, while dev_create_root_signature creates the real root signature preserving parameter 0 (verified via CreateCommandSignature) and also succeeds on the empty fallback path for an invalid blob with NodeMask = 0xff.

Tested

  • Verified dev_create_root_signature_sanitizes_node_mask fails before the fix on WARP with 0x80070057 (E_INVALIDARG) for NodeMask = 2.
  • Targeted tests after the fix (cargo test -p xcl --lib -j 4 -- dev_create_root_signature_ --nocapture): 2 passed, 0 failed, 0 ignored.
  • Full workspace suite (cargo test --workspace -j 2 -- --test-threads=4 --skip test_title_runs_and_game_folder_is_untouched --skip uma_driver::tests:: with XCL_DXC_DIR set to DXC 1.9 on RTX 5070 Ti): 41 test binaries, 2610 passed, 0 failed, 49 ignored, 9 filtered out.
  • SKIPPED breakdown (26 total): 21 no wave64 (RTX 5070 Ti is wave32), 3 refused (V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32 #1426 semantics), 2 no heap windows (XCL_HEAP_WINDOWS=1 opt-in).

Regression run

xcl-smoke v1
commit: f0e8fdd5c3942ddd399d5ee11384c8595c5aacff
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 150
exit: 0x0
frames shown: 1695 (PresentX 1695)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 31546 MB
xcl-smoke v1
commit: bbb55ad2e725b0ebdb4a5f7d3b28bcf0bc1b6a31
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 150
exit: 0x0
frames shown: 1558 (PresentX 1558)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 33759 MB

Not tested

  • Retail titles that pass NodeMask > 1 to CreateRootSignature were 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, and XCL_HEAP_WINDOWS=1 opt-in unit tests were not run in the workspace suite.

AI use

  • Authored, verified, and tested with an AI coding agent; all changes and test results were verified directly against the local repository, compiler, test suite, and 150 s smoke run.

@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) labels Nov 29, 2026
@saintwolf

Copy link
Copy Markdown
Contributor

Reviewed and tested at bbb55ad2.

Looks clean and well-tested (proves unhooked PC rejects NodeMask > 1 while both the valid blob and empty fallback succeed). One minor nit: dev_create_root_signature_sanitizes_node_mask calls adopt(dev.as_raw(), Kind::Device) in-process rather than spawning an isolated child process like #3403/#3400/#3386.

Tested locally

  • Windows 11 (build 26300), NVIDIA GeForce RTX 4070 SUPER (driver 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

  • Antigravity (Gemini 4 Neon) assisted with code review and drafting; all builds and tests were executed locally on the hardware above.

@ClosetPie107

Copy link
Copy Markdown

Test report for #3387 at bbb55ad2e725b0ebdb4a5f7d3b28bcf0bc1b6a31, against its merge-base with main, d8bd9a38, under Wine on AMD.

Tested

Not tested

  • native Windows
  • NVIDIA
  • the gpu:: tests in the suite runs
  • the workspace's other crates and integration tests (only -p xcl --lib)
  • a game run (no regression block)

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

The test no longer requires the unhooked CreateRootSignature to refuse NodeMask 2: Microsoft's D3D12 refuses it, vkd3d-proton takes it, and then only the hooked call is checked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Kalmarv
Kalmarv force-pushed the samplers/rootsig-nodemask-sanitize branch from bbb55ad to b149d26 Compare November 30, 2026 23:48
@github-actions github-actions Bot added the needs-pr-check Failing the PR description check (CONTRIBUTING.md) label Nov 30, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Review (head b149d26, diff read, not a merge-check: the PR description check fails, so not built or run here yet):

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_NOINTERFACE retry 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 uses skip_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.

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Test report (not a merge-check: PR description red)
base: b2b1f10
head: b149d26
merge: 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 #3387 (comment), 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.

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

Labels

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) needs-pr-check Failing the PR description check (CONTRIBUTING.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants