Repository navigation
Shaders: match whole entries in the PSV0 string table - #3088
scoresby13 wants to merge 1 commit into
Conversation
Dukestar69
left a comment
There was a problem hiding this comment.
Tested locally merged onto origin/main (63bcca4) on Windows 11 x64 (with dxil.dll validator):
cargo test -p victory-shader psv: 3 passed, 0 failed (includingpsv_string_table_matches_whole_entriesandpsv_suffix_semantics_validate_with_dxil).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).
|
Independent verification for my claim #1633 (comment). Test report only; no source review. Disclosure: checks run by Claude Code (Claude Sonnet 5.5), coordinated by Codex (gpt-6.2-sol). Tested: PR head Validator: Results at the head (
Baseline control (parent source plus the PR's two new tests, no other change):
Notes: the older SDK 10.0.19041.0 One disclosure: before I set the WARP variables, I ran the full |
|
Automated triage for the maintainers. Merge candidate. In CI: passing (check). Generated by Claude Code |
fuzeofficlal
left a comment
There was a problem hiding this comment.
The whole-entry lookup in find_string (crates/victory-shader/src/emit/container.rs:239-255) cleanly fixes the PSV0 suffix-reuse bug and preserves 4-byte alignment and empty/system-value offset 0.
Verified locally on Windows 11 with Windows SDK 10.0.26100.0\x64\dxil.dll:
cargo clippy -p victory-shader --all-targets --locked -- -D warnings: cleancargo test -p victory-shader --lib --locked -- emit::container::tests: 3/3 passed (includingpsv_string_table_matches_whole_entriesandpsv_suffix_semantics_validate_with_dxil)
Two small notes for consideration:
- In
psv_suffix_semantics_validate_with_dxil(emit/container.rs:544-550),if let Ok(validator) = Validator::load()silently passes ifVICTORY_DXILpoints to a missing/broken DLL. RequiringValidator::load()to succeed whenVICTORY_DXILis explicitly set (or logging the skip reason otherwise) would prevent false-green validator runs. - Exact duplicate semantic names across input/output signatures (e.g.,
TEXCOORDin both) still deduplicate to one entry here. Older DXC validators (such asv1.8.2407) rebuild PSV0 by appending a string per arbitrary signature element and byte-comparing the result, whereas newer DXC compares by semantic content. Worth adding a note or a duplicate-name test case if compatibility with olderdxil.dllbuilds is targeted.
|
NVIDIA full-suite run, to go with the reports above by Dukestar69, fuzeofficlal, oni-swr, since none of them names a GPU run. Tested exact head Tested
Not tested
AI use
|
Summary
container::psvinterned arbitrary semantic names (e.kind == 0) usingfind(&strings, &needle)viawindows(needle.len()).position(...). Becausefindmatches at any byte offset rather than only at NUL-delimited entry starts (table[at - 1] == 0), an arbitrary semantic name that is a proper suffix of an earlier one (for example, standard HLSLBINORMALfollowed byNORMAL, orWORLD_COLORfollowed byCOLOR) reused a mid-string offset (such as offset3inside\0BINORMAL\0) instead of appending its own entry.In Microsoft DXC (
lib/DxilValidation/DxilContainerValidation.cpp),StringTableVerifierpopulatesOffsetToUseCountMaponly at NUL-terminated entry starts (0andi + 1after each'\0'), soPSVContentVerifier::VerifySignatureElementrejects mid-stringSemanticNameoffsets viaMarkUse, and pre-1.8dxil.dllvalidators reject the mismatchingPSV0part.Fix
findwithfind_string(table, name), which walks whole NUL-delimited entries starting at index1and only matches when the entire entry equalsname.0without allocating a temporaryVec<u8>, while keeping identical full semantic names shared (matchingmain's layout per Shaders: PSV0 and signatures laid out as the validator expects #1208).Verification
main(63bcca4):cargo test -p victory-shader --lib emit::container::tests:psv_string_table_matches_whole_entriesfailed: emitted\0BINORMAL\0WORLD_COLOR\0\0\0(skippingNORMALandCOLOR).psv_suffix_semantics_validate_with_dxilfailed against Windows SDK10.0.22621.0\x64\dxil.dll(101.6.2112.13):error: Container part 'Pipeline State Validation' does not match expected for module.\nValidation failed.cargo test -p victory-shader --lib emit::container::tests: 3 passed, 0 failed (including livedxil.dllvalidation).cargo test -p victory-shader --lib emit::tests::constant_color_validates: 1 passed, 0 failed.cargo test -p victory-shader --lib -- --test-threads=1: 292 passed, 3 ignored, 12 pre-existing failures unrelated to this change (10 Intel UHD 730 hardware GPU mismatches where WARP passes; 2 pre-existing repeated-TEXCOORDtests rejected by localdxil.dll1.6101.6.2112.13instead of validator 1.8).cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo clippy -p victory-shader --all-targets --all-features -- -D warnings: clean.cargo xtask policy:asset policy: 191 files ok.Claim comment: #1633 (comment)
AI-assisted. No game data used.