fix(shader): flush v_fma_f64 and v_div_fmas_f64 denormals by the f64 denormal field #13845

Merged
Deftera186 merged 2 commits from upstream-pr/13845 into main 2026-11-01 04:34:39 +00:00
Deftera186 commented 2026-10-31 09:13:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Deftera186 on 2026-10-31T09:13:52Z.


What

v_fma_f64 and v_div_fmas_f64 ignored the FLOAT_MODE f16/f64 denormal field (bits 7:6): both always kept their denormal operands and results, so a shader compiled with the field flushing (the common 0x40/0x00 modes) got a denormal where the PS5 GPU family writes a signed zero. For example v_fma_f64 of 0x3ff0000000000001 * 0x000fffffffffffff + 0 returned 0x0010000000000000 (the smallest normal) in denormal mode 0, where RDNA3 returns 0x0000000000000000: in mode 0 the denormal operand 0x000fffffffffffff is flushed to +0 before the multiply, so the product is 0.

The lowering now follows the field, matching v_mul_f64/v_add_f64:

  • Bit 0 clear (modes 0 and 2): v_fma_f64 flushes each denormal operand to a zero of its sign (flushF64Bits(.., 0x40), as add/mul do). v_div_fmas_f64 keeps its operands, as measured.
  • Bit 1 clear (modes 0 and 1): both flush a result whose magnitude, rounded to 53 significant bits with an unbounded exponent, is below 2^-1022 to a zero of the result's sign. Tininess is judged after rounding, not before: 0x2000000000000001 * 0x1ffffffffffffffe is exactly 2^-1022 - 2^-1126, which rounds to 2^-1022 and is kept, while 0x1fffffffffffffff * 0x2000000000000000 is exactly 2^-1022 - 2^-1075, below 2^-1022 after rounding, and is flushed. For v_div_fmas_f64 the test is applied to the final result after the VCC scale by 2^±128.
  • Mode 3 and shaders without a known float mode keep the previous lowering.

docs/dev/debt/shader.md said the field is not read and that v_fma_f64 flushes with tininess before rounding, an RDNA2 (gfx1035) note without published rows. This removes that sentence, drops v_fma_f64 and v_div_fmas_f64 from the add/mul entry's "keep the previous lowering" list, and adds a gap-first entry for the measured rule. The two disagree on one kind of row: 0x2000000000000001 * 0x1ffffffffffffffe is exactly 2^-1022 - 2^-1126, which gfx1101 rounds to 2^-1022 and keeps, while tininess before rounding would flush it. The rule measured here is the one the add/mul entry already records for v_mul_f64 on RDNA2 (gfx1031); v_fma_f64 on RDNA2 is not re-measured.

The tininess test recomputes the fma scaled up by 2^64 through the existing integer-exact FPFmaScale64 emitter (scale 64 for v_fma_f64, power + 64 for v_div_fmas_f64, where power is the VCC scale) and compares the magnitude with 2^-958 (2^64 * 2^-1022), the same shape as the v_mul_f64 path. Signaling-NaN quieting is unchanged; it is governed by IEEE mode, not the denormal field, and is out of scope here.

Exactness of the scaled recomputation: FPFmaScale64 computes fma(a, b, c) once-rounded with the scale added to the final exponent (it is the integer bit-exact multiply-add already used for the division sequence), so FPFmaScale64(a, b, c, k + 64) is fma(a, b, c) * 2^(k+64) with a single rounding and an unbounded intermediate exponent, which is the value the hardware's tininess decision uses. Scaling by 2^64 cannot create a false "tiny": if the true result is >= 2^-958 the scaled magnitude is >= 2^-958 and the test fails; if scaling overflows to infinity the true result was >= 2^958 > 2^-1022 and is never tiny; a NaN result has magnitude >= 0x7ff0000000000001, fails the < 2^-958 test, and is left unchanged. A zero result has magnitude 0, magnitude - 1 wraps above the threshold, and is not flushed, so an exact zero keeps its sign. No operand is scaled individually, so there is no per-operand overflow case.

Sources:

  • Hardware measurements on RDNA3 (gfx1101, Radeon RX 7700 XT) with tools/hw-oracle, below; not measured on the PS5's gfx1013 or on RDNA2.
  • The kept-mode behaviour (round once, IEEE 754 fusedMultiplyAdd with denormals preserved) is the existing FPFma64/FPFmaScale64 lowering and is unchanged.

Tested

Measured on RDNA3 (gfx1101, Radeon RX 7700 XT) with tools/hw-oracle; not measured on the PS5's gfx1013 or on RDNA2. FLOAT_MODE denorm16 field 0..3 (bytes 0x30/0x70/0xb0/0xf0), IEEE 0 and 1, DX10_CLAMP 1, round-to-nearest-even; every row below is identical at IEEE 0 and IEEE 1.

  • Hardware model (full sweep; script and per-row results available on request): the fixed recompiler and unfixed main are compared with the oracle over 300 random f64 triples (biased to denormals and small exponents) in all 8 modes, for v_fma_f64, v_div_fmas_f64 with VCC clear and VCC set. Result: fixed 0 mismatches in scope for all three; main had 180 (v_fma_f64), 116 (v_div_fmas_f64 VCC clear) and 84 (v_div_fmas_f64 VCC set). Excluded, 60 rows each: signaling-NaN inputs whose quieting depends on IEEE mode, not the denormal field; on those the fixed and the main recompiler agree, so the fix changes nothing there. inf * denormal rows where the (correct) input flush turns inf * 0 into the default NaN are counted as fixes, not exclusions; the fixed recompiler matches the hardware on them.
  • Red/green: with Float64Instructions.cpp and TranslationContext.hpp reverted to origin/main and the new test present, agc_driver_f64_fma_denormal_modes fails at the first row: v_fma_f64 f64 denormal mode 0, IEEE mode on of 0x3ff0000000000001, 0x000fffffffffffff and 0x0000000000000000 is 0x0010000000000000, expected 0x0000000000000000. With the fix restored it passes (0 device-dependent results skipped on RADV).
  • Paired validation-layer runs (VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1, VK_LOADER_DEBUG=layer), same build dir, regex = the new test plus agc_driver_f64_fma_subnormals, agc_driver_f64_denorm_preserve_spirv (a SPIR-V check that creates no Vulkan instance), agc_driver_f64_division, agc_driver_f64_division_modifiers, agc_driver_division_result_modifiers, agc_driver_f64_arithmetic, agc_driver_f64_add_mul_denormal_modes:
    • State A (fix reverted, test present): only agc_driver_f64_fma_denormal_modes fails; the other 7 pass. Layer inserted 7, missing-layer line 0, VUID- 0.
    • State B (fix): all 8 pass. Layer inserted 7, missing-layer line 0, VUID- 0. B's VUID count (0) does not exceed A's (0).
  • lavapipe (CI parity, Ubuntu 24.04 container, gcc 13, Release, SPIRV-Tools on): all 8 tests pass on llvmpipe (LLVM 20.1.2, Mesa 25.2.8); agc_driver_f64_fma_denormal_modes takes 0.78 s, the slowest (agc_driver_f64_arithmetic) 3.41 s.

New execution test core/libs/prx/libSceAgcDriver/tests/execution/F64FmaDenormalModes.cpp (ctest agc_driver_f64_fma_denormal_modes): 8 lanes per case, three cases (v_fma_f64, v_div_fmas_f64 with VCC clear, v_div_fmas_f64 with VCC set), each run in the 9 modes (no known float mode + fields 0..3 at IEEE 0 and 1) with per-field expected tables from the hardware. Rows use three independent operands and cover the discriminators above. It keeps the Float64 capability skip and the device-dependent skip for a device that flushes f64 denormals without float64DenormPreserve, as the neighbouring F64AddMulDenormalModes.cpp does.

v_fma_f64 hardware results, FLOAT_MODE IEEE 0 or 1 / DX10_CLAMP 1, one column per denormal field (identical at IEEE 0 and 1):

a b c field 0 field 1 field 2 field 3
0x3ff0000000000001 0x000fffffffffffff 0x0000000000000000 0x0000000000000000 0x0010000000000000 0x0000000000000000 0x0010000000000000
0x2000000000000001 0x1ffffffffffffffe 0x0000000000000000 0x0010000000000000 0x0010000000000000 0x0010000000000000 0x0010000000000000
0x1fffffffffffffff 0x2000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0010000000000000 0x0010000000000000
0x2000000000000000 0x1ff0000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0008000000000000 0x0008000000000000
0x000fffffffffffff 0x4000000000000000 0x8000000000000000 0x0000000000000000 0x001ffffffffffffe 0x0000000000000000 0x001ffffffffffffe
0x3ff0000000000000 0x0008000000000000 0x0008000000000001 0x0000000000000000 0x0010000000000001 0x0000000000000000 0x0010000000000001
0x4000000000000000 0x0008000000000000 0x8008000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0008000000000000
0x3ff8000000000000 0x0007555555555556 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x000b000000000001

Row 1 (c = +0) is the input-flush discriminator: in fields 0 and 2 operand b is flushed to +0, so the product is 0; in fields 1 and 3 the product 2^-1022 + ... is kept. Rows 2 and 3 are the tininess-after-rounding discriminators: 2^-1022 - 2^-1126 rounds up to the smallest normal and is kept in every mode, while 2^-1022 - 2^-1075 stays below 2^-1022 and is flushed in fields 0 and 1. v_div_fmas_f64 with VCC clear keeps row 1's product (no input flush) and flushes the same tiny results by bit 1; with VCC set the tininess is measured on the result after the 2^±128 scale. The full v_div_fmas_f64 tables are in the test.

GPUs tested: AMD Radeon RX 7700 XT (gfx1101), RADV, Mesa 26.2.4, Gentoo Linux (kernel 7.2.11); llvmpipe (LLVM 20.1.2), Mesa 25.2.8, Ubuntu 24.04 container with the Linux CI configuration.

docs/dev/debt/shader.md line 122 is also edited by #11483 (its DenormPreserve sentence); the sentences differ, the merge is a one-line text conflict.

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: none
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 7700 XT (gfx1101), RADV, Mesa 26.2.4, Gentoo Linux (kernel 7.2.11); llvmpipe (LLVM 20.1.2), Mesa 25.2.8, Ubuntu 24.04 container with the Linux CI configuration
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5096223754 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13845). Originally posted by [Deftera186](https://github.com/Deftera186) on 2026-10-31T09:13:52Z. --- ### What `v_fma_f64` and `v_div_fmas_f64` ignored the `FLOAT_MODE` f16/f64 denormal field (bits 7:6): both always kept their denormal operands and results, so a shader compiled with the field flushing (the common `0x40`/`0x00` modes) got a denormal where the PS5 GPU family writes a signed zero. For example `v_fma_f64` of `0x3ff0000000000001 * 0x000fffffffffffff + 0` returned `0x0010000000000000` (the smallest normal) in denormal mode 0, where RDNA3 returns `0x0000000000000000`: in mode 0 the denormal operand `0x000fffffffffffff` is flushed to +0 before the multiply, so the product is 0. The lowering now follows the field, matching `v_mul_f64`/`v_add_f64`: - Bit 0 clear (modes 0 and 2): `v_fma_f64` flushes each denormal operand to a zero of its sign (`flushF64Bits(.., 0x40)`, as add/mul do). `v_div_fmas_f64` keeps its operands, as measured. - Bit 1 clear (modes 0 and 1): both flush a result whose magnitude, rounded to 53 significant bits with an unbounded exponent, is below `2^-1022` to a zero of the result's sign. Tininess is judged after rounding, not before: `0x2000000000000001 * 0x1ffffffffffffffe` is exactly `2^-1022 - 2^-1126`, which rounds to `2^-1022` and is kept, while `0x1fffffffffffffff * 0x2000000000000000` is exactly `2^-1022 - 2^-1075`, below `2^-1022` after rounding, and is flushed. For `v_div_fmas_f64` the test is applied to the final result after the VCC scale by `2^±128`. - Mode 3 and shaders without a known float mode keep the previous lowering. `docs/dev/debt/shader.md` said the field is not read and that `v_fma_f64` flushes with tininess before rounding, an RDNA2 (gfx1035) note without published rows. This removes that sentence, drops `v_fma_f64` and `v_div_fmas_f64` from the add/mul entry's "keep the previous lowering" list, and adds a gap-first entry for the measured rule. The two disagree on one kind of row: `0x2000000000000001 * 0x1ffffffffffffffe` is exactly 2^-1022 - 2^-1126, which gfx1101 rounds to 2^-1022 and keeps, while tininess before rounding would flush it. The rule measured here is the one the add/mul entry already records for `v_mul_f64` on RDNA2 (gfx1031); `v_fma_f64` on RDNA2 is not re-measured. The tininess test recomputes the fma scaled up by `2^64` through the existing integer-exact `FPFmaScale64` emitter (scale `64` for `v_fma_f64`, `power + 64` for `v_div_fmas_f64`, where `power` is the VCC scale) and compares the magnitude with `2^-958` (`2^64 * 2^-1022`), the same shape as the `v_mul_f64` path. Signaling-NaN quieting is unchanged; it is governed by IEEE mode, not the denormal field, and is out of scope here. Exactness of the scaled recomputation: `FPFmaScale64` computes `fma(a, b, c)` once-rounded with the scale added to the final exponent (it is the integer bit-exact multiply-add already used for the division sequence), so `FPFmaScale64(a, b, c, k + 64)` is `fma(a, b, c) * 2^(k+64)` with a single rounding and an unbounded intermediate exponent, which is the value the hardware's tininess decision uses. Scaling by `2^64` cannot create a false "tiny": if the true result is `>= 2^-958` the scaled magnitude is `>= 2^-958` and the test fails; if scaling overflows to infinity the true result was `>= 2^958 > 2^-1022` and is never tiny; a NaN result has magnitude `>= 0x7ff0000000000001`, fails the `< 2^-958` test, and is left unchanged. A zero result has magnitude 0, `magnitude - 1` wraps above the threshold, and is not flushed, so an exact zero keeps its sign. No operand is scaled individually, so there is no per-operand overflow case. Sources: - Hardware measurements on RDNA3 (gfx1101, Radeon RX 7700 XT) with tools/hw-oracle, below; not measured on the PS5's gfx1013 or on RDNA2. - The kept-mode behaviour (round once, IEEE 754 `fusedMultiplyAdd` with denormals preserved) is the existing `FPFma64`/`FPFmaScale64` lowering and is unchanged. ### Tested Measured on RDNA3 (gfx1101, Radeon RX 7700 XT) with tools/hw-oracle; not measured on the PS5's gfx1013 or on RDNA2. FLOAT_MODE denorm16 field 0..3 (bytes `0x30`/`0x70`/`0xb0`/`0xf0`), IEEE 0 and 1, DX10_CLAMP 1, round-to-nearest-even; every row below is identical at IEEE 0 and IEEE 1. - Hardware model (full sweep; script and per-row results available on request): the fixed recompiler and unfixed `main` are compared with the oracle over 300 random f64 triples (biased to denormals and small exponents) in all 8 modes, for `v_fma_f64`, `v_div_fmas_f64` with VCC clear and VCC set. Result: fixed `0` mismatches in scope for all three; `main` had `180` (`v_fma_f64`), `116` (`v_div_fmas_f64` VCC clear) and `84` (`v_div_fmas_f64` VCC set). Excluded, `60` rows each: signaling-NaN inputs whose quieting depends on IEEE mode, not the denormal field; on those the fixed and the `main` recompiler agree, so the fix changes nothing there. `inf * denormal` rows where the (correct) input flush turns `inf * 0` into the default NaN are counted as fixes, not exclusions; the fixed recompiler matches the hardware on them. - Red/green: with `Float64Instructions.cpp` and `TranslationContext.hpp` reverted to `origin/main` and the new test present, `agc_driver_f64_fma_denormal_modes` fails at the first row: `v_fma_f64 f64 denormal mode 0, IEEE mode on of 0x3ff0000000000001, 0x000fffffffffffff and 0x0000000000000000 is 0x0010000000000000, expected 0x0000000000000000`. With the fix restored it passes (`0` device-dependent results skipped on RADV). - Paired validation-layer runs (`VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1`, `VK_LOADER_DEBUG=layer`), same build dir, regex = the new test plus `agc_driver_f64_fma_subnormals`, `agc_driver_f64_denorm_preserve_spirv` (a SPIR-V check that creates no Vulkan instance), `agc_driver_f64_division`, `agc_driver_f64_division_modifiers`, `agc_driver_division_result_modifiers`, `agc_driver_f64_arithmetic`, `agc_driver_f64_add_mul_denormal_modes`: - State A (fix reverted, test present): only `agc_driver_f64_fma_denormal_modes` fails; the other 7 pass. Layer inserted 7, missing-layer line 0, `VUID-` 0. - State B (fix): all 8 pass. Layer inserted 7, missing-layer line 0, `VUID-` 0. B's VUID count (0) does not exceed A's (0). - lavapipe (CI parity, Ubuntu 24.04 container, gcc 13, Release, SPIRV-Tools on): all 8 tests pass on llvmpipe (LLVM 20.1.2, Mesa 25.2.8); `agc_driver_f64_fma_denormal_modes` takes 0.78 s, the slowest (`agc_driver_f64_arithmetic`) 3.41 s. New execution test `core/libs/prx/libSceAgcDriver/tests/execution/F64FmaDenormalModes.cpp` (ctest `agc_driver_f64_fma_denormal_modes`): 8 lanes per case, three cases (`v_fma_f64`, `v_div_fmas_f64` with VCC clear, `v_div_fmas_f64` with VCC set), each run in the 9 modes (no known float mode + fields 0..3 at IEEE 0 and 1) with per-field expected tables from the hardware. Rows use three independent operands and cover the discriminators above. It keeps the `Float64` capability skip and the device-dependent skip for a device that flushes f64 denormals without `float64DenormPreserve`, as the neighbouring `F64AddMulDenormalModes.cpp` does. `v_fma_f64` hardware results, FLOAT_MODE IEEE 0 or 1 / DX10_CLAMP 1, one column per denormal field (identical at IEEE 0 and 1): | a | b | c | field 0 | field 1 | field 2 | field 3 | |---|---|---|---|---|---|---| | `0x3ff0000000000001` | `0x000fffffffffffff` | `0x0000000000000000` | `0x0000000000000000` | `0x0010000000000000` | `0x0000000000000000` | `0x0010000000000000` | | `0x2000000000000001` | `0x1ffffffffffffffe` | `0x0000000000000000` | `0x0010000000000000` | `0x0010000000000000` | `0x0010000000000000` | `0x0010000000000000` | | `0x1fffffffffffffff` | `0x2000000000000000` | `0x0000000000000000` | `0x0000000000000000` | `0x0000000000000000` | `0x0010000000000000` | `0x0010000000000000` | | `0x2000000000000000` | `0x1ff0000000000000` | `0x0000000000000000` | `0x0000000000000000` | `0x0000000000000000` | `0x0008000000000000` | `0x0008000000000000` | | `0x000fffffffffffff` | `0x4000000000000000` | `0x8000000000000000` | `0x0000000000000000` | `0x001ffffffffffffe` | `0x0000000000000000` | `0x001ffffffffffffe` | | `0x3ff0000000000000` | `0x0008000000000000` | `0x0008000000000001` | `0x0000000000000000` | `0x0010000000000001` | `0x0000000000000000` | `0x0010000000000001` | | `0x4000000000000000` | `0x0008000000000000` | `0x8008000000000000` | `0x0000000000000000` | `0x0000000000000000` | `0x0000000000000000` | `0x0008000000000000` | | `0x3ff8000000000000` | `0x0007555555555556` | `0x0000000000000000` | `0x0000000000000000` | `0x0000000000000000` | `0x0000000000000000` | `0x000b000000000001` | Row 1 (`c = +0`) is the input-flush discriminator: in fields 0 and 2 operand `b` is flushed to +0, so the product is 0; in fields 1 and 3 the product `2^-1022 + ...` is kept. Rows 2 and 3 are the tininess-after-rounding discriminators: `2^-1022 - 2^-1126` rounds up to the smallest normal and is kept in every mode, while `2^-1022 - 2^-1075` stays below `2^-1022` and is flushed in fields 0 and 1. `v_div_fmas_f64` with VCC clear keeps row 1's product (no input flush) and flushes the same tiny results by bit 1; with VCC set the tininess is measured on the result after the `2^±128` scale. The full `v_div_fmas_f64` tables are in the test. GPUs tested: AMD Radeon RX 7700 XT (gfx1101), RADV, Mesa 26.2.4, Gentoo Linux (kernel 7.2.11); llvmpipe (LLVM 20.1.2), Mesa 25.2.8, Ubuntu 24.04 container with the Linux CI configuration. `docs/dev/debt/shader.md` line 122 is also edited by #11483 (its DenormPreserve sentence); the sentences differ, the merge is a one-line text conflict. ### 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: none - [x] Unblocks: none - [x] GPUs tested: AMD Radeon RX 7700 XT (gfx1101), RADV, Mesa 26.2.4, Gentoo Linux (kernel 7.2.11); llvmpipe (LLVM 20.1.2), Mesa 25.2.8, Ubuntu 24.04 container with the Linux CI configuration - [x] AI-assisted: yes
MarcZX10 commented 2026-10-31 09:22:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T09:22:10Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The code change pins f64 FMA denormal behavior to gfx1101 results despite an unresolved earlier gfx1035 result and no RDNA2 measurement, and the PR also conflicts with open PR #11483 while declaring no dependency.

What I ran

Reviewed head 49198f673f0449e392f4e043486d49cbbba083a7. GitHub reports PR base 809c7fa2dfb1b21e2b31b3114b7d51bc14ee88ab; the current main tip used for fresh checks and the merge preview was 1b917483406cdaeae1d970393bcd21cda5272c9b. The preview against current main was clean. Environment: Linux x86_64, Python 3.11.2, Git 2.39.5; no compiler was invoked.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13845 --no-negative-controls --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13845
git diff --check refs/remotes/upstream/main...refs/remotes/upstream/pr-13845
python3 tools/check_conventions.py --base refs/remotes/upstream/main --head refs/remotes/upstream/pr-13845 --title 'fix(shader): flush v_fma_f64 and v_div_fmas_f64 denormals by the f64 denormal field' --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13845/pr-body.md
git merge-tree --write-tree refs/remotes/upstream/main refs/remotes/upstream/pr-13845
git merge-tree --write-tree refs/remotes/upstream/pr-11483 refs/remotes/upstream/pr-13845
python3 tools/pr_test_quality.py --root /marc/AnyPS5 --json core/libs/prx/libSceAgcDriver/tests/execution/F64FmaDenormalModes.cpp

Results

Check Result
Diff check and conventions Passed against current main.
Merge preview against current main Clean.
Pairwise merge with #11483 Conflicts in docs/dev/debt/shader.md; both PRs replace the same existing debt entry. #11483 is open at head 80cb2cd3acfdcde0abd374bc3f8886b5bd23e092.
Test registration The execution test is found by the existing CMake file(GLOB ... CONFIGURE_DEPENDS ...); the test-quality helper's possible-unregistered warning is a false positive.
No-build precheck Partial: diff, conventions/template, and live mergeability passed. Its isolated checkout lacks local-only pr_abi_audit.py and pr_test_quality.py; ABI auditing is not applicable to these paths.
Local build / focused C++ test Not run; the test requires a build, which is excluded from initial review.
Hosted CI snapshot Eligibility, conventions, portability, intake, labels, report, Ubuntu relinker, and relinker ASan passed. Windows product/relinker jobs were in progress; macOS relinker jobs were queued; Linux product job was skipped.
Selected unedited output

Conventions:

All conventions checks passed.

Merge preview against current main:

9ee6ecc7c83e1b64d84333bc32ff834015d842a9

Pairwise merge with #11483:

CONFLICT (content): Merge conflict in docs/dev/debt/shader.md

Test-quality heuristic:

{
  "findings": [
    {
      "path": "core/libs/prx/libSceAgcDriver/tests/execution/F64FmaDenormalModes.cpp",
      "line": 1,
      "kind": "possible-unregistered-cpp-test",
      "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
    }
  ],
  "negative_control_candidates": [],
  "limits": [
    "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
    "A test that passes against base is not by itself proof that the PR test is inadequate.",
    "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
  ]
}

Precheck helper errors:

/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13845/head-49198f673f04-f612c925/tools/pr_abi_audit.py': [Errno 2] No such file or directory
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13845/head-49198f673f04-f612c925/tools/pr_test_quality.py': [Errno 2] No such file or directory

Negative control

Assertion Mutation Result
The new test distinguishes the old lowering from the proposed f64 FMA flush behavior. Author reports reverting Float64Instructions.cpp and TranslationContext.hpp while retaining the test. Author-reported failure; not independently run here.

Findings

Blocking

  1. RDNA2 behavior is unresolved. The new test and lowering encode tininess-after-rounding for v_fma_f64, based on gfx1101/RDNA3 measurements. The PR says gfx1013 and RDNA2 were not measured, while the previous debt entry records an earlier gfx1035/RDNA2 observation that judged this boundary before rounding. The PR itself says the new rule differs for 0x2000000000000001 * 0x1ffffffffffffffe (the new rule keeps the minimum normal; the earlier rule flushes it). Please provide reproducible rows from RDNA2 hardware or another authoritative, generation-applicable source and reconcile the conflicting observation before encoding the behavior globally.
  2. Undeclared conflicting PR. #11483 is open and changes the same debt entry; a pairwise merge preview confirms a content conflict. This PR's description acknowledges the conflict but its checklist says Depends on: none. Agree which PR lands first, declare that ordering, and update the debt entry on the resulting head.

Suggested checklist correction, if #11483 is to land first:

- [x] Depends on: #11483

Non-blocking

No other source-level defect was confirmed. The submitted RDNA3/RADV and lavapipe results, including the reported negative control, are author-provided and were not independently reproduced here.

Sources

Not verified

No local build, CTest run, or negative control was performed. The PR author reports focused paired hardware runs on gfx1101 and lavapipe, but no PS5 gfx1013 or RDNA2 measurement. Windows jobs were still running and macOS relinker jobs were queued in the latest CI snapshot.

To get this to a good state

Please resolve the RDNA2 behavior evidence and #11483 overlap/dependency, then update the PR. I will rerun the same no-build checks against the new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5722145161 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13845#pullrequestreview-5722145161). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T09:22:10Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The code change pins f64 FMA denormal behavior to gfx1101 results despite an unresolved earlier gfx1035 result and no RDNA2 measurement, and the PR also conflicts with open PR #11483 while declaring no dependency. ## What I ran Reviewed head `49198f673f0449e392f4e043486d49cbbba083a7`. GitHub reports PR base `809c7fa2dfb1b21e2b31b3114b7d51bc14ee88ab`; the current `main` tip used for fresh checks and the merge preview was `1b917483406cdaeae1d970393bcd21cda5272c9b`. The preview against current `main` was clean. Environment: Linux x86_64, Python 3.11.2, Git 2.39.5; no compiler was invoked. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13845 --no-negative-controls --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13845 git diff --check refs/remotes/upstream/main...refs/remotes/upstream/pr-13845 python3 tools/check_conventions.py --base refs/remotes/upstream/main --head refs/remotes/upstream/pr-13845 --title 'fix(shader): flush v_fma_f64 and v_div_fmas_f64 denormals by the f64 denormal field' --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13845/pr-body.md git merge-tree --write-tree refs/remotes/upstream/main refs/remotes/upstream/pr-13845 git merge-tree --write-tree refs/remotes/upstream/pr-11483 refs/remotes/upstream/pr-13845 python3 tools/pr_test_quality.py --root /marc/AnyPS5 --json core/libs/prx/libSceAgcDriver/tests/execution/F64FmaDenormalModes.cpp ``` ## Results | Check | Result | |---|---| | Diff check and conventions | Passed against current `main`. | | Merge preview against current `main` | Clean. | | Pairwise merge with #11483 | Conflicts in `docs/dev/debt/shader.md`; both PRs replace the same existing debt entry. #11483 is open at head `80cb2cd3acfdcde0abd374bc3f8886b5bd23e092`. | | Test registration | The execution test is found by the existing CMake `file(GLOB ... CONFIGURE_DEPENDS ...)`; the test-quality helper's possible-unregistered warning is a false positive. | | No-build precheck | Partial: diff, conventions/template, and live mergeability passed. Its isolated checkout lacks local-only `pr_abi_audit.py` and `pr_test_quality.py`; ABI auditing is not applicable to these paths. | | Local build / focused C++ test | Not run; the test requires a build, which is excluded from initial review. | | Hosted CI snapshot | Eligibility, conventions, portability, intake, labels, report, Ubuntu relinker, and relinker ASan passed. Windows product/relinker jobs were in progress; macOS relinker jobs were queued; Linux product job was skipped. | <details><summary>Selected unedited output</summary> Conventions: ```text All conventions checks passed. ``` Merge preview against current `main`: ```text 9ee6ecc7c83e1b64d84333bc32ff834015d842a9 ``` Pairwise merge with #11483: ```text CONFLICT (content): Merge conflict in docs/dev/debt/shader.md ``` Test-quality heuristic: ```text { "findings": [ { "path": "core/libs/prx/libSceAgcDriver/tests/execution/F64FmaDenormalModes.cpp", "line": 1, "kind": "possible-unregistered-cpp-test", "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage." } ], "negative_control_candidates": [], "limits": [ "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.", "A test that passes against base is not by itself proof that the PR test is inadequate.", "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error." ] } ``` Precheck helper errors: ```text /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13845/head-49198f673f04-f612c925/tools/pr_abi_audit.py': [Errno 2] No such file or directory /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13845/head-49198f673f04-f612c925/tools/pr_test_quality.py': [Errno 2] No such file or directory ``` </details> ## Negative control | Assertion | Mutation | Result | |---|---|---| | The new test distinguishes the old lowering from the proposed f64 FMA flush behavior. | Author reports reverting `Float64Instructions.cpp` and `TranslationContext.hpp` while retaining the test. | Author-reported failure; not independently run here. | ## Findings ### Blocking 1. **RDNA2 behavior is unresolved.** The new test and lowering encode tininess-after-rounding for `v_fma_f64`, based on gfx1101/RDNA3 measurements. The PR says gfx1013 and RDNA2 were not measured, while the previous debt entry records an earlier gfx1035/RDNA2 observation that judged this boundary before rounding. The PR itself says the new rule differs for `0x2000000000000001 * 0x1ffffffffffffffe` (the new rule keeps the minimum normal; the earlier rule flushes it). Please provide reproducible rows from RDNA2 hardware or another authoritative, generation-applicable source and reconcile the conflicting observation before encoding the behavior globally. 2. **Undeclared conflicting PR.** #11483 is open and changes the same debt entry; a pairwise merge preview confirms a content conflict. This PR's description acknowledges the conflict but its checklist says `Depends on: none`. Agree which PR lands first, declare that ordering, and update the debt entry on the resulting head. Suggested checklist correction, if #11483 is to land first: ```suggestion - [x] Depends on: #11483 ``` ### Non-blocking No other source-level defect was confirmed. The submitted RDNA3/RADV and lavapipe results, including the reported negative control, are author-provided and were not independently reproduced here. ## Sources - [Prior gfx1035 debt entry at the PR base](https://github.com/boykopovar/AnyPS5/blob/809c7fa2dfb1b21e2b31b3114b7d51bc14ee88ab/docs/dev/debt/shader.md) - [Reviewed `v_fma_f64` and `v_div_fmas_f64` lowering](https://github.com/boykopovar/AnyPS5/blob/49198f673f0449e392f4e043486d49cbbba083a7/core/shader/recompiler/Translation/src/Float64Instructions.cpp) - [Added f64 FMA denormal test](https://github.com/boykopovar/AnyPS5/blob/49198f673f0449e392f4e043486d49cbbba083a7/core/libs/prx/libSceAgcDriver/tests/execution/F64FmaDenormalModes.cpp) - [Overlapping open PR #11483 at its current head](https://github.com/boykopovar/AnyPS5/blob/80cb2cd3acfdcde0abd374bc3f8886b5bd23e092/docs/dev/debt/shader.md) - [Contribution rules for overlap and declared dependencies](https://github.com/boykopovar/AnyPS5/blob/1b917483406cdaeae1d970393bcd21cda5272c9b/CONTRIBUTING.md) ## Not verified No local build, CTest run, or negative control was performed. The PR author reports focused paired hardware runs on gfx1101 and lavapipe, but no PS5 gfx1013 or RDNA2 measurement. Windows jobs were still running and macOS relinker jobs were queued in the latest CI snapshot. ## To get this to a good state Please resolve the RDNA2 behavior evidence and #11483 overlap/dependency, then update the PR. I will rerun the same no-build checks against the new head.
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!13845
No description provided.