mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:45:53 +01:00
[PR #112] rdna2spirv: refuse 3D Dref c_lz samples (SHADER-1402) #164
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#164
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/112
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:old-pr/9845📝 Commits (1)
71fdcc0rdna2spirv: refuse 3D Dref c_lz samples📊 Changes
5 files changed (+49 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(+29 -8)📝
tools/rdna2spirv.py(+2 -0)📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):Resubmission of
#9630, which was closed unmerged in the 22:28 UTC cleanup of outside PRs. I can't reopen it as its author, so this is the same commit, rebased ontomain2d53a8055without conflicts. Reviews and checks of the earlier headce4c3af2aare on#9630: an approval by@Zipettte, and checks by@SweatierKey(with a negative control),@catminou4,@molodayamamaand@o-psi(merge-candidate).Claimed in the coordination issue as: SHADER-1402
What and why
Refuse
image_sample_c_lzandimage_sample_c_lz_oon 3D images during translation.Vulkan forbids Dref instructions on 3D images (
VUID-StandaloneSpirv-OpImage-04777). Until now, the translator emittedOpImageSampleDrefExplicitLodthere, producing a module that assembled but failedspirv-val --target-env vulkan1.2.The refusal is narrow: 2D and 2D-array forms, texel-offset forms included, still translate and validate. The PR adds two hand-written assembly fixtures and a contract-table row.
The existing SHADER-1402 corpus census counted 15,155
image_sample_c_lzsites: 12,718 2D and 2,437 2D-array, none on 3D images. No game corpus was read for this PR.Tested on the rebased head (
main2d53a8055)Windows 11, Python 3.12.10, LLVM 23.1.6, SPIRV-Tools from Vulkan SDK 1.4.363.0.
python -m unittest discover -s tests/semantic -p test_sample_c.py: 10/10 OK, with no skips (spirv-valpresent).python -I scripts/run_semantic_tests.py tests/semantic: 459 files and 6,048 tests. 3 files fail:test_exec_computed(2 failures),test_image_atomics_guard(47) andtest_image_cube_store_glc(1 error). All three fail the same way onmain2d53a8055without this change.compileall,git diff --checkandscripts/check_no_game_data.pyon the five changed files: clean.Tested on the original head (
ce4c3af2a, onmain5d74c2723)spirv-val. The generated SPIR-V directories are byte-identical.xbox_presentcrashes on that machine come from an installed overlay's implicit Vulkan layer. Seedocs/testing.md: 5/5 pass withVK_LOADER_LAYERS_DISABLE=~implicit~.)AI-assisted: yes. The change was written with Kimi Code; the rebase and retest were done with Claude Code.
Checklist
docs/design.md, with its Vulkan validation reference and corpus count.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.