Extract scalar and vector ALU lowering from lower.rs #84
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!84
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-84"
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?
@feanorsun on GitHub · 2026-11-25 13:39 UTC · original
feanorsun:refactor/shader-lower-alu→main· +3892 −3880 · 2 files · 1 commits · closed without mergingMove scalar and vector ALU lowering into
emit/lower/alu.rs. The parent dispatches throughsopandvalu. All 52 moved method bodies match the original byte for byte.This resolves the file-size failure listed under Known problems in the README. The split reduces
lower.rsfrom 630,652 to 453,035 bytes. The new module is 177,971 bytes. Both fit under the existing 524,288-byte limit.Verification
cargo xtask policypassed for all 185 files.cargo check --locked -p victory-shader --all-targetspassed with the existingint_valuedead-code warning.cargo test --locked -p victory-shader --lib emit::lower::passed all 44 tests before and after the split.cargo test --locked -p victory-shader --lib emit::opcode_audit::refused_opcodes -- --exactpassed.cargo test --locked -p xtaskpassed all 4 tests, includingrepository_passes_policy.Verified on Windows with Rust 1.98.1 (
x86_64-pc-windows-gnu). No game was launched and no GPU or D3D12 device tests were run.@Adika713 on GitHub · 2026-11-25 15:36 UTC · original
Verified on AMD Radeon RX 6950 XT, Ryzen 5 3600, 32 GB RAM, Windows 11, Rust 1.98.1 / Cargo 1.98.1. No game data, no GPU device tests.
I used clean detached worktrees and an isolated
CARGO_TARGET_DIRper tree. A clean worktree matters here: the policy test in my main checkout also sees two untracked local.logfiles, which are not part of this PR comparison.Before, at
upstream/main01aadd193d57e71fb4d57810eb2fdd1bc95c950b:test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 3 filtered out.POLICY: crates/victory-shader/src/emit/lower.rs: 630652 bytes exceeds the 524288-byte limit.test result: FAILED. 3 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out.After, at this PR's head
b5a4046:test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 3 filtered out.test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out.lower.rs453,035 bytes andlower/alu.rs177,971 bytes, both under the limit.Overlap: PR #72 head
0771808also passes both commands (4 passed / 0 failed for xtask), withlower.rs499,516 bytes andlower/valu.rs131,464 bytes. I did not write a competing fix.Not tested: the game or any shader-GPU test; no game files were used.
AI-assisted: OpenCode, model Big Pickle. No game data.
@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
b5a4046: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 (b5a4046) 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.@feanorsun on GitHub · 2026-11-26 12:48 UTC · original
Closing this in favor of #72, which was opened first and brings
lower.rsunder the size limit with a smaller refactor. Thanks to everyone who tested both approaches.Pull request closed