mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:45:53 +01:00
[PR #1697] rdna2spirv: translate s_sethalt before s_endpgm as the end of the wave (SHADER-SETHALT) #1711
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#1711
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/1697
Author: @kawaii-shakal
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:shader-sethalt📝 Commits (4)
5d440c8rdna2spirv: translate s_sethalt before s_endpgm as the end of the wave (SHADER-SETHALT)a2f6613rdna2spirv: keep branch destinations when lowering s_sethaltf8cbebdMerge commit 'refs/leonida-fix/main' into codex/fix-1697661ec78Merge upstream main into shader-sethalt📊 Changes
3 files changed (+96 additions, -1 deletions)
View changed files
📝
docs/design.md(+1 -1)➕
tests/test_sethalt.py(+67 -0)📝
tools/rdna2spirv.py(+28 -0)📄 Description
Claim: SHADER-SETHALT, https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7157294504
What and why
s_sethaltsets the wave's HALT bit to SIMM16[0] (RDNA2 ISA, SOPP). 1 stops the wave until a debugger or the host clears it. Nothing clears it in a translated dispatch. The translator refused the instruction outright.In the 1.0.2.1 pipeline library one compute program has it:
s_sethalt 1right befores_endpgm, after its only store. It is a 24-byte-prologue FSPX program (#583). It is the ones_sethaltleft in #674's table and the library's last refusal on current main.tools/rdna2spirv.py:drop_final_halts, called intranslate()before code generation.s_sethalt 1when the next instruction iss_endpgm. The wave ends there anyway, after the same memory writes.s_sethalt 0anywhere.s_sethalt 1with more code after it, ass_sethalt 1 before more code. On the console that wave would hang; an invocation cannot.docs/design.md: the no-op SOPP row says this.Test
tests/test_sethalt.py, with hand-written compute listings and no game data:s_sethalt 1; s_endpgmgives the same SPIR-V as the store followed bys_endpgm.s_sethalt 0is a no-op.s_sethalt 1before more code is refused.All 3 fail on main and pass with the change.
test_sopp_noops,test_printed_encodingandtest_isa_coveragealso pass. Run with Python 3.13 and pytest 9 on Windows 11 Pro 26300.Count on the 1.0.2.1 library (2,684 compute programs,
make_gameon main 237deb64c's translator with--wave64-emulate, LLVM 23):spirv-val.vk_pipeline_check, RTX 5070 Ti, NVIDIA driver on Windows): 0 failures so far on this run; this program's module was not compiled through the GPU on its own.Two FidelityFX DLL programs (03 and 18) are refused for a separate reason: the exact re-anchor path does not try
restore_dot4_inline_sel. #1662 already fixes that, so it is not in this PR.AI-assisted: yes (Claude Code, Claude Opus 5.5).
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.