Shaders: a buffer descriptor made raw from first-lane reads skips the waterfall proof and is traced as each lane's own #2867
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#2867
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?
@BastienRodz on GitHub · 2026-11-25 22:46 UTC · original
A buffer descriptor that a program makes raw before a byte access (the pattern
Tracer::made_rawfollows, as the FidelityFX upscaler's compiler emits) escapes the waterfall proof when its dwords were read from the first lane.Where.
Tracer::descriptortraces the words the raw descriptor was made from, themade_rawswap.v_readfirstlane_b32results,classify→per_lanetraces them as each lane's own descriptor (Source::Fetched).first_lane_wordsdecides whethertrackmust prove a waterfall loop. It looks at the access's own SGPRs instead, where dwords 1-3 are the results ofs_and_b32,s_mul_i32ands_or_b32. It finds no first-lane reads, so no proof runs and nothing is refused.Input (wave32):
No waterfall loop surrounds the access.
What happens on main
13f91ca.trackreturnsFetched, so each lane reads through its own descriptor. In a GPU run of that program under vkd3d-proton, odd lanes read the second buffer:[100, 201, 102, 203, ...].Expected. One descriptor serves the whole wave:
Every lane reads lane 0's buffer,
[100, 101, 102, ...]. As for any first-lane read outside a waterfall loop, the translation should refuse it ("a descriptor read from the first lane outside a waterfall loop", as ina_first_lane_read_outside_a_loop_is_no_waterfall).Found by reading the code and checked with synthetic programs; I have no in-game observation. No game data. Analysis assisted by Claude Code.
github-bot referenced this issue2026-11-26 05:16:19 +00:00
@rezioliver-collab on GitHub · 2026-11-25 23:11 UTC · original
On Wave64, #2869 accepted the raw buffer descriptor when the waterfall loop updated all 64 bits of
EXEC. It rejected both the loop that updated onlyEXEC_LOand the shader with no loop. Onmain, the resource tracker classified the descriptor asSource::Fetchedin all three cases without proving any of the comparisons or first-lane reads.main(842b0cb7)dee92f59)s_xor_b64)v_readfirstlane_b32results.s_xor_b32onEXEC_LO)a waterfall loop whose retry does not keep the lanes still waitings_cbranch_execnzreplaced withs_nop)a descriptor read from the first lane outside a waterfall loopI ran a native
victory-shaderintegration test on an Apple M1 (macOS 14.7, Rust 1.98.1). The test built the IR for a synthetic Wave64 compute shader and ran the CPU resource tracker with structured lane analysis. The shader read four descriptor words from the first active lane and converted the descriptor to raw form beforebuffer_load_dword. Each negative case changed a single instruction. Both rejections pointed to the same buffer load at byte offset0x6c. Applying the PR commit to the testedmainrevision gave the same three results as the PR head.@Marvisak on GitHub · 2026-11-26 00:43 UTC · original
Automated triage for the maintainers.
Confirmed on
main(63bcca4). Incrates/victory-shader/src/resource.rs,Tracer::first_lane_wordschecks the access's own descriptor SGPRs forv_readfirstlane_b32origins, while the descriptor itself is traced throughTracer::made_rawfrom the words before thes_and/s_mul/s_orrewrite. When dwords 1-3 are those rewritten values,first_lane_wordsreturnsNone, so the waterfall proof intracknever runs. The Wave64 comparison above (main vs. #2869) agrees.Open pull request #2869 addresses this.
Generated by Claude Code