Clamped v_sub_nc_u32 (unsigned saturation) is refused as integer output modifiers (8 compute shaders) #365

Closed
opened 2026-11-27 14:16:02 +00:00 by tiagonogueiraa-bit · 3 comments
tiagonogueiraa-bit commented 2026-11-27 14:16:02 +00:00 (Migrated from github.com)
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by tiagonogueiraa-bit on 2026-11-27T14:16:02Z.


A small shape from #4: "integer output modifiers" is refused in 8 unique compute shaders of a 12,020-shader corpus (Series S, boot to the menus, main 905e7aa). All 8 are v_sub_nc_u32 vN, vA, vB clamp, with the result written to LDS.

The VOP3 clamp bit on an unsigned add or sub saturates: LLVM's AMDGPU backend selects usubsat and uaddsat to v_sub_nc_u32 and v_add_nc_u32 with clamp.

Plan:

  • Lower the clamp on v_add_nc_u32, v_sub_nc_u32 and v_subrev_nc_u32 as unsigned saturation.
  • Keep clamp on other integer operations, and omod, refused.
  • Include a GPU value test and a by-output corpus sweep in the PR.
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6648183966 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/365). Originally posted by [tiagonogueiraa-bit](https://github.com/tiagonogueiraa-bit) on 2026-11-27T14:16:02Z. --- A small shape from #4: "integer output modifiers" is refused in 8 unique compute shaders of a 12,020-shader corpus (Series S, boot to the menus, main `905e7aa`). All 8 are `v_sub_nc_u32 vN, vA, vB clamp`, with the result written to LDS. The VOP3 clamp bit on an unsigned add or sub saturates: LLVM's AMDGPU backend selects `usubsat` and `uaddsat` to `v_sub_nc_u32` and `v_add_nc_u32` with clamp. Plan: - Lower the clamp on `v_add_nc_u32`, `v_sub_nc_u32` and `v_subrev_nc_u32` as unsigned saturation. - Keep clamp on other integer operations, and `omod`, refused. - Include a GPU value test and a by-output corpus sweep in the PR.
tiagonogueiraa-bit commented 2026-11-27 14:16:03 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by tiagonogueiraa-bit on 2026-11-27T14:16:03Z.


/claim

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7220564221 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/365#issuecomment-7220564221). Originally posted by [tiagonogueiraa-bit](https://github.com/tiagonogueiraa-bit) on 2026-11-27T14:16:03Z. --- /claim
github-actions[bot] commented 2026-11-27 14:16:13 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T14:16:13Z.


Claimed by @tiagonogueiraa-bit. Open a draft pull request with Refs #365 in its description within 24 hours, or the claim expires.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7220567895 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/365#issuecomment-7220567895). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-27T14:16:13Z. --- Claimed by @tiagonogueiraa-bit. Open a draft pull request with `Refs #365` in its description within 24 hours, or the claim expires.
LakshanSivakumar commented 2026-11-28 00:35:31 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-28T00:35:31Z.


Thank you. Clamped v_add_nc_u32, v_sub_nc_u32 and v_subrev_nc_u32 now saturate, in #366 on main. Your sweep showed 8 compute shaders gained, no regressions. Clamp on other integer operations and omod stay refused on purpose. I have not seen it in the game. Closing; reopen if one of the 8 is still refused on a6a58361.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7231034885 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/365#issuecomment-7231034885). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-28T00:35:31Z. --- Thank you. Clamped v_add_nc_u32, v_sub_nc_u32 and v_subrev_nc_u32 now saturate, in #366 on main. Your sweep showed 8 compute shaders gained, no regressions. Clamp on other integer operations and omod stay refused on purpose. I have not seen it in the game. Closing; reopen if one of the 8 is still refused on a6a58361.
Sign in to join this conversation.
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
LakshanSivakumar/Native-Victory-macOS#365
No description provided.