[PR #858] rdna2spirv: support buffer_load_format_d16_hi_x and buffer_store_format_d16_hi_x (OLD-9907) #897

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

📋 Pull Request Information

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

Base: main ← Head: feat/old-9907-buffer-format-d16


📝 Commits (1)

  • 3ad34dd rdna2spirv: buffer_load_format_d16_hi_x and buffer_store_format_d16_hi_x

📊 Changes

3 files changed (+120 additions, -7 deletions)

View changed files

📝 docs/design.md (+1 -0)
➕ tests/semantic/test_buffer_format_d16_hi.py (+100 -0)
📝 tools/rdna2spirv.py (+19 -7)

📄 Description

Claimed in the coordination issue as: OLD-9907

Summary

Carries forward old-pr/9907 (carried-over draft #172) onto current main (d0da7dade), preserving the original author's (Luiz Neves) commit:

  • rdna2spirv: buffer_load_format_d16_hi_x and buffer_store_format_d16_hi_x

Supports buffer_load_format_d16_hi_x (writes decoded 16-bit result into bits 31:16 of vdata, preserving bits 15:0, and marks vdata as read in read_before_write_vgprs) and buffer_store_format_d16_hi_x (reads component from bits 31:16 of vdata), plus the docs/design.md row and tests/semantic/test_buffer_format_d16_hi.py.

Rebase adjustments

  • Adapted self.tou(...) -> self.int_bits(...) in Gen.buffer_store to match current main.
  • Merged op == "buffer_load_format_d16_hi_x" alongside main's buffer_load_* d16 condition in read_before_write_vgprs.
  • Resolved docs/design.md table insertion below current main's Typed buffer formats row.

Testing & Verification

  • AI-assisted: yes (rebase, conflict resolution, and verification).
  • Synthetic fixtures only: no game data used (python -I scripts/check_no_game_data.py clean on all touched files).
  • Host: Windows 11, Python 3, Vulkan SDK spirv-as / spirv-val (--target-env vulkan1.3).
  • Tests:
    • python -I tests/semantic/test_buffer_format_d16_hi.py -v: 3/3 OK across all 77 formats in Gen.FORMATS (load high-half preservation, store high-half selection across 5 values per format, and read_before_write_vgprs)
    • spirv-as --target-env vulkan1.3 + spirv-val --target-env vulkan1.3 on translated compute shader exercising both buffer_load_format_d16_hi_x and buffer_store_format_d16_hi_x: PASS
    • python -m unittest discover -s tests/semantic -p test_buffer_format_narrow_int.py: 3/3 OK
    • python -I tests/test_docs_links.py: 16/16 OK
    • python -I tests/test_text_write_line_endings.py: 3/3 OK
    • python -m compileall -q make_game.py tools tests/semantic/test_buffer_format_d16_hi.py: OK

🔄 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/858 **Author:** [@TanmaySatyam](https://github.com/TanmaySatyam) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/old-9907-buffer-format-d16` --- ### 📝 Commits (1) - [`3ad34dd`](https://github.com/ubiquitarianism/leonida/commit/3ad34dddc38848ac6c0b2bb573f5ee0a01879458) rdna2spirv: buffer_load_format_d16_hi_x and buffer_store_format_d16_hi_x ### 📊 Changes **3 files changed** (+120 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+1 -0) ➕ `tests/semantic/test_buffer_format_d16_hi.py` (+100 -0) 📝 `tools/rdna2spirv.py` (+19 -7) </details> ### 📄 Description Claimed in the coordination issue as: OLD-9907 ### Summary Carries forward `old-pr/9907` (carried-over draft #172) onto current `main` (`d0da7dade`), preserving the original author's (`Luiz Neves`) commit: - `rdna2spirv: buffer_load_format_d16_hi_x and buffer_store_format_d16_hi_x` Supports `buffer_load_format_d16_hi_x` (writes decoded 16-bit result into bits 31:16 of `vdata`, preserving bits 15:0, and marks `vdata` as read in `read_before_write_vgprs`) and `buffer_store_format_d16_hi_x` (reads component from bits 31:16 of `vdata`), plus the `docs/design.md` row and `tests/semantic/test_buffer_format_d16_hi.py`. ### Rebase adjustments - Adapted `self.tou(...)` -> `self.int_bits(...)` in `Gen.buffer_store` to match current `main`. - Merged `op == "buffer_load_format_d16_hi_x"` alongside `main`'s `buffer_load_*` d16 condition in `read_before_write_vgprs`. - Resolved `docs/design.md` table insertion below current `main`'s `Typed buffer formats` row. ### Testing & Verification - **AI-assisted:** yes (rebase, conflict resolution, and verification). - **Synthetic fixtures only:** no game data used (`python -I scripts/check_no_game_data.py` clean on all touched files). - **Host:** Windows 11, Python 3, Vulkan SDK `spirv-as` / `spirv-val` (`--target-env vulkan1.3`). - **Tests:** - `python -I tests/semantic/test_buffer_format_d16_hi.py -v`: 3/3 OK across all 77 formats in `Gen.FORMATS` (load high-half preservation, store high-half selection across 5 values per format, and `read_before_write_vgprs`) - `spirv-as --target-env vulkan1.3` + `spirv-val --target-env vulkan1.3` on translated compute shader exercising both `buffer_load_format_d16_hi_x` and `buffer_store_format_d16_hi_x`: PASS - `python -m unittest discover -s tests/semantic -p test_buffer_format_narrow_int.py`: 3/3 OK - `python -I tests/test_docs_links.py`: 16/16 OK - `python -I tests/test_text_write_line_endings.py`: 3/3 OK - `python -m compileall -q make_game.py tools tests/semantic/test_buffer_format_d16_hi.py`: OK --- <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#897
No description provided.