Shaders: precompute MD5 round constants and avoid per-block Vec in md… #1475
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1476"
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 Texbirds on 2026-11-24T18:18:13Z.
…5_block
Problem
md5_blockincrates/victory-shader/src/emit/container.rsallocates aVec<u32>and callsf64::sin()64 times for every 64-byte block of emitted DXIL container data.Fix
sin()calculation with the standard RFC 1321const K: [u32; 64]table.[u32; 16]array instead of heap-allocating aVec<u32>per block.md5_core_matches_the_standardtest.Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T18:42:16Z.
Review: APPROVED
Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (
ffe310e),cargo test -p victory-shader --locked→ 96 passed, 0 failed. Execution/valu tests are#[cfg(all(test, windows))]and were not run here; lowering/structure coverage only.MD5 block function: the per-round
Kconstants are now the standard RFC 1321 table (spot-checked first/last entries) instead of being recomputed viasin()per round, the message words are a stack array instead of aVec, and the round loop iterates the table directly. Pure perf/clarity, no semantic change. 96 passed on macOS.Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-24T20:13:33Z.
Offline measurement on a retail dump, and the shader tests on Ada
Result: no count change against
main.Offline. I merged head
711d651ontomainffe310e(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 21,724 onmain, 21,724 with this PR.No program changes its failure reason either. That is the expected result for a fix whose instructions sit behind the earlier failures on
main. The count shows that the change rejects nothing. It does not show whether the output is right.Tests: with the same merge,
cargo test --locked -p victory-shader --libpassed 120, failed 0. The bitcode benchmark is ignored, as onmain, where 120 pass. The run was on an RTX 4070 SUPER (Ada, 32-lane waves, driver 32.0.16.1088), the default adapter, withVICTORY_WARPunset.No shader names or data are included, per the asset policy. AI-assisted (Claude Code).