BUILD-SPIRV-DEBUGINFO: Support named SPIR-V shader debug instructions #310
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/310"
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 ettehn on 2026-11-24T03:06:11Z.
Claimed in the coordination issue as: BUILD-SPIRV-DEBUGINFO
Rebased on main after #78 merged. On Windows, the updated head passed 47 SPIR-V assembler tests, 3 line-ending checks, all 6,075 semantic tests, and the no-game-data check.
What and why
Carries forward old upstream PR #4744. Register all 44 names from Khronos
NonSemantic.Shader.DebugInfo.100and use the imported instruction set for bothOpExtInstandOpExtInstWithForwardRefsKHR. Without this, the Python assembler tries to parse names such asDebugSourceas integers.Tested
Windows 11 25H2 (build 26200.9974), Ryzen 9 8945HX, Python 3.13.7, Khronos SPIRV-Tools 2026.4. These checks run on the CPU and use no GPU driver.
The new synthetic regression failed on
mainwithinvalid integer literal 'DebugSource'and passed after the fix. It compares named instructions with numeric opcodes, validates the module withspirv-val --target-env vulkan1.2, and checks binary parity withspirv-asexcept for the generator word.python -IB -m unittest discover -s tests -p 'test_spirv_asm*.py'— 42 passed. The same command on the local integration with #78 passed 47 tests.python -IB tests/test_text_write_line_endings.py— 3 passed.python -IB scripts/run_semantic_tests.py tests/semantic -j 8— 6,075 tests across 463 files, zero failing files. The same suite on unpatchedmainalso had zero failing files.python -IB scripts/check_no_game_data.py— passed.AI-assisted: Yes. OpenAI Codex helped port the patch, run the Windows checks and prepare this PR.
Checklist
Imported from ubiquitarianism/leonida. Originally posted by Oliwettoo on 2026-11-24T10:25:54Z.
Looks good. The new
NONSEMANTIC_SHADER_DEBUGINFO_100table matches SPIRV-Headers'extinst.nonsemantic.shader.debuginfo.100.grammar.jsonexactly (same 44 names, same opcodes, checked by script).OpExtInstWithForwardRefsKHRstays out of the pure-Id fast path because of its literal operand, so routing it through the ext-set lookup is enough.tests/test_spirv_asm.pypasses on currentmain(the spirv-as comparison was skipped here, as there is no SPIRV-Tools on this machine). Ship. AI-assisted review.Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-24T13:36:48Z.
Merging.
Why merged: Adds the named NonSemantic.Shader.DebugInfo.100 instruction table so SPIR-V debug instructions disassemble by name. Oliwettoo checked that the table matches SPIRV-Headers' grammar exactly (44 names).
Why it's good: Data table plus tests only. Its tests: 47 passed. No behaviour change for shaders without debug info.
Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (
21625bca8or51f316092) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main2d73c242f(git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones).AI-assisted (Claude Code, Claude Opus 5.5).