help wanted: GPU translation, part 5 (vertex and pixel pipelines) #2023
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#2023
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 23:18 UTC · original
Ordinary vertex + pixel pipelines that
tools/startup/gfx2hlsl.pystill refuses. Each row is an independent piece of work for one pull request with a source-built or hand-assembled fixture. Counts are distinct pipeline requests from a private cache (first refusal only; closing one row exposes the next for some requests).Items (pick one, say so in a comment)
buffer_store_dwordx3, and behind it formatted loads through a descriptor taken from a heap at run timebuffer_load_format_x/_xy/_xyzwhere the format comes from the third buffer-descriptor wordv_readfirstlane_b32without a proven uniform sourced16modifier)v_cvt_f32_u32with an SDWA multiply-by-two destination modifierimage_sample_c_lzwith sampler fields the translator does not model (mip filter, upper bits of the third sampler word)16_16_SNORM(76),8_8_8_8_UINT(30),2_10_10_10_UNORM(22)v_min_u32with a DPP controlv_xor3_b32s_bitset1_b32v_cvt_pk_u8_f32Items already listed in part 1 (#1996) are not repeated:
v_subrev_f32with DPP,image_storein a pixel stage, the pixel-stage entry registers.What a pull request needs
tests/startup_gfx2hlsl_*_check.pyandtests/startup_translator_check.pystill passing.Related: #1723 (refusal census over an offline archive), #1978 (a census mode that reports every refusal site, not only the first).
Other parts: #1996 (pixel shaders), #1998 (mesh shaders), #1999 (render state and indirect draws), and the compute part filed alongside this one.
@consolelogkyo on GitHub · 2026-11-24 23:33 UTC · original
I'll take item E (
v_cvt_f32_u32and the float-resultVEC_U_TO_Fconversions in SDWA form with output modifiersclamp,mul:2,mul:4,div:2). I'll apply the output modifier and clamp in hardware order (scale first, saturate second, then bitwisedst_sel/dst_unusedplacement), keepVEC_Uinteger/uint-result conversions and float source modifiers refused, and verify with constructed SDWA encodings, negative controls, and desktop GPU readback.AI-assisted.
@Ybucaille on GitHub · 2026-11-25 00:09 UTC · original
I'll take three small items in
tools/startup/gfx2hlsl.py, one pull request each:v_xor3_b32: same semantics as the compute lowering in #1573, with a source-built fixture whose three sources differ in every byte and a negative control that drops the third operand.16_16_SNORMbuffer format only (the other two formats stay open): an entry next toBUF_FMT_16_16_UNORM, with -32768 clamped to -1.0 per the D3D/Vulkan SNORM rule, and controls on 0x8000, 0x8001, 0x7fff and 0.v_cvt_pk_u8_f32: byte select from src1, insertion into src2, rounding and clamping cited from LLVM 15 and checked against the existingcompute_store_aotform if there is one.Each keeps refusing what its fixture doesn't cover.
AI-assisted.
@Ybucaille on GitHub · 2026-11-25 00:14 UTC · original
Item I is up in #2097 (
v_xor3_b32, extendsstartup_gfx2hlsl_bit_alu_check.py). Item G is up in #2099 (16_16_SNORMonly, extendsstartup_vertex_fetch_formats_check.py). Controls and the llvm-mc fixture checks pass on Linux; the_warp/_hardwaredraws still need a Windows run. Item K is in progress.AI-assisted.
@R0Y00 on GitHub · 2026-11-25 00:17 UTC · original
Item E is on main in #2062 at
7aa3b53c. The Windows rerun used FXC and DXC on WARP and RTX 4060 Laptop. Each draw matched 1,024 reference words, and all five output-modifier or destination-selection controls produced the expected mismatch. The remainder of this issue still has its own rows and claims.@Ybucaille on GitHub · 2026-11-25 00:21 UTC · original
Item K is up in #2101 (
v_cvt_pk_u8_f32, same restriction on S0 as the compute lowering: +0.0 or an integer in 1..255; constants outside are refused). Controls pass on Linux; the_warp/_hardwaredraws still need a Windows run.AI-assisted.
@R0Y00 on GitHub · 2026-11-25 00:41 UTC · original
Item G is on main via #2099 (
246a875d). I reran the corrected SNORM readback at0832296eon WARP and RTX 4060 Laptop. Both checked all 12 formats, 16 vertices each, with CPU byte decoding and nine compiled mutations. The typed-buffer route and DXGI format 37 mapping are in that PR; other format rows stay open.@consolelogkyo on GitHub · 2026-11-25 00:58 UTC · original
I'll take item D (
image_loadwithd16at mip level zero intools/startup/gfx2hlsl.py). I'll narrow enableddmaskcomponents fromLoadto IEEE binary16 with an integer round-to-nearest-even helper (avoidingf32tof16truncation toward zero on normalized depth values) and pack them pairwise intoceil(popcount(dmask) / 2)destination VGPRs, keepimage_load_mipandimage_sample*d16forms refused, and verify with constructed MIMG encodings, negative controls, and desktop GPU readback againstDXGI_FORMAT_R16_UNORMandDXGI_FORMAT_R32G32B32A32_FLOATtextures on WARP and hardware.AI-assisted.
@R0Y00 on GitHub · 2026-11-25 01:10 UTC · original
There is an overlapping item D implementation in #2119. Please coordinate there before starting a second base-load implementation. The common acceptance needs the bound view type, since float/normalized and integer loads require different conversion, and an input whose ties distinguish binary16 nearest-even from truncation. A source-built mip-zero normalized/float comparison can land first; keep mip and integer forms pending until the same contract is proved. Item I is on main in #2097; the source-built third-input omission fails the translated GPU check on WARP and RTX 4060 Laptop.
@tedin7 on GitHub · 2026-11-25 01:23 UTC · original
Picking up Item B (buffer_load_format_x/xy/xyz format from runtime descriptor) with WARP readback tests.
@consolelogkyo on GitHub · 2026-11-25 01:29 UTC · original
Item D is up in #2139 (
image_loadwithd16at mip level zero, verified with DXCps_6_0and FXCps_5_1againstR16_UNORMandR32G32B32A32_FLOATtextures and six negative controls on WARP and RX 9070 XT).AI-assisted.
@tedin7 on GitHub · 2026-11-25 01:40 UTC · original
Picking up Item H (
v_min_u32with DPP control) and Item L (lane mask derived from descriptor data) as two separate PRs with D3D12 WARP readback tests.@tedin7 on GitHub · 2026-11-25 01:42 UTC · original
Update: deferring Item H (
v_min_u32DPP) until one of the open DPP base PRs (#2038/#2140/#2141/#2143) lands onmainto avoid stacking a conflicting DPP base. Continuing with Item L.@tedin7 on GitHub · 2026-11-25 02:47 UTC · original
DPP base landed via #2141/#2143; resuming Item H: v_min_u32 with DPP control.
@RavenCurseBurg on GitHub · 2026-11-25 03:41 UTC · original
I’ll take the
8_8_8_8_UINTvertex-fetch format in item G. I’ll extend the source-built fixture to check four unsigned channels at unaligned addresses and add a negative control for the channel decoding.@R0Y00 on GitHub · 2026-11-25 04:46 UTC · original
Item D’s level-zero D16 load is on
mainin #2139 (ca905008). Independent Windows Release verification passed 10/10 on WARP and RTX 4060 Laptop, including both R16_UNORM double-rounding inputs, the odd-dmaskupper-half controls, and refusal of unsupported bound SRVs. If a remaining request uses D16 with a selected mip or an integer view, keep it as a separate reproduction under item D. The other rows remain open.@ArnabSaga on GitHub · 2026-11-25 08:57 UTC · original
I'd like to take the
2_10_10_10_UNORMvertex-fetch format in item G.I'll build on the existing vertex-fetch format table and source-built verification fixture, verify the packed component ordering against LLVM 15 and AMD format definitions, and test normalization, unaligned reads and all four output components on WARP and physical hardware. Negative controls will cover incorrect bit shifts, channel ordering and normalization divisors.
The other buffer formats remain outside this slice.
@ArnabSaga on GitHub · 2026-11-25 10:18 UTC · original · edited 2026-11-25 10:20 UTC
After checking the existing pull requests, I found that #2006 already covers the
2_10_10_10_UNORMformat. I'll withdraw my proposed claim to avoid duplicating that work and investigate another available slice instead.@R0Y00 on GitHub · 2026-11-25 14:31 UTC · original
The descriptor-driven
buffer_load_format_x/xy/xyzslice landed in #2138 (a31f70a1). In the independent Windows test, both WARP and RTX 4060 Laptop kept the target clear for missing descriptor metadata, unsupported FORMAT and unresolved storage. With a valid descriptor, zero and one drew black and red. The translated readback passed 17 cases and detected 19 mutations on each adapter.Build
offscreen_checkandstartup_stream_consumer, then runctest --preset release --no-tests=error -j 1 -R '^startup_(vertex_fetch_formats_|mubuf_descriptor_)' -V. This evidence is for the formats in the implemented table. The rest of the pipeline inventory stays open.@consolelogkyo on GitHub · 2026-11-25 19:50 UTC · original
I'll take an Item F comparison-sampler slice for
image_sample_candimage_sample_c_lzintools/startup/gfx2hlsl.pyandsrc/startup_stubs/translated_sampler_bindings.h:SQ_TEX_CLAMP_BORDER(6) alongsideSQ_TEX_CLAMP_LAST_TEXEL(2) in X and Y with fixedSQ_IMG_SAMP_WORD3BORDER_COLOR_TYPE(TRANS_BLACK,OPAQUE_BLACK,OPAQUE_WHITE), keepingBORDER_COLOR_TYPE == REGISTER, half-border/mirror-once-border modes, and standalonepixel_aotchecks refused. I'll include source-built D3D12 draw readback (in-bounds, out-of-bounds, and bilinear border-edge blending across border colors) and negative controls on WARP and AMD hardware.AI-assisted.
@consolelogkyo on GitHub · 2026-11-25 20:29 UTC · original
Item F slice (
CLAMP_BORDER+ fixedBORDER_COLOR_TYPEforimage_sample_c/image_sample_c_lzand static/dynamic sampler decoding) is up in #2549 (016c68ad), verified with DXCps_6_0and FXCps_5_1across in-bounds, out-of-bounds, mixed-axis, bilinear border PCF, and four negative-control mutations on WARP and Radeon RX 9070 XT.AI-assisted.
@consolelogkyo on GitHub · 2026-11-25 20:58 UTC · original
I'll take the Item D explicit-mip follow-up: lowering
image_load_mipwithd16intools/startup/gfx2hlsl.py(2D, 3D and 2D-array views) on top of #2139'spack16_d16(pack16_rne+pack16_unorm16),d16srv <index> exactSRV validation, and odd-dmaskupper-half tracking, keeping computed16,a16andtferefused. I'll include source-built multi-mip D3D12 readback (includingR16_UNORMandR32G32B32A32_FLOATacross mips and slices) and negative controls on WARP and AMD hardware.AI-assisted.
@consolelogkyo on GitHub · 2026-11-25 21:31 UTC · original
Item D explicit-mip follow-up (
image_load_mipwithd16on 2D, 3D and 2D-array views intools/startup/gfx2hlsl.py) is up in #2575 (28e58482), verified with DXCps_6_0and FXCps_5_1across two-mip (8x2+4x1) 2D and two-slice 2D-arrayR16_UNORMandR32G32B32A32_FLOATtextures, odd-dmaskupper-half poison checks, and 14 GPU negative-control mutations on WARP and Radeon RX 9070 XT.AI-assisted.
@SimSalabimse on GitHub · 2026-11-25 23:57 UTC · original
Claiming Item J (
s_bitset1_b32, and the natural pairs_bitset0_b32) intools/startup/gfx2hlsl.py.Plan: one focused PR on
mainate3dda42b. Port thepixel_aot/ #1579 lowering (D = D \| (1u << (S0 & 31))/ clear form), refuse lane-mask and descriptor destinations, hand-assembled SOP1 fixture with a negative control that fails when the lowering is disabled. Pure-Python CPU evaluation of the translated text; Windows WARP/hardware draws left for an independent retest if wanted.AI-assisted.
@Leyukaka on GitHub · 2026-11-26 01:20 UTC · original
@tedin7 taking over Item L since there has been no activity on it for 2 h (claimed in your 2026-11-25 01:40Z comment, last mentioned at 01:42Z; no PR, commit or comment on it since); will hand back if you resume.
On my local capture (counts and instruction shape only), 42 requests stop at
mask from descriptor data, with 43 refusal hits between them:s_mov_b64 vcc, s[n:n+1]wheres[n:n+1]holds descriptor words. In each, the first later references tovccors104..s107ares[104:107]as the descriptor operand ofs_buffer_load_dword*. Over all 43 hits, only one has any later write ofvccors104..s107. This looks like the compiler assembling a four-dword buffer descriptor whose upper half sits ins106/s107, whichvccaliases.s_mov_b64 exec, s[n:n+1]from descriptor data.Plan:
Record
s_mov_b64 vcc, s[n:n+1]from descriptor data as the descriptor symbols ofs106/s107and emit no code, reusing the #2057 path fors_loadintos[104:107], so thats[104:107]resolves to the same descriptor as the source registers.Keep it refused on any read of that
vccbefore it is overwritten, explicit or implicit:v_cndmask, the carry-in ofv_addc_co/v_subb_co/v_subbrev_co,v_div_fmas;vcc/vcc_lo/vcc_hisource operand of any scalar or vector instruction (VOPC e64, SDWA,s_and_saveexecand the like);s_cbranch_vccz/vccnz.The only accepted read is
s[104:107]as a descriptor operand.execfrom descriptor data stays refused.Tests: a hand-assembled pixel shader that builds the descriptor this way and loads through it, checked on WARP against the same load through the original registers, plus refusal controls for the reads above. A mutant that drops the copy must change pixels.
AI-assisted.