mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:50:51 +01:00
[PR #1865] tools/shader_meta: fold signed min/max, s_bfe_i32, s_sext_i32, s_pack_* and guard SGPR width #1877
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#1877
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/1865
Author: @kirigayakazima
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/shader-meta-scalar-folding📝 Commits (1)
e0a8694Fold s_min/max_i32, s_bfe_i32, s_sext_i32, and s_pack_* in shader_meta and guard SGPR width📊 Changes
3 files changed (+98 additions, -7 deletions)
View changed files
📝
tests/test_shader_meta.py(+39 -0)📝
tests/test_shader_meta_operands.py(+21 -0)📝
tools/shader_meta.py(+38 -7)📄 Description
Claimed in the coordination issue as: SHADER-META-SCALAR-PACK-SEXT-SIGNED-FOLD-AND-WIDTH-GUARD (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7164029615)
What and why
tools/rdna2spirv.pyintools/shader_meta.pyfor signed scalar min/max (s_min_i32,s_max_i32), signed bitfield extraction (s_bfe_i32), 16-bit half packing (s_pack_ll_b32_b16,s_pack_lh_b32_b16,s_pack_hh_b32_b16), and unary sign extension (s_sext_i32_i8,s_sext_i32_i16).s_add_*,s_sub_*,s_addc_u32,s_subb_u32, and binary ALU folding) to require single-SGPR (n == 1) destination and stride-source operands so malformed multi-SGPR operands clear prior state cleanly without attaching bogus constant or stride tags.tests/test_shader_meta.pyandtests/test_shader_meta_operands.py.Tested
python -I tests/test_shader_meta.py -v->Ran 30 tests in 0.200s(OK);python -I tests/test_shader_meta_operands.py -v->Ran 6 tests in 0.000s(OK).upstream/main5e95fa2fwith updated test files copied into detached worktree):test_shader_meta.py->Ran 30 tests in 0.267s(FAILED (failures=17));test_shader_meta_operands.py->Ran 6 tests in 0.001s(FAILED (failures=3)).python -I tests/test_ci_registration.py(Ran 16 tests in 5.029s,OK),python -I tests/test_text_write_line_endings.py(Ran 3 tests in 12.679s,OK),python -I scripts/check_no_game_data.py(exit 0),python -I -m compileall -q(exit 0),git diff --check(exit 0).GPUs tested: n/a (static shader metadata constant folding and operand width validation tests)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.