Shaders: lane-indexed reads/writes on a 64-lane host wave use the wrong console wave or are refused #593
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from Marvisak/VIctory. Originally posted by NolanCotter on 2026-11-24T05:17:32Z.
Same family as #131/#125, one level up: for
MaskData::Host(pixel/vertex programs, noWaveSize, so the host wave can be 64 lanes = two console waves), the lane-indexed ops either refuse or read the wrong wave.crates/victory-shader/src/emit/lower.rs,valu_op:v_readlane_b32with a constant lane takescross_lane(false)→a cross-lane operation outside compute→ the whole program is refused. On a wave32 program under a 64-lane host wave, console lanekof the lane's own wave is host lanek | (lane & 32)— expressible, no refusal needed. The same refusal hits wave64 programs, where a constant lane is already a valid host lane and should just work.v_writelane_b32callscross_lane(false)unconditionally → refused on every pixel/vertex program, computed lane or not. On host lanes,me == laneis already the correct host-space test for a computed lane; a constant lane needs the same| (lane & 32)base.v_readfirstlane_b32emitswaveReadLaneFirst→ the host wave's first active lane — wave A's lane 0 — for lanes 32-63, whose console wave's first lane is a lane of the ballot's high half + 32.Repro (synthetic wave32 pixel program,
v_readlane v4, v2, 5): the write is dropped (a cross-lane operation outside compute), the register reads back its input0, and the op list shows nowaveReadLaneAt.Found while continuing #131: mask-as-number reads were fixed there; these are the lane-index uses the same host-wave model needs.
Imported from Marvisak/VIctory. Originally posted by NolanCotter on 2026-11-24T05:17:36Z.
Claiming this (same author as #434). Will implement the host-wave fix in
v_readlane/v_writelane/v_readfirstlanelowering with synthetic GFX10 tests, no game files.Imported from Marvisak/VIctory. Originally posted by NolanCotter on 2026-11-24T05:20:44Z.
Fixed in #599 (head
3823462): constant console lanes take the lane's own wave's 32-lane base on wide host waves, wave64 const lanes read directly, and v_readfirstlane picks the low bit of its own ballot half. Synthetic wave32 test asserts the emitted ops; 59/59 victory-shader tests pass. No game files.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:49:03Z.
Automated triage for the maintainers.
Confirmed on current
main(940d32f), incrates/victory-shader/src/emit/lower.rs, in the VALU lowering:v_readlane_b32with a constant lane callscross_lane(false)whenmask_dataisMaskData::Host, and outside compute that refuses the program ("a cross-lane operation outside compute"). Only a computed lane is read as a host lane.v_writelane_b32callscross_lane(false)unconditionally, so every pixel/vertex program using it is refused.v_readfirstlane_b32(apart from the waterfall-read case) emitswaveReadLaneFirst, which returns the host wave's first active lane, not the first lane of the lane's own console wave.Open PR #599 addresses this. It depends on #434 and needs a rebase.
Generated by Claude Code
upstream-sync referenced this issue2026-11-25 22:04:33 +00:00