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

Closed
opened 2026-11-27 14:16:42 +00:00 by github-bot · 3 comments
Owner

@⁠tiagonogueiraa-bit on GitHub · 2026-11-27 14:16 UTC · original

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** on GitHub · 2026-11-27 14:16 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/365) 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 14:16:42 +00:00
Author
Owner

@⁠tiagonogueiraa-bit on GitHub · 2026-11-27 14:16 UTC · original

/claim

**@⁠tiagonogueiraa-bit** on GitHub · 2026-11-27 14:16 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/365#issuecomment-7220564221) /claim
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-27 14:16 UTC · original

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

**@⁠github-actions[bot]** on GitHub · 2026-11-27 14:16 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/365#issuecomment-7220567895) Claimed by @⁠tiagonogueiraa-bit. Open a draft pull request with `Refs #365` in its description within 24 hours, or the claim expires.
github-bot referenced this issue from a commit 2026-11-27 16:13:14 +00:00
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-28 00:35 UTC · original

Thank you. Clamped v_add_nc_u32, v_sub_nc_u32 and v_subrev_nc_u32 now saturate, in #369 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.

**@⁠LakshanSivakumar** on GitHub · 2026-11-28 00:35 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/365#issuecomment-7231034885) Thank you. Clamped v_add_nc_u32, v_sub_nc_u32 and v_subrev_nc_u32 now saturate, in #369 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.