Shaders: honor EXEC guard on v_interp_* writes to preserve inactive lanes #3153
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!3153
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3153"
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?
@reeledMarek on GitHub · 2026-11-26 10:27 UTC · original
reeledMarek:fix/shader-interp-exec-guard→main· +245 −8 · 3 files · 3 commits · openSummary
Lower::interpincrates/victory-shader/src/emit/lower.rspreviously passedNoneas the guard to bothwrite_half(v_interp_p2_f16) andwrite(v_interp_mov_f32/v_interp_p2_f32).v_interp_*instructions respectEXEC: inactive lanes in predicated/divergent pixel-shader control flow keep their prior destination VGPR value instead of being overwritten.self.guard(site.0, site.1)?towrite_halfandwrite_placed_with_old; for same-VGPR two-instruction VINTRP pairs (v_interp_p1_f32+v_interp_p2_f32under the same guard), step back overp1(whose SSA write isVal::Missing) to recover the true pre-p1VGPR value instead of zeroing inactive lanes.crates/victory-shader/src/emit/lower/interp_guard_tests.rscovering guardedv_interp_mov_f32, guardedv_interp_p1_f32+v_interp_p2_f32(with DXIL validation on Windows), and unguarded control.@steven-seagull27 on GitHub · 2026-11-26 11:21 UTC · original
One FP16 case still loses both halves of the previous VGPR on
b8355be. I ran the same five 8×8 pixel shaders from #3149 on the common parent and both PR heads, twice per adapter. The RTX 5080 and Windows inbox WARP gave the same results.63bcca4b8355be92a21a8This PR fixes all pixels for the FP32 move, shared-destination FP32 pair, and both separate-destination FP16 cases. The remaining 32 pixels are columns 0–3 of all eight rows when
v_interp_p1ll_f16andv_interp_p2_f16both write v3. After EXEC is restored, the first pixel reads (0.0, 0.0) for the low and high halves. The pre-pair value was (1.0, 2.0). #3149 recovers that value for every inactive pixel.The FP16 path in this head returns from
write_halfbefore the shared-destination old-value handling below it. #3149 carries the pre-p1 value through the FP16 write as well. If the two fixes are consolidated, the shared-destination half case is worth keeping.To reproduce the first failure in a disposable checkout of
b8355be, bring over just Arkenoz's test module and run it:For the counts above I let all five draw/readbacks finish and recorded mismatches by active/inactive half. Synthetic shaders, AI-assisted testing with Codex.
@Dukestar69 on GitHub · 2026-11-26 11:30 UTC · original · approved these changes
Verified on RTX 5090 against
origin/main(63bcca4):cargo test -p victory-shader --lib interp_guard_tests:: -- --test-threads=1: passed.cargo test -p victory-shader --lib emit::tests:: -- --test-threads=1: 17/17 passed.cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 192 files ok.Cleanly honors EXEC guards on
v_interp_*writes so inactive lanes preserve their values.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@reeledMarek on GitHub · 2026-11-26 15:20 UTC · original
Great catch @steven-seagull27 — thanks for testing all five cases on RTX 5080 and WARP!
Fixed in
dbddcde: extractedinterp_old_val()andwrite_half_with_old()so the FP16 path also steps back over a shared-destinationv_interp_p1ll_f16(preserving both halves of the pre-p1 VGPR on inactive lanes), and added a shared-destinationv_interp_p1ll_f16+v_interp_p2_f16regression test ininterp_guard_tests.rs.View 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.