spirv_metal_set0: synthesize uint, retype helper calls, expand decoration groups, and capture spirv-as stderr (SHADER-METAL-SET0-FIX) #946
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/946"
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?
Imported from ubiquitarianism/leonida. Originally posted by hamdog0203 on 2026-11-24T15:33:24Z.
Summary
Fixes four SPIR-V / CLI edge cases in
tools/spirv_metal_set0.py:OpTypeInt 32 0) before the first resized pointer type when a module with resized set-0 descriptor arrays does not already declare one (instead of exiting withSystemExit).OpCopyObjectandOpFunctionCallintoOpFunctionParameterand clonedOpTypeFunctiondeclarations (without mutating function types shared with unresized foreign-set helpers), and fail closed on conflicting call sites orOpPhi/OpSelectpointer merges.OpDecorationGroup/OpGroupDecoratefor bothDescriptorSet 0andBindingdecorations, splitting sharedBindinggroups when they mix set-0 and non-set-0 targets.spirv-asstderr and pass explicitencoding="utf-8", errors="replace"forspirv-dis/spirv-assocli()surfaces assembler errors and preserves UTF-8OpNames on Windows code pages.Verification
pytest tests/test_spirv_metal_set0.py -v(with Khronos SPIRV-Toolsspirv-as,spirv-dis,spirv-val1.4.363.1): 15/15 passed, 0 skipped.main(a289278): 6/7 new tests failed onmain.unittest tests/test_text_write_line_endings.py: 3/3 passed.scripts/check_no_game_data.py: exit 0; LF-only, no BOM.Claimed in the coordination issue as: SHADER-METAL-SET0-FIX (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7136062894)
AI-assisted: yes
No game files
Imported from ubiquitarianism/leonida. Originally posted by KernelSmoker on 2026-11-24T15:37:04Z.
Review: APPROVED
Verified on exact head
9c09a6749b246c3f86e9eba6dc4b6129444585cb. In a disposable Fedora 45 container with SPIRV-Tools installed,tests/test_spirv_metal_set0.pypassed 15/15, including assembled andspirv-val-validated modules for synthetic uint insertion, nested helper parameter/call retyping, mixed decoration groups, and rejection of unsupported/conflicting pointer flows.tests/test_text_write_line_endings.pypassed 3/3. Python compile,check_no_game_data.py, andgit diff --checkpassed. The tests use synthetic SPIR-V only; no game data or GPU result is claimed.Imported from ubiquitarianism/leonida. Originally posted by sodove on 2026-11-28T11:28:24Z.
#946 | head
9c09a6749b246c3f86e9eba6dc4b6129444585cb|python3 -m pytest -q -rA tests/test_spirv_metal_set0.py| red: 7 failed, 8 passed | green: 15 passed | Red → greenSPIRV-Tools were on PATH. The suite exercised the CLI and real assembly/disassembly/validation, including retyped helper calls and grouped decorations.
Copied the PR tests onto clean main
4a54aedcb6b66525e0c9f72a6ea10263337c9141for the baseline, then merged that main into the recorded PR head and reran those files. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Unittest failure/error counts include subtests where applicable. AI-assisted with OpenAI Codex. Batch claim.Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T11:41:36Z.
Merged, thank you @hamdog0203! This PR (spirv_metal_set0: synthesize uint, retype helper calls, expand decoration groups, and capture spirv-as stderr (SHADER-METAL-SET0-FIX)) passed its own tests with main merged in during sodove's verification of this shader batch, so it went in with the batch.
AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.