d3d12_xs: serialize SM 6.6 heap-directly-indexed root signature flags on Windows 10 #683

Open
github-bot wants to merge 1 commit from github-bot/gh-683 into main AGit
Owner

@⁠Kokonotcu on GitHub · 2026-11-24 11:52 UTC · original
Kokonotcu:fix/rootsig-sm66-flags-win10 → main · +166 −2 · 4 files · 1 commits · open

Windows 10's built-in d3d12.dll refuses root signature flags 0x400 and 0x800 (CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED / SAMPLER_HEAP_DIRECTLY_INDEXED) with "Unsupported bit-flag set (root signature flags c00)".

The retail title builds each program's root signature from the shader's PRIV chunk and serializes it through D3D12SerializeVersionedRootSignature. A refusal leaves a null program in the pass table, and the title crashed reading it (game_scarlett_master.exe+0xb5a5f8, a read of [0+0x68]) about 15 s into every boot on a Windows 10 host. Measured with a new log of the host's error message:

[rt] d3d12_xs: D3D12SerializeVersionedRootSignature (version 2, 2 parameter(s), flags 0xc00) failed 0x80070057: Unsupported bit-flag set (root signature flags c00).

Change

  • The flags the host serializer refuses are asked once per bit (0x100..0x800) with an empty 1.1 description.
  • The description is serialized without those bits, and they are written back into the blob's RTS0 flags word; the DXBC container hash is recomputed (an all-zero hash stays zero). CreateRootSignature therefore still sees the heap-indexing flags.
  • Serializer failures are logged (first 8) with the host's message.
  • d3d12_xs_root_signature_test covers it: a 1.1 description with 0x400 | 0x800 | 0x1 serializes, its RTS0 flags keep all three bits and its hash is valid.

Verified: Windows 10 19045, RTX 3080 Laptop: d3d12_xs_root_signature_test passes (the 1.2 case skips, as before, on a d3d12.dll without 1.2). On the retail boot the b5a5f8 crash is gone and the run continues past it.

On a host whose d3d12.dll already accepts the flags (Windows 11 / Agility), the probe finds nothing refused and the path is unchanged.

🤖 Generated with Claude Code

**@⁠Kokonotcu** on GitHub · 2026-11-24 11:52 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/683) `Kokonotcu:fix/rootsig-sm66-flags-win10` → `main` · +166 −2 · 4 files · 1 commits · open Windows 10's built-in d3d12.dll refuses root signature flags 0x400 and 0x800 (CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED / SAMPLER_HEAP_DIRECTLY_INDEXED) with "Unsupported bit-flag set (root signature flags c00)". The retail title builds each program's root signature from the shader's PRIV chunk and serializes it through `D3D12SerializeVersionedRootSignature`. A refusal leaves a null program in the pass table, and the title crashed reading it (`game_scarlett_master.exe+0xb5a5f8`, a read of `[0+0x68]`) about 15 s into every boot on a Windows 10 host. Measured with a new log of the host's error message: ``` [rt] d3d12_xs: D3D12SerializeVersionedRootSignature (version 2, 2 parameter(s), flags 0xc00) failed 0x80070057: Unsupported bit-flag set (root signature flags c00). ``` **Change** - The flags the host serializer refuses are asked once per bit (0x100..0x800) with an empty 1.1 description. - The description is serialized without those bits, and they are written back into the blob's RTS0 flags word; the DXBC container hash is recomputed (an all-zero hash stays zero). `CreateRootSignature` therefore still sees the heap-indexing flags. - Serializer failures are logged (first 8) with the host's message. - `d3d12_xs_root_signature_test` covers it: a 1.1 description with 0x400 | 0x800 | 0x1 serializes, its RTS0 flags keep all three bits and its hash is valid. **Verified**: Windows 10 19045, RTX 3080 Laptop: `d3d12_xs_root_signature_test` passes (the 1.2 case skips, as before, on a d3d12.dll without 1.2). On the retail boot the b5a5f8 crash is gone and the run continues past it. On a host whose d3d12.dll already accepts the flags (Windows 11 / Agility), the probe finds nothing refused and the path is unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Windows 10's built-in d3d12.dll refuses root signature flags 0x400 and 0x800
(CBV_SRV_UAV / SAMPLER_HEAP_DIRECTLY_INDEXED) with "Unsupported bit-flag set". The
title builds every program's root signature from the shader's PRIV chunk and
serializes it; a refusal leaves a null program in its pass table, and the title
crashed reading it (game_scarlett_master.exe+0xb5a5f8, boots 5-9).

The flags the host refuses are asked once per bit; the description is serialized
without them and they are written back into the blob's RTS0 flags (container hash
recomputed), so CreateRootSignature still sees them. The shim test covers it, and
its target now links presentx_capture.cpp, which d3d12_xs_device.cpp needs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:16:09 +00:00
Author
Owner

@⁠lixonik on GitHub · 2026-11-24 12:04 UTC · original · reviewed

Independent Windows 10 check at d1029668 from a full Git checkout. I built the standalone d3d12_xs_root_signature_test sources with Microsoft DirectX-Headers v1.614.1 and the system D3D12 runtime. The PR test linked against the base shim at 21625bca fails the heap-indexed serialization case with 0x80070057. Linked against the PR shim, it passes, including the 1.0 and WARP 1.1 cases. Native 1.2 was skipped because this runtime lacks it.

I also exercised the new fallback separately, with a synthetic 1.2 description, no static sampler flags, flags 0xc01, and no error blob requested. The shim emitted a 1.1 RTS0 payload preserving 0xc01, and it passed the same hash check as the 1.1 test.

AI-assisted. Synthetic inputs and WARP only. No title boot or hardware GPU run.

**@⁠lixonik** on GitHub · 2026-11-24 12:04 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/683#pullrequestreview-6038848894) · **reviewed** Independent Windows 10 check at `d1029668` from a full Git checkout. I built the standalone `d3d12_xs_root_signature_test` sources with Microsoft DirectX-Headers v1.614.1 and the system D3D12 runtime. The PR test linked against the base shim at `21625bca` fails the heap-indexed serialization case with `0x80070057`. Linked against the PR shim, it passes, including the 1.0 and WARP 1.1 cases. Native 1.2 was skipped because this runtime lacks it. I also exercised the new fallback separately, with a synthetic 1.2 description, no static sampler flags, flags `0xc01`, and no error blob requested. The shim emitted a 1.1 RTS0 payload preserving `0xc01`, and it passed the same hash check as the 1.1 test. AI-assisted. Synthetic inputs and WARP only. No title boot or hardware GPU run.
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 12:21 UTC · original · approved these changes

Reviewed and verified fix for SM 6.6 heap-directly-indexed root signature flags (0x400/0x800) on Windows 10. Probing refused flags dynamically, stripping them before invoking the host D3D12 serializer, and patching them back into the RTS0 chunk with container checksum recomputation prevents crashes at boot without breaking newer OS environments. Test coverage in d3d12_xs_root_signature_test.cpp validates DXBC container integrity and flag persistence. Approved.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 12:21 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/683#pullrequestreview-6039094315) · **approved these changes** Reviewed and verified fix for SM 6.6 heap-directly-indexed root signature flags (0x400/0x800) on Windows 10. Probing refused flags dynamically, stripping them before invoking the host D3D12 serializer, and patching them back into the RTS0 chunk with container checksum recomputation prevents crashes at boot without breaking newer OS environments. Test coverage in d3d12_xs_root_signature_test.cpp validates DXBC container integrity and flag persistence. Approved.
Author
Owner

@⁠wanchudao on GitHub · 2026-11-24 15:37 UTC · original

I checked the host serializer for #683 (PR head d102966) on Windows 11 build 26300, with
d3d12.dll 10.0.26100.10068 and Python 3.14.7. Both probes called
D3D12SerializeVersionedRootSignature with zero parameters and zero static samplers.

  • python -I -B probe_rootsig_flags.py: all 24 combinations returned S_OK. The probe
    used root-signature versions 1.0, 1.1 and 1.2 with flags 0x000, 0x001, 0x100, 0x200,
    0x400, 0x800, 0xC00 and 0xC01.
  • python -I -B audit_a3/probe_d3d12_rootsig_independent.py: all 12 combinations of
    those versions with 0x000, 0x400, 0x800 and 0xC00 also returned S_OK. Versions 0
    and 4 and the unknown bit 0x10000000 returned E_INVALIDARG in the control cases.

For the 12 overlapping cases, an additional check read the RTS0 flags field in the
serialized blobs. It matched the requested value in all 12 cases.

This measures serialization on this host. The probes created no D3D12 device. I did
not run the PR's workaround or exercise its RTS0 write-back on a host that rejects
these flags.

AI use — DeepSeek Harness (DeepSeek V4.1 Flash) ran the original probes and drafted the
report. OpenAI Codex (GPT-6.2 Sol) independently reran both probes, checked the serialized
fields, and revised the report.

**@⁠wanchudao** on GitHub · 2026-11-24 15:37 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/683#issuecomment-7136351945) I checked the host serializer for #683 (PR head d102966) on Windows 11 build 26300, with d3d12.dll 10.0.26100.10068 and Python 3.14.7. Both probes called D3D12SerializeVersionedRootSignature with zero parameters and zero static samplers. - `python -I -B probe_rootsig_flags.py`: all 24 combinations returned S_OK. The probe used root-signature versions 1.0, 1.1 and 1.2 with flags 0x000, 0x001, 0x100, 0x200, 0x400, 0x800, 0xC00 and 0xC01. - `python -I -B audit_a3/probe_d3d12_rootsig_independent.py`: all 12 combinations of those versions with 0x000, 0x400, 0x800 and 0xC00 also returned S_OK. Versions 0 and 4 and the unknown bit 0x10000000 returned E_INVALIDARG in the control cases. For the 12 overlapping cases, an additional check read the RTS0 flags field in the serialized blobs. It matched the requested value in all 12 cases. This measures serialization on this host. The probes created no D3D12 device. I did not run the PR's workaround or exercise its RTS0 write-back on a host that rejects these flags. AI use — DeepSeek Harness (DeepSeek V4.1 Flash) ran the original probes and drafted the report. OpenAI Codex (GPT-6.2 Sol) independently reran both probes, checked the serialized fields, and revised the report.
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 02:36 UTC · original

@⁠Kokonotcu: #1353, which does the same fix for the Windows 10 root-signature flags, has just been merged. It retries only after a refusal, covers both the versioned and the legacy serializer, and checks the hash before patching. I tested both PRs; details are in my merge note on #1353. One part of this PR would still be useful on top of main: logging the host's error message for the first few serializer failures. If you rebase just that piece as a small PR, I'll test it. Otherwise this one can probably be closed as covered by #1353. Thanks for finding the crash in the first place.

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

**@⁠QemmHD** on GitHub · 2026-11-25 02:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/683#issuecomment-7150950502) @⁠Kokonotcu: #1353, which does the same fix for the Windows 10 root-signature flags, has just been merged. It retries only after a refusal, covers both the versioned and the legacy serializer, and checks the hash before patching. I tested both PRs; details are in my merge note on #1353. One part of this PR would still be useful on top of main: logging the host's error message for the first few serializer failures. If you rebase just that piece as a small PR, I'll test it. Otherwise this one can probably be closed as covered by #1353. Thanks for finding the crash in the first place. AI-assisted (Claude Code, Claude Opus 5.5).
This pull request has changes conflicting with the target branch.
  • runtime/shims/d3d12_xs.cpp
  • runtime/shims/d3d12_xs_rootsig.cpp
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/683/head:github-bot/gh-683'
git switch 'github-bot/gh-683'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-683'
git switch 'github-bot/gh-683'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-683'
git switch 'github-bot/gh-683'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-683'
git switch 'main'
git merge --squash 'github-bot/gh-683'
git switch 'main'
git merge --ff-only 'github-bot/gh-683'
git switch 'main'
git merge 'github-bot/gh-683'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.