Shaders: fix 4 DXIL validator bugs and add synthetic container/validator tests #1202
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1202"
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?
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T16:24:52Z.
Summary
Closes #1049
Full verification details and change notes are documented in #1049 (commit
9ffb7a1, based onmainffe310e).Verification (Windows 11 x64 MSVC)
rustfmt --edition 2024 --checkon edited files: PASScargo xtask policy: PASS (zero game files/data)cargo clippy --all-targets --locked -- -D warnings(default +--features diagnosticswhere applicable): PASSAI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-24T16:56:03Z.
Tested
Validatoragainst the Windows SDKdxil.dlland found two additional live-DLL edge cases worth folding in alongside the COM/module lifetime fixes:STATUS_ACCESS_VIOLATION(0xc0000005) insidedxil.dllon truncated"DXBC..."blobs:IDxcValidator::ValidatetrustsDxilContainerHeader::ContainerSizeInBytesandPartCountat offsets 24/28 before checkingIDxcBlob::GetBufferSize(), reading out of bounds on truncated or corruptDXBCheaders. Runningif container.starts_with(b"DXBC") { crate::dxbc::Container::parse(container).map_err(|e| e.to_string())?; }up front catches malformed containers in safe Rust without affecting non-DXBCunit-test stubs.Validator::loaderror strings:String::from_utf16_lossy(&name)includes the appended0terminator ("cannot load ...\0"). Encoding withOsStrExt::encode_wide().chain([0])and formattingtarget.to_string_lossy()keeps both non-UTF-8 paths and error strings clean.Also verified
container::hashin-place signing byte-for-byte againstdxil.dllacross all 64len % 64padding remainders (including the 55/56 two-block split). Reference commit:github.com/fuzeofficlal/VIctory@6a82a194cfImported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T17:15:48Z.
Thanks @fuzeofficlal for the live \dxil.dll\ edge-case review!
Folded both fixes into this PR:
Added regression tests for both (\load_error_has_no_trailing_nul, \ runcated_dxbc_container_is_rejected_before_calling_dxil). Re-verified \cargo test -p victory-shader --lib emit::validator\ (11/11 passed), \cargo clippy -p victory-shader --all-targets -- -D warnings, and \cargo xtask policy.
AI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T18:00:12Z.
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
9ffb7a1:cargo test -p victory-shaderpasses, 137 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:34:51Z.
Automated triage for the maintainers. Closing because another open pull request covers the same change.
See #477. The same validator fixes as #477 (GetStatus, empty error blob, FreeLibrary, NUL in the message) at twice the size, plus container tests that pin current output; its Psv test literal lacks the gs field main added, so it does not compile on main.
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