[PR #1203] [MERGED] rdna2spirv: mesh shader compressed exports unpack f16 pairs instead of failing (OLD-9921) #1237

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

📋 Pull Request Information

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

Base: main ← Head: carry/old-9921-ms-compressed-exports


📝 Commits (4)

  • d6efad1 fix: mesh shader compressed exports (exp pos1/param ... compr) unpack their f16 pairs instead of raising Unsupported (rdna2spirv)
  • e39adc9 docs: contract row for compressed mesh-shader exports
  • 50740a1 Merge main into carry/old-9921-ms-compressed-exports
  • 275cb01 Merge main into carry/old-9921-ms-compressed-exports (after #1197)

📊 Changes

3 files changed (+94 additions, -37 deletions)

View changed files

📝 docs/design.md (+1 -1)
📝 tests/test_translate.py (+52 -0)
📝 tools/rdna2spirv.py (+41 -36)

📄 Description

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

Depends on: #1197

What and why

Carries forward old-pr/9921 (draft #189, original commit author tedin7 preserved; indexed in #17), rebased cleanly onto current main.

Fixes mesh shader compressed exports (exp pos1/param ... compr) in tools/rdna2spirv.py so they unpack their f16 pairs instead of raising Unsupported("mesh compressed export"):

  • Extracts shared Gen.export_comps(a, ins) from Gen.export and reuses it in Gen.mesh_export for pos1+, pos0, and param* exports, unpacking each f16 pair register via OpExtInst %v2float %glsl UnpackHalf2x16 and preserving off slots as None.
  • Adds 4 unit tests in tests/test_translate.py: test_ms_compressed_pos1_clip_export_unpacks_f16_pairs, test_ms_compressed_pos1_clip_export_off_register_writes_nothing, test_ms_compressed_param_export_unpacks_f16_pairs, and test_ms_uncompressed_exports_do_not_unpack_halves.

Tested

  • Executed all 4 new tests/test_translate.py functions directly via rdna2spirv.translate and verified SPIR-V binary assembly via spirv_asm.assemble (no llvm-mc/spirv-val installed on host): 4/4 PASS.
  • python -I scripts/run_semantic_tests.py tests/semantic: 470 files, 6,168 tests, 0 files failed.
  • python -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/test_translate.py: exit 0 (no game data).

GPUs tested: n/a (CPU SPIR-V interpreter semantic suite + in-process spirv_asm assembly on Windows 11 Pro 64-bit, Python 3.12.10)

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. (extends existing compressed export f16 unpacking to mesh stage)

🔄 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/1203 **Author:** [@ambroseautomation](https://github.com/ambroseautomation) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `carry/old-9921-ms-compressed-exports` --- ### 📝 Commits (4) - [`d6efad1`](https://github.com/ubiquitarianism/leonida/commit/d6efad1bbcf44d12ae2946adeb5081e27753be6f) fix: mesh shader compressed exports (exp pos1/param ... compr) unpack their f16 pairs instead of raising Unsupported (rdna2spirv) - [`e39adc9`](https://github.com/ubiquitarianism/leonida/commit/e39adc942cfe473f3febbf9ff30a6787baa705bb) docs: contract row for compressed mesh-shader exports - [`50740a1`](https://github.com/ubiquitarianism/leonida/commit/50740a1bc541b2d007f87cad86f7a776f994f3e7) Merge main into carry/old-9921-ms-compressed-exports - [`275cb01`](https://github.com/ubiquitarianism/leonida/commit/275cb01456b408c5f7ee985d7b70a5e1b696cc6f) Merge main into carry/old-9921-ms-compressed-exports (after #1197) ### 📊 Changes **3 files changed** (+94 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+1 -1) 📝 `tests/test_translate.py` (+52 -0) 📝 `tools/rdna2spirv.py` (+41 -36) </details> ### 📄 Description Claimed in the coordination issue as: OLD-9921 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7142940137) Depends on: #1197 ### What and why Carries forward `old-pr/9921` (draft #189, original commit author `tedin7` preserved; indexed in #17), rebased cleanly onto current `main`. Fixes mesh shader compressed exports (`exp pos1/param ... compr`) in `tools/rdna2spirv.py` so they unpack their f16 pairs instead of raising `Unsupported("mesh compressed export")`: - Extracts shared `Gen.export_comps(a, ins)` from `Gen.export` and reuses it in `Gen.mesh_export` for `pos1+`, `pos0`, and `param*` exports, unpacking each f16 pair register via `OpExtInst %v2float %glsl UnpackHalf2x16` and preserving `off` slots as `None`. - Adds 4 unit tests in `tests/test_translate.py`: `test_ms_compressed_pos1_clip_export_unpacks_f16_pairs`, `test_ms_compressed_pos1_clip_export_off_register_writes_nothing`, `test_ms_compressed_param_export_unpacks_f16_pairs`, and `test_ms_uncompressed_exports_do_not_unpack_halves`. ### Tested - Executed all 4 new `tests/test_translate.py` functions directly via `rdna2spirv.translate` and verified SPIR-V binary assembly via `spirv_asm.assemble` (no `llvm-mc`/`spirv-val` installed on host): 4/4 PASS. - `python -I scripts/run_semantic_tests.py tests/semantic`: 470 files, 6,168 tests, 0 files failed. - `python -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/test_translate.py`: exit 0 (no game data). GPUs tested: n/a (CPU SPIR-V interpreter semantic suite + in-process `spirv_asm` assembly on Windows 11 Pro 64-bit, Python 3.12.10) 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. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (extends existing compressed export f16 unpacking to mesh stage) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:20: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#1237
No description provided.