Remove unreachable arms and dead code in the shader translator #70
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!70
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-70"
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:18 UTC · original
romainhedouin:perf/shader-dead-code→a-publier· +4 −26 · 1 files · 1 commits · openRemoves code in the shader translator that never runs or is never used:
valu_op's half-conversion arms (valu16always takes them first), two no-op bindings, andenter_loop's unused parameter. The rest of the original change is already gone ona-publieror is now used there.lower.rslinesTested:
cargo test -p victory-shader --releasepasses 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'sshaders.rpfwere not run.🤖 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
98ec4ec:cargo test -p victory-shader --lib --locked: 266 passed, 0 failed, 6 ignored, hardware dispatch tests included (mainat01aadd1: 266 passed). Two runs, with #140 applied on top. Without it, parallelvictory-shaderruns here sometimes crash inside WARP (d3d10warp.dll, STATUS_ACCESS_VIOLATION).maindoes 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.@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 (98ec4ec) 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: 266 passed, 0 failed, 6 ignored. Not run in the game.@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.
98ec4ec180todecfe9fae1View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.