tests: check clamp on V_MIN3/MAX3/MED3_F16 #1250

Closed
github-bot wants to merge 1 commit from gh-pr/1250/head into gh-pr/1250/base
Owner

@⁠Nawid3333 on GitHub · 2026-10-08 20:00 UTC · original
Nawid3333:tests/f16-minmax3-clamp → main · +33 −0 · 1 files · 1 commits · closed without merging

Problem

#1116 made the decoder accept the VOP3 clamp bit on V_MIN3_F16, V_MAX3_F16 and V_MED3_F16, but no case sets
it. Rejecting clamp on them again, as before #1116, passed every test I could run (the CPU tests, the GPU case list
and the focused modes that pass on my host); a shader that uses it would then fail to compile.

Change

VectorMinMaxMed3F16Clamp runs the three instructions with clamp: V_MAX3_F16 on the low halves (max 3.0 clamps to
1.0), V_MIN3_F16 on the high halves with op_sel (min -8.0 clamps to +0.0) and V_MED3_F16 on the low halves (2.0
clamps to 1.0). Like VectorMinMaxMed3F16Ops, it expects the other 16-bit half of each destination to be preserved.
It runs in the default list and with --minmax3-f16-clamp-only, which runs both cases.

Testing

Windows 11, clang-cl 19.1.5, Release, AMD RX 9070 XT (Vulkan driver 2.0.395, Adrenalin 26.8.1), on 2f4b8a33:

  • shader_recompiler_compute_tests --minmax3-f16-clamp-only passes.
  • With the decoder rejecting clamp on these three instructions again, it fails.
  • shader_cfg, resource_tracking, resource_materialization, scalar_provenance and shader_vertex_metadata
    pass.
  • The default run stops earlier on this host (D24S8, #930), so the case was run through its focused mode.
  • CI on my fork builds it on Linux, Windows and macOS; CI has no GPU, so it does not run this case: https://github.com/Nawid3333/KytyPS5/actions/runs/37832369348

AI use (per the README's AI policy): Claude (Anthropic) found the gap with a mutation run, wrote the test and
this description, and ran the checks above on my machine.

**@⁠Nawid3333** on GitHub · 2026-10-08 20:00 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1250) `Nawid3333:tests/f16-minmax3-clamp` → `main` · +33 −0 · 1 files · 1 commits · closed without merging ## Problem #1116 made the decoder accept the VOP3 clamp bit on `V_MIN3_F16`, `V_MAX3_F16` and `V_MED3_F16`, but no case sets it. Rejecting clamp on them again, as before #1116, passed every test I could run (the CPU tests, the GPU case list and the focused modes that pass on my host); a shader that uses it would then fail to compile. ## Change `VectorMinMaxMed3F16Clamp` runs the three instructions with clamp: `V_MAX3_F16` on the low halves (max 3.0 clamps to 1.0), `V_MIN3_F16` on the high halves with op_sel (min -8.0 clamps to +0.0) and `V_MED3_F16` on the low halves (2.0 clamps to 1.0). Like `VectorMinMaxMed3F16Ops`, it expects the other 16-bit half of each destination to be preserved. It runs in the default list and with `--minmax3-f16-clamp-only`, which runs both cases. ## Testing Windows 11, clang-cl 19.1.5, Release, AMD RX 9070 XT (Vulkan driver 2.0.395, Adrenalin 26.8.1), on `2f4b8a33`: - `shader_recompiler_compute_tests --minmax3-f16-clamp-only` passes. - With the decoder rejecting clamp on these three instructions again, it fails. - `shader_cfg`, `resource_tracking`, `resource_materialization`, `scalar_provenance` and `shader_vertex_metadata` pass. - The default run stops earlier on this host (D24S8, #930), so the case was run through its focused mode. - CI on my fork builds it on Linux, Windows and macOS; CI has no GPU, so it does not run this case: https://github.com/Nawid3333/KytyPS5/actions/runs/37832369348 **AI use** (per the README's AI policy): Claude (Anthropic) found the gap with a mutation run, wrote the test and this description, and ran the checks above on my machine.
#1116 (60e53a39) made the decoder accept the VOP3 clamp bit on the f16
MIN3/MAX3/MED3 instructions, but no case sets it: rejecting clamp again (the
shader then fails to compile) passes every test. VectorMinMaxMed3F16Clamp runs
the three instructions with clamp on inputs above 1.0 and below 0.0, on both
16-bit halves, and expects 1.0 and +0.0 with the other half preserved. It runs
in the default list and with --minmax3-f16-clamp-only, next to
VectorMinMaxMed3F16Ops.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:50:02 +00:00
github-bot closed this pull request 2026-11-26 09:50:02 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-08 20:05 UTC · original

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3f4fdd55-a725-4716-a1fc-d4281d630274
📥 Commits

Reviewing files that changed from the base of the PR and between 2f4b8a335d and 3e6e1024a8.

📒 Files selected for processing (1)
  • tests/ShaderRecompilerComputeTests.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Adds VectorMinMaxMed3F16Clamp to test clamped half-precision min3, max3, and med3 instructions against expected output words. Registers the test and adds --minmax3-f16-clamp-only to run it with VectorMinMaxMed3F16Ops.

Suggested reviewers: nmzik

Priority: ⬇️ Low

Change: Other

Merge Risk: ⚪ Minimal · up to 3e6e1

This adds focused coverage for clamp behavior across all three F16 min3/max3/med3 instructions, with no unresolved merge-blocking concern.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the missing clamp coverage, the new test behavior, the selectors, and the reported validation results.
Title check ✅ Passed The title is concise and directly identifies the test coverage added for clamp behavior on V_MIN3_F16, V_MAX3_F16, and V_MED3_F16.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-08 20:05 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1250#issuecomment-6068083277) <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/1250?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=2" alt="Review in Change Stack →" width="220" height="32"></a> <!-- review_stack_entry_end --> <!-- recent_review_start --> No actionable comments were generated in the recent review. 🎉 <details> <summary>ℹ️ Recent review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `3f4fdd55-a725-4716-a1fc-d4281d630274` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 2f4b8a335d5e27a5153bdea670bd877a061e37b1 and 3e6e1024a8db75fc9f122ebc4239201583df2497. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `tests/ShaderRecompilerComputeTests.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. </details> --- <!-- recent_review_end --> <!-- walkthrough_start --> <details> <summary>📝 Walkthrough</summary> ## Walkthrough Adds `VectorMinMaxMed3F16Clamp` to test clamped half-precision min3, max3, and med3 instructions against expected output words. Registers the test and adds `--minmax3-f16-clamp-only` to run it with `VectorMinMaxMed3F16Ops`. **Suggested reviewers:** `nmzik` </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ⬇️ Low <!-- change_assessment_commit:"3e6e1024a8db75fc9f122ebc4239201583df2497" --> **Change:** Other <!-- change_assessment_end --> <!-- final_review_risk_start --> **Merge Risk:** **⚪ Minimal** · up to `3e6e1` <!-- final_review_risk_coverage:{"sourceCommitId":"3e6e1024a8db75fc9f122ebc4239201583df2497","coveredCommitId":"3e6e1024a8db75fc9f122ebc4239201583df2497","kind":"reviewed"} --> This adds focused coverage for clamp behavior across all three F16 min3/max3/med3 instructions, with no unresolved merge-blocking concern. <!-- final_review_risk_end --> <!-- pre_merge_checks_walkthrough_start --> <details> <summary>🚥 Pre-merge checks | ✅ 5</summary> <details> <summary>✅ Passed checks (5 passed)</summary> | Check name | Status | Explanation | | :------------------------ | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Description check | ✅ Passed | The description clearly explains the missing clamp coverage, the new test behavior, the selectors, and the reported validation results. | | Title check | ✅ Passed | The title is concise and directly identifies the test coverage added for clamp behavior on V_MIN3_F16, V_MAX3_F16, and V_MED3_F16. | | Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0… | | Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | </details> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- autopilot:start --> - [ ] <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autopilot</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts <!-- autopilot:end --> <!-- tips_start --> --- Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=1250)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary>❤️ Share</summary> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </details> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.