rdna2spirv: accept VOP3 clamp no-op on scalar 16-bit mul_lo/max/min/shifts #426

Closed
tahffo68hk-hash wants to merge 1 commit from upstream-pr/426 into main
tahffo68hk-hash commented 2026-11-24 05:04:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by tahffo68hk-hash on 2026-11-24T05:04:24Z.


Summary

(AI-assisted) Fixes SHADER-INT16-CLAMP-NOOP: ools/rdna2spirv.py previously rejected the VOP3 clamp modifier with Unsupported on the eight scalar 16-bit integer instructions _mul_lo_u16, _max_u16, _min_u16, _max_i16, _min_i16, _lshlrev_b16, _lshrrev_b16, and _ashrrev_i16.

Native RDNA2 hardware measurement (gfx1036) shows that all eight instructions accept the VOP3 clamp bit and treat it as a hardware no-op (for example, _mul_lo_u16 0xffff, 0xffff clamp wraps modulo 2^16 to

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5466434817 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/426). Originally posted by [tahffo68hk-hash](https://github.com/tahffo68hk-hash) on 2026-11-24T05:04:24Z. --- ### Summary (AI-assisted) Fixes SHADER-INT16-CLAMP-NOOP: ools/rdna2spirv.py previously rejected the VOP3 clamp modifier with Unsupported on the eight scalar 16-bit integer instructions _mul_lo_u16, _max_u16, _min_u16, _max_i16, _min_i16, _lshlrev_b16, _lshrrev_b16, and _ashrrev_i16. Native RDNA2 hardware measurement (gfx1036) shows that all eight instructions accept the VOP3 clamp bit and treat it as a hardware no-op (for example, _mul_lo_u16 0xffff, 0xffff clamp wraps modulo `2^16` to
Oliwettoo commented 2026-11-24 10:36:39 +00:00 (Migrated from github.com)

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


test_alu_u16_clamp.py passes with the PR on current main. 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). Merge note: the 'Integer clamp' row is also edited by #392, #398 and #422, and git merge-tree shows this conflicts with all three. AI-assisted review.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7129009183 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/426#issuecomment-7129009183). Originally posted by [Oliwettoo](https://github.com/Oliwettoo) on 2026-11-24T10:36:39Z. --- `test_alu_u16_clamp.py` passes with the PR on current `main`. 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). Merge note: the 'Integer clamp' row is also edited by #392, #398 and #422, and `git merge-tree` shows this conflicts with all three. AI-assisted review.
MoonEyes commented 2026-11-27 23:19:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-27T23:19:42Z.


Hi @tahffo68hk-hash, thanks for this pull request. It currently conflicts with main (conflicting file(s): docs/design.md), so it carries the needs rebase label. CONTRIBUTING.md asks authors to rebase their branch on main; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7230054611 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/426#issuecomment-7230054611). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-27T23:19:42Z. --- Hi @tahffo68hk-hash, thanks for this pull request. It currently conflicts with `main` (conflicting file(s): `docs/design.md`), so it carries the `needs rebase` label. CONTRIBUTING.md asks authors to rebase their branch on `main`; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here. AI-assisted (Claude Code, Claude Opus 5.5).
aslan2142 commented 2026-12-01 11:51:33 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:51:33Z.

Review: CHANGES_REQUESTED


Reviewed against current main: the scalar 16-bit VOP3 clamp no-op change in tools/rdna2spirv.py and test look solid, but this branch conflicts with main in docs/design.md and has failing CI. Please rebase onto current main so CI runs cleanly.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130686758 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/426#pullrequestreview-6130686758). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:51:33Z. **Review:** CHANGES_REQUESTED --- Reviewed against current `main`: the scalar 16-bit VOP3 clamp no-op change in `tools/rdna2spirv.py` and test look solid, but this branch conflicts with `main` in `docs/design.md` and has failing CI. Please rebase onto current `main` so CI runs cleanly. *(AI-assisted review.)*
aslan2142 commented 2026-12-01 16:30:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:30:12Z.


Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7317713818 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/426#issuecomment-7317713818). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:30:12Z. --- Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.

Pull request closed

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!426
No description provided.