[PR #1225] rdna2spirv: 64-bit scalar data ops lower to 2x32-bit, no Int64 (OLD-9958 / SHADER-930) #1257

Open
opened 2026-11-26 20:20:37 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1225
Author: @ambroseautomation
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: carry/old-9958-salu64-2x32


📝 Commits (1)

  • b451cd8 rdna2spirv: 64-bit scalar data ops lower to 2x32-bit, no Int64 (SHADER-930)

📊 Changes

11 files changed (+566 additions, -39 deletions)

View changed files

📝 docs/design.md (+1 -1)
📝 runtime/test/shaders/check.py (+4 -1)
➕ runtime/test/shaders/cs_w32_salu64_bfe.asm (+84 -0)
➕ runtime/test/shaders/cs_w32_salu64_bits.asm (+64 -0)
📝 scripts/run_gpu_tests.py (+5 -2)
➕ tests/semantic/fixtures/disasm/cs_w32_salu64_bfe.s (+64 -0)
➕ tests/semantic/fixtures/disasm/cs_w32_salu64_bits.s (+49 -0)
➕ tests/semantic/test_salu64_2x32.py (+227 -0)
📝 tests/semantic/test_salu_bfe_64.py (+8 -5)
📝 tools/int_hw_probe.py (+25 -0)
📝 tools/rdna2spirv.py (+35 -30)

📄 Description

Claimed in the coordination issue as: OLD-9958 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143531427)

What and why

Carries forward old-pr/9958 (draft #224, original commit author slipperysquid preserved; indexed in #17; SHADER-930), rebased cleanly onto current main.

Lowers s_bfe_u64 and s_bfe_i64 in tools/rdna2spirv.py to 2x32-bit operations with no OpCapability Int64 / OpTypeInt 64 / uses_psb requirement:

  • Funnel-shifts the 64-bit dword pair right by the offset (all shifts in 0..31) and extracts min(w, 32) bits for the low dword and the remaining bits for the high dword via 32-bit OpBitFieldUExtract / OpBitFieldSExtract (sign-extending the high dword from the low dword when w <= 32 for s_bfe_i64), preserving exact value and SCC semantics.
  • Adds tests/semantic/test_salu64_2x32.py (verifying no Int64 across all seven 64-bit scalar data ops, bfe value + SCC grids, and CPU execution of the GPU fixtures), updates tests/semantic/test_salu_bfe_64.py, adds GPU fixtures runtime/test/shaders/cs_w32_salu64_bfe.asm and cs_w32_salu64_bits.asm wired into check.py and scripts/run_gpu_tests.py, adds 11 cases to tools/int_hw_probe.py, and updates the contract row in docs/design.md.

Tested

  • python -m unittest discover -s tests/semantic -p test_salu64_2x32.py -v: 8 tests, OK.
  • python -m unittest discover -s tests/semantic -p test_salu_bfe_64.py -v: 44 tests, OK.
  • python -I tests/test_shader_checks.py: 87 tests, OK.
  • python -I tests/test_docs_links.py: 16 tests, OK.
  • python -I scripts/run_semantic_tests.py tests/semantic: 471 files, 6,176 tests, 0 files failed.
  • python -I scripts/check_no_game_data.py on all 11 touched files: exit 0 (no game data).

GPUs tested: n/a (CPU SPIR-V interpreter semantic suite on Windows 11 Pro 64-bit, Python 3.12.10; original author tested the GPU fixtures on RX 6800 XT / RTX 3070 / llvmpipe)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of 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.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1225 **Author:** [@ambroseautomation](https://github.com/ambroseautomation) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `carry/old-9958-salu64-2x32` --- ### 📝 Commits (1) - [`b451cd8`](https://github.com/ubiquitarianism/leonida/commit/b451cd8e7e0bdb5910854b53c070e448aecb6c26) rdna2spirv: 64-bit scalar data ops lower to 2x32-bit, no Int64 (SHADER-930) ### 📊 Changes **11 files changed** (+566 additions, -39 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+1 -1) 📝 `runtime/test/shaders/check.py` (+4 -1) ➕ `runtime/test/shaders/cs_w32_salu64_bfe.asm` (+84 -0) ➕ `runtime/test/shaders/cs_w32_salu64_bits.asm` (+64 -0) 📝 `scripts/run_gpu_tests.py` (+5 -2) ➕ `tests/semantic/fixtures/disasm/cs_w32_salu64_bfe.s` (+64 -0) ➕ `tests/semantic/fixtures/disasm/cs_w32_salu64_bits.s` (+49 -0) ➕ `tests/semantic/test_salu64_2x32.py` (+227 -0) 📝 `tests/semantic/test_salu_bfe_64.py` (+8 -5) 📝 `tools/int_hw_probe.py` (+25 -0) 📝 `tools/rdna2spirv.py` (+35 -30) </details> ### 📄 Description Claimed in the coordination issue as: OLD-9958 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143531427) ### What and why Carries forward `old-pr/9958` (draft #224, original commit author `slipperysquid` preserved; indexed in #17; SHADER-930), rebased cleanly onto current `main`. Lowers `s_bfe_u64` and `s_bfe_i64` in `tools/rdna2spirv.py` to 2x32-bit operations with no `OpCapability Int64` / `OpTypeInt 64` / `uses_psb` requirement: - Funnel-shifts the 64-bit dword pair right by the offset (all shifts in `0..31`) and extracts `min(w, 32)` bits for the low dword and the remaining bits for the high dword via 32-bit `OpBitFieldUExtract` / `OpBitFieldSExtract` (sign-extending the high dword from the low dword when `w <= 32` for `s_bfe_i64`), preserving exact value and `SCC` semantics. - Adds `tests/semantic/test_salu64_2x32.py` (verifying no `Int64` across all seven 64-bit scalar data ops, `bfe` value + `SCC` grids, and CPU execution of the GPU fixtures), updates `tests/semantic/test_salu_bfe_64.py`, adds GPU fixtures `runtime/test/shaders/cs_w32_salu64_bfe.asm` and `cs_w32_salu64_bits.asm` wired into `check.py` and `scripts/run_gpu_tests.py`, adds 11 cases to `tools/int_hw_probe.py`, and updates the contract row in `docs/design.md`. ### Tested - `python -m unittest discover -s tests/semantic -p test_salu64_2x32.py -v`: 8 tests, OK. - `python -m unittest discover -s tests/semantic -p test_salu_bfe_64.py -v`: 44 tests, OK. - `python -I tests/test_shader_checks.py`: 87 tests, OK. - `python -I tests/test_docs_links.py`: 16 tests, OK. - `python -I scripts/run_semantic_tests.py tests/semantic`: 471 files, 6,176 tests, 0 files failed. - `python -I scripts/check_no_game_data.py` on all 11 touched files: exit 0 (no game data). GPUs tested: n/a (CPU SPIR-V interpreter semantic suite on Windows 11 Pro 64-bit, Python 3.12.10; original author tested the GPU fixtures on RX 6800 XT / RTX 3070 / llvmpipe) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#1257
No description provided.