startup: the 64-bit vector shifts have no lowering (1 of the remaining loading-screen shader refusals) #1817
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#1817
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?
@triggered02 on GitHub · 2026-11-24 19:09 UTC · original
Found in the refusal census (#870). 1 refused shader, and the operation had no lowering:
Problem
The 64-bit vector shifts (
v_lshlrev_b64,v_lshrrev_b64,v_ashrrev_i64) had no lowering.tools/pixel_aot.pyimplements them for the pixel AOT path with explicit per-word temporaries; this translator represents registers as single HLSL variables, so the naive version has two traps:sh < 32andsh >= 32must be separate cases;v[10:11] = v[10:11] >> n) must read both original words before writing either.Fix
Three helpers in the shader preamble take the low and high words by value, mask the count to six bits, and return the result packed as a
uint2:The handler writes both words in one statement, which makes the in-place case safe by construction:
Sources may be a VGPR pair, an SGPR pair or an integer inline constant; the low word always shifts unsigned and only
v_ashrrev_i64signs the high word.Test
startup_gfx2hlsl_b64_shiftbuilds VOP3A encodings from the checked-in decoder's layout (prefix0b110101, opcodes0x2ff/0x300/0x301, low destination inw0[7:0], count inw1[8:0], value inw1[17:9]), decodes them, then translates. Nine checks: all three shifts use their own helper, both destination words are written, the census form lowers to a zero pair, an inline constant count stays a constant, and the three helpers are in the preamble with the count masked.Fail-first: pointing the right shift at the left-shift helper fails the census form lowers to a zero pair; dropping the high destination write fails the right shift uses the helper and writes both words; removing the count mask fails the helpers mask the count.
Pre-existing failures, not from this PR
startup_gfx2hlsl_mad_preserve_{warp,hardware}fail in this dev tree withUnknown GPU operation or invalid arguments: --raw-uav-dump-sm62— the build'soffscreen_checkis stale. Confirmed identical onorigin/main(ecc6e6ce) with the same binary, so it is unrelated to this branch. A rebuild should fix it; I did not touch that tool.What this does not establish
AI-assisted (Claude Code).