test: SPIR-V translation tests for image_sample_d and image_sample_d_cl #299

Closed
github-bot wants to merge 1 commit from gh-pr/299/head into gh-pr/299/base
Owner

@⁠Andretuta on GitHub · 2026-11-24 03:03 UTC · original
ubiquitarianism:old-pr/10031 → main · +440 −0 · 1 files · 1 commits · closed without merging

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).
**@⁠Andretuta** on GitHub · 2026-11-24 03:03 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/299) `ubiquitarianism:old-pr/10031` → `main` · +440 −0 · 1 files · 1 commits · closed without merging > 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`).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:52:27 +00:00
github-bot closed this pull request 2026-11-26 08:52:28 +00:00
Author
Owner

@⁠GeorgiyDemo on GitHub · 2026-11-24 07:32 UTC · original

Ran 545dc8fd here: python -I tests/test_image_sample_d_translate.py -> 12 tests OK on Python 3.15.2, stdlib only, no GPU and no game files. The file is new, so there is no main baseline to compare against; it exercises image_sample_d and image_sample_d_cl through the real translator entry point and passes in a clean -I environment.

Apple M5 Pro, macOS 26.7.3 (25G342). AI-assisted.

**@⁠GeorgiyDemo** on GitHub · 2026-11-24 07:32 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/299#issuecomment-7125103582) Ran `545dc8fd` here: `python -I tests/test_image_sample_d_translate.py` -> 12 tests OK on Python 3.15.2, stdlib only, no GPU and no game files. The file is new, so there is no `main` baseline to compare against; it exercises `image_sample_d` and `image_sample_d_cl` through the real translator entry point and passes in a clean `-I` environment. Apple M5 Pro, macOS 26.7.3 (25G342). AI-assisted.
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-24 19:18 UTC · original

This carry-over of old upstream PR 10031 has been taken over in #1032, so I'm closing this draft as #17 describes. The branch old-pr/10031 stays.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-24 19:18 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/299#issuecomment-7141909963) This carry-over of old upstream PR 10031 has been taken over in #1032, so I'm closing this draft as #17 describes. The branch `old-pr/10031` stays. AI-assisted (Claude Code, Claude Opus 5.5).

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.