mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:25:53 +01:00
[PR #2362] rdna2spirv: forward DPP src0 neg/abs to op readers instead of eager 32-bit modify (SHADER-DPP-F16-AND-SIGN-MODS) #2365
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#2365
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/2362
Author: @ShotTechOp
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/dpp-f16-and-sign-mods📝 Commits (1)
cf622cerdna2spirv: forward DPP src0 neg/abs to op readers instead of eager 32-bit modify (SHADER-DPP-F16-AND-SIGN-MODS)📊 Changes
3 files changed (+193 additions, -2 deletions)
View changed files
📝
docs/design.md(+1 -1)➕
tests/semantic/test_dpp_f16_mods.py(+188 -0)📝
tools/rdna2spirv.py(+4 -1)📄 Description
Item ID:
SHADER-DPP-F16-AND-SIGN-MODSSummary
Fixes
Gen.dpp_insn()intools/rdna2spirv.pysosrc0'sneg/absmodifiers are forwarded on the post-selectssaoperand instead of eagerly applying 32-bit floatGen.modify(src0, src)(bit 31FAbs/OpFNegate) before dispatching to_insn():v_add_f16_dpp,v_sub_f16_dpp,v_subrev_f16_dpp,v_mul_f16_dpp,v_min_f16_dpp,v_max_f16_dpp,v_fmac_f16_dpp,v_cvt_f32_f16_dpp,v_cmp_*_f16_dpp, etc.): previouslyGen.modify()cleared/flipped bit 31 (the unused high half) and strippedneg/abs, so-v1and|v1|were completely ignored on the f16 low half (bit 15), andbound_ctrl:1with-v1produced+0.0hinstead of-0.0h. Forwardingneg/absletsf16_in/f16_in_bits/modify_f/cmp_classapply them to bit 15 after the invalid-lane zero select.v_cndmask_b32_dpp,v_min_f32_dpp,v_max_f32_dpp,v_cmp_class_f32_dpp): previously eagerGen.modify()emittedFAbs/OpFNegate(which can quiet sNaNs and flush denormals) before those ops ran their raw integer bit-31 sign-move paths (src_u_sign_mods/src_f_sign_mods/cmp_class).HW-DPP-NEG-INVALID-LANE(test_dpp_bound_ctrl_modifiers.py): modifiers still apply afterOpSelect %uint %src_ok %shuffled %c0, sov_mov_b32_dpp v2, -v1 ... bound_ctrl:1still produces-0.0f(0x80000000) withOpBitcast %float+FAbs/OpFNegateon the select result.Updates the DPP contract row in
docs/design.mdand addstests/semantic/test_dpp_f16_mods.py.Verification
spirv_mini_interp&spirv_wave_interp; no local GPU/Vulkan/spirv-valinstalled)python -I tests/semantic/test_dpp_f16_mods.py -v-> 4/4 OK (wave32 &--wave64-emulate)python -I tests/semantic/test_dpp_bound_ctrl_modifiers.py-> 2/2 OKpython -I tests/semantic/test_dpp_compare.py-> 9/9 OK (2 skipped)python -I tests/semantic/test_dpp_eager_subgroup.py-> 8/8 OKpython -I tests/test_text_write_line_endings.py-> 3/3 OKpython -m compileall -q tools/rdna2spirv.py tests/semantic/test_dpp_f16_mods.py-> exit 0python -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/semantic/test_dpp_f16_mods.py docs/design.md-> exit 0git diff --check-> cleanorigin/main(tools/extracted fromorigin/main):tests/semantic/test_dpp_f16_mods.pyfails 4/4 tests (v_add_f16_dpp/v_mul_f16_dppignore f16-/| |,v_cvt_f32_f16_dppyields+0.0finstead of-0.0f,v_min_f16_dppyields+1.0hinstead of-3.0h, andv_cndmask_b32_dpp/v_cmp_class_f32_dppemitOpFNegate).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.