Repository navigation
Translator: v_lerp_u8 - #577
Conversation
v_lerp_u8 raised Unsupported. Per byte it gives (S0.b + S1.b + bit 0 of S2.b) >> 1, the unsigned average rounded by S2 (RDNA ISA pseudocode). clamp is rejected, not guessed. tests/semantic/test_alu_lerp_u8.py checks it against a plain-Python reference.
cs_wqm_w32 (SHADER-34) and cs_w32_lane_wrap (SHADER-52) check 32-lane EXEC/VCC masks and lane selects. On Mesa llvmpipe, whose compute subgroups are 8 wide, they can't produce their words, and the "GPU tests on llvmpipe" step in runtime.yml has failed on main since 91b36cf. Skip them where vk_compute_test reports a widest subgroup below 32 lanes, the rule ps_bitmask_perm already uses, in check.py and run_gpu_tests.py (which reuses check.py's helper). Devices with 32 or more lanes still run and judge them. AI-assisted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D7JEiKsTUaHQbCTdc4Eghy (cherry picked from commit be46677)
|
CI note: |
IAmNotSiob
left a comment
There was a problem hiding this comment.
Matches the RDNA2 pseudocode: per byte (S0.b + S1.b + S2[8i]) >> 1, and the 9-bit sum can't leak into the next byte because each byte is extracted first. Raising on clamp rather than guessing seems right. Merged with main, tests/semantic passes (788). LGTM. AI-assisted review (Claude Code).
…ROC-20) #544, #549 and #577 merged without a row in the contract table, which AGENTS.md asks for. One row per group, each with the semantics (checked against the RDNA2 ISA pseudocode), what is not handled (clamp on the SAD and lerp ops) and how it was confirmed (the CPU tests added by the PR); none is GPU-checked. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
tools/rdna2spirv.pyraisesUnsupportedonv_lerp_u8. It's in the GFX10 VOP3 set, but not in the translated corpus, so this is future-proofing. Claimed in #374.Change
tools/rdna2spirv.py: per byte i,D.b[i] = (S0.b[i] + S1.b[i] + (S2.b[i] & 1)) >> 1, as the RDNA ISA pseudocode writes it.clampraisesUnsupportedinstead of being guessed.tests/semantic/test_alu_lerp_u8.py(new, stdlibunittest) checks against a plain-Python reference:clamprejectedexpas 16-bit halves ORed into0x40000000, so no export channel can be a NaN pattern (TEST-67, spirv_mini_interp: OpBitcast and float outputs quiet signalling-NaN bit patterns (bit 22 flips) #509)Tested
python -I -m unittest discover -s tests/semantic: all pass. Without the translator change, the new file has 446 errors (Unsupported). It also passes with the interpreter forced to quiet signalling NaNs, the way Python < 3.14 does.python -m compileall -q tools testspasses. Not run on a GPU, and no game files used.mainis currently red for reasons outside this PR: TEST-67 (tests/semantic: OpBitcast keeps signalling-NaN bits in the mini interpreter (TEST-67) #533 / spirv_mini_interp: OpBitcast and float outputs keep signalling-NaN patterns (TEST-67) #543) and the llvmpipe subgroup size (Tests: skip the wave32 lane-mask dumps below 32 lanes (fixes llvmpipe CI on main) #555). PRs inherit those failures until they're merged.AI-assisted (Claude Code): it wrote the change and the tests, and ran the checks listed above.