Remove unreachable arms and dead code in the shader translator #70

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

@⁠romainhedouin on GitHub · 2026-11-25 13:18 UTC · original
romainhedouin:perf/shader-dead-code → a-publier · +4 −26 · 1 files · 1 commits · open

Removes code in the shader translator that never runs or is never used: valu_op's half-conversion arms (valu16 always takes them first), two no-op bindings, and enter_loop's unused parameter. The rest of the original change is already gone on a-publier or is now used there.

Before After
lower.rs lines 14,123 14,101
Lines removed / added 26 / 4

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

🤖 Generated with Claude Code

**@⁠romainhedouin** on GitHub · 2026-11-25 13:18 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/70) `romainhedouin:perf/shader-dead-code` → `a-publier` · +4 −26 · 1 files · 1 commits · open Removes code in the shader translator that never runs or is never used: `valu_op`'s half-conversion arms (`valu16` always takes them first), two no-op bindings, and `enter_loop`'s unused parameter. The rest of the original change is already gone on `a-publier` or is now used there. | | Before | After | |---|---|---| | `lower.rs` lines | 14,123 | 14,101 | | Lines removed / added | | 26 / 4 | Tested: `cargo test -p victory-shader --release` passes on macOS, and the DXIL of all 17,316 lowerings it runs (the unit tests plus a temporary corpus of synthetic programs, errors included) hashed the same before and after; 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:34:59 +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 98ec4ec: cargo test -p victory-shader --lib --locked: 266 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/70#issuecomment-7168243572) 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 `98ec4ec`: `cargo test -p victory-shader --lib --locked`: **266 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 (98ec4ec) 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: 266 passed, 0 failed, 6 ignored. Not run in the game.

**@⁠adrianmjim** on GitHub · 2026-11-25 17:47 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/70#issuecomment-7170001496) 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 (`98ec4ec`) 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`: 266 passed, 0 failed, 6 ignored. Not run in the game.
Author
Owner

@⁠gut0to on GitHub · 2026-11-25 16:06 UTC · original · reviewed

AI-assisted static review; I did not run tests or launch the game. The removed conversion arms in valu_op are shadowed by the earlier valu16 dispatch for v_cvt_f16_f32 and v_cvt_f32_f16, while the deleted integer arms are handled before the catch-all integer() call. The PR reports cargo test -p victory-shader in debug and release plus unchanged DXIL hashes across lowerer audits; I did not execute those checks.

**@⁠gut0to** on GitHub · 2026-11-25 16:06 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/70#pullrequestreview-6060928108) · **reviewed** AI-assisted static review; I did not run tests or launch the game. The removed conversion arms in valu_op are shadowed by the earlier valu16 dispatch for v_cvt_f16_f32 and v_cvt_f32_f16, while the deleted integer arms are handled before the catch-all integer() call. The PR reports cargo test -p victory-shader in debug and release plus unchanged DXIL hashes across lowerer audits; I did not execute those checks.
github-bot changed target branch from main to a-publier 2026-11-27 01:00:40 +00:00
github-bot force-pushed github-bot/gh-70 from 98ec4ec180 to decfe9fae1 2026-11-27 01:00:40 +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/70/head:github-bot/gh-70'
git switch 'github-bot/gh-70'

Merge

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