mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:40:52 +01:00
[PR #338] rdna2spirv: translate v_sat_pk_u8_i16 (SHADER-SATPK-U8) #392
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#392
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/338
Author: @NolanCotter
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:shader-satpk-u8📝 Commits (1)
6446e3crdna2spirv: translate v_sat_pk_u8_i16 (SHADER-SATPK-U8)📊 Changes
7 files changed (+143 additions, -3 deletions)
View changed files
📝
docs/design.md(+1 -0)📝
docs/fssm_crosscheck.md(+1 -1)➕
tests/semantic/fixtures/sat_pk_u8_i16.asm(+16 -0)➕
tests/semantic/test_alu_sat_pk_u8_i16.py(+94 -0)📝
tests/test_f16_op_sel.py(+1 -1)📝
tests/test_translate.py(+1 -1)📝
tools/rdna2spirv.py(+29 -0)📄 Description
Claimed in #14 as SHADER-SATPK-U8.
Summary
tools/rdna2spirv.py: new rule forv_sat_pk_u8_i16(VOP1 0x62 / VOP3 0x1E2). Each signed i16 half of SRC0 is sign-extended,OpSClamped to [0, 255] and packed into the low 16 bits of VDST; the high half is preserved (GFX9+ partial 16-bit write — LLVM models the def asVOP1Inst_t16, Mesa ACOinstr_is_16bit, same class asv_cvt_f16_f32). Sourceneg/abs,clamp,omodandop_selraiseUnsupported;_sdwawhitelistssrc0_sel/dst_sel/dst_unused;_dppgoes throughnon_dpp_mods;_e32refuses all modifiers.tests/semantic/fixtures/sat_pk_u8_i16.asm+tests/semantic/test_alu_sat_pk_u8_i16.py: hand-written listing, runs the emitted SPIR-V throughspirv_mini_interpagainst a plain-Python reference — lane edge values (-0x8000/-1/0/255/256/0x7FFF), SGPR, literal and inline-constant sources,_sdwasource/destination selects, and refused modifiers.docs/design.md: contract-table row naming the confirmation (AMD machine-readable ISA semantics; LLVM/ACO partial-write reference; CPU-checked test; not GPU-verified).docs/fssm_crosscheck.md: removed from the unhandled-xbsc list.tests/test_translate.py,tests/test_f16_op_sel.py: the still-unsupported canary is repointed fromv_sat_pk_u8_i16tov_mullit_f32(still unhandled on this base).Heads-up for reviewers: PR #265's
_FULL32_V16_PREFIXESlistsv_sat_pkas a full-32-bit write for its wave64-halves liveness fix; this op writes only the low 16 bits and preserves the high half, so whichever of the two lands second should drop that prefix (noted as afinding:in #14).Test plan
python -m unittest discover -s tests/semantic -p test_alu_sat_pk_u8_i16.py— 5 tests passpython -m pytest tests/test_f16_op_sel.py— passespython -I scripts/run_semantic_tests.py tests/semantic— 444 files / 5894 tests; the only 4 failures (test_float_nan_fract,test_image_atomics_guard,test_image_store_d16,test_int32_to_f64) reproduce identically on cleanmain(the last is aspirv-optSIGSEGV in the test environment)python -I scripts/check_no_game_data.pyon both new files — cleanAI-assisted (Devin). No game files, no GPU, nothing online; semantics confirmed against AMD's ISA spec and the LLVM/ACO tables, not hardware. GPUs tested: none.
Generated with Devin
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.