Use MD5's constant table instead of 64 sin() per block #64
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!64
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-64"
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?
@romainhedouin on GitHub · 2026-11-25 13:16 UTC · original
romainhedouin:perf/md5-constant-table→main· +25 −8 · 1 files · 1 commits · closed without mergingEvery translated shader container is hashed with MD5. For each 64-byte block,
md5_blockallocated aVecfor the 16 message words and recomputed the 64 round constants withsin(). The constants are now the standard fixed table and the words live on the stack. The hash is bit-for-bit the same: a new test checks that each table entry equals the oldsin()formula, andmd5_core_matches_the_standardstill passes.md5_blockthroughput (same process, 3 runs)sin()calls per 64-byte blockcargo test -p victory-shaderpasses. Speeds up shader translation (loading and stutters), not the frame itself.🤖 Generated with Claude Code
@ySKELLETONX on GitHub · 2026-11-25 16:36 UTC · original
Tested on an RX 7600 XT 16 GB (RDNA3, Navi 33), driver 32.0.32015.2008, Windows 11 Pro build 26300, Rust 1.98.1, at
336cd30:cargo test -p victory-shader --lib --locked: 267 passed, 0 failed, 6 ignored, hardware dispatch tests included (mainat01aadd1: 266 passed). Workspace tests only; not run in the title.@adrianmjim on GitHub · 2026-11-25 17:47 UTC · original
Checked against the game's
shaders.rpfon an RX 7900 XT (Windows 11 build 26300, dxil.dll 10.0.26100.0), with this PR (336cd30) applied to01aadd1and its own target dir.victory translate --validate --list --host-lanes 32-64with a hash of every emitted program's DXIL (a local, uncommitted patch): all 25,623 emitted programs are byte for byte the same as on01aadd1, and the counts are unchanged (VS/PS 14,247/14,247, CS 2,682/2,682, MS 8,694 of 8,765). Two runs of01aadd1give the same hashes, so the comparison is deterministic.cargo test -p victory-shader --lib -- --test-threads=1: 267 passed, 0 failed, 6 ignored. Not run in the game.@romainhedouin on GitHub · 2026-11-26 22:54 UTC · original
Closing:
a-publieralready uses a constantKtable and a stack[u32; 16]inmd5_block(from200bde4), so there are nosin()calls per block left to remove. Thanks for the test runs.Pull request closed