Repository navigation
rdna2spirv: pack v_lerp_u8 byte arithmetic (SHADER-695) - #3715
lumenpearson wants to merge 1 commit into
Conversation
|
I checked the packed form against the per-byte ISA definition
No carry can cross a byte.
|
|
Automated test:
Same machine and setup as my earlier manual reports. AI-assisted (Claude Code). |
kacper-serewis
left a comment
There was a problem hiding this comment.
SHADER-695 at 44b1242 and parent f847748: all 1,024 packed GPU result words per revision matched a per-byte integer oracle. The sweep crossed 8×8 operand values with 16 rounding masks and varied neighboring bytes to check carry isolation. All 32 synthetic compute shaders per revision passed Vulkan 1.2 spirv-val. NVIDIA RTX 5070, driver 616.56. AI-assisted.
|
Measured on gfx1036 (RDNA2, driver 26.10.1, game MODE; integer op) through raw hw_oracle kernels, one lane: |
|
Tested
No game files. (AI-assisted test run.) |
|
Tested |
Claimed as SHADER-695 in #3574.
Lower
v_lerp_u8with one 32-bit shift and packed additions. For each byte, shared bits contributex & y, differing bits contribute(x ^ y) >> 1, and the rounding bit contributes only if the sum is odd. The pre-shift mask keeps bits within their bytes. Even the rounded result fits in one byte. The existingclamprejection remains in place.The synthetic fixture cuts the arithmetic for four
v_lerp_u8instructions from 120 SPIR-V operations to 32. Its four reference words match all 4,096 pixels before and after on an RTX 3070 (NVIDIA 591.86, Windows 11). Both modules passspirv-val --target-env vulkan1.3.85 focused semantic tests pass on Python 3.12. A separate arithmetic check matches 131,072 packed cases, covering every pair of byte values and both rounding choices.
No game files. AI-assisted (Codex).