Skip to content

D3D12-TEST-MESH-PIPELINE-ROOT-SIG: omit SM 6.6 heap flags in mesh pipeline library test - #2938

Closed
bobcatchris wants to merge 1 commit into
ProjectLeonida:mainfrom
bobcatchris:fix/d3d12-mesh-pipeline-test-root-sig
Closed

bobcatchris wants to merge 1 commit into
ProjectLeonida:mainfrom
bobcatchris:fix/d3d12-mesh-pipeline-test-root-sig

Conversation

@bobcatchris

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: D3D12-TEST-MESH-PIPELINE-ROOT-SIG (#2570 (comment); ref finding #2570 (comment))

What and why

pipeline::host::tests::a_mesh_pipeline_loads_from_the_library (d3d12/crates/leonida-gpu/src/pipeline/host.rs:1529) called root_signature(&host.device, &[], &[], false), which unconditionally sets D3D12_ROOT_SIGNATURE_FLAG_CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED and D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED (SM 6.6). Because the test's ms_6_5/ps_6_5 shaders bind no descriptors, inbox Windows 10 d3d12.dll rejects the root signature with E_INVALIDARG (the same issue #2855 fixed for depth_bounds_pipeline_loads_and_filters_draws, without touching this test).

Fix:

  • Added test helper empty_root_signature_blob() serializing an empty v1.1 root signature with D3D12_ROOT_SIGNATURE_FLAG_NONE and used it in a_mesh_pipeline_loads_from_the_library.
  • Added pure-CPU unit test empty_test_root_signature_omits_sm66_heap_flags deserializing the blob via D3D12CreateVersionedRootSignatureDeserializer and asserting D3D12_ROOT_SIGNATURE_FLAG_NONE (runs even on runners without dxc.exe or mesh shader hardware).

Tested

  • Windows 11, Rust 1.98.1, cargo test --locked -p leonida-gpu --lib pipeline::host::tests: 10 passed, 0 failed (including live a_mesh_pipeline_loads_from_the_library on RX 7900 XTX with PC dxc.exe and empty_test_root_signature_omits_sm66_heap_flags).
  • python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/pipeline/host.rs: clean.

GPUs tested: AMD Radeon RX 7900 XTX 24 GB (driver 32.0.32029.2010, Windows 11, profile L).

AI-assisted: yes — Gemini 4 Neon (implementation and an independent read-only reviewer pass).

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.

@merzleckeier

Copy link
Copy Markdown
Contributor

Mesh root signature and library cross-check under Wine on 69485a86 merged into 66c79286f. The standalone root-signature test passed without an adapter. Decoding the actual blob from the mesh test on both GPUs gave root-signature v1.1 with zero parameters and zero samplers on each tree. The flags were 0x0c01 on main and 0x0000 with this PR.

On Wine 11.22 / VKD3D-Proton 3.1.0, both PSO requests returned on both trees, then the pre-existing library-hit assertion failed 3/3 per tree and adapter. The observed failure was earlier in the cache path: CreatePipelineLibrary returned E_INVALIDARG (0x80070057) for the empty library, before load or store. The existing #2654 (55ac5d33) changes that call to pass a null pointer for zero bytes. I tested #2654 by itself and combined with this PR on the same base. Each arm passed all 3 mesh-library runs per adapter, with no skips, on RTX 4070 SUPER (620.73.4) and Radeon RADV (26.3.1).

That verifies the empty flags and the combined Wine library path. The Windows 10 inbox D3D12 runtime was outside this run. MEASURED with synthetic shader inputs, OpenAI Codex and a separate read-only review.

@KelboLive KelboLive 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.

The Win10 premise does not hold for this test: a_mesh_pipeline_loads_from_the_library returns at host.rs:1544 when mesh_shaders() is false, and inbox Win10 tops out at SM 6.5 while that check requires 6.6 (src/host.rs:6268-6270) — so it never reaches CreateRootSignature there, and on Win11 26200 the old call already passed. The Wine CreatePipelineLibrary failure is #2654's problem, not this one.

The change is still defensible as hygiene (a zero-descriptor test shouldn't promise SM 6.6 heap indexing), and the new CPU-side deserializer test is a genuine small complement — but #2855's current head now subsumes this PR: 31752c4da factors root_signature_with_flags() and uses it for both this test and the depth-bounds test, keeping ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT and the production serializer. The two conflict in pipeline/host.rs (merge-tree exit 1), and #2938's "without touching this test" line is stale since #2855's second commit landed at 21:01Z.

Please drop this branch, or rebase onto #2855 and keep only empty_test_root_signature_omits_sm66_heap_flags. In that case assert flags & (CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED | SAMPLER_HEAP_DIRECTLY_INDEXED) == 0 rather than == NONE, since the input-assembler flag is harmless and #2855 keeps it.

Separately: no test fails if production loses its SM 6.6 flags — I replaced Flags: input in root_signature() and all 10 host tests stayed green — so that guarantee remains review-only. If it matters, it needs its own assertion.

@lixonik

lixonik commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Heads-up on a small overlap with #2855: following review feedback from @KelboLive and @imShangLi on #2855, commit 31752c4da in #2855 factored root_signature_with_flags(...) out of root_signature(...) and updated both depth_bounds_pipeline_loads_and_filters_draws and a_mesh_pipeline_loads_from_the_library to call it without the SM 6.6 heap flags.

Your pure-CPU deserialization test (empty_test_root_signature_omits_sm66_heap_flags) is a nice addition here -- happy to either revert the a_mesh_pipeline_loads_from_the_library hunk in #2855 if maintainers prefer landing #2938 separately, or let whichever lands first take it.

@bobcatchris

Copy link
Copy Markdown
Contributor Author

Closing in favor of #2855 (31752c4), which now subsumes the �_mesh_pipeline_loads_from_the_library SM 6.6 flag removal via
oot_signature_with_flags and conflicts on pipeline/host.rs. Thanks @KelboLive and @lixonik for catching the overlap! AI-assisted.

@bobcatchris bobcatchris closed this Dec 1, 2026
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.

4 participants