BUILD-SPIRV-DEBUGINFO: Support named SPIR-V shader debug instructions #310

Manually merged
github merged 1 commit from gh-pr/310/head into gh-pr/310/base 2026-11-26 08:52:54 +00:00
Owner

@⁠ettehn on GitHub · 2026-11-24 03:06 UTC · original
ettehn:spirv-nonsemantic-debuginfo → main · +95 −2 · 3 files · 1 commits · merged 2026-11-24 13:36 UTC

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.100 and use the imported instruction set for both OpExtInst and OpExtInstWithForwardRefsKHR. Without this, the Python assembler tries to parse names such as DebugSource as 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 main with invalid integer literal 'DebugSource' and passed after the fix. It compares named instructions with numeric opcodes, validates the module with spirv-val --target-env vulkan1.2, and checks binary parity with spirv-as except 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 unpatched main also 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

  • No game data, keys or decryption.
  • No translator rule change. The patch affects the Python SPIR-V assembler.
**@⁠ettehn** on GitHub · 2026-11-24 03:06 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/310) `ettehn:spirv-nonsemantic-debuginfo` → `main` · +95 −2 · 3 files · 1 commits · merged 2026-11-24 13:36 UTC Claimed in the coordination issue as: [BUILD-SPIRV-DEBUGINFO](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) 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.100` and use the imported instruction set for both `OpExtInst` and `OpExtInstWithForwardRefsKHR`. Without this, the Python assembler tries to parse names such as `DebugSource` as 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 `main` with `invalid integer literal 'DebugSource'` and passed after the fix. It compares named instructions with numeric opcodes, validates the module with `spirv-val --target-env vulkan1.2`, and checks binary parity with `spirv-as` except 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 unpatched `main` also 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 - [x] No game data, keys or decryption. - No translator rule change. The patch affects the Python SPIR-V assembler.
Carry forward old Leonida PR #4744 for BUILD-SPIRV-DEBUGINFO.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:52:51 +00:00
github manually merged commit f8a88299e1 into gh-pr/310/base 2026-11-26 08:52:54 +00:00
Author
Owner

@⁠Oliwettoo on GitHub · 2026-11-24 10:25 UTC · original

Looks good. The new NONSEMANTIC_SHADER_DEBUGINFO_100 table matches SPIRV-Headers' extinst.nonsemantic.shader.debuginfo.100.grammar.json exactly (same 44 names, same opcodes, checked by script). OpExtInstWithForwardRefsKHR stays 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.py passes on current main (the spirv-as comparison was skipped here, as there is no SPIRV-Tools on this machine). Ship. AI-assisted review.

**@⁠Oliwettoo** on GitHub · 2026-11-24 10:25 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/310#issuecomment-7128771951) Looks good. The new `NONSEMANTIC_SHADER_DEBUGINFO_100` table matches SPIRV-Headers' `extinst.nonsemantic.shader.debuginfo.100.grammar.json` exactly (same 44 names, same opcodes, checked by script). `OpExtInstWithForwardRefsKHR` stays 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.py` passes on current `main` (the spirv-as comparison was skipped here, as there is no SPIRV-Tools on this machine). Ship. AI-assisted review.
Author
Owner

@⁠QemmHD on GitHub · 2026-11-24 13:36 UTC · original

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 (21625bca8 or 51f316092) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c242f (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).

**@⁠QemmHD** on GitHub · 2026-11-24 13:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/310#issuecomment-7133081115) 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 (21625bca8 or 51f316092) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c242f (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).
This discussion has been locked. Commenting is limited to contributors.
No description provided.