Shaders: follow plain v_mov_b32 copies when pairing interpolations #1293
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1293
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1293/head"
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?
@mgunes1311-lab on GitHub · 2026-11-24 17:11 UTC · original
mgunes1311-lab:shader-interp-vgpr-copies→main· +337 −24 · 1 files · 2 commits · closed without mergingFollow plain VGPR-to-VGPR
v_mov_b32copies and agreeing phis when pairing pixel shader interpolations incrates/victory-shader/src/io.rs. Copy-based pairing is accepted only when the copies and both interpolation halves use the program entry EXEC mask.Changes
i/jand the first-half accumulator; reject modifiers, SDWA, DPP, mismatched inputs, and empty copy/phi cycles.Reg::V(*reg)dereference in the f16 first-half match.Verification
cargo test -p victory-shader --target x86_64-pc-windows-msvc --locked io::: 7 passed.cargo test -p victory-shader --target x86_64-pc-windows-msvc --all-features --locked: 123 passed, 0 failed, 1 benchmark ignored.-D warnings: passed.cargo run -p xtask --target x86_64-pc-windows-msvc --locked -- policy: 154 files passed.The full workspace test run encountered
victory-loader::crash::tests::unwinds_like_the_system_walk(stack frames differ by one). The same failure was reproduced with unchanged main-version loader and shader I/O code, so a green full-workspace run is not claimed. No in-game validation or performance improvement is claimed.@geiyiliyabumo on GitHub · 2026-11-24 17:30 UTC · original
Independent check of \
971c075\ on Windows 11 / Rust 1.98.1 MSVC:eg: u8\ by value, so \Reg::V(*reg)\ cannot be dereferenced:
\\
error[E0614]: type \u8\ cannot be dereferenced
\\
Changing \Reg::V(*reg)\ back to \Reg::V(reg)\ should unblock compilation so tests and clippy can run.
AI-assisted; synthetic tests only, no game files.
@adamdotpy on GitHub · 2026-11-24 19:28 UTC · original
Reviewed at head
6a9cc8f(two commits overffe310e, worktree on the PR head, isolated target dir, Windows 11 / Rust 1.98.1). Findings, ranked:1. The copy-following is conservative in exactly the right places.
vgpr_copyonly followsv_mov_b32with every modifier field clear (neg/abs/neg_hi/opsel/opsel_hi/clamp/omod/SDWA/DPP all checked) and a single VGPR source — anything else stops the trace. Phi tracing requires all incoming args to resolve to the same barycentric(kind, index), and the cycle guard moved intosites/barycentric_from(seen) so loops terminate without silently dropping args.2. The EXEC guard is the important part and it is correct.
entry_execrequires the instruction to read the entry EXEC value (both EXEC halves on wave64) fromp.inputs— so a loop's EXEC phi with the same SSA name but a different per-iteration mask fails the check, and a partial copy cannot let inactive lanes rejoin with the destination's old value.pairrejects a copied interpolation unless both halves (and every traced first-half site) use the entry mask. This addresses the unsound case where copy-following would pair halves computed under different masks.3. Verified here. New tests in
io.rscover copy-following (interpolation_follows_vgpr_copies:v_mov_b32 v4,v0/v5,v1/ acc copyv3,v2pair into oneInterpolatedwithfirst: [(0,2)]) and the EXEC-mask rejection.cargo test -p victory-shader --lib io::7 passed / 0 failed; full lib 123 passed / 0 failed / 1 ignored (22 s, GPU tests included).4. Checks:
cargo clippy -p victory-shader --all-targets --all-features --locked -- -D warningsclean;cargo build --release -p victorybuilds;rustfmt --edition 2024 --check crates/victory-shader/src/io.rsfully clean (0 hunks).5. Effect, not a defect: this widens pairing to shaders that move barycentrics/acc through plain copies before interpolating — previously those refused with "an interpolation with computed barycentrics". The refusal remains for anything that isn't a provably plain copy under the entry mask, so no unsound pairing is introduced.
Nothing found that would block this.
@Marvisak on GitHub · 2026-11-25 00:36 UTC · original
Automated triage for the maintainers. Closing because this change is already in
main, ormainhas since replaced the code it patches.If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed