Shaders: fix 4 DXIL validator bugs and add synthetic container/validator tests #1202
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!1202
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1202/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?
@geiyiliyabumo on GitHub · 2026-11-24 16:24 UTC · original
geiyiliyabumo:test/shader-container-validator→main· +765 −25 · 2 files · 2 commits · closed without mergingSummary
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.
@fuzeofficlal on GitHub · 2026-11-24 16:56 UTC · original
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@6a82a194cf@geiyiliyabumo on GitHub · 2026-11-24 17:15 UTC · original
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.
@Zipettte on GitHub · 2026-11-24 18:00 UTC · original
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).
@Marvisak on GitHub · 2026-11-25 00:34 UTC · original
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