startup: treat the SMEM offset form 'off' as zero #1681
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!1681
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1681/head"
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?
@triggered02 on GitHub · 2026-11-24 17:00 UTC · original
triggered02:startup/smem-off→main· +121 −2 · 4 files · 1 commits · closed without mergingFixes #1674. This is the largest single group in the loading-screen refusal census — 7 of 29 refused shaders (#870).
Problem
offis the SMEM offset form with nom0offset, so its byte offset is zero.gfx2hlslpassed the operand to the uint helper, which refused the whole translation:In
s_load_dword*the same operand failed earlier insideint(ops[2], 0)and reporteds_load with a register offset through ..., which named the wrong cause.Change
The literal and
m0forms keep their previous behaviour (s_buffer_loadkeepsm0as a register offset;s_loadstill refuses a register offset), and an operand that is neither a literal,m0noroffis still refused rather than silently treated as zero.Test
New
startup_gfx2hlsl_smem_offsetctest covering:offaccepted as zero fors_buffer_load_dword,s_buffer_load_dwordx2ands_load_dword;m0stays a register offset fors_buffer_load, and stays refused fors_load;Fail-first: reverting the two lines makes the new test fail with
Unsupported: operand 'off'/ theint()ValueError.What this does not establish
m0register offset fors_load_dword*stays refused; this slice does not model it.v_cvt_f32_i32 with ['mul:2'],BUF_FMT_16_16_16_16_FLOAT,SQ_RSRC_IMG_1D) are untouched.AI-assisted (Claude Code).
offas zero 88545bc769@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 17:00 UTC · original · edited 2026-11-24 17:04 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
0f00121ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
@ -594,1 +595,3 @@offset = self.u(ops[2])# The SMEM offset operand is either a literal, m0 (a register offset) or `off`, which means no m0# offset at all: zero. Treating `off` as an unknown uint operand refused the whole translation.offset = '0u' if ops[2] == 'off' else self.u(ops[2])@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 17:03 UTC · original
offbranch reachable for decoded shader bytesIn the real pipeline,
Stage.__init__populates instructions throughdecode(), which callsD.decode_instruction;tools/disasm_rdna2.py:2674-2681emits an SMEM operand as a hex literal for selector 125 or viadecode_s_regotherwise, never asoff. This condition—and the test that injects handwritten assembly intoStage.one—is therefore unreachable for shader bytes, so the reported refused shaders will still refuse. Update the decoder or input path, or test this through a real decoded instruction.Useful? React with 👍 / 👎.
@R0Y00 on GitHub · 2026-11-24 17:07 UTC · original
Thanks for filing #1674 and providing an independent implementation. #1676 is on main and covers the same two SMEM forms, including the fixed-buffer-word classification and descriptor-table case. Closing the overlapping implementation here. The loading-cache rescan you offered remains valuable in #870 as aggregate evidence.
@triggered02 on GitHub · 2026-11-24 17:09 UTC · original
You are right and I am closing this PR rather than reworking it in place — the fix targets a path the decoder never produces, so it does not help the shaders the issue is about.
Confirmation of your finding. With
Stage.oneannotating the refusing instruction, re-running translation over the same 29 refused cache entries gives:Every one of the seven is an
expexport whose unused channels are spelledoff. None is an SMEM load, and the decoder's SMEM path does emit a hex literal for selector 125 as you said (tools/disasm_rdna2.py:2674-2681). Thes_setreg-style text I patched only appears in hand-written assembly, which is exactly what my test injected throughStage.one— so the test proved the branch works while never exercising a decoded instruction. That is the more serious of the two errors: an unreachable fix is harmless, an unreachable test is not.My independent check agrees with yours on the mechanism as well:
buffer_load_dword v5, off, s[8:11], s3from000030e000050203reaches the buffer path with a different failure, and SMEM0x4-style literals translate fine.What happens next. I am filing a corrected issue for the real form —
expwithoffchannels — with a test that starts from encoded bytes and goes throughdecode(), not from hand-written assembly, and I will send that as a new PR. #1674 will be corrected or closed, since its diagnosis (SMEM offset operand) was wrong.Thanks for reading the call site instead of the diff. The
u('off')message survives to the .fail file, which made the wrong group look plausible; the annotated re-run is what actually located it.AI-assisted (Claude Code).
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 17:03 UTC · original · reviewed
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
0f00121d52ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Pull request closed