Skip to content

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

Open
Snooozs wants to merge 1 commit into
ProjectLeonida:mainfrom
Snooozs:carry-old-4731
Open

Snooozs wants to merge 1 commit into
ProjectLeonida:mainfrom
Snooozs:carry-old-4731

Conversation

@Snooozs

@Snooozs Snooozs commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: OLD-4731 (#14 (comment))

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 3ed8e50: 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

…ct bits where the host can't serialize them

"1.1 with every root-signature flag" (#3340) sets CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED and
SAMPLER_HEAP_DIRECTLY_INDEXED, which came with Shader Model 6.6. Windows 10's built-in d3d12.dll refuses them
("Unsupported bit-flag set (root signature flags c7f)"), so the test failed on every Windows 10 PC. As for the
1.2 cases, the test now asks the host first. Where it can't serialize the heap-direct bits, it prints SKIP for
them and round-trips the other seven flags, so a parser reading the wrong header word is still caught there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GZEZyXGTTXs4V33hrBw1tD
(cherry picked from commit d1b1d0dbc9bfa02cb4779b3ae9829330eea31a0e)
@kawaii-shakal

Copy link
Copy Markdown
Contributor

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: 4bb1a09 (one commit, cherry-picked from d1b1d0dbc, author Felix Croasdale). Base: merge-base with main is 3ed8e50, 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 3ed8e50: 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 d3d12_set_descriptor_heaps_test: set the heap-direct root-signature flag word by hand where the host serializer refuses it (OLD-7718) #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

Snooozs commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

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

Snooozs commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

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

qhukz13 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

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).

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