Hash the DXIL type and constant tables with Fx instead of SipHash #80

Open
github-bot wants to merge 1 commit from github-bot/gh-80 into a-publier AGit
Owner

@⁠romainhedouin on GitHub · 2026-11-25 13:34 UTC · original
romainhedouin:perf/bitcode-fast-hasher → a-publier · +59 −3 · 2 files · 1 commits · open

The DXIL module's type and constant tables hash with the structurer's Fx hasher (high bits rotated down) instead of SipHash. The tables are only probed, never iterated, and ids follow insertion order, so the emitted bytes can't change.

lower only, synthetic programs (Mac, release, medians of 2 runs) Before After
1,959 single-instruction programs, total 64.2–65.0 ms 54.8–55.1 ms (−15%)
200-instruction ALU program 155–156 µs 151–152 µs (−3%)
2,000-instruction ALU program 1.41 ms 1.40–1.41 ms (no gain)

Tested: cargo test -p victory-shader --release passes on macOS (adds interned_ids_follow_insertion_order), and the DXIL of all 17,316 lowerings it runs (unit tests plus a temporary synthetic corpus) hashed the same before and after; the gain is for small shaders and fades for large ones, and the Windows GPU tests and the game's shaders.rpf were not run.

🤖 Generated with Claude Code

**@⁠romainhedouin** on GitHub · 2026-11-25 13:34 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/80) `romainhedouin:perf/bitcode-fast-hasher` → `a-publier` · +59 −3 · 2 files · 1 commits · open The DXIL module's type and constant tables hash with the structurer's Fx hasher (high bits rotated down) instead of SipHash. The tables are only probed, never iterated, and ids follow insertion order, so the emitted bytes can't change. | `lower` only, synthetic programs (Mac, release, medians of 2 runs) | Before | After | |---|---|---| | 1,959 single-instruction programs, total | 64.2–65.0 ms | 54.8–55.1 ms (−15%) | | 200-instruction ALU program | 155–156 µs | 151–152 µs (−3%) | | 2,000-instruction ALU program | 1.41 ms | 1.40–1.41 ms (no gain) | Tested: `cargo test -p victory-shader --release` passes on macOS (adds `interned_ids_follow_insertion_order`), and the DXIL of all 17,316 lowerings it runs (unit tests plus a temporary synthetic corpus) hashed the same before and after; the gain is for small shaders and fades for large ones, and the Windows GPU tests and the game's `shaders.rpf` were not run. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:35:11 +00:00
Author
Owner

@⁠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 e9fb41b: cargo test -p victory-shader --lib --locked: 267 passed, 0 failed, 6 ignored, hardware dispatch tests included (main at 01aadd1: 266 passed). Two runs, with #140 applied on top. Without it, parallel victory-shader runs here sometimes crash inside WARP (d3d10warp.dll, STATUS_ACCESS_VIOLATION). main does that too, so it has nothing to do with this PR, but it made the first run of this PR look broken. Workspace tests only; not run in the title.

**@⁠ySKELLETONX** on GitHub · 2026-11-25 16:36 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/80#issuecomment-7168242887) 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 `e9fb41b`: `cargo test -p victory-shader --lib --locked`: **267 passed, 0 failed, 6 ignored**, hardware dispatch tests included (`main` at `01aadd1`: 266 passed). Two runs, with #140 applied on top. Without it, parallel `victory-shader` runs here sometimes crash inside WARP (`d3d10warp.dll`, STATUS_ACCESS_VIOLATION). `main` does that too, so it has nothing to do with this PR, but it made the first run of this PR look broken. Workspace tests only; not run in the title.
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-25 17:47 UTC · original

Checked against the game's shaders.rpf on an RX 7900 XT (Windows 11 build 26300, dxil.dll 10.0.26100.0), with this PR (e9fb41b) applied to 01aadd1 and its own target dir. victory translate --validate --list --host-lanes 32-64 with a hash of every emitted program's DXIL (a local, uncommitted patch): all 25,623 emitted programs are byte for byte the same as on 01aadd1, and the counts are unchanged (VS/PS 14,247/14,247, CS 2,682/2,682, MS 8,694 of 8,765). Two runs of 01aadd1 give 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.

(I did not time it: the machine was running other jobs, so the translate times are not comparable.)

**@⁠adrianmjim** on GitHub · 2026-11-25 17:47 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/80#issuecomment-7170002460) Checked against the game's `shaders.rpf` on an RX 7900 XT (Windows 11 build 26300, dxil.dll 10.0.26100.0), with this PR (`e9fb41b`) applied to `01aadd1` and its own target dir. `victory translate --validate --list --host-lanes 32-64` with a hash of every emitted program's DXIL (a local, uncommitted patch): **all 25,623 emitted programs are byte for byte the same as on `01aadd1`**, and the counts are unchanged (VS/PS 14,247/14,247, CS 2,682/2,682, MS 8,694 of 8,765). Two runs of `01aadd1` give 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. (I did not time it: the machine was running other jobs, so the translate times are not comparable.)
github-bot changed target branch from main to a-publier 2026-11-27 01:00:44 +00:00
github-bot force-pushed github-bot/gh-80 from e9fb41b753 to 7a2f299499 2026-11-27 01:00:44 +00:00 Compare
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/80/head:github-bot/gh-80'
git switch 'github-bot/gh-80'

Merge

Merge the changes and update on Forgejo.
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-80'
git switch 'github-bot/gh-80'
git rebase 'a-publier'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-80'
git switch 'github-bot/gh-80'
git rebase 'a-publier'
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-80'
git switch 'a-publier'
git merge --squash 'github-bot/gh-80'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-80'
git switch 'a-publier'
git merge 'github-bot/gh-80'
git push origin 'a-publier'
This discussion has been locked. Commenting is limited to contributors.
No description provided.