Skip to content

fix(shader): keep the f32 sign on native f16 results when the NaN probe matches - #18484

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
LeandroLP23:fix/shader-native-f16-narrow-sign
Nov 21, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
LeandroLP23:fix/shader-native-f16-narrow-sign

Conversation

@LeandroLP23

Copy link
Copy Markdown
Contributor

What

On AMD's Windows driver, eight f16 execution tests fail on main again. Each one returns +0 where -0 is expected, the problem #2483 reported:

  • agc_driver_f16_conversion_float_mode
  • agc_driver_float16_misc
  • agc_driver_float16_modifiers
  • agc_driver_float16_rounding
  • agc_driver_fp16_overflow
  • agc_driver_ldexp_f16_inline_constants
  • agc_driver_sdwa_ldexp_f16
  • agc_driver_vop2_modifier_forms

For example: v_ldexp_f16 0x8000, 0.5 is 0x0000, expected 0x8000.

Cause:

Change: the float16NarrowNans path still returns the native result, NaN payload included, but ORs in the f32 source's sign, as the other native path does. A conversion never changes the sign, so devices that already returned the right sign get the same bits. The cost is three integer instructions per conversion instead of the full NaN rebuild that #11351 removed.

docs/dev/ARCHITECTURE.md says the emitter returns the native result when the probe matches. It now adds that a narrowed value takes its sign from the f32 source, and why.

Tested

Windows 11, AMD Radeon 860M (RDNA 3.5), AMD proprietary driver 26.10.2, MinGW GCC 15.2 Release, on main f57c971559. Every run used ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation.

Build The 8 tests above
main all fail
main with APS5_NO_NATIVE_F16_NANS=1 all pass
this branch (the probe still selects the native path) all pass

Not tested on RADV, Intel or NVIDIA. The probe also selects the native path on those devices when it matches, and there the added sign is the sign they already return.

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 (a regression of f16 results lose the sign of zero on AMD's Windows driver since #1252 (native f32→f16 conversion) #2483, which is closed)
  • Unblocks: none
  • GPUs tested: AMD Radeon 860M (AMD proprietary driver 26.10.2)
  • AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added shader core/shader docs labels Nov 11, 2026
@JJenkx

JJenkx commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Windows data point on a different AMD GPU: this card does not show the failure, so I can't confirm the fix here, only that the PR doesn't break these tests.

Setup: Windows 11 Enterprise 22621, RX 6700 XT (RDNA 2), AMD driver 26.10.1, MinGW-w64 GCC 15.2 UCRT, Release, ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1, through the shared Windows GPU FIFO.

Build The 8 tests in the description
main f57c971559 all pass, 3 of 3 runs (24 of 24)
this head 7d9d84f9c7, which contains that main all pass, 3 of 3 runs (24 of 24)

The binaries matched the hashes recorded at preparation for both arms, and each receipt shows exit 0 and app_count=0.

Games on this machine log f32 to f16 NaN results: native (0 of 220032 probe results differ), the same probe result as yours. I did not check which path these test executables take, because ctest prints nothing for a passing test. So this does not tell us whether the difference is the GPU generation (your RDNA 3.5 against this RDNA 2) or the driver (26.10.2 against 26.10.1).

AI-assisted: yes.

@LeandroLP23

Copy link
Copy Markdown
Contributor Author

Thanks for the RX 6700 XT run. A passing test does print its probe line with -V:

ctest --test-dir build -V -R '^agc_driver_ldexp_f16_inline_constants$'

Look for [float-controls] ... f32 to f16 NaN results: native (...). If it says native there and the test still passes on main, your driver keeps the sign on that path, and the difference is in the GPU generation or the driver version, not the probe. If it says emulated, the test never took the path this PR changes.

On the 860M (driver 26.10.2) it says native (0 of 220032 probe results differ), and the eight tests pass on main with APS5_NO_NATIVE_F16_NANS=1.

AI-assisted: yes (Claude Code)

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 5925 docs/dev/ARCHITECTURE.md
PR 6412 docs/dev/ARCHITECTURE.md
PR 7642 docs/dev/ARCHITECTURE.md
PR 7684 docs/dev/ARCHITECTURE.md
PR 9356 docs/dev/ARCHITECTURE.md
PR 9387 docs/dev/ARCHITECTURE.md
PR 9508 docs/dev/ARCHITECTURE.md
PR 10193 docs/dev/ARCHITECTURE.md
PR 12324 core/shader/recompiler/SpirvBackend/src/SpirvAlu/SpirvAluEmitterMath.cpp
PR 13928 docs/dev/ARCHITECTURE.md
PR 13929 docs/dev/ARCHITECTURE.md
PR 15456 docs/dev/ARCHITECTURE.md
PR 15529 docs/dev/ARCHITECTURE.md
PR 15548 docs/dev/ARCHITECTURE.md
PR 16831 docs/dev/ARCHITECTURE.md
PR 17611 docs/dev/ARCHITECTURE.md
PR 17943 docs/dev/ARCHITECTURE.md
PR 18029 docs/dev/ARCHITECTURE.md
PR 18082 docs/dev/ARCHITECTURE.md
PR 18226 docs/dev/ARCHITECTURE.md
PR 20187 docs/dev/ARCHITECTURE.md
PR 20315 docs/dev/ARCHITECTURE.md
PR 22424 docs/dev/ARCHITECTURE.md
PR 22434 docs/dev/ARCHITECTURE.md
PR 22546 docs/dev/ARCHITECTURE.md
PR 22647 docs/dev/ARCHITECTURE.md
PR 22697 docs/dev/ARCHITECTURE.md

@github-actions github-actions Bot added the fix error Closes an issue (Fixes #N) label Nov 11, 2026
@Jirka135

Copy link
Copy Markdown
Contributor

An RDNA 3.5 data point for "A conversion never changes the sign", measured with tools/hw-oracle (HIP runtime). It's independent of the recompiler. The PS5's gfx1013 is not measured.

Setup:

  • AMD Radeon 8060S (Ryzen AI MAX+ 395, gfx1151), Windows 11 Pro 10.0.26300, driver 32.0.22032.6002
  • oracle from tools/hw-oracle at f57c971
  • wave32, f32 round to nearest even, DX10_CLAMP 1, FP16_OVFL 0
  • IEEE 0 and 1, f32 denormal field 0 and 3, f16 denormal field 0, 1, 2 and 3, and f16 round modes 0, 1, 2 and 3: 64 modes in all

Rows:

  • f32 → f16 forms: 204 per mode. The first operand is one of 34 f32 values: 17 values with both signs. They are 0, 0x00000001, 0x007fffff, 0x00800000, 0x32800000, 0x33000000 and 0x33800000 (values that round to 0 or to the smallest f16 denormal), 0x387fc000, 0x38800000, 1, 0x477fe000 (the largest f16), 0x47800000 (f16 overflow), 0x7f7fffff, infinity, 0x7fc12345, 0x7f812345 and 0x7fffffff. The second operand is 1, −1, 0.5, 2^-20, −0 or +0.
  • v_ldexp_f16: 108 per mode. The f16 value is one of 18 halves: 0, 0x0001, 0x03ff, 0x0400, 1, 0x7bff, infinity, 0x7e12 and 0x7c56, each with both signs. The exponent is 0, 1, −1, −30, 30 or 0x3800.

Forms:

  • v_cvt_f16_f32 of the buffer value.
  • v_cvt_f16_f32 of the result of a v_mul_f32 and of a v_add_f32 in the same program. The description says the failing tests convert the result of an f32 operation.
  • The low half of v_cvt_pk_rtz_f16_f32.
  • v_ldexp_f16 v10, v4, v5, and v_ldexp_f16 v10, v4, 0.5 (the form in the description's example).

The result sign is compared with the f32 value converted, or with the f16 source for v_ldexp_f16.

form rows (64 modes) sign changed
v_cvt_f16_f32 of the buffer value 13056 0
v_cvt_f16_f32 of v_mul_f32 13056 0
v_cvt_f16_f32 of v_add_f32 13056 0
v_cvt_pk_rtz_f16_f32, low half 13056 0
v_ldexp_f16 v10, v4, v5 6912 0
v_ldexp_f16 v10, v4, 0.5 6912 0

A second run printed exact bits in 8 modes: IEEE 0 and 1, f32 denormal field 0 and 3, and f16 denormal field 0 and 3, all with f16 round mode 0. In every one of them:

  • v_ldexp_f16 0x8000, 0.5 is 0x8000, the value the description expects.
  • v_cvt_f16_f32 of the v_add_f32 result −0 + −0 is 0x8000.
  • v_cvt_f16_f32 of the v_mul_f32 result −2^-25 × 1 is 0x8000. The product is 0xb3000000, which rounds to zero in f16.
  • v_cvt_f16_f32 of −0 and of −2^-25 loaded from the buffer is 0x8000.

So on gfx1151 the f16 result of a conversion or an ldexp always has the sign of its source, NaN and zero results included. Taking the sign from the f32 source therefore gives the hardware's sign bit in every row here.

The oracle runs raw ISA through HIP, not the Vulkan driver's OpFConvert, so it does not reproduce the +0 the description sees on the 860M with driver 26.10.2. What it does show is that +0 for a negative source is not what gfx1151 does.

Not run: the recompiler side (no Windows build of the runner here), and the PR's tests.

AI-assisted: yes (measurement scripted with Claude Code; rows and results checked by me).

@Jirka135

Copy link
Copy Markdown
Contributor

A second RDNA 3.5 data point, on an older driver than the 860M one. It has the same probe result and the same eight failures on main. All eight pass with this PR.

Setup:

Command (separate ctest invocations, one at a time):

set ANYPS5_REQUIRE_VULKAN=1
set ANYPS5_NO_SHADER_CACHE=1
set ANYPS5_GPU=8060S
ctest --test-dir build -R "^agc_driver_<name>$" -j 1 -V --timeout 120

Results:

test main main + APS5_NO_NATIVE_F16_NANS=1 #18484
agc_driver_f16_conversion_float_mode fail pass 3/3 pass
agc_driver_float16_misc fail pass 3/3 pass
agc_driver_float16_modifiers fail pass 3/3 pass
agc_driver_float16_rounding fail (also 3/3 in a separate #3882 run) pass 3/3 pass
agc_driver_fp16_overflow fail pass 3/3 pass
agc_driver_ldexp_f16_inline_constants fail pass 3/3 pass
agc_driver_sdwa_ldexp_f16 fail pass 3/3 pass
agc_driver_vop2_modifier_forms fail pass 3/3 pass

The failures on main are all −0 returned as +0, for example:

  • v_ldexp_f16 0x8000, 0.5 is 0x0000, expected 0x8000
  • f16 rounding: vector 1 (...) v_mul_f16 is 0xabcd0000, expected 0xabcd8000
  • sdwa ldexp f16: lane 0 BYTE_2/BYTE_1 -> WORD_0 is 0x00000000, expected 0xffff8000
  • vop2 modifier forms: lane 0 v_ldexp_f16_e64 v21, -v4, v5 is 0xdead0000, expected 0xdead8000

On the open question of GPU generation vs driver: both RDNA 3.5 parts fail the same way, the 860M on Adrenalin 26.10.2 (.12012) and the 8060S on 32.0.22032. The RX 6700 XT on 26.10.1 passes. That points at the generation more than the driver, although the probe says native on all three.

Not run: RADV, Intel, NVIDIA.

AI-assisted: yes (run scripted with Claude Code; results checked by me)

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the f32 sign on native f16 narrowing — no blocking findings

The change keeps the f32 source sign on the native f16 narrowing path, and the code I read at head 7d9d84f9c7ba87d6726511fb74daefb1843c1762 matches the description.

What I ran

  • Head 7d9d84f9c7ba87d6726511fb74daefb1843c1762, base main.
  • Read the diff of both changed files and the emitter at head (SpirvAluEmitterMath.cpp lines 2005–2045), plus the three call sites of EmitNativeF32ToF16BitsRte.
  • No build and no tests run here (no-build review). The author reports a run on AMD Radeon 860M (driver 26.10.2), which I did not perform.

Results

Check Result Note
Diff read passed 2 of 2 files
Emitter read at head passed Lines 2005–2045
Call sites passed 3 sites, all pass f32 values
Build and tests not run No-build review
Author's device run not run Reported by the author, not verified here

Findings

Blocking

None.

Non-blocking

  • SpirvAluEmitterMath.cpp:2036: the narrowed path now returns sign | (bits & 0x7fff). The high half of bits is the constant zero from OpCompositeConstruct (line 2032), so the mask keeps only the f16 result. Sign and magnitude are correct for finite values, and for NaN the sign comes from the source, as the non-narrow path already does (line 2042).
  • SpirvAluEmitterMath.cpp:2035: the sign line moved above the nanPayloadUnused return. The nanPayloadUnused path (line 2038) does not use sign, and the final return (line 2042) still does, so that path behaves as before.
  • No test is added in this PR. Coverage depends on the existing agc_driver_float16_* and related tests, which the author reports fail on main on this device and pass with the change. A unit test that feeds a computed negative value through the narrowed path would cover the case the probe misses.

Sources

  • Diff: diff.patch, SpirvAluEmitterMath.cpp and docs/dev/ARCHITECTURE.md, head 7d9d84f9c7ba87d6726511fb74daefb1843c1762.

Not verified

  • Build and test results on any device; only the author's report exists.
  • RADV, Intel and NVIDIA behaviour; the description says these are not tested.
  • The probe's sign coverage: the probe converts buffer-loaded values, so a device can pass it and still return +0 for computed -0. The description and ARCHITECTURE.md state this; I did not check the probe's inputs in full.

To get this to a good state

  • Optional: add a test for a computed negative value through the narrowed path, or name the existing test that covers it.
  • Rerun the eight listed agc_driver tests on the new head if the head changes.

@LeandroLP23

Copy link
Copy Markdown
Contributor Author

Thanks for the review. On the test: the eight agc_driver tests in the description already feed computed negative values through the narrowed path.

  • agc_driver_ldexp_f16_inline_constants is one example. Its v_ldexp_f16 0x8000, 0.5 case computes -0 in f32 and narrows it, and it expects 0x8000.
  • On this device the probe selects the native path (0 of 220032 probe results differ). These tests fail on main with +0 and pass on this branch with the probe unchanged, so the run goes through the float16NarrowNans branch that this PR changes.
  • They do not check the probe-skipping path, which APS5_NO_NATIVE_F16_NANS=1 already made pass on main.

A device whose driver already keeps the sign passes them either way. So they guard this change only on drivers that drop the sign, such as AMD's Windows driver here. A host-side test could not see the bug, because it is in the driver's OpFConvert result. I'd rather not add a second GPU test that repeats these eight.

The head has not changed since my run, so the eight results in the description still apply.

AI-assisted: yes (Claude Code)

@mrfelek

mrfelek commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

RADV data point, since the description lists RADV as not tested. On RADV the probe also picks the native path, but the eight tests pass on main as well, so this device can't confirm the fix. It does show the change doesn't break them on RADV.

Setup: Ubuntu 26.04, Linux 7.0, AMD Radeon 780M (Ryzen 9 PRO 8945HS, RDNA 3, 1002:1900, subgroup 64), Mesa 26.0.8 (RADV PHOENIX), GCC 15.2, Release. ANYPS5_REQUIRE_VULKAN=1, with the shader cache off as the tests set it. Only the eight execution tests were built (ANYPS5_AGC_EXECUTION_TESTS). main is 0cf873937f; B is this head 7d9d84f9c7 merged onto it (59f1288a81, clean).

build the 8 tests in the description probe line
main 8 of 8 pass f32 to f16 NaN results: native (0 of 220032 probe results differ)
this PR 8 of 8 pass the same

Every run selected the 780M (Selected GPU name=AMD Radeon 780M Graphics (RADV PHOENIX)), and none was skipped. Since the probe selects the native path and the tests still pass on main, RADV seems to keep the sign there, where AMD's Windows driver on RDNA 3.5 loses it. As with the RX 6700 XT run above, the failure doesn't show on this device.

AI-assisted.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 15, 2026
LeandroLP23 and others added 2 commits November 15, 2026 15:25
…be matches

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LeandroLP23
LeandroLP23 force-pushed the fix/shader-native-f16-narrow-sign branch from 7d9d84f to a82def3 Compare November 15, 2026 14:35
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 15, 2026
@sharveshprabhu

Copy link
Copy Markdown
Contributor

RDNA 3 on AMD's Windows driver, on the current head a82def3918: same failure on main, fixed by this PR.

Setup: Radeon 780M (1002:1900), AMD driver 26.10.2, Windows 11 26300, WinLibs GCC 15.2.0 r7 Release, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, validation layer on. Probe line: native (0 of 220032 probe results differ).

build the 8 tests, 3 runs each
main ccad36a7fc (merge base) 0 of 24 pass, −0 returned as +0
this head a82def3918 24 of 24
this head merged onto main 86b21bf2da 24 of 24
  • The full agc|shader suite on the merge passes 1925 of 1928. The other 3 don't pass on main without this PR either (stencil_plane_memory, store_over_untracked, and upload_cache_read_only_flush, which doesn't build on Windows). No VUID- lines.
  • mrfelek's RADV run above is on the same chip and passes on main, so on the 780M the +0 comes from the Windows driver, not the hardware.

AI-assisted: yes (Claude Code)

@domx4q

domx4q commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Ran the eight f16 tests from the description and the other agc_driver_f16*/float16*/fp16* tests with the Khronos validation layer on Linux and an NVIDIA GPU; the Tested section notes NVIDIA was not tested.

Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (vendor 0x10de, device 0x2684, Ada), proprietary driver 620.70.06, Vulkan 1.4.357, Khronos validation layer 1.4.363.1. Head a82def3918 merged onto main e4caa07950 with --no-ff, clean merge. Main baseline is a Release build of e4caa07950 on the same machine.

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer \
ctest --test-dir build -R '^agc_driver_(f16|float16|fp16|ldexp_f16|sdwa_ldexp_f16|vop2_modifier_forms)' -V
main e4caa07950 this PR
Result 28/28 passed 28/28 passed
Insert instance layer "VK_LAYER_KHRONOS_validation" 25 25
was not found but was requested by env var VK_INSTANCE_LAYERS 0 0
VUID- none none

On this driver the start-up probe does not select the native path, on either side, so the tests run the emulated conversion and the changed float16NarrowNans return is not used for them:

main:    f32 to f16 NaN results: emulated (98484 of 220032 probe results differ, first 0x7f800001: 0x00007e00 emulated, 0x00007fff native)
this PR: f32 to f16 NaN results: emulated (98328 of 220032 probe results differ, first 0x7f800001: 0x00007e00 emulated, 0x00007fff native)

The probe's own native variant does go through the changed path: in all 25 runs per side, 156 fewer probe results differ on this PR, so the added sign changes some native results on this driver too. The remaining differences keep the probe on the emulated path. The three _spirv tests create no Vulkan instance, so the layer count is 25 for 28 tests. Every test selected the RTX 4090.

No new VUID- errors; all focused tests pass on Ada, where the probe keeps the emulated path, so the f16 test results are unchanged.

AI-assisted: yes (Claude Code)

@rafaconvaitis

Copy link
Copy Markdown
Contributor

Confirmation on a second AMD device with AMD's Windows driver: 8 f16 tests fail on main 907fe8fd31 on the Radeon 760M and all pass with head a82def3918 merged alone onto it (git merge --no-ff, clean merge). The NVIDIA GPU of the same machine passes them on both sides.

Setup: Windows 11 25H2 (build 26200), two GPUs in the same machine, each selected with ANYPS5_GPU: AMD Radeon 760M integrated graphics (1002:15bf, Vulkan device name Radeon 5), AMD Software 26.11.2 (driver 32.0.32029.2010, Vulkan 1.4.359), and NVIDIA GeForce RTX 3050 6 GB (10de:2584), driver 610.88 (Vulkan 1.4.341). WinLibs GCC 15.2.0 r7 UCRT, Release, BUILD_TESTING=ON, all 914 agc*_tests targets built, Khronos validation layer 1.4.363 (LunarG SDK 1.4.363.1).

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer SDL_AUDIODRIVER=dummy, ctest -R '^agc.*(f16|float16|fp16|vop2_modifier_forms)' -V -j 1, 3 runs per cell.

Radeon 760M RTX 3050
main 125 tests pass 3/3, 8 fail 3/3, 1 skipped 134 tests pass 3/3
this PR 133 tests pass 3/3, 1 skipped 134 tests pass 3/3
  • The 8 that fail on main on the Radeon 760M and pass with this PR, with the line each reports on main:
    • agc_driver_f16_conversion_float_mode: AGC graphics: v_ldexp_f16 round16 0 denorm16 2 inputs 0x00008001 0x0000ffe2 is 0x00000000, expected 0x00008000
    • agc_driver_float16_misc: AGC graphics: f16 misc: vector 12 (0x006e8000, 0x00000214, 0xbf800000) v_ldexp_f16 is 0xabcd0000, expected 0xabcd8000
    • agc_driver_float16_modifiers: AGC graphics: float16 modifiers: lane 9 v_ldexp_f16 mul:2 is 0x00000000, expected 0x00008000
    • agc_driver_float16_rounding: AGC graphics: f16 rounding: vector 1 (0x00000000, 0x00000400, 0x00008001) v_mul_f16 is 0xabcd0000, expected 0xabcd8000
    • agc_driver_fp16_overflow: AGC graphics: fp16 overflow: lane 20 no float mode v_ldexp_f16 is 0x00000000, expected 0x00008000
    • agc_driver_ldexp_f16_inline_constants: AGC graphics: ldexp f16 inline constants: v_ldexp_f16 0x8000, 0.5 is 0x0000, expected 0x8000
    • agc_driver_sdwa_ldexp_f16: AGC graphics: sdwa ldexp f16: lane 0 BYTE_2/BYTE_1 -> WORD_0 is 0x00000000, expected 0xffff8000
    • agc_driver_vop2_modifier_forms: AGC graphics: vop2 modifier forms: lane 0 v_ldexp_f16_e64 v21, -v4, v5 is 0xdead0000, expected 0xdead8000
  • In all 8 the f16 result is 0x0000 where 0x8000, negative zero, is expected.
  • No test of the 134 changes from pass to fail with this PR on either GPU.
  • agc_driver_float16_unused_nan_payloads is skipped on the Radeon 760M on both sides: f16 unused NaN payloads: skipped, the device has no native f16 conversions with RTE rounding and kept f16 denormals.
  • VUID- lines: 0 in all logs. Every run logs the Selected GPU name= line of its GPU and Insert instance layer "VK_LAYER_KHRONOS_validation", and none logs was not found but was requested.

AI-assisted: yes (build and runs scripted with an AI assistant, on the hardware above).

@Teren19

Teren19 commented Nov 19, 2026

Copy link
Copy Markdown

RDNA4 data point for this fix, on AMD's Windows driver.

Windows 11 Pro 10.0.26100, AMD Radeon RX 9070 XT (0x1002:0x7550, RDNA4), AMD driver 32.0.32015.7029, MSYS2 UCRT64 GCC 16.2.0, Release, BUILD_TESTING=ON, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1. Base is main 866864a5bc; the change is f266d4b cherry-picked on top (the docs commit left out).

The eight tests listed in the description:

Build Result
main 0 of 8 pass; each returns +0 where -0 is expected, for example v_ldexp_f16 ... is 0x00000000, expected 0x00008000
main with APS5_NO_NATIVE_F16_NANS=1 8 of 8 pass
main + f266d4b 8 of 8 pass, 3 runs in a row

The probe line reads f32 to f16 NaN results: native (0 of 220032 probe results differ), so this device takes the float16NarrowNans path the change touches.

Not done: no Khronos validation layer is installed here, so there is no VUID comparison, and I ran only these eight tests on the change, not the rest of the suite.

AI-assisted: yes

@seanmylo-sketch

Copy link
Copy Markdown

Tested #18484 locally on Windows 10.0.26200 / RX 9060 XT (AMD 26.11.2 LLPC / 2.0.416, WinLibs GCC 16.2.0) by cherry-picking onto main (8e158a83d9ed): all 8 f16 tests from #24185 now pass (100% tests passed out of 8).

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

Nothing blocks this change; the points below are optional.

What I ran

Reviewed head a82def3918e847b5cbc9b9fed4613b22f362c8fa. I read the prepared description, commits, manifest, diff, both changed files, and targeted emitter callers and conversion probe code. I did not run build or tests; the reported device test results are author supplied.

Results

Check Result Note
Changed code review passed Sign extraction and native result mask inspected
Build and tests not run No local execution performed

Findings

Blocking

None.

Non-blocking

None.

Not verified

The author-reported Windows 11 / AMD Radeon 860M results were not independently verified. I did not read other files in files.json beyond the two changed files and the targeted context ranges; no changed files were excluded from the prepared bundle.

To get this to a good state

Nothing is required.

@kiwe147

kiwe147 commented Nov 21, 2026

Copy link
Copy Markdown

Tested head a82def3918, applied with git apply on main fd4aeed483 together with the other 28 PRs of one batch (#22366, #22943, #23994, #24150, #24483, #14625, #16796, #17425, #20528, #22589, #22887, #14505, #16792, #17900, #20048, #20099, #20517, #21636, #22886, #23659, #23880, #24047, #24100, #24248, #16353, #21683, #21714, #22276). All applied without conflicts and the whole tree built.

Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. GPUs: NVIDIA GeForce RTX 3080 (driver 621.24) and the AMD Radeon iGPU of the CPU (gfx1036, driver 32.0.21036.18). No validation layer. iGPU run: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ANYPS5_GPU="AMD Radeon", agc_/video tests only.

tests RTX 3080 iGPU
none: no test of its own in this PR - -

Whole batch: the full ctest -j 12 (6522 tests) on the RTX 3080 has 5 failing tests; the 4 that also fail on main fd4aeed483 are agc_driver_stencil_plane_memory, agc_driver_msaa_dcc_unwatch, agc_storage_write_back_host_retile, and pr_overlap_names, which needs a newer Python than my 3.10. Intermittent in this run (pass when rerun alone, or known flaky): agc_driver_store_over_untracked. Failing tests I could not trace to a single PR (reverting the likely candidates did not clear them): public_headers. The 2125 agc_/video tests on the iGPU have 2 failing: agc_driver_stencil_plane_memory, agc_driver_store_over_untracked (agc_driver_stencil_plane_memory also fails on main).

This is one combined tree, not a run of this PR alone.

AI-assisted: yes (Claude Code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs fix error Closes an issue (Fixes #N) shader core/shader

Projects

None yet

Development

Successfully merging this pull request may close these issues.

f16 results lose the sign of zero on AMD's Windows driver since #1252 (native f32→f16 conversion)