fix(shader): check NaN on the bits for ordered less-than and greater-than #3595
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3595"
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 LeandroLP23 on 2026-10-11T13:58:39Z.
What
agc_driver_f32_compare_constant(from #2408) fails on the AMD Windows driver (#3536):A NaN compared less than +infinity gives 1, and so does +infinity compared greater than a NaN (the next failure in the same test once less-than is fixed). Both happen only when the infinity reaches the shader as a constant. The same driver returns 1 for a NaN in an ordered not-equal on a 32-wide subgroup ballot (#825). An ordered
x < +infis equivalent to an orderedx != +inf, so the driver's compiler presumably rewrites these compares into that not-equal. I haven't confirmed that in the driver's output.FPOrdLessThan32andFPOrdGreaterThan32now AND their result with the integer NaN check thatFPOrdNotEqual32has used since #825. The check moves into a sharedBothOrderedBits32. The result is the same for every input. The TechnicalDebt entry for #825 now covers all three compares.Tested
Radeon 860M (RDNA 3.5), Windows 11 (26300), AMD driver 32.0.13058.8001, WinLibs GCC 15.2.0 r7, Release,
maina11c8f7f7. The AMD Vulkan cache andshader_cachewere emptied before each run.agc_driver_f32_compare_constantmainv_cmp_gt_f32 0x7f800000, 0x7fc00000 is 1, expected 0With this PR,
ctest -R agc_passes 374/374 (main: 373/374) and the other shader tests pass 156/156.tools/check_conventions.py --base origin/mainpasses.Fork CI: https://github.com/LeandroLP23/AnyPS5/actions/runs/38143672108
agc_driver_f32_compare_constantpasses. The three failures also happen onmain:agc_driver_image_plane_address_on_line_implicit_lod,guest_kernel_stack_protectandagc_driver_emulated_color_compare, which fails the same way in #3578's run, a change that doesn't touch the shader code.guest_filesystem(#3518),guest_kernel_sys(#3510) andwindows_exceptions(#3411) fail as onmain.Fixes #3536
Checklist
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 MarcZX10 on 2026-10-11T14:36:40Z.
I integrated the shared ordered NaN bit check into my PR #3541, including both less-than and greater-than. The implementation uses
BothOrderedBits32forFPOrdNotEqual32,FPOrdLessThan32, andFPOrdGreaterThan32, and the updated TechnicalDebt entry covers all three operations. I preserved your commit as the second commit in #3541 so your authorship stays attached to the change. I believe #3541 is now the better single PR to review because it includes this shared fix alongside the focused #3536 reproducer and validation context: https://github.com/boykopovar/AnyPS5/pull/3541. Thanks for working through the symmetric greater-than failure too.Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-11T17:11:10Z.
Closing in favour of #3541, whose final tree is identical to this one.
Pull request closed