root_signature_oracle_test: check the flag word without the heap-direct bits where the host can't serialize them (OLD-4731) #988

Closed
Snooozs wants to merge 1 commit from upstream-pr/988 into main
Snooozs commented 2026-11-24 16:31:11 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Snooozs on 2026-11-24T16:31:11Z.


Claimed in the coordination issue as: OLD-4731 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7137704829)

What and why

Carries on Felix Croasdale's old pull request 4731, which has no old-pr/ branch. The commit is cherry-picked unchanged and keeps its author; it applies cleanly. If the author would rather carry it on, say so and I will close this.

Windows 10's built-in d3d12.dll refuses the two heap-direct root-signature flags (Shader Model 6.6). The test asks the host first; where it cannot serialize them it prints SKIP for those bits and still round-trips the other seven flags.

Tested

Windows 10 Pro 22H2 (10.0.19045), NVIDIA GeForce RTX 5060 Ti (621.01) and WARP, VS 2022 RelWithDebInfo, Vulkan SDK 1.4.363.0, ctest -R "^root_signature_oracle$":

  • main 3ed8e50b7: fails, Unsupported bit-flag set (root signature flags c7f)
  • with this commit: passes

I have not run it on Windows 11. check_no_game_data.py on the changed file: clean. Test-only change.

GPUs tested: NVIDIA GeForce RTX 5060 Ti, driver 621.01, Windows 10 22H2

AI-assisted: yes. Claude Code (Claude Opus 5.5) restored, reviewed and tested the original commit.

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.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator rule)

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5476219004 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/988). Originally posted by [Snooozs](https://github.com/Snooozs) on 2026-11-24T16:31:11Z. --- Claimed in the coordination issue as: OLD-4731 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7137704829) ### What and why Carries on Felix Croasdale's old pull request 4731, which has no `old-pr/` branch. The commit is cherry-picked unchanged and keeps its author; it applies cleanly. If the author would rather carry it on, say so and I will close this. Windows 10's built-in d3d12.dll refuses the two heap-direct root-signature flags (Shader Model 6.6). The test asks the host first; where it cannot serialize them it prints SKIP for those bits and still round-trips the other seven flags. ### Tested Windows 10 Pro 22H2 (10.0.19045), NVIDIA GeForce RTX 5060 Ti (621.01) and WARP, VS 2022 RelWithDebInfo, Vulkan SDK 1.4.363.0, `ctest -R "^root_signature_oracle$"`: - `main` 3ed8e50b7: fails, `Unsupported bit-flag set (root signature flags c7f)` - with this commit: passes I have not run it on Windows 11. `check_no_game_data.py` on the changed file: clean. Test-only change. GPUs tested: NVIDIA GeForce RTX 5060 Ti, driver 621.01, Windows 10 22H2 AI-assisted: yes. Claude Code (Claude Opus 5.5) restored, reviewed and tested the original commit. ### 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. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator rule) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
kawaii-shakal commented 2026-11-24 16:43:04 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kawaii-shakal on 2026-11-24T16:43:04Z.


Review of #988, root_signature_oracle_test: check the flag word without the heap-direct bits where the host can't serialize them (OLD-4731)

Head: 4bb1a09c4c (one commit, cherry-picked from d1b1d0dbc, author Felix Croasdale). Base: merge-base with main is 3ed8e50b7, the current main. Only runtime/test/root_signature_oracle_test.cpp changes, nothing else differs from main. The claim in #14 (comment 7137704829, OLD-4731) matches the pull request.

Environment: Windows 11 Pro 10.0.26300, d3d12.dll 10.0.26100.9818, VS 18 2026, RelWithDebInfo, -DBUILD_TESTING=ON, one worktree from origin/main. This test uses only the host serializer and the layer's parser, with no GPU. I swapped in only the changed file and rebuilt only root_signature_oracle_test.

Commands: cmake --build runtime/build --config RelWithDebInfo --target root_signature_oracle_test -- /m:4, then ctest --test-dir runtime/build -C RelWithDebInfo -R "^root_signature_oracle$" -V.

Results:

  • main 3ed8e50b7: passes, including "1.1 with every root-signature flag: the whole PC flag word round-trips (heap-direct bits included)".
  • With the PR: passes, with no warnings in the changed file. The probe succeeds, so there is no SKIP line, the heap-direct bits stay in every_pc_flag, and all nine bits round-trip as on main.
  • Mutation A: the parser drops the heap-direct bits (runtime/src/root_signature.cpp:343, out.sig.flags = flags & ~0xC00u). On the normal path (Windows 11) the round-trip check and the canonical codec check fail. When I force the probe to fail (simulating Windows 10), the test passes. So on such a host this case no longer catches a parser that loses only those two bits.
  • Mutation B: the parser reads the flags from the wrong header word (root_signature.cpp:326, u32_at(16, flags)), with the probe forced to fail. It fails with 4 failures ("1.1 empty" and both checks in "1.1 with every root-signature flag"). The remaining seven bits still catch a parser that reads the wrong word, as the commit message says.

Findings:

  1. The condition comes from the host. The probe (root_signature_oracle_test.cpp:357-368) serializes a 1.1 description with only the two heap-direct bits through the host's D3D12SerializeVersionedRootSignature. The bits are removed only when that call fails. This uses the same pattern as the existing 1.2 probe at the old lines 612-622. A SKIP line names what is not checked, so it is not a silent skip.
  2. On a host that cannot serialize the bits (Windows 10), the test loses coverage of the two heap-direct bits in the parser, as mutation A shows. That fits the purpose of the test. It is an oracle test against the PC serializer, and it cannot have a reference blob the host refuses to make. With #990, d3d12_set_descriptor_heaps_test writes those bits into an RTS0 blob by hand and checks that the layer keeps them, so between the two PRs the bits are still covered on Windows 10. Mentioning that in the comment would help. Optional, does not block.
  3. The comment above the case (lines 339-343) gives the reason for the case as "a graphics signature sets ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT and a bindless one sets the heap-direct bits". On the reduced path only the first half applies. Mutation B shows that the wrong-word check still holds, so this is just wording.
  4. If the probe fails for an unrelated reason (anything other than the bits being refused), the bits are also dropped. The probe is the same call as the main case, so a host with a broken serializer would fail elsewhere in this test anyway. Fine.

Verdict: approve. It passes here, the reduction is conditional on the host serializer actually refusing the bits and says so with SKIP, the rest of the flag word is still checked against the oracle (mutation B), and the bits it cannot check are covered by #990's hand-written blob. Optional: point to that in the comment.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7138098337 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/988#issuecomment-7138098337). Originally posted by [kawaii-shakal](https://github.com/kawaii-shakal) on 2026-11-24T16:43:04Z. --- Review of #988, root_signature_oracle_test: check the flag word without the heap-direct bits where the host can't serialize them (OLD-4731) Head: 4bb1a09c4cf19bc2abe4b2e15d57f50a2f0f031e (one commit, cherry-picked from d1b1d0dbc, author Felix Croasdale). Base: merge-base with main is 3ed8e50b7, the current main. Only runtime/test/root_signature_oracle_test.cpp changes, nothing else differs from main. The claim in #14 (comment 7137704829, OLD-4731) matches the pull request. Environment: Windows 11 Pro 10.0.26300, d3d12.dll 10.0.26100.9818, VS 18 2026, RelWithDebInfo, -DBUILD_TESTING=ON, one worktree from origin/main. This test uses only the host serializer and the layer's parser, with no GPU. I swapped in only the changed file and rebuilt only root_signature_oracle_test. Commands: `cmake --build runtime/build --config RelWithDebInfo --target root_signature_oracle_test -- /m:4`, then `ctest --test-dir runtime/build -C RelWithDebInfo -R "^root_signature_oracle$" -V`. Results: - main 3ed8e50b7: passes, including "1.1 with every root-signature flag: the whole PC flag word round-trips (heap-direct bits included)". - With the PR: passes, with no warnings in the changed file. The probe succeeds, so there is no SKIP line, the heap-direct bits stay in `every_pc_flag`, and all nine bits round-trip as on main. - Mutation A: the parser drops the heap-direct bits (runtime/src/root_signature.cpp:343, `out.sig.flags = flags & ~0xC00u`). On the normal path (Windows 11) the round-trip check and the canonical codec check fail. When I force the probe to fail (simulating Windows 10), the test passes. So on such a host this case no longer catches a parser that loses only those two bits. - Mutation B: the parser reads the flags from the wrong header word (root_signature.cpp:326, `u32_at(16, flags)`), with the probe forced to fail. It fails with 4 failures ("1.1 empty" and both checks in "1.1 with every root-signature flag"). The remaining seven bits still catch a parser that reads the wrong word, as the commit message says. Findings: 1. The condition comes from the host. The probe (root_signature_oracle_test.cpp:357-368) serializes a 1.1 description with only the two heap-direct bits through the host's D3D12SerializeVersionedRootSignature. The bits are removed only when that call fails. This uses the same pattern as the existing 1.2 probe at the old lines 612-622. A SKIP line names what is not checked, so it is not a silent skip. 2. On a host that cannot serialize the bits (Windows 10), the test loses coverage of the two heap-direct bits in the parser, as mutation A shows. That fits the purpose of the test. It is an oracle test against the PC serializer, and it cannot have a reference blob the host refuses to make. With #990, d3d12_set_descriptor_heaps_test writes those bits into an RTS0 blob by hand and checks that the layer keeps them, so between the two PRs the bits are still covered on Windows 10. Mentioning that in the comment would help. Optional, does not block. 3. The comment above the case (lines 339-343) gives the reason for the case as "a graphics signature sets ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT and a bindless one sets the heap-direct bits". On the reduced path only the first half applies. Mutation B shows that the wrong-word check still holds, so this is just wording. 4. If the probe fails for an unrelated reason (anything other than the bits being refused), the bits are also dropped. The probe is the same call as the main case, so a host with a broken serializer would fail elsewhere in this test anyway. Fine. Verdict: approve. It passes here, the reduction is conditional on the host serializer actually refusing the bits and says so with SKIP, the rest of the flag word is still checked against the oracle (mutation B), and the bits it cannot check are covered by #990's hand-written blob. Optional: point to that in the comment. AI-assisted.
Snooozs commented 2026-11-24 16:44:11 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Snooozs on 2026-11-24T16:44:11Z.


Thanks @kawaii-shakal, especially for mutation A: it shows exactly what Windows 10 loses here (the two heap-direct bits), and that #990 covers them there. I have kept the author's commit unchanged and leave the two optional wording points to the author or a maintainer.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7138126805 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/988#issuecomment-7138126805). Originally posted by [Snooozs](https://github.com/Snooozs) on 2026-11-24T16:44:11Z. --- Thanks @kawaii-shakal, especially for mutation A: it shows exactly what Windows 10 loses here (the two heap-direct bits), and that #990 covers them there. I have kept the author's commit unchanged and leave the two optional wording points to the author or a maintainer.
Snooozs commented 2026-11-25 06:41:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Snooozs on 2026-11-25T06:41:26Z.


Still needed after #1353: on main 42537e7b6 without this PR, root_signature_oracle_test still fails on Windows 10 19045 (1 failure, exit 1).

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7155056190 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/988#issuecomment-7155056190). Originally posted by [Snooozs](https://github.com/Snooozs) on 2026-11-25T06:41:26Z. --- Still needed after #1353: on `main` `42537e7b6` without this PR, `root_signature_oracle_test` still fails on Windows 10 19045 (1 failure, exit 1). AI-assisted (Claude Code, Claude Opus 5.5).
qhukz13 commented 2026-11-25 09:33:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by qhukz13 on 2026-11-25T09:33:52Z.


Confirmed on a GeForce GTX 1050 Ti, as asked in #14: NVIDIA 582.66, Windows 10 Pro 19045, MSVC RelWithDebInfo, main cdb003ea1 + this PR. root_signature_oracle fails on main (FAIL 1.1 with every root-signature flag: Microsoft serializer accepts it, Unsupported bit-flag set (root signature flags c7f)) and passes 3 of 3 with the PR (SKIP ... the heap-direct bits (the host d3d12.dll can't serialize them, e.g. Windows 10); the other flags are still checked, then PASS ... the whole PC flag word round-trips). AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7158500025 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/988#issuecomment-7158500025). Originally posted by [qhukz13](https://github.com/qhukz13) on 2026-11-25T09:33:52Z. --- Confirmed on a GeForce GTX 1050 Ti, as asked in #14: NVIDIA 582.66, Windows 10 Pro 19045, MSVC RelWithDebInfo, `main` `cdb003ea1` + this PR. `root_signature_oracle` fails on `main` (`FAIL 1.1 with every root-signature flag: Microsoft serializer accepts it`, `Unsupported bit-flag set (root signature flags c7f)`) and passes 3 of 3 with the PR (`SKIP ... the heap-direct bits (the host d3d12.dll can't serialize them, e.g. Windows 10); the other flags are still checked`, then `PASS ... the whole PC flag word round-trips`). AI-assisted (Claude Code).
OreoFR commented 2026-11-28 21:45:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:45:56Z.


Verified by OreoFR

  • Base: main c1ecf04ed + PR head e16d5adca; green run in a merge package of 9 PRs, no new ctest failure vs main
  • Test: ctest -R ^root_signature_oracle$
  • Red on main: OK on main
  • Green with the PR: OK
  • Verdict: NO RED (test-only PR)
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246254938 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/988#issuecomment-7246254938). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-28T21:45:56Z. --- **Verified by OreoFR** - Base: main `c1ecf04ed` + PR head `e16d5adca`; green run in a merge package of 9 PRs, no new ctest failure vs main - Test: `ctest -R ^root_signature_oracle$` - Red on main: OK on main - Green with the PR: OK - Verdict: NO RED (test-only PR) - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
zmasi commented 2026-11-29 01:00:03 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T01:00:03Z.


Windows 11 + MSVC 19.44 Verification — PASS (e16d5adcad)

Verified e16d5adcad (OLD-4731) merged onto origin/main (e66c65b950 / 16f5053047, 0 conflicts, plus a 5-way combined merge alongside #1146, #955, #2544, and #1738) on native Windows 11 (10.0.26200.9974) with MSVC 19.44.35228.

Checks Run

  • Native Windows 11 host d3d12.dll (Shader Model 6.6 heap-direct flags supported):
    • Compiled root_signature_oracle_test.exe with /std:c++20 /O2 /MD /EHsc /W4 /WX /permissive- /utf-8 (0 warnings) and ran against Windows 11 d3d12.dll: rc=0, verifying all 9 flags in every_pc_flag (CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED | SAMPLER_HEAP_DIRECTLY_INDEXED included) round-trip through D3D12SerializeVersionedRootSignature, parse_rts0, and canonical encode/decode.
  • Simulated pre-SM 6.6 Windows 10 d3d12.dll fallback (E_INVALIDARG on heap_direct probe):
    • Verified the fallback path logs "SKIP 1.1 with every root-signature flag: the heap-direct bits (the host d3d12.dll can't serialize them, e.g. Windows 10); the other flags are still checked", masks off heap_direct_flags, and passes the remaining 7-flag 1.1 and 1.2 round-trip checks (rc=0).

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248492328 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/988#issuecomment-7248492328). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-29T01:00:03Z. --- ## Windows 11 + MSVC `19.44` Verification — PASS (`e16d5adcad`) Verified `e16d5adcad` (`OLD-4731`) merged onto `origin/main` (`e66c65b950` / `16f5053047`, `0` conflicts, plus a 5-way combined merge alongside `#1146`, `#955`, `#2544`, and `#1738`) on native Windows 11 (`10.0.26200.9974`) with MSVC `19.44.35228`. ### Checks Run - **Native Windows 11 host `d3d12.dll` (Shader Model 6.6 heap-direct flags supported)**: - Compiled `root_signature_oracle_test.exe` with `/std:c++20 /O2 /MD /EHsc /W4 /WX /permissive- /utf-8` (`0` warnings) and ran against Windows 11 `d3d12.dll`: **`rc=0`**, verifying all 9 flags in `every_pc_flag` (`CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED | SAMPLER_HEAP_DIRECTLY_INDEXED` included) round-trip through `D3D12SerializeVersionedRootSignature`, `parse_rts0`, and canonical encode/decode. - **Simulated pre-SM 6.6 Windows 10 `d3d12.dll` fallback (`E_INVALIDARG` on `heap_direct` probe)**: - Verified the fallback path logs `"SKIP 1.1 with every root-signature flag: the heap-direct bits (the host d3d12.dll can't serialize them, e.g. Windows 10); the other flags are still checked"`, masks off `heap_direct_flags`, and passes the remaining 7-flag `1.1` and `1.2` round-trip checks (`rc=0`). AI-assisted.
aslan2142 commented 2026-12-01 16:32:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:32:45Z.


Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7317783990 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/988#issuecomment-7317783990). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:32:45Z. --- Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.

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!988
No description provided.