fix(shader): keep v_exp_f32 at or above the smallest normal for inputs from -126 #1571
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1571"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Zheorgyan on 2026-10-08T12:59:32Z.
What
agc_driver_vop1_float_unaryfails on an Apple M1 withexp_f32of -126 giving 0 where the test expects0x00800000. the M1 GPU'sexp2comes out about 2 ULP low even for whole numbers (2^-120 gives0x037ffffe), checked in plain Metal with fast math on and off. at -126 that lands just under the normal range, and Metal flushes it to 0for x >= -126 the exact result is at least 2^-126, so the FPExp2 specials now take a
UMax32of the result bits with0x00800000before the existing underflow pick. x < -126, -inf and NaN keep their current results, since the underflow pick and the NaN handling come after it. on a host whoseexp2doesn't undershoot, the max changes nothingTested
macos-portbranch.agc_driver_vop1_float_unaryfails before and passes after, and the rest of the suite is unchangedagc_driver_vop1_float_unaryis one of them, so the changed path isn't exercised theretools/check_conventions.pypassesChecklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by yahya308 on 2026-10-08T15:28:57Z.
Tested on top of main
9e2ffe0d, Windows 11, MinGW-w64 GCC 16.2.0, full ctest withANYPS5_REQUIRE_VULKAN=1 --repeat until-fail:3, NVIDIA RTX 4070 Laptop (32.0.16.1074) and AMD Radeon 780M (32.0.31041.1004).vopc_compare_tablefails on the 780M on main too (#825, #1473).Head
847bd9f4: no change from main on either GPU.vop1_float_unarypasses on both, so the max changes nothing on these hosts, as described.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T01:11:39Z.
Checked
v_exp_f32on the HW oracle (IEEE=0, DENORM=0): -126 gives0x00800000, values just above stay ≥ that and are monotonic, -126.0000076 and -inf give 0, +inf/NaN unchanged. TheUMax32therefore changes nothing on real hardware and only fixes hosts whoseexp2undershoots; it sits before the existing underflow pick, so x < -126 still returns 0.agc_driver_vop1_float_unarypasses here. Merging once CI is green.