test(shader): accept the split fma sum in F32DenormalFlush #3822

Merged
object05 merged 1 commit from upstream-pr/3822 into main 2026-10-11 22:06:56 +00:00
object05 commented 2026-10-11 17:13:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by object05 on 2026-10-11T17:13:48Z.


What

agc_driver_f32_denormal_flush fails on a device whose driver splits Fma into a multiply and an add:

lane 20 no float mode v_fma_f32 v14, v4, v5, v6 is 0x00800000, expected 0x00ffffff

Lane 20 is 0x1fffffff * 0x1fffffff + 0x00800000. The product is below 2^-126, so the split multiply flushes it and the add returns the addend. It is the only row with a tiny product and a non-zero addend. v_fma_f32 and v_fmac_f32 fail on it in all three float modes; every other check in the test passes.

When both return 0x00800000, the test prints that the device splits fma and does not check those two values. FmaRounding already does the same for its fused forms on such a device. The gap is added to the f32 denormals entry in TechnicalDebt.

#2114 reports the same line with the same values on an Intel UHD 630 on Windows (drivers 30.0.101.1339 and 31.0.101.2141).

Tested

Linux 6.18, GCC 16.2.1, Release, -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON, AMD Radeon Graphics (RADV RENOIR), Mesa 26.2.4.

  • main a11c8f7f7: 837 of 838 tests pass; agc_driver_f32_denormal_flush fails on every run.
  • With the change it passes. agc_driver_fma_rounding and agc_driver_float16_fma_rounding still pass.
  • RADV_DEBUG=shaders: the compiled shader has v_mad_f32 and no v_fma_f32.
  • tools/check_conventions.py --base origin/main passes.
  • Not tested: a device that fuses, Intel, Windows, any title.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4820845199 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3822). Originally posted by [object05](https://github.com/object05) on 2026-10-11T17:13:48Z. --- ### What `agc_driver_f32_denormal_flush` fails on a device whose driver splits `Fma` into a multiply and an add: ``` lane 20 no float mode v_fma_f32 v14, v4, v5, v6 is 0x00800000, expected 0x00ffffff ``` Lane 20 is `0x1fffffff * 0x1fffffff + 0x00800000`. The product is below 2^-126, so the split multiply flushes it and the add returns the addend. It is the only row with a tiny product and a non-zero addend. `v_fma_f32` and `v_fmac_f32` fail on it in all three float modes; every other check in the test passes. When both return `0x00800000`, the test prints that the device splits fma and does not check those two values. `FmaRounding` already does the same for its fused forms on such a device. The gap is added to the f32 denormals entry in TechnicalDebt. #2114 reports the same line with the same values on an Intel UHD 630 on Windows (drivers 30.0.101.1339 and 31.0.101.2141). ### Tested Linux 6.18, GCC 16.2.1, Release, `-DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON`, AMD Radeon Graphics (RADV RENOIR), Mesa 26.2.4. - `main` a11c8f7f7: 837 of 838 tests pass; `agc_driver_f32_denormal_flush` fails on every run. - With the change it passes. `agc_driver_fma_rounding` and `agc_driver_float16_fma_rounding` still pass. - `RADV_DEBUG=shaders`: the compiled shader has `v_mad_f32` and no `v_fma_f32`. - `tools/check_conventions.py --base origin/main` passes. - Not tested: a device that fuses, Intel, Windows, any title. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-11 18:37:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T18:37:58Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#3895 docs/dev/TechnicalDebt.md L499
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6112343966 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3822#issuecomment-6112343966). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-11T18:37:58Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #3895 | `docs/dev/TechnicalDebt.md` [L499](https://github.com/boykopovar/AnyPS5/blob/1be2ca2028f1caf4640a765941bfca2fae7d53f2/docs/dev/TechnicalDebt.md#L499) | | |
adriadam10 commented 2026-10-11 22:06:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T22:06:49Z.


Checked the diff against FmaRounding.cpp (same split-fma handling), built and ran the libSceAgcDriver tests (390/390, agc_driver_f32_denormal_flush passes on a fusing device). The skip is limited to lane 20's v_fma_f32/v_fmac_f32 and only when both return the split sum; merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114370675 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3822#issuecomment-6114370675). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T22:06:49Z. --- Checked the diff against `FmaRounding.cpp` (same split-fma handling), built and ran the libSceAgcDriver tests (390/390, `agc_driver_f32_denormal_flush` passes on a fusing device). The skip is limited to lane 20's `v_fma_f32`/`v_fmac_f32` and only when both return the split sum; merging.
Sign in to join this conversation.
No reviewers
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
boykopovar/AnyPS5!3822
No description provided.