rdna2spirv: accept VOP3 clamp/omod as hardware no-op on v_cvt_{i16,u16}_f16 #435

Merged
tahffo68hk-hash merged 1 commit from upstream-pr/435 into main 2026-11-28 11:51:38 +00:00
tahffo68hk-hash commented 2026-11-24 05:13:51 +00:00 (Migrated from github.com)

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 (

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5466533434 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/435). Originally posted by [tahffo68hk-hash](https://github.com/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 (
Oliwettoo commented 2026-11-24 10:36:41 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Oliwettoo on 2026-11-24T10:36:41Z.


test_alu_cvt_16.py passes with the PR on current main, but the contract isn't updated: docs/design.md's v_cvt_u16_f16/v_cvt_i16_f16 row still says clamp and the output multipliers are rejected as Unsupported rather 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 (an int_hw_probe.py case, or the tools/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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7129010070 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/435#issuecomment-7129010070). Originally posted by [Oliwettoo](https://github.com/Oliwettoo) on 2026-11-24T10:36:41Z. --- `test_alu_cvt_16.py` passes with the PR on current `main`, but the contract isn't updated: `docs/design.md`'s `v_cvt_u16_f16`/`v_cvt_i16_f16` row still says `clamp` and the output multipliers are rejected as `Unsupported` rather 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 (an `int_hw_probe.py` case, or the `tools/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.
sodove commented 2026-11-28 10:45:32 +00:00 (Migrated from github.com)

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 → green

Unmodified 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 3bd936ecd98995bca3e1da83d5e28d2343001aef was 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7238102957 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/435#issuecomment-7238102957). Originally posted by [sodove](https://github.com/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 → green** Unmodified 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 `3bd936ecd98995bca3e1da83d5e28d2343001aef` was 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](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7237873883).
DadaCap commented 2026-11-28 11:51:40 +00:00 (Migrated from github.com)

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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7238830420 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/435#issuecomment-7238830420). Originally posted by [DadaCap](https://github.com/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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!435
No description provided.