Shaders: signature rows of one register in the validator's order #1022
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1022
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1022/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?
@ThiagoAlexsander on GitHub · 2026-11-24 15:08 UTC · original
ThiagoAlexsander:shader/signature-row-order→main· +41 −2 · 1 files · 1 commits · closed without merging36 emitted programs fail validation with
Container part 'Program Input Signature' does not match expected for module(15) or... 'Program Output Signature' ...(21), reported in #201. The validator rebuildsISG1/OSG1from the module's signature metadata and compares the bytes. The two disagree on the order of rows within one register.Cause
DXC's
DxilProgramSignatureWritersorts the rows withsort_sig: by stream, then register, then semantic name offset, not by column (lib/DxilContainer/DxilContainerAssembler.cpp). With validator 1.6 names are not deduplicated by content: each arbitrary semantic gets its own offset in element order, and system values share theirs, as the comment insignaturealready says. So rows of one register keep element order.signaturesorted them by column.The two orders differ when a register's elements are declared in another order than their columns. In
VS_RasterizeWaterIndirectHW_MeshBased_Meshlets, for example, register 5 holdsTEXCOORD3in w, declared beforeNORMAL0in xyz. The metadata listsTEXCOORD3first andOSG1listedNORMAL0first.Change
One sort key in
container::signature:(register, name offset)instead of(register, column). The comment now says how the validator orders rows.Results
victory translate --validateover the title's files (mainffe310eagainst this branch, Windows SDKdxil.dll10.0.26100), compared program by program:mainContainer part ... does not matchAll 36 now validate. No other program changes. The D3D12 runtime already created pipelines for these modules (#201), so this makes the container agree with the module rather than unblock pipelines.
Testing
rows_of_one_register_keep_element_order_not_column_orderinemit/container.rs: a w element declared before an xyz element of the same register is written first. Withmain's key it fails ([(0, 0), (0, 1), (3, 1)]against[(0, 0), (3, 1), (0, 1)]).cargo test --workspace --locked: 343 passed, 0 failed, 6 ignored (342 onmainplus the new test). That includes the GPU tests that create graphics pipelines from translated signatures.cargo clippy --workspace --all-targets --locked -- -D warnings, with and without--all-features: clean.rustfmt --edition 2024 --checkoncontainer.rs: clean.cargo xtask policy: 154 files ok.Related: #554 makes rows of one interpolation mode and notes that it uncovers some of these errors. It changes how elements get their rows, this changes the order they are written in, so the two fit together.
AI use: Claude Code (Claude Opus 5.5) traced the mismatch by comparing one failing module's metadata with its
OSG1, checked DXC's sort, wrote the change and the test, and ran everything above. I reviewed the diff and the results.🤖 Generated with Claude Code
@Zipettte on GitHub · 2026-11-24 15:40 UTC · original
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
57e2cde:cargo test -p victory-shaderpasses, 121 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
@Marvisak on GitHub · 2026-11-25 00:30 UTC · original
Automated triage for the maintainers. Closing because this change is already in
main, ormainhas since replaced the code it patches.Signature rows are sorted by register only with element order kept in main (emit/container.rs signature(), stable sort;
13091f6e), which is what this PR arrives at.If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed