upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/thread_stacks.cpp
diff options
context:
space:
mode:
authorIvan <fiestorra@gmail.com>2026-11-23 04:19:39 +0100
committerIvan <fiestorra@gmail.com>2026-11-23 04:21:02 +0100
commita148559ba8c5991b2d0b0d5dd95181b41a22c419 (patch)
tree9f57a284edfdb3048bc4e0eade5947832b3e452c /runtime/src/thread_stacks.cpp
parent03b09a086592a197db64d91655c6e65c30764d96 (diff)
rdna2spirv: the packed 16-bit shifts read a half with a shift, not a field extract
docs/design.md already says a high 16-bit half is read with `>> 16` alone, with no narrowing after it, because AMD's Windows LLPC miscompiles that combination (#1506). The three packed 16-bit shifts were the exception: they took the shift amount with `OpBitFieldUExtract(s0, 16, 4)` and the value with `OpBitField{S,U}Extract(s1, 16, 16)`. An AMD Windows driver 25.10.36 on a gfx1036 reads a field extract at offset 16 with the offset taken mod 16, so both result halves got the low half of the source - 5 of 2000 wave32 programs of `tools/valu_fuzz.py --family f16 --programs 2000 --seed 1` (@Darkz0rz, SHADER-777 in the coordination issue). The same 2000 programs match 2000/2000 on a second gfx1036 (Radeon iGPU of a Ryzen 7 7800X3D, Windows driver 31.0.24002.92), and the SPIR-V that run produced does contain those offset-16 extracts. So this is a lowering that survives both drivers, not a value change: BitField{S,U}Extract(x, 16, 16) equals `x >> 16` with the matching right shift, and BitFieldUExtract(x, 16, 4) equals `(x >> 16) & 15`; checked over 200,010 inputs including 0, 1, 0xFFFF, 0x10000, 0x80000000, 0xFFFFFFFF, 0x7FFFFFFF and 0x8000. Extracts at offset 0 are left as they were. Coordinated as SHADER-784 in #4571, verifying SHADER-777. Counted over all 26 503 listings: 1 v_pk_lshlrev_b16 in 1 compute listing and 1 v_pk_lshrrev_b16 in another, no v_pk_ashrrev_i16 and no _sdwa form. Translating the corpus before and after with the same flags gives 26 503 translated and 26 473 valid in both, with 26 471 of the .spv identical in size and SHA-256; the two that change are the two holding those instructions, and their differences are only the replaced extracts. ps_ops4 and ps_ops6 pass on that gfx1036 iGPU and on an NVIDIA RTX 4090 (driver 32.0.16.2124).
Diffstat (limited to 'runtime/src/thread_stacks.cpp')
0 files changed, 0 insertions, 0 deletions