Shaders: lane-indexed reads/writes on a 64-lane host wave use the wrong console wave or are refused #593
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#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?
@NolanCotter on GitHub · 2026-11-24 05:17 UTC · original
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.
@NolanCotter on GitHub · 2026-11-24 05:17 UTC · original
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.@NolanCotter on GitHub · 2026-11-24 05:20 UTC · original
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.@Marvisak on GitHub · 2026-11-25 01:49 UTC · original
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