Repository navigation
Backlog
Labels
priority: P0Highest project priority
Description
Compute programs (gfx1013) that the startup compute translator still refuses. Each row is an independent piece of work for one pull request with a source-built or hand-assembled fixture. Counts are aggregate numbers from a private run (dispatches skipped per 300 frames of one scene / distinct programs); they only rank the items.
Items (pick one, say so in a comment)
| Item | What is refused today | Weight | Notes |
|---|---|---|---|
| A | Formatted buffer load through a descriptor taken from a heap at run time (buffer_load_format_x and wider, indexed) |
about 104,000 / 204 | The format, stride and size come from the descriptor words, which are only known at run time. Needs the descriptor words available to the shader (for example a side buffer of descriptor words per view) and a load that switches on the format field. The same gap exists for vertex and mesh stages. Related: #1542, #1143. |
| B | Formatted buffer store through a heap descriptor (buffer_store_format_xyzw, d16 forms) |
about 7,200 / 7 | Related: #1542. |
| C | Scalar holding a descriptor word used numerically (v_writelane_b32, s_cselect_b32, s_cmp_eq_i32 on a descriptor word or descriptor count) |
about 16,000 / 72 | The value tracker treats descriptor words as opaque. Needs a model of which fields may be read as numbers. |
| D | v_bcnt_u32_b32 |
about 7,500 / 4 | Population count plus addend. |
| E | image_gather4_l |
about 7,200 / 3 | Related: #1802 (gather needs view and mip state). |
| F | s_ff1_i32_b32 / s_ff1_i32_b64 of a general scalar (not exec) |
about 4,100 / 12 | |
| G | Smaller ALU and compare gaps: v_cmp_ne_i32 in some operand forms, s_bcnt1, v_mbcnt over a mask, a vcc_hi operand |
about 3,000 / 20 | One pull request each is fine. Related: #1546. |
| H | Image forms: cube images, image atomics (or, compare-swap), ds_append |
small | Related: #1545, #1541. |
What a pull request needs
- One item per pull request.
- A source-built or hand-assembled fixture (no bytes from any retail software) with buffer or image read-back and a negative control that fails when the lowering is disabled.
- LLVM / Mesa semantics cited for each instruction.
- Refuse precisely what the change does not cover. A wrong culling or argument-building pass hides every draw that depends on it, so a refusal that stays is better than a wrong translation.
Existing issues cover neighbouring areas and are not repeated here: #1541 (LDS and barriers), #1543 (DPP and cross-lane), #1544 (entry layout), #1545 (image stores and atomics), #1546 (lane-pattern masks), #1412 (running compute pipelines).
Other parts: #1996 (pixel shaders), #1998 (mesh shaders), #1999 (render state and indirect draws).
Metadata
Metadata
Assignees
Labels
priority: P0Highest project priority
Activity
SimSalabimse commentedon Nov 24, 2026
I'd like to take item F from this list: s_ff1_i32_b32 / s_ff1_i32_b64 of a general scalar (not exec) in the startup compute translator.
AI-Assisted
shader: lower s_ff1_i32 of a tracked scalar
archielcqp-a11y commentedon Nov 25, 2026
I'd like to take item A, formatted buffer loads through a heap descriptor, in
tools/compute_store_aot.py. Before writing code, here is the scope I propose. Please correct it if it is not the cut you want.There are two separate gaps. The compute profile resolves a descriptor only at a static table offset. Its formatted loads are gfx1030 only, with the format stated by the caller (
--source-format). Item A needs both of these to become run-time values. I'd split them into two pull requests.Slice 1 (first PR): the format switch. This mirrors the store path from #1542 (
--descriptor-format-constant,store_descriptor_format).Forms: gfx1013
buffer_load_format_{x,xy,xyz,xyzw}and thed16_forms,idxenonly, through the existing static t0 source binding with its stated stride.Format input: V# word 3 comes from a ready
s_buffer_loadconstant word that the caller names, one per formatted load, in program order.Decode: one HLSL
load_descriptor_format(formatWord, addr, channels, d16)reads FORMAT (bits 18:12) and accepts the same fixed bits as the store path: the GFX10 identity0x01000FACand the legacy DFMT/NFMT identity0x00000FAC. It handles the same format set as the stores:8_8_8_8_UNORM,16_16_UNORMand10_10_10_2_UNORM;16_16_FLOATand16_16_16_16_FLOAT;Conversion:
x / (2^n - 1);max(x / (2^(n-1) - 1), -1);f16tof32;I'll cite the RDNA 2 ISA (§8.1.4 and §8.1.8) and Mesa's
ac_build_buffer_load_format/ac_nirlowering for each rule. The PR will name any rule I cannot tie to a source.Open question, opcode wider than the format (for example
xyzwon32_FLOAT). D3D and Vulkan fill missing components with (0, 0, 0, 1). I have not found an RDNA statement of what the format unit returns. My proposal is that the slice handles only opcode widths no larger than the format, plus fixed bits and formats from the table. Anything else returns 0 in every component, and the docs list that zero result as a known gap, not as hardware behaviour. If you would rather have the (0, 0, 0, 1) fill with a citation, or the dispatch treated as invalid, I'll do that instead.Fixture: source-built gfx1013 assembly in LLVM 15 spelling, with readback on WARP and hardware. It loads every format through each opcode width it accepts, with record bytes that put sign bits, tie values and denormal halves in each field.
offen, a format word left unused, and the existing static-format flags combined with this one.Slice 2 (later PR, design only for now): the descriptor from the heap. The 204 programs take the descriptor itself from the heap at run time, so slice 1 alone unblocks none of them. Slice 2 needs:
ResourceDescriptorHeap[index](SM 6.6);num_recordsfrom word 2, with out-of-range indices returning 0.This overlaps the dynamic heap indexing in #1143, so I'd coordinate with that work before starting, and keep slice 2 out of the first PR.
tedin7 commentedon Nov 25, 2026
Picking up Item A (buffer_load_format from runtime heap descriptor in compute) with WARP readback tests.
R0Y00 commentedon Nov 25, 2026
Two item A claims came in. Please split them along the existing proposal: @archielcqp-a11y can take the format decoder on one static t0 binding first, and @tedin7 can take the heap-descriptor retrieval and its bounds/lifetime controls, building on that decoder instead of duplicating it. Please confirm that split here. For the first slice, start with matching format/opcode widths and ordinary word results. An unsupported format or over-wide opcode must be refused or report a distinct invalid outcome before any valid-looking output is published. Zero data from a valid read needs to remain distinguishable. D16 can follow with integer versus float handling and a format-specific rounding or conversion control. Keep the existing static and gfx1030 paths as regressions. Neither slice alone should be counted as application coverage until it is used in a real dispatch.
tedin7 commentedon Nov 25, 2026
Yielding Item A (slice 1) to @archielcqp-a11y who claimed it 3 minutes earlier — we have not opened a PR for it.
compute: lower v_bcnt_u32_b32 in compute_store_aot
tedin7 commentedon Nov 25, 2026
Confirmed on Item A split: we will wait for @archielcqp-a11y Slice 1 static format decoder before building Slice 2 (heap-descriptor retrieval + bounds/lifetime controls) on top of it. Meanwhile picking up Item G (compute ALU & compare gaps:
v_cmp_ne_i32,s_bcnt1,v_mbcnt,vcc_hi) with WARP readback tests.tedin7 commentedon Nov 25, 2026
Also picking up Item C (scalar holding a descriptor word used numerically in
compute_store_aot) as a separate PR with WARP readback tests.compute: refuse invalid descriptor-format loads before any store
archielcqp-a11y commentedon Nov 25, 2026
Confirming the split, @R0Y00, and thanks @tedin7 for yielding. I keep the format decoder on one static t0 binding. tedin7 builds the heap-descriptor retrieval and its bounds and lifetime controls on top of it.
Slice 1 is #2150. It is now updated to the rules above (
95d75de):DST_SEL), or a narrower or wider opcode makes the load invalid. Every load is staged before the first store, and an invalid load returns before any store. So u0 stays unwritten, and a valid read of zero data stays distinguishable. Four GPU runs check this on WARP and an RTX 3080, with zero-fill and (0, 0, 0, 1)-fill references that must fail.@tedin7, the decoder is
load_descriptor_format(formatWord, addr, channels, out bool valid), fromdescriptor_load_hlsl()intools/compute_store_aot.py. The heap slice can pass the view's word 3 where this slice passes the constant word.compute: rename the SNORM16 helper parameter and indent main()
compute: lower gfx1013 buffer_load_format from the descriptor format
R0Y00 commentedon Nov 25, 2026
Item A slice 1 landed in #2150 (c118f56). The exact candidate passed Windows Release controls, WARP and RTX 4060 Laptop. Wrong format, mismatched opcode width and unsupported fixed bits leave the output sentinel untouched. A valid zero-valued load writes its result. @tedin7 can now build the agreed heap-descriptor lookup and range/lifetime controls on this static decoder. Tests and commands
tedin7 commentedon Nov 25, 2026
#2150 merged; starting Item A Slice 2: runtime heap-descriptor retrieval + bounds/lifetime controls for formatted buffer loads.
26 remaining items
Ybucaille commentedon Nov 26, 2026
Fresh compute refusal counts on
main0827f43c, and a claim: SGPR spills in computeOne local 300 s run (Windows 11, RTX 2070,
run.ps1 -Render -Translate -HostCpu -MemoryGiB 12, no crash, ExecuteIndirect calls all 0), thengfx2hlsl.py --pendingover the cache. First refusal reason per slot-67 compute request, 2,575 requests:v_readfirstlane_b32requires a proven uniform sourcev_cmp_gt_i32_e64in an execz block:vcclive at the joins_andn2_b32in an execz block: lane mask live at the joins_loadof a resource-heap record whose index is read from a bufferTG_SIZE_ENrequires at most N threads per groupimage_storedmaskv_writelane_b32is lowered in pixel and mesh stages onlys_mov_b32in an execz blocks_bfm_b64src_sccnot provenimage_storeon a non-2D viewThese are first reasons only: a request refused here may hit others behind it.
Claim: constant-lane SGPR spills (
v_writelane_b32/v_readlane_b32) in compute, stacked on @tedin7's #2712 (samespill_operandslines; I will build on it rather than conflict, and only after it settles). The 68 requests come from 68 distinct wave32 programs with branches and loops, constant lanes only. Acceptingcsalone wins nothing, because every one of them spills a descriptor, a pointer or a lane mask, not a plain number. Measured on a scratch copy:csallowed: 65 then refused on "source holds lane mask or descriptor", 2 on a heap-records_load, 1 on lane ≥ 32;s_nand_b32on a lane mask (shader: lower s_nor_b32 and s_nand_b32 on lane mask in gfx2hlsl (Part of #1723) #2030).Plan, one PR each: (1)
csspills of descriptor and pointer words, keeping the tracked symbol across the reload with the existing write-before-read proof, so that the reloaded descriptor still counts as proven for the formatted load; (2) lane-mask spills, the reload restoring the mask. Source-built gfx1013 fixtures with negative controls; WARP and RTX 2070 runs on my side.AI-assisted (Claude Code).
startup: lower compute global_load_dword saddr form in gfx2hlsl (#2715)
startup: spill descriptors, pointers and lane masks to VGPR lanes in …
Leyukaka commentedon Nov 26, 2026
Claiming a new compute item:
image_storeonSQ_RSRC_IMG_3DandSQ_RSRC_IMG_1D, translator plus runtime binding. Todaytools/startup/gfx2hlsl.pyrefuses both withimage_store on SQ_RSRC_IMG_3D|1D: only 2D images are lowered.Measured on a local capture (counts and instruction shape only):
b505c32: 29 requests stop at the 3D form and 7 at the 1D form.6ee878d8, no inputs. Every graphics pipeline the runtime looked up was translated. Seven compute keys dispatch with no translation. The three most dispatched account for 18,172 of those 18,187 dispatches:image_store v[8:11], <address>, s[..] dmask:0xf ... unorm. The address isv[2:4]for the 3D image andv0for the 1D images. The 3D program's other image accesses are twoimage_loadon 2D images; the 1D programs have none.b505c32, the 3D refusal was hit 16 times over 15 requests: 13 withdmask:0xf(7 tuple address, 6 NSA), 3 with partial dmasks (2 of themd16). Partial dmasks stay refused here.Plan, translator:
image_storewithdmask:0xfon a 3D image toRWTexture3D<float4>with a 3-component address, and on a 1D image toRWTexture1D<float4>with one component.op_image_store: format,unorm, address tuple or NSA form, fixed-table descriptor), add the two kinds to the UAV declarations, and emituav N tex3d|tex1d ...in the manifest.d16forms seen.Plan, runtime:
uav N tex3d|tex1dinsrc/startup_stubs/d3d12_compute_dispatch.inl. The slot needs a dimension kind, not only the array flag.D3D12_UAV_DIMENSION_TEXTURE3D/TEXTURE1Dnext to the 2D and 2D-array branches, checking the resource dimension, the mip and, for 3D, the W range.Tests:
Prior art in the offline tool
tools/compute_store_aot.py: 3D stores (#1649) and the 1D slice claimed in #1545.tests/compute_check.cppalready reads back 1D and 3D UAVs. I will reuse that readback.@NiiRoZz, binding
tex3dandtex1dUAVs is part of your "Texture UAVs" item in #2274 (uav N tex1d|tex2d|tex2da|tex3d). The 2D and 2D-array views are on main through #2532, and I found no PR, commit or comment ontex3d/tex1d. I am taking over that part since there has been no activity on it for 2 h; I will hand it back if you resume.AI-assisted.
Leyukaka commentedon Nov 26, 2026
Claiming a new item for
tools/startup/gfx2hlsl.py:v_pk_max_f16andv_pk_min_f16, which have no handler today. They are refused by name.Measured on a local capture (counts and instruction shape only):
6ee878d8plus startup: lower compute image_store to 1D and 3D texture UAVs (Part of #2022) #2902: 4 requests stop atv_pk_max_f16and 2 atv_pk_min_f16.v_pk_max_f16. The run reports them as untranslated, and the offline translator names the instruction.v_pk_max_f16 vN, vN, 0 op_sel_hi:[..];v_pk_max_f16 vN, <literal>, vN;v_pk_max_f16 vN, vN, sN;v_pk_min_f16 vN, <literal>, vN.Plan:
Handlers: add both through the existing
packed_halfhelper, per lane, with the min/max ruletools/pixel_aot.pyalready uses (minmax16_num, added to the gfx2hlsl preamble): one NaN returns the other operand, and mixed zeros give-0for min and+0for max. NaN is tested on the binary16 encoding, not with a floatisnan().Sources: accept the kinds the real forms use, with the packed-source rule that
pixel_aot.pyimplements invop3p_f16_word:0;Sources are whitelisted (single VGPR,
sN,0x…,0) before they are read.op_selpicks the low or high half for the low result, andop_sel_hifor the high result.What is new ground:
pixel_aot's draw fixture covers a literal only with default selectors and SGPRs only on add and fma. A non-default selector on a literal or SGPR is not yet covered, and the tests below cover it. The PR also updates thepacked_halfdocstring, which today calls these sources unproven.Kept refused:
neg_lo/neg_hi/clamp;The existing non-VGPR refusal stays for
v_pk_add/mul/fma_f16.Tests:
op_sel/op_sel_hiroles, and one that usesmaxformin. Both must change the result.AI-assisted.
Leyukaka commentedon Nov 26, 2026
Follow-up claim to #2927: let
v_pk_add_f16,v_pk_mul_f16andv_pk_fma_f16take the same non-VGPR sources that #2927 accepts for min and max:0.The half that
op_sel/op_sel_hiselects follows thevop3p_f16_wordrule intools/pixel_aot.py.Measured on a local capture (counts and instruction shape only):
v_pk_max_f16. startup: lower v_pk_max_f16 and v_pk_min_f16 in gfx2hlsl (Part of #2022) #2927 moves it past that, and it then stops atv_pk_mul_f16with a hex literal source.v_pk_max/min_f16stop next atv_pk_mul_f16with a hex literal;v_pk_mul_f16with an SGPR source.Plan:
f16tof32of the selected half,f16rnof the result.v_pk_fma_f16);neg_lo/neg_hi(3 census requests onv_pk_add_f16, a separate item);clampand other modifiers.AI-assisted.
startup: lower packed binary16 minimum and maximum (#2927)
startup: lower compute image_store to 1D and 3D texture UAVs (#2902)
SimSalabimse commentedon Nov 27, 2026
I'm taking the remaining pixel-stage case where a heap image descriptor word is read as a number. #2161 already covers compute raw
num_records, and this is the image-word slice that's still refused. I'll add a source-built fixture intools/startup/gfx2hlsl.py, keep every other descriptor word refused, and open a PR against main.AI-Assisted
Leyukaka commentedon Nov 29, 2026
Releasing my claim of 2026-11-26 on SGPR, hex and inline
0sources forv_pk_add_f16,v_pk_mul_f16andv_pk_fma_f16; draft #2930 is closed.startup: lower pixel image descriptor size fields
startup: lower pixel image descriptor size fields
Leyukaka commentedon Nov 29, 2026
Taking back one part of the claim I released above:
v_pk_mul_f16with a 32-bit literal source intools/startup/gfx2hlsl.py.packed_halfrefuses it withoperand ... is not a single VGPR(tools/startup/gfx2hlsl.py:10116-10117onmain26df1826). The native compute frontend already accepts a literal there (src/gfx1013_direct_compute.inl:1684-1691).0sources,v_pk_add_f16andv_pk_fma_f16stay refused, with controls. One small PR, referencing startup: accept SGPR, hex and inline 0 sources in packed f16 add, mul and fma #2930.I'm working on this.
shader: accept SGPR, hex literal and zero sources in gfx2hlsl packed …