startup-runtime: gfx2hlsl does not support VOP2 SDWA #1141
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#1141
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?
@denn0x on GitHub · 2026-11-24 01:45 UTC · original
Problem
tools/startup/gfx2hlsl.pystops onvop2_sdwainstructions (sub-dword addressing: byte/word selects,sign extension, clamp). At least one pixel pipeline is left untranslated because of it.
Done when
SDWA source/destination selects are translated, with a gfx1013 assembly fixture that covers byte and word
selects and compares against the existing pixel AOT path.
Context:
docs/startup-runtime.md(#1135). Do not attach game files, dumps or logs that contain addresses or names from an executable; describe results in terms of the component tested.AI-assisted (Claude Code).
@rasptum on GitHub · 2026-11-24 02:04 UTC · original
Claiming this.
vop2_sdwaintools/startup/gfx2hlsl.py.AI-assisted (Claude Code).
@triggered02 on GitHub · 2026-11-24 05:35 UTC · original
Taking this. Plan: translate VOP2 SDWA source and destination selects in ools/startup/gfx2hlsl.py (byte/word selects, sign extension, destination select and unused lanes, clamp), and check the result against the existing ools/pixel_aot.py lowering for the same encodings with a source-built gfx1013 fixture.
Starting from the encodings the decoder already produces, so the fixture needs no assembler here (LLVM's MC tests supply the golden bytes).
@triggered02 on GitHub · 2026-11-24 05:39 UTC · original
Implemented as PR #1256.
Scope: the byte and word selects of the 32-bit integer VOP1/VOP2 SDWA forms, with source zero-extension, \sext()\ sign extension, destination field placement, and \UNUSED_PAD\ / \UNUSED_PRESERVE. The selection helpers now match \ ools/pixel_aot.py\ exactly, and \startup_gfx2hlsl_sdwa\ enforces that parity mechanically for every selection with and without \sext(), and for both destination unused forms, then drives the translator on gfx1013 assembly.
Two real bugs the fixture caught: the operation's HLSL has to be grouped before the destination mask (\_or_b32\ with \dst_sel:WORD_1\ otherwise emitted \7 | v8 & 0xffff, which keeps bits the hardware clears), and \sext()\ is a shift pair rather than a mask.
Not covered, and refused rather than translated inexactly: float SDWA forms and \dst_unused:UNUSED_SEXT. I did not run a full title startup from this branch, so I have not yet measured whether the pixel pipeline that stopped on SDWA now translates — I can run one and report the pipeline count if that is wanted before merge.
@triggered02 on GitHub · 2026-11-24 05:52 UTC · original
Measured impact, and it is weaker than the issue implies — reporting it rather than letting the PR look like a pipeline win.
I captured a fresh shader cache from an offline startup (
-ShaderCache, run to the known null at 88 s, 1,869 frames) and translated the four pipelines withgfx2hlsl.py --pending:.failorigin/main(4182af8f, no SDWA).failSo the two pipelines that used to fail were blocked by
s_setprio, not by SDWA — #1241 is merged and that is what unblocked them. Since `(Full measurement is on PR #1256.)