[PR #1187] rdna2spirv: refuse 3D Dref c_lz samples (OLD-9845 / SHADER-1402) #1219

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

📋 Pull Request Information

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

Base: main ← Head: carry/old-9845-dref-3d-refusal


📝 Commits (2)

  • 5b97994 rdna2spirv: refuse 3D Dref c_lz samples
  • 72e01c4 rdna2spirv: refuse all 3D image_sample_c* Dref forms (VUID-StandaloneSpirv-OpImage-04777)

📊 Changes

5 files changed (+66 additions, -8 deletions)

View changed files

📝 docs/design.md (+1 -0)
➕ tests/semantic/fixtures/dref_3d_c_lz.asm (+8 -0)
➕ tests/semantic/fixtures/dref_3d_c_lz_o.asm (+9 -0)
📝 tests/semantic/test_sample_c.py (+46 -8)
📝 tools/rdna2spirv.py (+2 -0)

📄 Description

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

What and why

Carries forward old-pr/9845 (draft #112, original commit author ThomasSAMP preserved; indexed in #17; SHADER-1402), rebased cleanly onto current main.

Refuses 3D depth-compare c_lz texture samples in tools/rdna2spirv.py:

  • Raises Unsupported ("3D depth comparison") for image_sample_c_lz and image_sample_c_lz_o with dim:SQ_RSRC_IMG_3D, because Vulkan forbids Dref image sampling instructions on 3D images (VUID-StandaloneSpirv-OpImage-04777).
  • Adds the contract row in docs/design.md (with the 1.0.2.1 corpus count: all 15,155 image_sample_c_lz sites are 2D or 2D-array, none 3D).
  • Adds hand-written fixtures tests/semantic/fixtures/dref_3d_c_lz.asm and dref_3d_c_lz_o.asm, and updates tests/semantic/test_sample_c.py to test both the 3D refusals and continued acceptance of 2D / 2D-array forms.

Tested

  • python -m unittest discover -s tests/semantic -p test_sample_c.py -v: 10 tests, OK (1 skipped: spirv-val not on PATH).
  • python -I scripts/run_semantic_tests.py tests/semantic: 470 files, 6,170 tests, 0 files failed.
  • python -I tests/test_docs_links.py: 16 tests, OK.
  • python -I scripts/check_no_game_data.py docs/design.md tools/rdna2spirv.py tests/semantic/test_sample_c.py tests/semantic/fixtures/dref_3d_c_lz.asm tests/semantic/fixtures/dref_3d_c_lz_o.asm: 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)

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/1187 **Author:** [@ambroseautomation](https://github.com/ambroseautomation) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `carry/old-9845-dref-3d-refusal` --- ### 📝 Commits (2) - [`5b97994`](https://github.com/ubiquitarianism/leonida/commit/5b979943c5346cfe28c08ad50d98ff09dd63ea5f) rdna2spirv: refuse 3D Dref c_lz samples - [`72e01c4`](https://github.com/ubiquitarianism/leonida/commit/72e01c4e713f8350542665f2eb936f1684c28163) rdna2spirv: refuse all 3D image_sample_c* Dref forms (VUID-StandaloneSpirv-OpImage-04777) ### 📊 Changes **5 files changed** (+66 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+1 -0) ➕ `tests/semantic/fixtures/dref_3d_c_lz.asm` (+8 -0) ➕ `tests/semantic/fixtures/dref_3d_c_lz_o.asm` (+9 -0) 📝 `tests/semantic/test_sample_c.py` (+46 -8) 📝 `tools/rdna2spirv.py` (+2 -0) </details> ### 📄 Description Claimed in the coordination issue as: OLD-9845 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7142425786) ### What and why Carries forward `old-pr/9845` (draft #112, original commit author `ThomasSAMP` preserved; indexed in #17; SHADER-1402), rebased cleanly onto current `main`. Refuses 3D depth-compare `c_lz` texture samples in `tools/rdna2spirv.py`: - Raises `Unsupported` (`"3D depth comparison"`) for `image_sample_c_lz` and `image_sample_c_lz_o` with `dim:SQ_RSRC_IMG_3D`, because Vulkan forbids Dref image sampling instructions on 3D images (`VUID-StandaloneSpirv-OpImage-04777`). - Adds the contract row in `docs/design.md` (with the 1.0.2.1 corpus count: all 15,155 `image_sample_c_lz` sites are 2D or 2D-array, none 3D). - Adds hand-written fixtures `tests/semantic/fixtures/dref_3d_c_lz.asm` and `dref_3d_c_lz_o.asm`, and updates `tests/semantic/test_sample_c.py` to test both the 3D refusals and continued acceptance of 2D / 2D-array forms. ### Tested - `python -m unittest discover -s tests/semantic -p test_sample_c.py -v`: 10 tests, OK (1 skipped: `spirv-val` not on PATH). - `python -I scripts/run_semantic_tests.py tests/semantic`: 470 files, 6,170 tests, 0 files failed. - `python -I tests/test_docs_links.py`: 16 tests, OK. - `python -I scripts/check_no_game_data.py docs/design.md tools/rdna2spirv.py tests/semantic/test_sample_c.py tests/semantic/fixtures/dref_3d_c_lz.asm tests/semantic/fixtures/dref_3d_c_lz_o.asm`: 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) 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#1219
No description provided.