[PR #593] [MERGED] rdna2spirv: s_bitreplicate_b64_b32 into VCC, s_flbit_i32_b64 of a lane mask (SHADER-LANEMASK-BITREP-FLBIT) #636

Closed
opened 2026-11-26 20:18:33 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/593
Author: @Tyrannys
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142

Base: main ← Head: fix/lanemask-bitreplicate-flbit


📝 Commits (1)

  • 1ea2ffb rdna2spirv: s_bitreplicate_b64_b32 into VCC, s_flbit_i32_b64 of a lane mask

📊 Changes

4 files changed (+85 additions, -8 deletions)

View changed files

📝 docs/design.md (+2 -2)
➕ tests/semantic/test_lane_mask_bitreplicate_flbit.py (+65 -0)
📝 tests/semantic/test_salu_flbit_64.py (+3 -2)
📝 tools/rdna2spirv.py (+15 -4)

📄 Description

Item: SHADER-LANEMASK-BITREP-FLBIT (claimed in #14).

Two lane-mask forms the translator refused, both in pipeline-library compute programs that the retail boot creates through slot 67:

  • s_bitreplicate_b64_b32 with a VCC destination. RDNA2 ISA SOP1: D[2i+1] = D[2i] = S0[i], so lane L's bit is S0 bit L // 2. EXEC already took this path (6ecd922d9); VCC now does the same and stores the lane's bit the way mov64 stores a mask into VCC (0xFFFFFFFF / 0). Other lane-mask sources and destinations stay Unsupported.
  • s_flbit_i32_b64 of a lane mask (EXEC, VCC, a mask pair). It now reads the wave's whole mask as real bits through wave_mask, as s_ff1_i32_b64 already does: 63 minus the last active lane, -1 when none. s_flbit_i32_i64 of a mask stays Unsupported.

Tests (synthetic programs only):

  • new tests/semantic/test_lane_mask_bitreplicate_flbit.py: both ops on every lane of a wave64 in spirv_mini_interp.run_workgroup; bitreplicate into VCC for 6 constants, flbit of EXEC for 6 masks and of a compare VCC for 5 lane counts.
  • tests/semantic/test_salu_flbit_64.py: the old "lane mask is rejected" case now checks s_flbit_i32_i64, which stays rejected.
  • docs/design.md: both contract rows updated, with how they are confirmed.

Full suite: python -I scripts/run_semantic_tests.py tests/semantic on this branch: 466 files, 6,111 tests, 1 file fails, test_image_cube_store_glc, which fails the same on main (7430f59b2) without this change.

Effect on the 1.0.2.1 boot (local work folder, RTX 4070 SUPER, Windows 11): 2 of the compute programs the title asked for and lacked (one per form) now translate and pass spirv-val.

AI-assisted (Claude Code). CPU-only checks; no GPU test run for this change.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/593 **Author:** [@Tyrannys](https://github.com/Tyrannys) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `fix/lanemask-bitreplicate-flbit` --- ### 📝 Commits (1) - [`1ea2ffb`](https://github.com/ubiquitarianism/leonida/commit/1ea2ffbcadac0ea8cd58fe0794a513ff68661af4) rdna2spirv: s_bitreplicate_b64_b32 into VCC, s_flbit_i32_b64 of a lane mask ### 📊 Changes **4 files changed** (+85 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+2 -2) ➕ `tests/semantic/test_lane_mask_bitreplicate_flbit.py` (+65 -0) 📝 `tests/semantic/test_salu_flbit_64.py` (+3 -2) 📝 `tools/rdna2spirv.py` (+15 -4) </details> ### 📄 Description Item: SHADER-LANEMASK-BITREP-FLBIT (claimed in #14). Two lane-mask forms the translator refused, both in pipeline-library compute programs that the retail boot creates through slot 67: - `s_bitreplicate_b64_b32` with a **VCC** destination. RDNA2 ISA SOP1: D[2i+1] = D[2i] = S0[i], so lane L's bit is S0 bit L // 2. EXEC already took this path (6ecd922d9); VCC now does the same and stores the lane's bit the way `mov64` stores a mask into VCC (0xFFFFFFFF / 0). Other lane-mask sources and destinations stay `Unsupported`. - `s_flbit_i32_b64` of a **lane mask** (EXEC, VCC, a mask pair). It now reads the wave's whole mask as real bits through `wave_mask`, as `s_ff1_i32_b64` already does: 63 minus the last active lane, -1 when none. `s_flbit_i32_i64` of a mask stays `Unsupported`. Tests (synthetic programs only): - new `tests/semantic/test_lane_mask_bitreplicate_flbit.py`: both ops on every lane of a wave64 in `spirv_mini_interp.run_workgroup`; bitreplicate into VCC for 6 constants, flbit of EXEC for 6 masks and of a compare VCC for 5 lane counts. - `tests/semantic/test_salu_flbit_64.py`: the old "lane mask is rejected" case now checks `s_flbit_i32_i64`, which stays rejected. - `docs/design.md`: both contract rows updated, with how they are confirmed. Full suite: `python -I scripts/run_semantic_tests.py tests/semantic` on this branch: 466 files, 6,111 tests, 1 file fails, `test_image_cube_store_glc`, which fails the same on `main` (7430f59b2) without this change. Effect on the 1.0.2.1 boot (local work folder, RTX 4070 SUPER, Windows 11): 2 of the compute programs the title asked for and lacked (one per form) now translate and pass `spirv-val`. AI-assisted (Claude Code). CPU-only checks; no GPU test run for this change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:33 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#636
No description provided.