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 from upstream-pr/2938 into main
bobcatchris commented 2026-12-01 20:04:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-12-01T20:04:38Z.


Claimed in the coordination issue as: D3D12-TEST-MESH-PIPELINE-ROOT-SIG (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7323785052; ref finding https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7318265079)

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.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5593545618 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2938). Originally posted by [bobcatchris](https://github.com/bobcatchris) on 2026-12-01T20:04:38Z. --- Claimed in the coordination issue as: D3D12-TEST-MESH-PIPELINE-ROOT-SIG (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7323785052; ref finding https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7318265079) ### 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 - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
merzleckeier commented 2026-12-01 20:42:23 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T20:42:23Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7325137997 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2938#issuecomment-7325137997). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-01T20:42:23Z. --- 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 commented 2026-12-01 21:27:08 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T21:27:08Z.

Review: CHANGES_REQUESTED


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6140455322 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2938#pullrequestreview-6140455322). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-12-01T21:27:08Z. **Review:** CHANGES_REQUESTED --- 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 commented 2026-12-01 21:48:03 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-01T21:48:03Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7326800272 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2938#issuecomment-7326800272). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-01T21:48:03Z. --- 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 commented 2026-12-01 22:21:13 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-12-01T22:21:13Z.


Closing in favor of #2855 (31752c4da), 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7327683503 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2938#issuecomment-7327683503). Originally posted by [bobcatchris](https://github.com/bobcatchris) on 2026-12-01T22:21:13Z. --- Closing in favor of #2855 (31752c4da), 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.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2938
No description provided.