Repository navigation
Conversation
|
Checked on an AMD Radeon RX 9070 (RDNA4, gfx1201), Windows 11, merged onto
AI-assisted (Claude Code); runs on my machine. |
|
Rebased onto |
1457585 to
1e0c67f
Compare
# Conflicts: # docs/design.md
|
Already merged into |
# Conflicts: # docs/design.md
What and why
Closes SHADER-132 (claimed in #2078). Measures f16/f64 rounding under
s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 2)(nearest-even vs toward-zero) natively on RDNA2 (gfx1036, wave32 and wave64) viatools/hw_oraclefor #753 (SHADER-35):v_rcp_f16,v_rsq_f16,v_sqrt_f16,v_sin_f16, plus the 3 previously unmeasured opsv_cos_f16,v_exp_f16,v_log_f16): 0 / 65,536 inputs differ between RNE and RTZ in both wave32 and wave64 (917,504 evaluations total). This closes the unmeasured gap indocs/design.mdand pins the measured words (cos(0x3037) = 0x396a,exp(0x3037) = 0x3c62,log(0x4a37) = 0x4345) intests/test_mode_round.py.v_cvt_f16_f32,v_add/sub/mul/fma_f16,v_pk_add/fma_f16,v_fma_mix{lo,hi}_f16single-rounding & overflow,v_add_f64exact residual & overflow saturation): 17 / 17 exact in both wave32 and wave64, matchingtools/rdna2spirv.py.No translator change was needed.
Added / Updated
tools/mode_round_probe.py— standalone RDNA2 hardware probe (tools/hw_oracle, stdlib-only,--self-test, exit 77 when unavailable/non-GFX10)tests/test_mode_round_probe.py— CPU-only unit tests for the probetests/test_mode_round.py— added the measuredv_cos_f16,v_exp_f16,v_log_f16words totest_transcendental_f16_nearest_after_rtz_writedocs/design.md— updated theMODE.FP_ROUND/ f16 transcendentals contract row with the exhaustivegfx1036wave32/wave64 measurementsTested
tools/mode_round_probe.py): AMD Ryzen 7 9800X3D iGPU (gfx1036, Linux 7.3.4-1-cachyos, AMDGPU DRM viatools/hw_oracle):wave32 (gfx1036): 17/17 f16/f64 RNE/RTZ cases exact; 7/7 f16 transcendentals 0/65536 RNE/RTZ diffswave64 (gfx1036): 17/17 f16/f64 RNE/RTZ cases exact; 7/7 f16 transcendentals 0/65536 RNE/RTZ diffspython3 -m compileall -q make_game.py tools testscleanpytest -q tests/test_mode_round.py tests/test_mode_round_probe.py tests/test_tool_stdout_encoding.py: 57 passedAI-assisted.