shader: preserve f32 denorms when the guest MODE keeps them #1619

Open
github-bot wants to merge 1 commit from github-bot/gh-1619 into main AGit
Owner

@⁠Nawid3333 on GitHub · 2026-10-17 19:55 UTC · original
Nawid3333:shader/f32-denorm-preserve → main · +137 −14 · 11 files · 1 commits · open

Compute shaders run with the MODE that COMPUTE_PGM_RSRC1.FLOAT_MODE sets. With FP_DENORM[5:4] = 3 (FLOAT_MODE 0xf0) the hardware keeps f32 denormal inputs and results. Kyty already reads bit 4 to decide whether compare inputs are flushed, but it never asks the host to keep denormals, so a host that flushes f32 denormals by default turns them into zero. Both of my GPUs do that (RX 9070 XT with LLPC, and the Ryzen 7600X iGPU with AMD's other compiler): in such a shader V_MUL_F32 of 0x00800000 and 0.5 gives 0 instead of 0x00400000.

Change

  • The device's shaderDenormPreserveFloat32 (part of the float-controls properties VulkanCreateDevice already queries) is passed to the recompiler as a Spirv::Profile field next to maintenance8 (so it is also part of the shader store header, like the rest of the profile). A compute shader with FP_DENORM[5:4] = 3 declares DenormPreserve 32 when the device supports it and the device's denormBehaviorIndependence isn't NONE (with NONE every float width would need the same mode, VUID-RuntimeSpirv-denormBehaviorIndependence-06290; DXVK checks the same, f5fa7a90).
  • Instructions that flush denormals in every mode keep doing so in such a shader. That is V_MAD_F32/V_MAC_F32, as the existing VectorMadF32FlushesDenorms expects, and the results of V_RCP_F32 and V_EXP_F32 (ISA: "Denormals are flushed"; the V_RCP_F32 input was already flushed, and a denormal V_EXP_F32 input already gives 1.0, as in your 93071ebd). These flushes are only emitted in shaders that declare DenormPreserve 32, so the 3DMiniGolf/NVIDIA note in EmitFPMad32 still holds for every other shader. They go through main's EmitFlushF32DenormToSignedZero, so with relaxed_float on they are left out like main's other flushes. NVIDIA's driver reports shaderDenormPreserveFloat32 = false (gpuinfo), so on NVIDIA the SPIR-V doesn't change at all.
  • Other modes are unchanged. I also tried declaring DenormFlushToZero 32 for mode 0, but on the RX 9070 XT VectorF64ModesModifiersAndExec then failed (a negative V_CVT_F32_F64 result that is flushed came back as +0 instead of -0), so I left that out. Compute shaders with FP64 instructions still exit unless FLOAT_MODE is 0xc0 (the existing guard in spirvEmitterModule.cpp), so 0xf0 with FP64 stays as on main; it needs its own FP64 denorm handling (the F32/F64 conversions flush today) before that guard can change.

Tests

  • New VectorF32DenormsPreservedWhenRequested (FLOAT_MODE 0xf0, V_MUL_F32/V_ADD_F32 with denormal inputs and results; it also checks that the SPIR-V declares DenormPreserve 32): fails before the change on both GPUs (all four results are 0) and passes after it. It is skipped where the harness device fails the same check as VulkanCreateDevice.
  • New VectorF32TranscendentalsFlushDenorms (FLOAT_MODE 0xf0): V_RCP_F32 of 2^127 gives 0, V_EXP_F32 of -130 gives 0, V_RCP_F32 of a denormal gives +inf. It passes; with the two result flushes removed it fails on both GPUs (the RX 9070 XT keeps the V_EXP_F32 denormal, the iGPU the V_RCP_F32 one), so each driver needs one of them.
  • VectorMadF32FlushesDenorms keeps passing; with DenormPreserve 32 declared but without the MAD flushes it fails.
  • VectorMed3F32NanUsesMin3Path (FLOAT_MODE 0xf0, already on main) fails on the Ryzen iGPU on main: word 89 is 0x00000000 instead of the denormal 0x80000001. With this change it passes there too.
  • shader_cfg_tests (not run by CI): new TestNewShaderRecompilerF32DenormExecutionMode checks that only FLOAT_MODE 0xf0 on a device that can preserve f32 denormals gets DenormPreserve 32, and that no other denorm mode is declared; passes.
  • On both GPUs, native and with the harness forced to 32-wide subgroups (a local switch, not in this PR), compared with 763d3be3 (the base of this PR then): the whole compute suite (726 entries) and the 30 graphics cases kept their status apart from the two new tests, and the new cases gave no validation-layer messages.

Rebased onto main a0b083c85 (one commit; the earlier merge commits are gone)

  • Main's Spirv::Profile gained ray_query, so Serialize.h now lists nine Profile fields.
  • On the RX 9070 XT, compared with main: shader_cfg_tests passes on both; --relaxed-float-only passes on both; the full compute run fails the same two existing cases on both (GpuSelectedFormattedRgba16Store, IndirectImageQueryDimensions) and stops on both at the same 2-sample format 129 this GPU cannot create, before the new cases. Run on their own, the two new cases, VectorMadF32FlushesDenorms, VectorMadF32RoundsProduct and RelaxedFloatNativeOps pass; the last three pass on main too.
  • CI (build and tests on Windows, Linux and macOS) passes on 252925a (this PR's head): https://github.com/Nawid3333/KytyPS5/actions/runs/45068182146
  • This touches EmitFPMad32, EmitterState and tests next to the ones of my #1622, so whichever of the two lands second needs a small rebase; I'll do it.

If you'd like this done differently, tell me and I'll change it.

Written with Claude Code (AI): it found this with a test, wrote the change and ran the tests on my PC (Windows 11, AMD drivers 26.8.1 and 26.10.1).

🤖 Generated with Claude Code

**@⁠Nawid3333** on GitHub · 2026-10-17 19:55 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1619) `Nawid3333:shader/f32-denorm-preserve` → `main` · +137 −14 · 11 files · 1 commits · open Compute shaders run with the MODE that `COMPUTE_PGM_RSRC1.FLOAT_MODE` sets. With `FP_DENORM[5:4] = 3` (FLOAT_MODE `0xf0`) the hardware keeps f32 denormal inputs and results. Kyty already reads bit 4 to decide whether compare inputs are flushed, but it never asks the host to keep denormals, so a host that flushes f32 denormals by default turns them into zero. Both of my GPUs do that (RX 9070 XT with LLPC, and the Ryzen 7600X iGPU with AMD's other compiler): in such a shader `V_MUL_F32` of `0x00800000` and 0.5 gives `0` instead of `0x00400000`. **Change** - The device's `shaderDenormPreserveFloat32` (part of the float-controls properties `VulkanCreateDevice` already queries) is passed to the recompiler as a `Spirv::Profile` field next to `maintenance8` (so it is also part of the shader store header, like the rest of the profile). A compute shader with `FP_DENORM[5:4] = 3` declares `DenormPreserve 32` when the device supports it and the device's `denormBehaviorIndependence` isn't `NONE` (with `NONE` every float width would need the same mode, VUID-RuntimeSpirv-denormBehaviorIndependence-06290; DXVK checks the same, f5fa7a90). - Instructions that flush denormals in every mode keep doing so in such a shader. That is `V_MAD_F32`/`V_MAC_F32`, as the existing `VectorMadF32FlushesDenorms` expects, and the results of `V_RCP_F32` and `V_EXP_F32` (ISA: "Denormals are flushed"; the `V_RCP_F32` input was already flushed, and a denormal `V_EXP_F32` input already gives 1.0, as in your 93071ebd). These flushes are only emitted in shaders that declare `DenormPreserve 32`, so the 3DMiniGolf/NVIDIA note in `EmitFPMad32` still holds for every other shader. They go through main's `EmitFlushF32DenormToSignedZero`, so with `relaxed_float` on they are left out like main's other flushes. NVIDIA's driver reports `shaderDenormPreserveFloat32 = false` (gpuinfo), so on NVIDIA the SPIR-V doesn't change at all. - Other modes are unchanged. I also tried declaring `DenormFlushToZero 32` for mode 0, but on the RX 9070 XT `VectorF64ModesModifiersAndExec` then failed (a negative `V_CVT_F32_F64` result that is flushed came back as +0 instead of -0), so I left that out. Compute shaders with FP64 instructions still exit unless FLOAT_MODE is `0xc0` (the existing guard in `spirvEmitterModule.cpp`), so `0xf0` with FP64 stays as on main; it needs its own FP64 denorm handling (the F32/F64 conversions flush today) before that guard can change. **Tests** - New `VectorF32DenormsPreservedWhenRequested` (FLOAT_MODE `0xf0`, `V_MUL_F32`/`V_ADD_F32` with denormal inputs and results; it also checks that the SPIR-V declares `DenormPreserve 32`): fails before the change on both GPUs (all four results are 0) and passes after it. It is skipped where the harness device fails the same check as `VulkanCreateDevice`. - New `VectorF32TranscendentalsFlushDenorms` (FLOAT_MODE `0xf0`): `V_RCP_F32` of 2^127 gives 0, `V_EXP_F32` of -130 gives 0, `V_RCP_F32` of a denormal gives +inf. It passes; with the two result flushes removed it fails on both GPUs (the RX 9070 XT keeps the `V_EXP_F32` denormal, the iGPU the `V_RCP_F32` one), so each driver needs one of them. - `VectorMadF32FlushesDenorms` keeps passing; with `DenormPreserve 32` declared but without the MAD flushes it fails. - `VectorMed3F32NanUsesMin3Path` (FLOAT_MODE `0xf0`, already on main) fails on the Ryzen iGPU on main: word 89 is `0x00000000` instead of the denormal `0x80000001`. With this change it passes there too. - `shader_cfg_tests` (not run by CI): new `TestNewShaderRecompilerF32DenormExecutionMode` checks that only FLOAT_MODE `0xf0` on a device that can preserve f32 denormals gets `DenormPreserve 32`, and that no other denorm mode is declared; passes. - On both GPUs, native and with the harness forced to 32-wide subgroups (a local switch, not in this PR), compared with 763d3be3 (the base of this PR then): the whole compute suite (726 entries) and the 30 graphics cases kept their status apart from the two new tests, and the new cases gave no validation-layer messages. **Rebased onto main a0b083c85** (one commit; the earlier merge commits are gone) - Main's `Spirv::Profile` gained `ray_query`, so `Serialize.h` now lists nine Profile fields. - On the RX 9070 XT, compared with main: `shader_cfg_tests` passes on both; `--relaxed-float-only` passes on both; the full compute run fails the same two existing cases on both (`GpuSelectedFormattedRgba16Store`, `IndirectImageQueryDimensions`) and stops on both at the same 2-sample format 129 this GPU cannot create, before the new cases. Run on their own, the two new cases, `VectorMadF32FlushesDenorms`, `VectorMadF32RoundsProduct` and `RelaxedFloatNativeOps` pass; the last three pass on main too. - CI (build and tests on Windows, Linux and macOS) passes on 252925a (this PR's head): https://github.com/Nawid3333/KytyPS5/actions/runs/45068182146 - This touches `EmitFPMad32`, `EmitterState` and tests next to the ones of my #1622, so whichever of the two lands second needs a small rebase; I'll do it. If you'd like this done differently, tell me and I'll change it. Written with Claude Code (AI): it found this with a test, wrote the change and ran the tests on my PC (Windows 11, AMD drivers 26.8.1 and 26.10.1). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Compute shaders with MODE.FP_DENORM[5:4] = 3 now declare DenormPreserve 32 when the host supports it
(shaderDenormPreserveFloat32, and denorm controls not tied across bit widths). V_MAD_F32/V_MAC_F32 and
the V_RCP_F32/V_EXP_F32 results keep flushing denorms in that mode, as on the hardware.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:01:44 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-17 20:02 UTC · original · edited 2026-11-22 20:51 UTC

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review
Walkthrough

The change adds an FP32 denormal-preservation setting to the graphics context and SPIR-V profile. Vulkan device support and compute float mode determine whether the emitter enables preservation. The emitter conditionally flushes values in multiply-add, reciprocal, and exponential operations, and adds the SPIR-V capability and execution mode when enabled. Compute and shader configuration tests cover host support, emitted modes, and operation results.

Suggested reviewers: nmzik

Change: Bug fix

Merge Risk: Minimal · up to 25292

This change preserves FP32 denormals for compute shaders that request it, and only on hosts that support it. Other hosts and modes are unchanged. FP64 compute shaders in this float mode were already unsupported before this PR, so no new merge-blocking risk is introduced.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: preserving f32 denormals in compute shaders when the guest FLOAT_MODE keeps them. It matches the changeset (denorm_preserve_f32 profile flag, DenormPreserve 32 executi…
Description check Passed The description explains the problem (FLOAT_MODE 0xf0 with FP_DENORM[5:4] = 3 and host flushing of f32 denormals), the device capability plumbing through Spirv::Profile, the SPIR-V DenormPreserve 32 d…
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.
Full details: Title check

Explanation

The title names the main change: preserving f32 denormals in compute shaders when the guest FLOAT_MODE keeps them. It matches the changeset (denorm_preserve_f32 profile flag, DenormPreserve 32 execution mode, and flush handling for MAD, RCP, and EXP), and it is concise and specific.

Full details: Description check

Explanation

The description explains the problem (FLOAT_MODE 0xf0 with FP_DENORM[5:4] = 3 and host flushing of f32 denormals), the device capability plumbing through Spirv::Profile, the SPIR-V DenormPreserve 32 declaration, the retained flushes for MAD, RCP, and EXP, and the tests added and run. It directly describes the changed files.

Warning

Some tools did not complete. Review the errors below.

Cppcheck (2.22.0)

Cppcheck (2.22.0) exceeded its 180-second time budget. Findings from completed work are retained; remaining checks are incomplete.

tests/shaderCfgTests.cpp

Cppcheck interrupted; analysis of this file is incomplete

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

**@⁠coderabbitai[bot]** on GitHub · 2026-10-17 20:02 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1619#issuecomment-6240087367) · edited 2026-11-22 20:51 UTC <!-- coderabbit-ai-generated:v1 --> <!-- 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/1619?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg" alt="Explain Change →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- This is an auto-generated comment: review paused by coderabbit.ai --> > [!NOTE] > ## Reviews paused > > It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the `reviews.auto_review.auto_pause_after_reviewed_commits` setting. > > - Last reviewed commit: 252925add501383495b2383186c78875fc090bef > > Use the following commands to manage reviews: > - `@coderabbitai resume` to resume automatic reviews. > - `@coderabbitai review` to trigger a single review. > > Use the checkboxes below for quick actions: > - [ ] <!-- {"checkboxId":"7f6cc2e2-2e4e-497a-8c31-c9e4573e93d1"} --> Resume reviews > - [ ] <!-- {"checkboxId":"e9bb8d72-00e8-4f67-9cb2-caf3b22574fe"} --> Trigger review <!-- end of auto-generated comment: review paused by coderabbit.ai --> <!-- walkthrough_start --> <details> <summary><strong>Walkthrough</strong></summary> <dl> <dd> <br> The change adds an FP32 denormal-preservation setting to the graphics context and SPIR-V profile. Vulkan device support and compute float mode determine whether the emitter enables preservation. The emitter conditionally flushes values in multiply-add, reciprocal, and exponential operations, and adds the SPIR-V capability and execution mode when enabled. Compute and shader configuration tests cover host support, emitted modes, and operation results. **Suggested reviewers:** `nmzik` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> <!-- change_assessment_commit:"252925add501383495b2383186c78875fc090bef" --> <!-- change_assessment_priority:{"version":1,"urgency":"p2","manual":false} --> **Change:** Bug fix <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-unassessed-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minimal</strong> · up to <code>25292</code></summary> <dl> <dd> <br> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **⚪ Minimal** · up to `25292` --> <!-- final_review_risk_coverage:{"sourceCommitId":"252925add501383495b2383186c78875fc090bef","coveredCommitId":"252925add501383495b2383186c78875fc090bef","kind":"reviewed"} --> This change preserves FP32 denormals for compute shaders that request it, and only on hosts that support it. Other hosts and modes are unchanged. FP64 compute shaders in this float mode were already unsupported before this PR, so no new merge-blocking risk is introduced. <!-- final_review_risk_end --> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_start --> <details> <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 4</strong></summary> <dl> <dd> <br> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title names the main change: preserving f32 denormals in compute shaders when the guest FLOAT_MODE keeps them. It matches the changeset (denorm_preserve_f32 profile flag, DenormPreserve 32 executi… | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description explains the problem (FLOAT_MODE 0xf0 with FP_DENORM[5:4] = 3 and host flushing of f32 denormals), the device capability plumbing through Spirv::Profile, the SPIR-V DenormPreserve 32 d… | | Linked Issues check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | <details> <summary><strong>Full details: Title check</strong></summary> <dl> <dd> <br> **Explanation** The title names the main change: preserving f32 denormals in compute shaders when the guest FLOAT_MODE keeps them. It matches the changeset (denorm_preserve_f32 profile flag, DenormPreserve 32 execution mode, and flush handling for MAD, RCP, and EXP), and it is concise and specific. </dd> </dl> </details> <details> <summary><strong>Full details: Description check</strong></summary> <dl> <dd> <br> **Explanation** The description explains the problem (FLOAT_MODE 0xf0 with FP_DENORM[5:4] = 3 and host flushing of f32 denormals), the device capability plumbing through Spirv::Profile, the SPIR-V DenormPreserve 32 declaration, the retained flushes for MAD, RCP, and EXP, and the tests added and run. It directly describes the changed files. </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- operational_warnings_start --> <!-- This is an auto-generated comment: all tool run failures by coderabbit.ai --> > [!WARNING] > Some tools did not complete. Review the errors below. > > <details> > <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/wrench-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/wrench.svg" width="16" height="16" align="absmiddle" alt=""></picture> Cppcheck (2.22.0)</strong></summary> > <dl> > <dd> > <br> > > Cppcheck (2.22.0) exceeded its 180-second time budget. Findings from completed work are retained; remaining checks are incomplete. > > <details> > <summary><strong>tests/shaderCfgTests.cpp</strong></summary> > <dl> > <dd> > <br> > > Cppcheck interrupted; analysis of this file is incomplete > > </dd> > </dl> > </details> > > </dd> > </dl> > </details> <!-- end of auto-generated comment: all tool run failures by coderabbit.ai --> <!-- operational_warnings_end --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=1619)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary><strong>Share</strong></summary> <dl> <dd> <br> - [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) </dd> </dl> </details> <!-- tips_end -->
Author
Owner

@⁠NeySlim on GitHub · 2026-10-17 23:09 UTC · original

RADV data point: Radeon 8060S (RDNA 3.5), Mesa 26.2.4, against 763d3be3. RADV reports shaderDenormPreserveFloat32 = true with SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY, so the new tests run and are not skipped. Without the DenormPreserve 32 execution mode, VectorF32DenormsPreservedWhenRequested gets 0 for all four results; with the PR both new tests pass and the rest of the suite is unchanged.

**@⁠NeySlim** on GitHub · 2026-10-17 23:09 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1619#issuecomment-6242863585) RADV data point: Radeon 8060S (RDNA 3.5), Mesa 26.2.4, against 763d3be3. RADV reports `shaderDenormPreserveFloat32 = true` with `SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY`, so the new tests run and are not skipped. Without the `DenormPreserve 32` execution mode, `VectorF32DenormsPreservedWhenRequested` gets 0 for all four results; with the PR both new tests pass and the rest of the suite is unchanged.
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-28 20:39 UTC · original · reviewed

Nitpick comments: 1
src/graphics/shader/recompiler/backend/spirv/spirvEmitterModule.cpp: 1

862-863: Trivial · Functional Correctness · Heavy lift

Handle FP64 conversions before extending float_mode == 0xf0.

A compute shader with an FP64 instruction and float_mode == 0xf0 can still exit at this guard. The guard predates this PR, so this is not a newly introduced regression.

0xf0 preserves the FP64 denormal bits from 0xc0 but changes the FP32 denormal mode. If this PR should support that combination, narrow the guard to the supported FP64/mode combinations and update EmitConvertF32F64 and EmitConvertF64F32. Both currently flush FP32 denormals unconditionally, while the AMD ISA states that these conversions support denormals. Do not remove the guard without updating these conversions.


Review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between c39c769233d247aa93b346e12580679d748f7820 and 8fe0ac70cf52be99b76a5d3c679837531c148e09.

Files selected for processing: 11
  • src/graphics/host_gpu/graphicContext.h
  • src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
  • src/graphics/presentation/window/vulkanWindow.cpp
  • src/graphics/shader/recompiler/backend/spirv/SpirvEmitter.cpp
  • src/graphics/shader/recompiler/backend/spirv/SpirvEmitter.h
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterAlu.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterInternal.h
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterModule.cpp
  • src/graphics/shader/recompiler/ir/Serialize.h
  • tests/ShaderRecompilerComputeTests.cpp
  • tests/shaderCfgTests.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-10-28 20:39 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1619#pullrequestreview-5689388560) · **reviewed** <!-- coderabbit-ai-generated:v1 --> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/brush-cleaning-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/brush-cleaning.svg" width="16" height="16" align="absmiddle" alt=""></picture> Nitpick comments: 1</summary><blockquote> <dl> <dd> <details> <summary>src/graphics/shader/recompiler/backend/spirv/spirvEmitterModule.cpp: 1</summary><blockquote> <dl> <dd> `862-863`: **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/neutral-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Trivial** · **Functional Correctness** · **Heavy lift** **Handle FP64 conversions before extending `float_mode == 0xf0`.** A compute shader with an FP64 instruction and `float_mode == 0xf0` can still exit at this guard. The guard predates this PR, so this is not a newly introduced regression. `0xf0` preserves the FP64 denormal bits from `0xc0` but changes the FP32 denormal mode. If this PR should support that combination, narrow the guard to the supported FP64/mode combinations and update `EmitConvertF32F64` and `EmitConvertF64F32`. Both currently flush FP32 denormals unconditionally, while the AMD ISA states that these conversions support denormals. Do not remove the guard without updating these conversions. <!-- cr-comment:v1:459b7dded86151a3bffa1796 --> </dd> </dl> </blockquote></details> </dd> </dl> </blockquote></details> --- <details> <summary><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="16" height="16" align="absmiddle" alt=""></picture> Review info</summary> <dl> <dd> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</summary> <dl> <dd> - **Source mode**: Auto - **Repository**: [KytyPS5/KytyPS5](<https://github.com/KytyPS5/KytyPS5>) - **Branch**: [main](<https://github.com/KytyPS5/KytyPS5/tree/main>) - **File**: [.coderabbit.yaml](<https://github.com/KytyPS5/KytyPS5/blob/c67352d5d6dc6fc3fd375deed5c1a89b3e33974e/.coderabbit.yaml>) - **Commit**: [c67352d](<https://github.com/KytyPS5/KytyPS5/commit/c67352d5d6dc6fc3fd375deed5c1a89b3e33974e>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `b05ba456-034d-407d-bd02-191a39db4a67` </dd> </dl> </details> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</summary> <dl> <dd> Reviewing files that changed from the base of the PR and between c39c769233d247aa93b346e12580679d748f7820 and 8fe0ac70cf52be99b76a5d3c679837531c148e09. </dd> </dl> </details> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 11</summary> <dl> <dd> * `src/graphics/host_gpu/graphicContext.h` * `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp` * `src/graphics/presentation/window/vulkanWindow.cpp` * `src/graphics/shader/recompiler/backend/spirv/SpirvEmitter.cpp` * `src/graphics/shader/recompiler/backend/spirv/SpirvEmitter.h` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterAlu.cpp` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterInternal.h` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterModule.cpp` * `src/graphics/shader/recompiler/ir/Serialize.h` * `tests/ShaderRecompilerComputeTests.cpp` * `tests/shaderCfgTests.cpp` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. </dd> </dl> </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=a5842efc-1a24-4ccb-8852-7eeb446f5685 attempt=51707e26-1a74-43a6-9cb5-fa8014bdfaeb batch=1/1 -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-22 20:51 UTC · original · reviewed

Minor comments: 1

src/graphics/shader/recompiler/backend/spirv/spirvEmitterModule.cpp: 1

864-865: Minor · Functional Correctness · Poor tradeoff

FP64 compute shaders with float_mode 0xf0 do not receive the new FP32 denorm mode.

The EXIT_NOT_IMPLEMENTED guard at lines 864-865 predates this PR and is unchanged. A compute shader that uses FP64 with float_mode 0xf0 aborts at this guard. The new FP32 DenormPreserve mode is therefore never emitted for those shaders. This behavior was already present, and this PR does not introduce a new abort.

If FP64 compute coverage is intended, the guard needs a defined FP64 behavior for mode 0xf0 before it can change. The current FP64 path is written for mode 0xc0 and keeps FP64 denormal preservation disabled. Define that behavior first, then update the guard to match.

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 15f97f1e397ebb84036e98c84812bb5a71d9f23b and 252925add5.

Files selected for processing: 9

  • src/graphics/host_gpu/graphicContext.h
  • src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
  • src/graphics/presentation/window/vulkanWindow.cpp
  • src/graphics/shader/recompiler/backend/spirv/SpirvEmitter.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterInternal.h
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterModule.cpp
  • src/graphics/shader/recompiler/ir/Serialize.h
  • tests/ShaderRecompilerComputeTests.cpp
  • tests/shaderCfgTests.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-11-22 20:51 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1619#pullrequestreview-6014469481) · **reviewed** <!-- coderabbit-ai-generated:v1 --> <details> <summary><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/amber-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minor comments: 1</summary><blockquote> <dl> <dd> <br> <details> <summary>src/graphics/shader/recompiler/backend/spirv/spirvEmitterModule.cpp: 1</summary><blockquote> <dl> <dd> <br> `864-865`: **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/amber-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minor** · **Functional Correctness** · **Poor tradeoff** **FP64 compute shaders with `float_mode` 0xf0 do not receive the new FP32 denorm mode.** The `EXIT_NOT_IMPLEMENTED` guard at lines 864-865 predates this PR and is unchanged. A compute shader that uses FP64 with `float_mode` 0xf0 aborts at this guard. The new FP32 `DenormPreserve` mode is therefore never emitted for those shaders. This behavior was already present, and this PR does not introduce a new abort. If FP64 compute coverage is intended, the guard needs a defined FP64 behavior for mode 0xf0 before it can change. The current FP64 path is written for mode 0xc0 and keeps FP64 denormal preservation disabled. Define that behavior first, then update the guard to match. <!-- cr-comment:v1:4b241e6c9fd23734fd492b92 --> </dd> </dl> </blockquote></details> </dd> </dl> </blockquote></details> <h6> <details> <summary><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Review info</summary> <dl> <dd> <br> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</summary> <dl> <dd> <br> - **Source mode**: Auto - **Repository**: [KytyPS5/KytyPS5](<https://github.com/KytyPS5/KytyPS5>) - **Branch**: [main](<https://github.com/KytyPS5/KytyPS5/tree/main>) - **File**: [.coderabbit.yaml](<https://github.com/KytyPS5/KytyPS5/blob/a0b083c85293d55a48b4f8774285415c29d78c8b/.coderabbit.yaml>) - **Commit**: [a0b083c](<https://github.com/KytyPS5/KytyPS5/commit/a0b083c85293d55a48b4f8774285415c29d78c8b>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `c9be52b1-efd1-4732-ab73-52bb5b18d94c` </dd> </dl> </details> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</summary> <dl> <dd> <br> Reviewing files that changed from the base of the PR and between 15f97f1e397ebb84036e98c84812bb5a71d9f23b and 252925add501383495b2383186c78875fc090bef. </dd> </dl> </details> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 9</summary> <dl> <dd> <br> * `src/graphics/host_gpu/graphicContext.h` * `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp` * `src/graphics/presentation/window/vulkanWindow.cpp` * `src/graphics/shader/recompiler/backend/spirv/SpirvEmitter.cpp` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterInternal.h` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterModule.cpp` * `src/graphics/shader/recompiler/ir/Serialize.h` * `tests/ShaderRecompilerComputeTests.cpp` * `tests/shaderCfgTests.cpp` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. </dd> </dl> </details> </h6> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=66c4a813-dff8-42dd-8046-b9c1f05b4655 attempt=71bf5ad4-934c-49ca-a1cd-f0d17c800c13 batch=1/1 -->
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1619/head:github-bot/gh-1619'
git switch 'github-bot/gh-1619'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1619'
git switch 'github-bot/gh-1619'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1619'
git switch 'github-bot/gh-1619'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1619'
git switch 'main'
git merge --squash 'github-bot/gh-1619'
git switch 'main'
git merge --ff-only 'github-bot/gh-1619'
git switch 'main'
git merge 'github-bot/gh-1619'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.