Repository navigation
fix(shader): quiet signaling NaN cube results in IEEE mode - #2043
Conversation
a07116a to
f3660a0
Compare
|
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
No title was run. 🤖 Addressed by Claude Code |
|
Rebased on current Checked on the rebased head: full build and ctest 633/633; |
f3660a0 to
5d27030
Compare
With IEEE_MODE=1 the hardware quiets a signaling NaN that v_cubesc, v_cubetc or v_cubema_f32 returns, keeping the sign the instruction gives it; with IEEE=0 the bits pass through. Same rule as boykopovar#1867, measured on gfx1036 in both modes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Its signaling NaN result is quieted with IEEE=1 by the cube sentence above. Co-Authored-By: Claude <noreply@anthropic.com>
|
Rebased on current Checked on the rebased head: scoped build and ctest 324/324 (libSceAgc, libSceAgcDriver); |
5d27030 to
aee2d25
Compare
…c-snan fix(shader): quiet signaling NaN cube results in IEEE mode
What
Part of #981, a follow-up to #1867. In a shader with
IEEE_MODE=1, the cube instructions return a signaling NaN unchanged:With IEEE=1 the hardware quiets a signaling NaN result of
v_cubesc/cubetc/cubema_f32, and keeps the sign the instruction gives it (cubescabove returns-z). With IEEE=0 the bits pass through. This is the rule #1867 measured for the unary instructions.floatCubepicks the NaN operand itself, so these bits never came from the driver: #1867 recordedv_cubemaas "left to the driver", but the code always returned the signaling NaN as it was.floatCubenow passes a NaN result throughquietNan32. IEEE=0, shaders without a known float mode andv_cubeid_f32behave as before. WithDX10_CLAMP=1 a clamped NaN still becomes 0; withDX10_CLAMP=0 it keeps its sign and payload and is quieted only with IEEE=1 (row 2v_cubema_f32 ... clamp:7f800001at IEEE=0,7fc00001at IEEE=1 on gfx1036).Which title needs it
No known title needs it yet. It extends the rule #1867 measured to three more instructions, and it only changes shaders running with IEEE=1, which titles we know do not use (they use 0xc0, IEEE=0).
Tested
CachyOS Linux, GCC 16.2, RTX 4070 Ti (NVIDIA 615.71) and Radeon 610M (RADV, Mesa 26.2.4). Measured on RDNA2 (gfx1036) with the HW oracle.
agc_driver_vop3_cube_clampnow also runs at IEEE=0 and IEEE=1. Its 16 forms × 32 rows were captured on hardware in both modes. The IEEE=0 capture equals the existing table. At IEEE=1, 12 of the 512 cells differ, all signaling NaN results of sc/tc/ma, with and without source modifiers.lane 2 IEEE=1 v_cubema_f32 v13, v4, v5, v6 is 0x7f800001, expected 0x7fc00001.cubesc), 278 (cubetc) and 196 (cubema) rows differed with IEEE=1 before, 0 after, on both drivers.v_cubeid_f32still matches.check_conventions.pyandgit diff --checkpass.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)🤖 Generated with Claude Code