test(agc): accept any NaN encoding in f16 FMA denormal modes #7109

Closed
akkadbakkad89 wants to merge 1 commit from upstream-pr/7109 into main
akkadbakkad89 commented 2026-10-17 12:01:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-17T12:01:44Z.


What

Fixes the NVIDIA failures in agc_driver_f16_fma_denormal_modes and agc_driver_fma_mix_f16_denormal_modes reported in #7100. The expected tables record AMD's NaN encodings for invalid FMA operations (0xfe00 for f16, 0xffc00000 for f32); NVIDIA returns different, equally valid NaN encodings (0x7fff, 0x7fffffff). Both tests now follow the existing Float16ResultModifiers idiom: exact bit equality when the expected value is not NaN, and any NaN encoding when it is. IsNan16/SameHalf cover the f16 test; IsNan32/SameFloat cover the f32-only v_fma_mix_f32 forms. No recompiler changes: sign/payload of an invalid-operation NaN is device-defined, and the tests' non-NaN rows (including 0x7c00 infinity) still require exact bits.

Tested

  • RTX 3070, driver 617.42, Windows 11, MinGW (WinLibs GCC 15.2.0): both tests failed on current main exactly as the issue describes (v_fma_f16 ... is 0x7fff, expected 0xfe00; v_fma_mix_f32 ... is 0x7fffffff, expected 0xffc00000) and pass with this change.
  • RTX 3070: full f16/FMA/denormal sibling run, 43/43 pass.
  • WSL2 lavapipe/llvmpipe (LLVM 20.1.2): both tests pass.

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 under Silent stubs in their library's technical debt file
  • 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
  • Fixes: Fixes #7100
  • Unblocks: none
  • GPUs tested: NVIDIA RTX 3070, driver 617.42, Windows 11; lavapipe/llvmpipe on WSL2
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4899881742 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7109). Originally posted by [akkadbakkad89](https://github.com/akkadbakkad89) on 2026-10-17T12:01:44Z. --- ### What Fixes the NVIDIA failures in `agc_driver_f16_fma_denormal_modes` and `agc_driver_fma_mix_f16_denormal_modes` reported in #7100. The expected tables record AMD's NaN encodings for invalid FMA operations (`0xfe00` for f16, `0xffc00000` for f32); NVIDIA returns different, equally valid NaN encodings (`0x7fff`, `0x7fffffff`). Both tests now follow the existing `Float16ResultModifiers` idiom: exact bit equality when the expected value is not NaN, and any NaN encoding when it is. `IsNan16`/`SameHalf` cover the f16 test; `IsNan32`/`SameFloat` cover the f32-only `v_fma_mix_f32` forms. No recompiler changes: sign/payload of an invalid-operation NaN is device-defined, and the tests' non-NaN rows (including `0x7c00` infinity) still require exact bits. ### Tested - RTX 3070, driver 617.42, Windows 11, MinGW (WinLibs GCC 15.2.0): both tests failed on current main exactly as the issue describes (`v_fma_f16 ... is 0x7fff, expected 0xfe00`; `v_fma_mix_f32 ... is 0x7fffffff, expected 0xffc00000`) and pass with this change. - RTX 3070: full f16/FMA/denormal sibling run, 43/43 pass. - WSL2 lavapipe/llvmpipe (LLVM 20.1.2): both tests pass. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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] Fixes: Fixes #7100 - [x] Unblocks: none - [x] GPUs tested: NVIDIA RTX 3070, driver 617.42, Windows 11; lavapipe/llvmpipe on WSL2 - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-17 12:16:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T12:16: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
PR 7093 core/libs/prx/libSceAgcDriver/tests/execution/F16FmaDenormalModes.cpp L214
core/libs/prx/libSceAgcDriver/tests/execution/FmaMixF16DenormalModes.cpp L177
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6233778817 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7109#issuecomment-6233778817). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-17T12:16: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 | |---|---|---|---| | [PR 7093](https://www.github.com/boykopovar/AnyPS5/pull/7093) | `core/libs/prx/libSceAgcDriver/tests/execution/F16FmaDenormalModes.cpp` [L214](https://github.com/boykopovar/AnyPS5/blob/c9e6c45de9ccccc4f714e153252a8fa48efbf367/core/libs/prx/libSceAgcDriver/tests/execution/F16FmaDenormalModes.cpp#L214)<br>`core/libs/prx/libSceAgcDriver/tests/execution/FmaMixF16DenormalModes.cpp` [L177](https://github.com/boykopovar/AnyPS5/blob/c9e6c45de9ccccc4f714e153252a8fa48efbf367/core/libs/prx/libSceAgcDriver/tests/execution/FmaMixF16DenormalModes.cpp#L177) | | |
akkadbakkad89 commented 2026-10-17 12:22:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-17T12:22:54Z.


Duplicate of #7093, which opened ~30 min before #7100 was filed (same approach: accept any NaN where the expectation is NaN). Validated that head e5b4b326c passes both tests on an RTX 3070 — posted the datapoint there. Closing in favour of the earlier PR.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6233830450 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7109#issuecomment-6233830450). Originally posted by [akkadbakkad89](https://github.com/akkadbakkad89) on 2026-10-17T12:22:54Z. --- Duplicate of #7093, which opened ~30 min before #7100 was filed (same approach: accept any NaN where the expectation is NaN). Validated that head `e5b4b326c` passes both tests on an RTX 3070 — posted the datapoint there. Closing in favour of the earlier PR.

Pull request closed

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!7109
No description provided.