Hash only the declared bytes of embedded DXBC containers #322

Closed
agonisingbasher wants to merge 1 commit from upstream-pr/322 into main
agonisingbasher commented 2026-11-26 16:41:02 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by agonisingbasher on 2026-11-26T16:41:02Z.


When the shader scanner finds an uncompressed DXBC container, it currently passes the entire suffix of the enclosing file downstream. Different copies of the same shader then produce different hashes, and the shader cache can hash and copy unrelated archive data.

This change keeps the slice already bounded by the DXBC parser and passes it to shader-info, translate, and shaders through their shared scanner. Packed SGD5 records continue through the existing path.

Validation

  • The Windows diagnostics build and the embedded-container regression test passed. The asset policy check also passed.

  • A synthetic 16 MiB file containing 512 identical valid DXBC headers produced 512 distinct hashes before the fix and one after it. Median shader-info --verbose time across three runs on this machine went from 3.973 s to 0.073 s. This measures the offline scanner.

  • The full diagnostics suite for the Victory CLI passed (27 tests). On an RX 6600 XT, a separate local shader inventory matched the README totals: 25,694 translated entries and 195 unsupported entries in the shader archive, plus 96 translated entries and no errors from the executable and DLL scan. The executable and DLL scan used the patched build. The patch addresses cache keys and scanner cost.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:5513849754 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/322). Originally posted by [agonisingbasher](https://github.com/agonisingbasher) on 2026-11-26T16:41:02Z. --- When the shader scanner finds an uncompressed DXBC container, it currently passes the entire suffix of the enclosing file downstream. Different copies of the same shader then produce different hashes, and the shader cache can hash and copy unrelated archive data. This change keeps the slice already bounded by the DXBC parser and passes it to `shader-info`, `translate`, and `shaders` through their shared scanner. Packed SGD5 records continue through the existing path. ### Validation - The Windows diagnostics build and the embedded-container regression test passed. The asset policy check also passed. - A synthetic 16 MiB file containing 512 identical valid DXBC headers produced 512 distinct hashes before the fix and one after it. Median `shader-info --verbose` time across three runs on this machine went from 3.973 s to 0.073 s. This measures the offline scanner. - The full diagnostics suite for the Victory CLI passed (27 tests). On an RX 6600 XT, a separate local shader inventory matched the README totals: 25,694 translated entries and 195 unsupported entries in the shader archive, plus 96 translated entries and no errors from the executable and DLL scan. The executable and DLL scan used the patched build. The patch addresses cache keys and scanner cost.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
avatarmanz/VIctory-7900XTX!322
No description provided.