shader: round f32 to f16 conversions to nearest even #1204

Closed
github-bot wants to merge 2 commits from gh-pr/1204/head into gh-pr/1204/base
Owner

@⁠Nawid3333 on GitHub · 2026-10-08 12:02 UTC · original
Nawid3333:shader/f16-pack-rounding → main · +56 −38 · 8 files · 2 commits · closed without merging

Problem

On AMD GPUs, every inexact 16-bit float result the recompiler produces is one ulp toward zero. On an
RX 9070 XT (Windows 11, driver 26.8.1) three GPU-harness modes fail because of it:

  • --buffer-float16-store-only, --buffer-format-store-only: BufferStoreFormatXyzwFloat16ConvertsComponents
    stores 0x3c03 where the test expects 0x3c04.
  • --cmpx-class-f16-only: FloatInlineConstantF16UsesNumericValue turns 1/(2π) into 0x3117 instead of
    0x3118.

--fract-f16-only changes too. With this change it passes, because three of its edge results now round to
1.0 as the test expects (on AMD they truncated to 0x3bff). Whether V_FRACT_F16 may return 1.0 at all is
a separate question, raised in #1209.

Cause

The recompiler computes 16-bit float results in f32 and packs them with GLSL.std.450 PackHalf2x16.
The Vulkan spec's precision table defines packHalf2x16 as "correctly rounded with implementation
defined rounding mode", and the float-controls rounding modes don't cover it. The AMD driver I tested
truncates. The tests above expect round to nearest even (0x3c04, 0x3118), the default rounding of
RDNA2's MODE register.

Fix

Convert in integer arithmetic, the way V_CVT_PKRTZ_F16_F32 already does. Its round-toward-zero
helper gets a round-to-nearest-even mode: after truncating it adds the rounding increment (ties to
even) and overflows to infinity. Values between 2^-25 and 2^-24 round up to the smallest subnormal,
values at or below 2^-25 to zero. PackHalf2x16, ConvertF16F32, formatted 16-bit float buffer stores
and 16-bit (D16) float image data use the new mode. The result no longer depends on the host driver,
and no Float16 capability or device feature is needed. Round-toward-zero results (PKRTZ) don't change.
The SPIR-V checks in shaderCfgTests that required PackHalf2x16 now check for its absence or for the
conversion itself.

Two things to be aware of:

  • Cost: each 16-bit float result now takes a few dozen integer SPIR-V instructions instead of one
    extended instruction, on every host (PKRTZ already works this way). I haven't measured the effect on
    real shaders.
  • I don't know how the PS5's fixed-function formatted-store conversion rounds; this follows the
    existing test, which expects round to nearest even there too.

Testing

Windows 11, clang-cl 19.1.5, Release, AMD RX 9070 XT, this branch on main 5a880808:

  • The three modes above (and --fract-f16-only) fail on main and pass with this change; with the six
    backend/spirv files reset to main (tests kept) they fail again. shader_cfg passes.
  • All --*-only modes against main (420bb51d): 94/109 pass instead of 90/109; the only changes are
    those four modes, and the other 15 failing modes fail exactly as on main.
  • Each half-precision case whose SPIR-V check used to require PackHalf2x16 now forbids it (second
    commit, after CodeRabbit's review).
  • MakeCases()-only cases that no --*-only mode reaches, run through a temporary local selector on
    both builds: Pkrtz (2), ImageD16 (2), F16 (27), Half (12) and D16 (36) all pass with this change. On
    main the same set passes except F16, which stops at VectorFractF16CapturedAndEdges.
  • Fork CI (Windows, Linux, macOS): green, https://github.com/Nawid3333/KytyPS5/actions/runs/37772081908
  • A bit-exact model of the emitted conversion agrees with IEEE round to nearest even on 3.4 million
    inputs covering every f32 exponent, including the subnormal and overflow ranges; the PKRTZ path is
    bit-identical to before.

Not tested on NVIDIA. I expect the same results there, except possibly NaN payload bits and
subnormals where its native pack differed, plus the instruction cost above.

AI use (per the README's AI policy): Claude (Anthropic) found the failing modes with a nightly test run on my PC, traced the cause, wrote the change and ran the tests above on my machine.

🤖 Generated with Claude Code

**@⁠Nawid3333** on GitHub · 2026-10-08 12:02 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1204) `Nawid3333:shader/f16-pack-rounding` → `main` · +56 −38 · 8 files · 2 commits · closed without merging ## Problem On AMD GPUs, every inexact 16-bit float result the recompiler produces is one ulp toward zero. On an RX 9070 XT (Windows 11, driver 26.8.1) three GPU-harness modes fail because of it: - `--buffer-float16-store-only`, `--buffer-format-store-only`: `BufferStoreFormatXyzwFloat16ConvertsComponents` stores `0x3c03` where the test expects `0x3c04`. - `--cmpx-class-f16-only`: `FloatInlineConstantF16UsesNumericValue` turns 1/(2π) into `0x3117` instead of `0x3118`. `--fract-f16-only` changes too. With this change it passes, because three of its edge results now round to 1.0 as the test expects (on AMD they truncated to `0x3bff`). Whether `V_FRACT_F16` may return 1.0 at all is a separate question, raised in #1209. ## Cause The recompiler computes 16-bit float results in f32 and packs them with GLSL.std.450 `PackHalf2x16`. The Vulkan spec's precision table defines `packHalf2x16` as "correctly rounded with implementation defined rounding mode", and the float-controls rounding modes don't cover it. The AMD driver I tested truncates. The tests above expect round to nearest even (`0x3c04`, `0x3118`), the default rounding of RDNA2's MODE register. ## Fix Convert in integer arithmetic, the way `V_CVT_PKRTZ_F16_F32` already does. Its round-toward-zero helper gets a round-to-nearest-even mode: after truncating it adds the rounding increment (ties to even) and overflows to infinity. Values between 2^-25 and 2^-24 round up to the smallest subnormal, values at or below 2^-25 to zero. `PackHalf2x16`, `ConvertF16F32`, formatted 16-bit float buffer stores and 16-bit (D16) float image data use the new mode. The result no longer depends on the host driver, and no Float16 capability or device feature is needed. Round-toward-zero results (PKRTZ) don't change. The SPIR-V checks in `shaderCfgTests` that required `PackHalf2x16` now check for its absence or for the conversion itself. Two things to be aware of: - Cost: each 16-bit float result now takes a few dozen integer SPIR-V instructions instead of one extended instruction, on every host (PKRTZ already works this way). I haven't measured the effect on real shaders. - I don't know how the PS5's fixed-function formatted-store conversion rounds; this follows the existing test, which expects round to nearest even there too. ## Testing Windows 11, clang-cl 19.1.5, Release, AMD RX 9070 XT, this branch on `main` `5a880808`: - The three modes above (and `--fract-f16-only`) fail on `main` and pass with this change; with the six `backend/spirv` files reset to `main` (tests kept) they fail again. `shader_cfg` passes. - All `--*-only` modes against `main` (`420bb51d`): 94/109 pass instead of 90/109; the only changes are those four modes, and the other 15 failing modes fail exactly as on `main`. - Each half-precision case whose SPIR-V check used to require `PackHalf2x16` now forbids it (second commit, after CodeRabbit's review). - `MakeCases()`-only cases that no `--*-only` mode reaches, run through a temporary local selector on both builds: Pkrtz (2), ImageD16 (2), F16 (27), Half (12) and D16 (36) all pass with this change. On `main` the same set passes except F16, which stops at `VectorFractF16CapturedAndEdges`. - Fork CI (Windows, Linux, macOS): green, https://github.com/Nawid3333/KytyPS5/actions/runs/37772081908 - A bit-exact model of the emitted conversion agrees with IEEE round to nearest even on 3.4 million inputs covering every f32 exponent, including the subnormal and overflow ranges; the PKRTZ path is bit-identical to before. Not tested on NVIDIA. I expect the same results there, except possibly NaN payload bits and subnormals where its native pack differed, plus the instruction cost above. **AI use** (per the README's AI policy): Claude (Anthropic) found the failing modes with a nightly test run on my PC, traced the cause, wrote the change and ran the tests above on my machine. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Vulkan specifies GLSL.std.450 PackHalf2x16 as correctly rounded with an
implementation-defined rounding mode, and the RoundingModeRTE/RTZ
execution modes don't apply to it. AMD's driver truncates while RDNA2
rounds 16-bit float results to nearest even, so every inexact half
result was one ulp toward zero on AMD hosts. On an RX 9070 XT,
BufferStoreFormatXyzwFloat16ConvertsComponents stored 0x3c03 instead of
0x3c04, and FloatInlineConstantF16UsesNumericValue turned 1/(2*pi) into
0x3117 instead of 0x3118.

Convert in integer arithmetic, as V_CVT_PKRTZ_F16_F32 already does. The
round-toward-zero helper gains a round-to-nearest-even mode that adds
the rounding increment after truncation, overflows to infinity, and
rounds values just above 2^-25 up to the smallest subnormal. The zero
threshold moves from f32 exponent 103 to 102. Round-toward-zero results
don't change, because a subnormal shift of 24 already yields zero there.
The PackHalf2x16 and ConvertF16F32 ops, 16-bit float formatted stores
and D16 image results now use the new mode, so the result no longer
depends on the host driver and needs no Float16 capability or device
feature.

The SPIR-V checks that required PackHalf2x16 now check for its absence
or for the conversion itself.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The SPIR-V checks of these cases used to require PackHalf2x16. Forbid it
instead, so a return to the driver's pack fails the tests even on drivers
whose pack happens to round to nearest even.

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

@⁠coderabbitai[bot] on GitHub · 2026-10-08 12:09 UTC · original · edited 2026-10-08 13:03 UTC

Review in Change Stack →

📝 Walkthrough

Walkthrough

The SPIR-V emitter now supports F32-to-F16 conversion with selectable rounding and explicit packing of two half values. Scalar conversion, formatted stores, and image-result packing use these paths. Tests update their emitted-instruction expectations.

Suggested reviewers: nmzik

Priority: ➖ Normal

Change: Bug fix

Merge Risk: 🔵 Low · up to 2cff8

The conversion paths appear correct, but no checked-in output assertion protects ties-to-even at halfway values. Add the two focused cases to catch a future rounding regression; the existing driver-dependent packing guards are in place.

🚥 Pre-merge checks | ✅ 4 | ❓ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ❓ Inconclusive Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 6 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly summarizes the main change: updating f32-to-f16 conversions to use round-to-nearest-even.
Description check ✅ Passed The description directly explains the conversion issue, the integer-arithmetic fix, affected paths, testing results, and known limitations.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 6 files. (1 skipped: 1 too large.)

  • 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 12:09 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1204#issuecomment-6059525639) · edited 2026-10-08 13:03 UTC <!-- 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/1204?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 --> <!-- walkthrough_start --> <details> <summary>📝 Walkthrough</summary> ## Walkthrough The SPIR-V emitter now supports F32-to-F16 conversion with selectable rounding and explicit packing of two half values. Scalar conversion, formatted stores, and image-result packing use these paths. Tests update their emitted-instruction expectations. **Suggested reviewers:** `nmzik` </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ➖ Normal <!-- change_assessment_commit:"2cff8e60d79ce182809f2d7c7dab161490a0529a" --> **Change:** Bug fix <!-- change_assessment_end --> <!-- final_review_risk_start --> **Merge Risk:** **🔵 Low** · up to `2cff8` <!-- final_review_risk_coverage:{"sourceCommitId":"2cff8e60d79ce182809f2d7c7dab161490a0529a","coveredCommitId":"2cff8e60d79ce182809f2d7c7dab161490a0529a","kind":"reviewed"} --> The conversion paths appear correct, but no checked-in output assertion protects ties-to-even at halfway values. Add the two focused cases to catch a future rounding regression; the existing driver-dependent packing guards are in place. <!-- final_review_risk_end --> <!-- pre_merge_checks_walkthrough_start --> <details> <summary>🚥 Pre-merge checks | ✅ 4 | ❓ 1</summary> ### ❌ Failed checks (1 inconclusive) | Check name | Status | Explanation | Resolution | | :---------------- | :------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ❓ Inconclusive | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 6 files. (1 skipped: 1… | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary>✅ Passed checks (4 passed)</summary> | Check name | Status | Explanation | | :------------------------ | :------- | :------------------------------------------------------------------------------------------------------------------------------------------ | | 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. | | Title check | ✅ Passed | The title clearly summarizes the main change: updating f32-to-f16 conversions to use round-to-nearest-even. | | Description check | ✅ Passed | The description directly explains the conversion issue, the integer-arithmetic fix, affected paths, testing results, and known limitations. | </details> <details> <summary>Full details: Docstring Coverage</summary> **Explanation** Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 6 files. (1 skipped: 1 too large.) </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=1204)! 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 -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-08 12:09 UTC · original · reviewed

🧹 Nitpick comments (1)
tests/ShaderRecompilerComputeTests.cpp (1)

24070-24070: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a per-path SPIR-V guard for the half conversions.

The shaderCfg checks cover different fixtures. MoreAluFamilies covers v_cvt_f16_f32, Vop3pPackedF16 covers packed F16 arithmetic, and StagedShaderOps covers F16 FMA operations. The formatted-store test checks one buffer_store_format_x case, not this XYZW case. None guards the four vector paths or ImageD16GatherPacksHalfPairs.

Add a PackHalf2x16 forbidden check or assert the explicit integer conversion sequence in each affected test. This prevents a driver-dependent packing regression from passing on drivers that round correctly.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2cdeab01-8a89-43be-a331-efc3413c9f95
📥 Commits

Reviewing files that changed from the base of the PR and between 3c62359e05 and bab897a444.

📒 Files selected for processing (8)
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterAlu.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterAluHelpers.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterImage.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterInstructions.h
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterInternal.h
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cpp
  • tests/ShaderRecompilerComputeTests.cpp
  • tests/shaderCfgTests.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-10-08 12:09 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1204#pullrequestreview-5456319720) · **reviewed** <details> <summary>🧹 Nitpick comments (1)</summary><blockquote> <details> <summary>tests/ShaderRecompilerComputeTests.cpp (1)</summary><blockquote> `24070-24070`: **📐 Maintainability & Code Quality** | **🔵 Trivial** | **⚡ Quick win** **Add a per-path SPIR-V guard for the half conversions.** The `shaderCfg` checks cover different fixtures. `MoreAluFamilies` covers `v_cvt_f16_f32`, `Vop3pPackedF16` covers packed F16 arithmetic, and `StagedShaderOps` covers F16 FMA operations. The formatted-store test checks one `buffer_store_format_x` case, not this XYZW case. None guards the four vector paths or `ImageD16GatherPacksHalfPairs`. Add a `PackHalf2x16` forbidden check or assert the explicit integer conversion sequence in each affected test. This prevents a driver-dependent packing regression from passing on drivers that round correctly. <!-- cr-comment:v1:f38a6a5e3e64a0501c245813 --> </blockquote></details> </blockquote></details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `2cdeab01-8a89-43be-a331-efc3413c9f95` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 3c62359e05854ea3ae8f09d176ae2f82d3bbf817 and bab897a444b5ad281435372a47f9bb60609c201b. </details> <details> <summary>📒 Files selected for processing (8)</summary> * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterAlu.cpp` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterAluHelpers.cpp` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterImage.cpp` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterInstructions.h` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterInternal.h` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cpp` * `tests/ShaderRecompilerComputeTests.cpp` * `tests/shaderCfgTests.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=877a188c-56a9-44aa-a51c-a22e134c8131 attempt=f0c5fa82-ae97-4e7b-ae94-c7987e270f87 batch=1/1 -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-08 12:36 UTC · original · reviewed

🧹 Nitpick comments (1)
src/graphics/shader/recompiler/backend/spirv/spirvEmitterAluHelpers.cpp (1)

80-91: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add exact nearest-even halfway assertions.

BufferStoreFormatXyzwFloat16ConvertsComponents exercises the new helper and checks exact outputs, but it has no halfway inputs. The SPIR-V checks only detect instruction structure. Add one tie with an even retained half and one with an odd retained half.

Suggested fix
-      -4.0f, 3.0f, 0.0f, 2.0f};
+      std::bit_cast<float>(0x3f801000u), std::bit_cast<float>(0x3f803000u),
+      0.0f, 2.0f};
...
-  test.expected = {0xc0003c04u, 0x34003800u, 0x4200c400u, 0x40000000u};
+  test.expected = {0xc0003c04u, 0x34003800u, 0x3c023c00u, 0x40000000u};

ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 00088c21-71f0-4878-a1b3-3e170eee3241
📥 Commits

Reviewing files that changed from the base of the PR and between bab897a444 and 2cff8e60d7.

📒 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; 1 remain after this review.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-08 12:36 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1204#pullrequestreview-5456659663) · **reviewed** <details> <summary>🧹 Nitpick comments (1)</summary><blockquote> <details> <summary>src/graphics/shader/recompiler/backend/spirv/spirvEmitterAluHelpers.cpp (1)</summary><blockquote> `80-91`: **🎯 Functional Correctness** | **🔵 Trivial** | **⚡ Quick win** **Add exact nearest-even halfway assertions.** `BufferStoreFormatXyzwFloat16ConvertsComponents` exercises the new helper and checks exact outputs, but it has no halfway inputs. The SPIR-V checks only detect instruction structure. Add one tie with an even retained half and one with an odd retained half. <details> <summary>Suggested fix</summary> ```diff - -4.0f, 3.0f, 0.0f, 2.0f}; + std::bit_cast<float>(0x3f801000u), std::bit_cast<float>(0x3f803000u), + 0.0f, 2.0f}; ... - test.expected = {0xc0003c04u, 0x34003800u, 0x4200c400u, 0x40000000u}; + test.expected = {0xc0003c04u, 0x34003800u, 0x3c023c00u, 0x40000000u}; ``` </details> <!-- cr-comment:v1:925d4921a0935096709ba6e4 --> </blockquote></details> </blockquote></details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `00088c21-71f0-4878-a1b3-3e170eee3241` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between bab897a444b5ad281435372a47f9bb60609c201b and 2cff8e60d79ce182809f2d7c7dab161490a0529a. </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; 1 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=a55f647c-741a-457e-82b1-14d86e1099da attempt=168de1c5-7350-40bf-88ef-70f71f2dd02f batch=1/1 -->

Pull request closed

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