Shaders: PSV0 names every arbitrary element, as DXC does #3323
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!3323
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3323"
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?
@Moon0755 on GitHub · 2026-11-26 17:58 UTC · original
Moon0755:fix/psv0-semantic-names→main· +80 −13 · 1 files · 1 commits · openPart of #1945 (the writer half).
What
container::psvlooked a semantic name up in the string table before adding it, so a name used by two elements (TEXCOORDon an input and on an output) was written once and both elements pointed at it. Now every element with an arbitrary semantic and a non-empty name appends its own entry; system values and empty names still point at offset 0.findhas no caller left and is removed.container.rsonly;lower.rsis untouched.Why
DXC does not share entries.
SetPSVSigElementappends the name for each arbitrary element without searching (source). Validators before 1.8 rebuild the whole part from the module andmemcmpit (v1.6.2112, v1.7.2308), so a shared entry givesContainer part 'Pipeline State Validation' does not match expected for module. From 1.8 the check is by content and accepts both layouts, which is why CI never showed it. #1945 has the numbers for the validators that do reject it.Evidence
dxc.exe1.9.2602.17,-T vs_6_6 -E main -validator-version 1.6, a vertex shader withPOSITION,TEXCOORD0in andSV_Position,TEXCOORD0out: the string table is\0POSITION\0TEXCOORD\0TEXCOORD\0and the fourth element's name offset is0x13. The new testpsv_appends_repeated_semantic_names_like_dxccompares the first 164 bytes ofpsv()(everything before the input-to-output table) with that output.repository_passes_policy ... ok.NORMAL,BINORMAL, threeTEXCOORDandCOLOR; a geometry shader with twoTEXCOORDin and out; a vertex shader withBINORMAL,NORMAL,WORLD_COLOR,COLORin andNORMALout. In all three the table is one entry per named element, in element order, nothing shared.victory-shaderon three adapters, each one test up on unmodified63bcca4with the same tests failing as there: WARP 299 passed, 4 failed (298 and 4 before); AMD integrated Radeon 296 and 7 (295 and 7); NVIDIA RTX 2060 300 and 3 (299 and 3). The validator on this machine is the 1.9 one, so this shows the new layout is accepted, not that the old one was refused.Other pull requests
main; the part about the string table is not inmain(63bcca4still callsfind). The fork has it as fxceless/victory-fork#61. The idea is theirs; this is the one change with a test against DXC's bytes.NORMALinsideBINORMAL); with one entry per element there is no lookup, so that case cannot occur either. Its testpsv_string_table_matches_whole_entriesexpects the outputNORMALat offset 10, shared with the input; DXC, for that signature, writes\0BINORMAL\0NORMAL\0WORLD_COLOR\0COLOR\0NORMAL\0and puts it at 35. If #3088 goes in first I will rebase this onto it. I tried that locally on its headd7a9515: withfind_stringremoved and that one test's table and offset set to DXC's, its two tests and the new one pass.Not checked
psv()sets every bit on purpose (#1985).Synthetic tests only; no game files.
— Gemini & Fable
@Dukestar69 on GitHub · 2026-11-26 18:07 UTC · original · approved these changes
Reviewed the diff and verified locally on Windows 11 x64 (
dxil.dllvalidation enabled):find()scan.cargo test -p victory-shader --lib emit::container:: -- --test-threads=1: 2 passed, 0 failed (includingpsv_appends_repeated_semantic_names_like_dxc).cargo test -p victory-shader --lib emit::tests:: -- --test-threads=1: 17 passed, 0 failed.cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 18:26 UTC · original
I verified the legacy-validator result directly on Windows. The existing synthetic shader test
emit::tests::elements_sharing_a_row_keep_their_orderemits twoTEXCOORDelements, then validates the full container. I ran the same test on63bcca4and exact PR headba7f9e6, with the loaded DLL path and version observed in each test process.63bcca4ba7f9e6dxil.dll101.7.2308.12Pipeline State Validationpart mismatchdxil.dll1.9.2609.5The new
psv_appends_repeated_semantic_names_like_dxcgolden test also passes on the exact head. This reproduces the #1945 writer defect on a synthetic shader and verifies that the change fixes what the older validator rejects. Microsoft's signed 1.7.2308 release · AI-assisted with Codex.@borosf on GitHub · 2026-11-26 19:03 UTC · original
Independent local verification on Windows 11 x64, Intel Arc B580 12 GB (12 cores), at this PR's head
ba7f9e6:Result: victory-shader lib: 301 passed / 2 failed (both known baseline); the new psv_appends_repeated_semantic_names_like_dxc test passed.
Both clippy runs exit 0 (-D warnings, both feature sets). The B580 baseline failures pristine main also hits are: victory-gpu descriptor::host::tests::dynamic_slots_are_held_until_released + memory::tests::lists_share_a_table_and_copies_keep_their_views (#1744/#1829); victory-shader emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros + emit::valu_tests::fspx_programs_run_with_the_hardwares_dot_products. No PR regressions.
Synthetic tests only; no game data used. Full log kept locally. — borosf
@fuzeofficlal on GitHub · 2026-11-26 20:14 UTC · original · approved these changes
Looks good to me — appending each non-empty
Arbitrary(kind == 0) semantic name without deduplicating matches DXC'sPSV0string-table writer while keeping empty names and system values at offset0.Verified locally on Windows 11 with head
ba7f9e61cleanly merged ontomain(63bcca43):crates/victory-shader/src/emit/container.rs:243-250and436-510: the golden bytes match SDK DXCPSV0header, string table, index table, and 16-byte element records, and the added lines matchrustfmt --edition 2024.cargo run -p xtask -- policy(191 files ok) andcargo clippy --locked -p victory-shader --all-targets -- -D warnings(both default and--all-features) pass.cargo test --locked -p victory-shader --lib emit::container:2 passed; 0 failed(0.00s).cargo test --locked -p victory-shader --lib emit::tests:17 passed; 0 failedunder bothVICTORY_WARP=0andVICTORY_WARP=1(withWindows Kits\10\bin\10.0.26100.0\x64\dxil.dllpresent).View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.