[PR #299] [CLOSED] test: SPIR-V translation tests for image_sample_d and image_sample_d_cl #352

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/299
Author: @Andretuta
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: old-pr/10031


📝 Commits (1)

  • 545dc8f test: SPIR-V translation tests for image_sample_d and image_sample_d_cl

📊 Changes

1 file changed (+440 additions, -0 deletions)

View changed files

➕ tests/test_image_sample_d_translate.py (+440 -0)

📄 Description

Carried over from old PR 10031 by Ritolino in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/10031, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
Ritolino: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Claimed in the coordination issue as: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116998532

What and why

Adds standalone stdlib-only SPIR-V translation tests (tests/test_image_sample_d_translate.py) for image_sample_d and image_sample_d_cl via real rdna2spirv.translate() calls.

  • Covers 1D, 2D, 3D, 2D_ARRAY, and CUBE dimensions (OpImageSampleExplicitLod with Grad and matching scalar/%v2float/%v3float gradient and coordinate vectors), image_sample_d_cl (Grad|MinLod + MinLod capability), a16 coordinate/clamp unpacking with 32-bit gradients, non-PS stage support, and partial dmask VGPR compaction.
  • Verifies rdna2spirv.Unsupported on unsupported variants/dims/short address counts (_o, _c_d, etc.) and includes negative controls confirming image_sample without _d omits Grad and dmask changes alter written VGPRs.
  • Does not touch any shared files.

Tested

AI-assisted.

Ran on Windows 11 (Python 3.12.10, stdlib-only):

  • python -I tests/test_image_sample_d_translate.py -v -> Ran 12 tests in 0.089s — OK
  • python -I -m compileall -q make_game.py tools tests -> exit code 0

Checklist

  • No game data (no extracted assets, keys, hashes, or disassembly from the game).
  • Translator rule N/A (test-only PR; no changes to tools/rdna2spirv.py).

🔄 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/299 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `old-pr/10031` --- ### 📝 Commits (1) - [`545dc8f`](https://github.com/ubiquitarianism/leonida/commit/545dc8fd6a15c30d37eec85a6e1e68e1b4562dbf) test: SPIR-V translation tests for image_sample_d and image_sample_d_cl ### 📊 Changes **1 file changed** (+440 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `tests/test_image_sample_d_translate.py` (+440 -0) </details> ### 📄 Description > Carried over from **old PR 10031** by `Ritolino` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/10031`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `Ritolino`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Claimed in the coordination issue as: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116998532 ### What and why Adds standalone `stdlib-only` SPIR-V translation tests (`tests/test_image_sample_d_translate.py`) for `image_sample_d` and `image_sample_d_cl` via real `rdna2spirv.translate()` calls. - Covers `1D`, `2D`, `3D`, `2D_ARRAY`, and `CUBE` dimensions (`OpImageSampleExplicitLod` with `Grad` and matching scalar/`%v2float`/`%v3float` gradient and coordinate vectors), `image_sample_d_cl` (`Grad|MinLod` + `MinLod` capability), `a16` coordinate/clamp unpacking with 32-bit gradients, non-PS stage support, and partial `dmask` VGPR compaction. - Verifies `rdna2spirv.Unsupported` on unsupported variants/dims/short address counts (`_o`, `_c_d`, etc.) and includes negative controls confirming `image_sample` without `_d` omits `Grad` and `dmask` changes alter written VGPRs. - Does not touch any shared files. ### Tested AI-assisted. Ran on Windows 11 (Python 3.12.10, stdlib-only): - `python -I tests/test_image_sample_d_translate.py -v` -> `Ran 12 tests in 0.089s — OK` - `python -I -m compileall -q make_game.py tools tests` -> exit code 0 ### Checklist - [x] No game data (no extracted assets, keys, hashes, or disassembly from the game). - [x] Translator rule N/A (test-only PR; no changes to `tools/rdna2spirv.py`). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:17:36 +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#352
No description provided.