OLD-7234: restore old upstream PR 7234 - d3d12_xs: pin that the root-signature flag mask keeps every public flag (old upstream PR 7140) #677
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!677
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/677/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@aslan2142 on GitHub · 2026-11-24 11:41 UTC · original
aslan2142:root-sig-flag-mask→main· +475 −1 · 3 files · 5 commits · merged 2026-11-25 22:58 UTCClaimed in the coordination issue as: OLD-7234 #14
Restoration of my original pull request, old upstream PR 7234 in
ItsNotRexed/Leonida, which was closed unmerged when that repository went private on 2026-11-23 (old numbers link nowhere now). Rebased onto main at21625bca8c; the only changes are that the old PR references in comments and commit messages are now plain text ("old upstream PR 7140").What and why
main.kXboxRootSignatureFlagHighByte,runtime/shims/d3d12_xs_rootsig.h) on every descriptor and RTS0 blob, whatever built it.0x03000000: its direct call passes a 1.1 description withFlags = 0x80, and its decoder readsFlagsas a 16-bit value.D3D12_ROOT_SIGNATURE_FLAGSvalue is in bits 0-11, so the mask cannot touch one, and it can stay unconditional.docs/d3d12_vulkan.mdanswers the question the doc still left open ("whether its root signatures carry them is open") and says why the mask stays as it is.root_sig_public_flags_test(Windows only, next toroot_sig_test) checks:[0, 0xFFFF];0x80and all twelve;0x03000080comes back as0x80, with a valid container hash and no other byte changed;static_asserts that no public flag lies in the cleared byte.Tested
Built and run on Linux. The Windows build used clang targeting x86_64-w64-mingw32 and ran under Wine 11.22. MSVC (
/W4 /permissive-) is left to CI.root_sig_public_flags_testbuilt againstmain's code: 28 pass, 0 fail, as expected for a guard.0x80, in a scratch copy: 12 pass, 16 fail. So the test catches a mask that eats a public flag.root_sig_test: 56 pass, 1 fail, the same onmainand on this branch. The failure is "shim deserializer accepts an all-zero-checksum Xbox blob". Wine's host deserializer causes it, and this pull request does not touch it.git diff --checkandscripts/check_no_game_data.pyon the changed files: clean.GPUs tested: n/a (the test needs no GPU)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)AI-assisted (Claude Code, Claude Opus 5.5).
@trigger337 on GitHub · 2026-11-24 11:46 UTC · original
agent: yes
AI-assisted: yes
Code review and repository integrity check:
kXboxRootSignatureFlagHighByteinruntime/shims/d3d12_xs_rootsig.hexclusively targets bits 24-31 (0xFF000000). All standardD3D12_ROOT_SIGNATURE_FLAGSspan bits 0-11 (0x00000800max), ensuring standard flags remain unaltered across descriptor conversion and RTS0 serialization.docs/d3d12_vulkan.mdresolving the open question on retail root signature bit patterns.scripts/check_no_game_data.py: clean.tests/test_text_write_line_endings.py: 3/3 tests passed.tests/test_docs_links.py: 16/16 passed.@lixonik on GitHub · 2026-11-24 12:09 UTC · original · reviewed
Independent native Windows 10 run at
3769fd6b:root_sig_public_flags_testbuilds with MSVC and passes with zero failures.I also built that exact test against the shim from #683 at
d1029668, which is a useful merge-order check. The combined run has two failures: the host-parity assertion for versioned 1.0 and for 1.1. Each sees two different results because #683 intentionally accepts the heap-indexed cases that the host serializer refuses. The separate checks that the flags round-trip and that the input description is unchanged still pass.Whichever lands second will need to update that test expectation for the intentional Windows 10 fallback. The flag preservation and byte-for-byte parity where the host accepts the description can still be checked.
AI-assisted testing on synthetic root signatures from full Git worktrees. No GPU required.
@aslan2142 on GitHub · 2026-11-24 19:30 UTC · original
Thanks for the Windows 10 run and for checking it against #683.
CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED(0x400) orSAMPLER_HEAP_DIRECTLY_INDEXED(0x800) is serialized by the shim on a host that refuses it, on purpose, so "the shim refuses what the host refuses" no longer holds for those two bits.maindoesn't have #683 yet, and onmainthe shim does refuse what the host refuses, so a looser check now would test nothing.root_sig_public_flags_testhere: for a bit the host refuses, expect the shim to succeed, its RTS0 flags to keep the bit and the container hash to be valid, and keep byte-for-byte parity wherever the host accepts. If this lands first, the same change belongs in #683.main's:test_tool_stdout_encoding(fixed onmainby #605 and #948) andcs_imgload_tfe/cs_imgload_d16_tfe(issue #31, fixed onmainby #892).AI-assisted (Claude Code, Claude Opus 5.5).
@lixonik on GitHub · 2026-11-25 05:35 UTC · original · reviewed
Follow-up now that #1353 has merged. I rebuilt this PR's
root_sig_public_flags_test.cppat3769fd6bagainst the shim sources at the #1353 merge commita2de554eon native Windows 10 with MSVC. The test exited 1 with three failing host-parity checks: versioned 1.0, versioned 1.1, and the legacy serializer. The legacy check is now affected as well because #1353 covers that entry point. The flag-preservation and Xbox-bit masking checks still passed.Please account for the intentional heap-indexed fallback in those three assertions while keeping the byte-for-byte checks for the cases the host accepts. AI-assisted, CPU-only synthetic test.
@aslan2142 on GitHub · 2026-11-25 22:58 UTC · original
Merged:
d3d12_xskeeps every public root-signature flag through the flag mask, and a test pins it (old upstream PR 7140).CBV_SRV_UAV_HEAP_DIRECTLY_INDEXEDorSAMPLER_HEAP_DIRECTLY_INDEXEDbut takes the description without them, the three host-parity checks now expect the shim to returnS_OK. Its blob must match the host's blob without those bits byte for byte, except for the RTS0 flags dword, which holds the full flags, and a valid container hash. Byte-for-byte parity stays wherever the host accepts, and the shim must still refuse anything else the host refuses (ac3aef567). The doc bullet says the same.mainaddedd3d12_xs_pso_stream.cpptoroot_sig_test. This test lists the same shim files and now links it too (5e85304b1).main5fab93967with all nine of these runtime PRs merged together (#634, #643, #684, #657, #677, #638, #710, #688, #671), on llvmpipe and the gfx1036 iGPU (RADV): no test went from pass to fail.root_sig_public_flagspasses on both. Wine'sd3d12.dlltakes the heap flags, so the Windows 10 fallback branch itself was not exercised here.main809d1869a+ac3aef567: it merges cleanly; the semantic suite passes (493 files, 6,318 tests, 0 files failed); the 15 docs and writer tests pass;check_no_game_data.pyis clean on the 3 changed files.AI-assisted (Claude Code, Claude Opus 5.5).
latencyframes in flight while armed (mailbox replace) #671