mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:05:54 +01:00
[PR #410] rdna2spirv: treat VOP3P v_dot2_f32_f16 clamp as hardware no-op (SHADER-DOT2-F32-F16-CLAMP) #462
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#462
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/410
Author: @tahffo68hk-hash
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:fix/shader-dot2-f32-f16-clamp📝 Commits (1)
abb68a9rdna2spirv: treat VOP3P v_dot2_f32_f16 clamp as hardware no-op (SHADER-DOT2-F32-F16-CLAMP)📊 Changes
3 files changed (+23 additions, -4 deletions)
View changed files
📝
docs/design.md(+1 -1)📝
tests/semantic/test_alu_dot_complete.py(+18 -2)📝
tools/rdna2spirv.py(+4 -1)📄 Description
Claimed in the coordination issue as:
SHADER-DOT2-F32-F16-CLAMPProblem
tools/rdna2spirv.pyappliedclamp_mods([0.0, 1.0]saturation) when VOP3Pv_dot2_f32_f16had theclampmodifier set. As noted indocs/design.md,v_dot2_f32_f16had not previously been hardware-measured on RDNA2.Measured natively on AMD RDNA2 (
gfx1036viatools/hw_oracle) across all fourieee/dx10_clamp/denorm32/denorm16_64MODE combinations: the VOP3Pclampbit onv_dot2_f32_f16is a hardware no-op:1.0*1.0 + 1.0*1.0 + 1.0withclamp->0x40400000(+3.0f), whereas the translator returned0x3f800000(1.0f).-1.0*1.0 + -1.0*1.0 + -1.0withclamp->0xc0400000(-3.0f), whereas the translator returned0x00000000(0.0f).+infwithclamp->0x7f800000;NaNwithclamp->0x7fc00000.Fix
clamp_modson VOP3Pv_dot2_f32_f16intools/rdna2spirv.py.tests/semantic/test_alu_dot_complete.pyto match the hardware-measured no-op behavior and add explicit+3.0f/-3.0f/+infregression assertions.docs/design.md.Verification
python -I tests/semantic/test_alu_dot_complete.py-> OK.spirv-val):tools/hw_oracle-> 4/4 dwords across+3.0f,-3.0f,+inf, andop_sel+neg_lo+clamp(verified across all 4 MODE combinations).vk_compute_test.exe:spirv-valPASS)--wave64-emulate): 4/4 exact dwords (spirv-valPASS)中文翻译
在协调帖 #14 中认领的 ID:
SHADER-DOT2-F32-F16-CLAMP问题描述
tools/rdna2spirv.py此前对带有clamp的 VOP3P 指令v_dot2_f32_f16施加了[0.0, 1.0]截断(docs/design.md注明此前尚未在 RDNA2 硬件实测)。经原生 AMD RDNA2(
gfx1036)在全部 4 种ieee/dx10_clamp/denormMODE 组合下实测确认:VOP3Pv_dot2_f32_f16的clamp位为硬件空操作(+3.0f保持0x40400000、-3.0f保持0xc0400000、+inf保持0x7f800000、NaN保持0x7fc00000)。修复方案
tools/rdna2spirv.py中对 VOP3Pv_dot2_f32_f16不再施加clamp_mods。tests/semantic/test_alu_dot_complete.py并新增+3.0f/-3.0f/+inf回归用例。docs/design.md契约表中记录硬件实测结果。验证结果
tests/semantic/test_alu_dot_complete.py全部通过。--wave64-emulate)4/4 精确一致,spirv-val全部通过。🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.