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

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

Imported from ubiquitarianism/leonida. Originally posted by Kokonotcu on 2026-11-24T11:52:16Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5471595560 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/683). Originally posted by [Kokonotcu](https://github.com/Kokonotcu) on 2026-11-24T11:52:16Z. --- 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)
lixonik commented 2026-11-24 12:04:07 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-24T12:04:07Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6038848894 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/683#pullrequestreview-6038848894). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-24T12:04:07Z. **Review:** COMMENTED --- 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.
abnalstlll-byte commented 2026-11-24 12:21:15 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T12:21:15Z.

Review: APPROVED


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6039094315 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/683#pullrequestreview-6039094315). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T12:21:15Z. **Review:** APPROVED --- 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.
wanchudao commented 2026-11-24 15:37:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by wanchudao on 2026-11-24T15:37:56Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7136351945 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/683#issuecomment-7136351945). Originally posted by [wanchudao](https://github.com/wanchudao) on 2026-11-24T15:37:56Z. --- 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.
QemmHD commented 2026-11-25 02:36:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-25T02:36:49Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7150950502 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/683#issuecomment-7150950502). Originally posted by [QemmHD](https://github.com/QemmHD) on 2026-11-25T02:36:49Z. --- @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).
DadaCap commented 2026-11-28 10:34:36 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T10:34:36Z.


Thanks for the contribution! This PR was reviewed by the maintainers and is being closed as part of a large batch of closures.

Reason: superseded by main.

If this looks like a mistake, mention @DadaCap here at any time and it will be looked at again.

AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7237986056 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/683#issuecomment-7237986056). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-28T10:34:36Z. --- Thanks for the contribution! This PR was reviewed by the maintainers and is being closed as part of a large batch of closures. Reason: superseded by main. If this looks like a mistake, mention @DadaCap here at any time and it will be looked at again. AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.

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