fix(victory-shader): handle console_lanes and inactive EXEC for v_permlane16/x16 #440
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!440
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-440"
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?
@mauroalvare on GitHub · 2026-11-26 18:49 UTC · original
mauroalvare:fix/victory-permlane16-inactive-exec→main· +206 −36 · 3 files · 2 commits · closed without mergingChange
In VIctory's RDNA2-to-DXIL translator (
third_party/victory/crates/victory-shader/src/emit/lower.rs),v_permlane16_b32andv_permlanex16_b32had two bugs:console_lanesdetection missedv_permlane*: the compute prologue checkedn.contains("permute"), which does not match"v_permlane16_b32"or"v_permlanex16_b32". A compute shader usingv_permlane16_b32/v_permlanex16_b32without another cross-lane op panicked ondebug_assert!(self.s.threads.is_none() || self.console_lanes)in debug builds and silently omittedWaveSizeand console-lane thread-ID relabelling in release builds.EXEC),fi(op_sel[0]), andbound_ctrl(op_sel[1]) were ignored:v_permlane16_b32/v_permlanex16_b32always passed the rawwaveReadLaneAtresult directly toint(self, r). Under AMD RDNA 2 ISA semantics, unlessfi:1is set, reading an inactive source lane (EXEC == 0) must supply0whenbound_ctrl:1or preservevdstwhenbound_ctrl:0. This silently corrupted results in guarded wave32, divergent-branch wave32, and paired wave64 compute shaders on NVIDIA 32-lane hosts.Fix:
n.starts_with("v_permlane")inconsole_lanes."v_permlane16_b32" | "v_permlanex16_b32", checkv.opselbits 0 (fi) and 1 (bound_ctrl); when!fi, check source-lane activity viawaveActiveBallot(guard.unwrap_or(true))and either substitute0(bound_ctrl:1) or gate the destination write (bound_ctrl:0).Linked issue: none
Verification
Base SHA:
c3cc02932fc596ee9d937e5743f73007c538365a(LooperSalty/AnyXboxX:main)Hardware: Windows 11, Ryzen 7 9700X, NVIDIA GeForce RTX 5070 Ti (driver
621.40),dxil.dll10.0.26100.0, Rust1.98.1(MSVC).Before the fix (failing on base
c3cc029on RTX 5070 Ti):After the fix (from
third_party/victory):Oracle and test data
The new regression test
permlane16_and_x16_honor_inactive_source_lanes_fi_and_bound_ctrlinthird_party/victory/crates/victory-shader/src/emit/wave64_tests.rssynthesizes six minimal GFX10 compute shaders (v_permlane16_b32andv_permlanex16_b32across guarded wave32, divergent-branch wave32, and paired wave64 on a 32-lane host) withEXECnarrowed to even lanes, testingfi:0 bound_ctrl:0,fi:0 bound_ctrl:1,fi:1 bound_ctrl:0, and active source reads without any other cross-lane instructions (also exercisingconsole_lanes). All shaders are validated withdxil.dlland verified dword-for-dword on RTX 5070 Ti against AMD RDNA 2 ISA semantics.No game, console, or SDK files were used.
Checklist
E_NOTIMPL), never a fake success.AI assistance: investigated, implemented, tested on RTX 5070 Ti, and drafted with Antigravity (Gemini).
@LooperSalty on GitHub · 2026-11-26 23:08 UTC · original
Closing after #454 moved
third_party/victoryto the Vice-Tay base (TaynanGT/Vice-Tay a252348).Vice-Tay's translator already implements the console lanes, EXEC,
fiandbound_ctrlhandling forv_permlane16/x16(victory-shader/src/emit/lower.rs). The regression test alone would still be welcome as a new PR.Thanks for the work. If you measure a gain on the new base, a new PR against
mainis welcome.🤖 Closed by Claude Code on behalf of the maintainer
Pull request closed