rdna2spirv: accept VOP3 clamp/omod as hardware no-op on v_cvt_{i16,u16}_f16 #435
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/435"
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?
Imported from ubiquitarianism/leonida. Originally posted by tahffo68hk-hash on 2026-11-24T05:13:51Z.
Summary
(AI-assisted) Fixes SHADER-CVT16-OUTMOD-NOOP: ools/rdna2spirv.py previously rejected VOP3 clamp, mul:2, mul:4, and div:2 (and SDWA clamp) with Unsupported on the integer-destination 16-bit conversions _cvt_i16_f16 and _cvt_u16_f16.
Native RDNA2 hardware measurement (gfx1036) across all 4 HW_REG_MODE configurations (
Imported from ubiquitarianism/leonida. Originally posted by Oliwettoo on 2026-11-24T10:36:41Z.
test_alu_cvt_16.pypasses with the PR on currentmain, but the contract isn't updated:docs/design.md'sv_cvt_u16_f16/v_cvt_i16_f16row still saysclampand the output multipliers are rejected asUnsupportedrather than guessed, which this PR changes. Please change that row to the new rule. The measured words are only in the PR text, so nobody can reproduce them: please commit a reproducible gfx103x case (anint_hw_probe.pycase, or thetools/hw_oracle.asm plus its raw output), as the maintainer asked on #392/#398 (AGENTS.md: a new rule goes in with how it was confirmed). AI-assisted review.Imported from ubiquitarianism/leonida. Originally posted by sodove on 2026-11-28T10:45:32Z.
#435 | head
3cc3c6c2e5bfa95ddaa5cce9f882366f1c86453a|python3 -m unittest discover -s tests/semantic -p test_alu_cvt_16.py -v| red: 8 run, 20 errors | green: 8 passed | Red → greenUnmodified main rejected output modifiers on the f16-to-i16/u16 conversions. The merged translator accepted the cases and passed the semantic assertions.
Captured 269 distinct complete SPIR-V module(s) emitted while rerunning test_alu_cvt_16.py on the merged tree. All assembled and passed spirv-val for Vulkan 1.2 with --allow-offset-texture-operand.
Base
3bd936ecd98995bca3e1da83d5e28d2343001aefwas merged into the recorded PR head for the second run. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Counts include unittest subtest events where applicable. AI-assisted with OpenAI Codex. Batch claim.Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T11:51:40Z.
Merged, thank you @tahffo68hk-hash! This translator PR (rdna2spirv: accept VOP3 clamp/omod as hardware no-op on v_cvt_{i16,u16}_f16) passed its own tests with main merged in during sodove's verification of this batch, so it went in with the batch.
AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.