Repository navigation
Description
Problem
On main: the compute stage in tools/startup/gfx2hlsl.py (#2182), publishing of translation requests for slot 67 compute pipelines (#2195) and translation of those requests (#2223). Texture UAV forms in the pixel stage translate (#2155) but the runtime binds none. Dispatch (#1974) and compute root state (#1803, #1975) are still open PRs. #1412 describes the whole path and stays the umbrella; #2022 lists translator gaps as lettered items and is not repeated here. This issue only splits the remaining work into items that can be claimed one at a time.
Local observation, not reproducible from this repository (one local run, counts only): 2,689 compute requests were published. 8 translate and compile on main. 90 do with the unmerged lowerings listed below (95 with one more buffer_load_format follow-up). In a window of the run, 874 distinct programs were dispatched (2,019,430 dispatches). The 23 of those that translate with the unmerged lowerings cover 2.24% of dispatches, and every one of the 23 writes a texture through a UAV, so none can be bound by the runtime yet. Shares below are the incremental gain of each step of a greedy cover over the dispatched programs, from that same run; they rank items and are not a prediction.
Proposal
A. Translator lowerings (gfx2hlsl compute stage)
Acceptance for every A item: source-built gfx1013 case + GPU read-back (WARP and hardware) + a pinned negative control that fails when the lowering is off. Refuse what the change does not cover.
-
buffer_store_format_d16_x: 7.8%; owner: unclaimed; check help wanted: GPU translation, part 4 (compute shaders) #2022 B first so the two do not overlap - buffer store through a modified descriptor (other than the stride clear): 4.4%; owner: NiiRoZz (claimed, no PR yet)
-
TG_SIZE_EN: 1.3%; owner: unclaimed; stays refused untils_and_b32 R, TG, 0xfc0andv_mbcnt_loreads are each shown correct on their own - execz exec write and scalar handling: 0.5%; owner: in progress by the startup: translate device slot 67 compute requests with the gfx2hlsl compute stage #2223 author (local branch, PR to follow)
-
buffer_load_format_x/xy/xyz: 0.6%; owner: startup: lower buffer_load_format_x/xy/xyz with the format from the buffer descriptor #2138 -
buffer_store_format_xyzw: 2.2%; owner: help wanted: GPU translation, part 4 (compute shaders) #2022 item B (claim there, not here) -
buffer_load_format_xyzw: 1.6%; owner: NiiRoZz (claimed, no PR yet), depends on startup: lower buffer_load_format_x/xy/xyz with the format from the buffer descriptor #2138 -
v_bfm_b32: 0.6%; owner: shader: lower v_bfm_b32 and missing VOP2/VOP3 ops in gfx2hlsl (Part of #1723) #2087 -
image_gather4_lzin compute: 0.6%; owner: done in shader: lower mip-zero 2D gathers in the startup compute translator #2282 (_lmerged in shader: lower gfx1013 compute image_gather4_l on a fixed-mip view #2258, which is the model to follow) -
s_pack_ll_b32_b16family: 0.4%; owner: shader: lower s_pack_ll/lh/hh_b32_b16 and s_absdiff_i32 in gfx2hlsl (Part of #1723) #2086 -
src_sccoperand: 0.3%; owner: startup: read src_scc as the SCC bit #1821 - SDWA
v_mov: 0.3%; owner: done in startup: lower v_mov_b32_sdwa in gfx2hlsl #2286 - packed VOP3P f16 (
v_pk_add_f16): 1.8%; owner: shader: lower packed VOP3P f16/i16/u16 and dot-product ops in gfx2hlsl (Part of #1723) #2081 -
image_stored16 in compute: 0.3%; owner: RavenCurseBurg, shader: translate packed D16 image stores in startup compute programs #2300 (open) -
v_sub_co_ci_u32: 0.2%; owner: shader: lower v_sub_co_ci_u32, v_subrev_co_ci_u32 and s_flbit_i32_b32 in gfx2hlsl (Part of #1723) #2041 -
v_mul_hi_u32: startup: lower v_mul_hi_u32 in gfx2hlsl #1747 merged ate06aca8b. Source-built register/literal lowering and FXC/DXC draw evidence in startup: lower v_mul_hi_u32 in gfx2hlsl #1747 and startup: v_mul_hi_u32 has no lowering (1 of the remaining loading-screen shader refusals) #1792. -
s_loadwith register offset through the resource heap: largest first refusal by dispatches afterbuffer_load_format_x; owner: shader: support s_load with register offset through resource heap in gfx2hlsl (Part of #1723) #2066 -
v_readfirstlaneproof (loop counter and one-path register are refused as unproven): owner: unclaimed -
v_mbcntover a mask, anddescriptor operand holds None: owner: RavenCurseBurg, shader: lower masked bit counts in small startup compute groups #2290 (open) for the uniform-mask part ofv_mbcnt;descriptor operand holds Noneunclaimed -
ds_write/ LDS in gfx2hlsl: 79,243 dispatches first-refused in the local window; owner: unclaimed (compute: LDS reads, writes and atomics plus s_barrier (groupshared lowering) #1541 covers LDS design; compute: lower group-shared LDS and s_barrier on gfx1013 #1566 iscompute_store_aotonly) - constants and symbols folded across branch targets (loop headers and forward joins): owner: constants done in startup: drop scalar constants at joins that another path writes in gfx2hlsl #2279 (merged); non-constant symbols NiiRoZz, startup: keep or refuse non-constant scalar symbols at joins in gfx2hlsl #2292 (open); negative control: nothing newly translates wrongly
Already open elsewhere and seen in the same ranking, so not duplicated: v_fma_mix_f32 #2055, v_readlane_b32 #2032, DPP forms #2038, s_bfm_b64 #2007, v_add_co_ci_u32 #2033.
B. Runtime (startup stubs)
Acceptance: a source-built fixture on WARP, hardware where it matters, a pinned negative control, and the exact ctest selection in the PR body.
- Real compute PSO and Dispatch slice from published translations (the slice asked for on startup: run compute pipelines (captured as Scarlett DXIL) and execute Dispatch; dispatches are dropped #1412); owner: in progress by the startup: translate device slot 67 compute requests with the gfx2hlsl compute stage #2223 author (local branch); depends on startup: implement command-list slot 14 Dispatch (Part of #870) #1974, feat: record compute root signature and descriptor tables (list slots 33 and 35) #1803, startup: implement command-list slots 37 and 39 root constants and views (Part of #870) #1975 merging first; acceptance: a dispatch writes a UAV and the test reads it back
- Texture SRVs and static samplers for translated compute programs; owner: in progress by the startup: translate device slot 67 compute requests with the gfx2hlsl compute stage #2223 author (local branch, stacked on the slice above); acceptance: a dispatch samples a texel; control: a view mismatch refuses with a reason
- Texture UAVs (owner: in progress by the startup: translate device slot 67 compute requests with the gfx2hlsl compute stage #2223 author, local branch stacked on the two above): bind
uav N tex1d|tex2d|tex2da|tex3d [float] table P O [channels n], refuse UINT/SINT/sRGB forfloat, refuse more channels thanchannels n, refuse a dimension mismatch, no UA flag, SRV+UAV on one resource; acceptance: a store lands in the requested mip and mip 0 keeps its sentinel (view-mip control) - Pixel-stage UAV binding (reuse the compute helper;
load_translationcurrently refuses anyuavline from startup: lower pixel-stage image_store to a typed UAV store #2155); acceptance: a texel stored by a draw is read back, with a no-UA-flag control - A translated draw samples a compute-written texture; acceptance: the texel is read back from the render target
- Per-reason refusal census: count every refusal reason per key, not only the last; acceptance: two controls show both reasons with counts; owner: stan495, startup: add bounded per-reason refusal census per pipeline key #2301 (open)
- Indirect Dispatch through slot 61 for slot-67 pipelines: claim the source-built fixture in #2492. A GPU-written argument record drives two different group counts; fenced UAV readback and the omitted-producer and missing-translation controls are required. Coordinate translated runtime wiring with startup: dispatch translated compute programs with raw table buffers #2470.
- Retry a placeholder pipeline when a translation appears later (proposed here, not in the handover); acceptance: a pipeline created before its translation dispatches after it arrives; control: still a no-op while untranslated
Alternatives
One large compute pull request. Rejected: a wrong lowering hides every dispatch that depends on it, so each piece needs its own read-back and negative control.
Verification
Each item carries its own acceptance. Overall state is read from the compute counts in docs/experiments.md once items land. A passing fixture supports the behavior under test only; it does not show that any title starts or runs.
Claiming
Comment with the item text before starting, open one pull request per item, and tick the box when it merges. Percentages and counts come from a local run and may shift as lowerings land.
Last updated 2026-11-25 from claims in the comments and merged pull requests.
AI-assisted (Claude Code).
Activity
RavenCurseBurg commentedon Nov 25, 2026
I'll take A,
image_gather4_lzin the startup compute translator (tools/startup/gfx2hlsl.py). The existing pixel handler already checks a constant clamp-to-edge sampler and a one-hot component. I'll exercise that profile from a source-built gfx1013 compute program with a raw output buffer, then compare all four returned texels on WARP and a GeForce RTX 4060. I'll use a nonzero first view mip and distinct values per channel and tap so an absolute-mip or gather-order mistake yields a specific readback mismatch. This uses the standalone compute fixture and can be tested before the runtime texture-binding work in B lands.NiiRoZz commentedon Nov 25, 2026
Claiming three A items, one pull request each:
v_movintools/startup/gfx2hlsl.py: source-built gfx1013 case, read-back, and a negative control that fails with the lowering off. Other SDWA forms stay refused.buffer_load_format_xyzw: a follow-up is ready locally on top of startup: lower buffer_load_format_x/xy/xyz with the format from the buffer descriptor #2138 and will be proposed once startup: lower buffer_load_format_x/xy/xyz with the format from the buffer descriptor #2138 merges. Nothing is opened before that.Not touching
buffer_store_format_d16_x(overlaps the d16 work on #2022 B),image_gather4_lz(claimed above) or the items owned by open pull requests.AI-assisted (Claude Code).
RavenCurseBurg commentedon Nov 25, 2026
I'll take the uniform-mask part of A's
v_mbcntitem in the startup compute translator. #1782 established a reference incompute_store_aot.py; this slice is fortools/startup/gfx2hlsl.py. I'll start with groups of at most 32 threads and a literal or proven constant SGPR mask, so all active lanes are in the low half for either guest wave size. I'll use sparse masks, a nonzero base, a multidimensional group, and WARP/RTX 4060 readbacks to distinguish the per-lane count from a plain lane ID, whole-mask popcount or a lost base. Larger groups and masks whose value cannot be proven stay outside this slice. The separate missing-descriptor diagnostic remains available.R0Y00 commentedon Nov 25, 2026
The A item for
image_gather4_lzlanded in #2282. On WARP and RTX 4060 Laptop, all five 320-word comparisons matched, and the omitted gather, wrong channel, wrong mip and swapped taps produced the expected mismatches. The alias and descriptor-boundary rejection checks also passed. Reproduce withctest --preset release --no-tests=error -R '^startup_compute_gather_lz(_warp|_hardware)?$' -V. This covers translation and standalone readback. Slot 67 still needs the B-path binding and submission evidence; the other A claims above can continue independently.startup: lower v_mov_b32_sdwa in gfx2hlsl (#2286)
RavenCurseBurg commentedon Nov 25, 2026
I'll take A's compute
image_store d16translation for the full RGBA mask, 2D, full-width XY and a fixed table descriptor. The startup translator currently refuses this even though the separate offline tool in #2106 already provides a source-built half-float reference. I'll use that reference and the existing three-mip RGBA16_FLOAT readback on WARP and RTX 4060, with controls for a missing store, half order, and EXEC.The emitted compute texture UAV will identify its float element type, dimension, table location and four channels as described under B. I'll check raw buffer/texture slot numbering and descriptor alias refusals in the translator. The slot-67 runtime binding work remains with the B owner.
stan495 commentedon Nov 25, 2026
I'd like to take Per-reason refusal census from Part B (
count every refusal reason per key, not only the last; acceptance: two controls show both reasons with counts).Checking
mainright now, the slot-67 runtime compute dispatch path is still on the local branch tracked in the first Part B items. Should I build this first as a standalone, lock-protected header and unit test insrc/startup_stubs/(similar tomemory_srv_census.h, keeping bounded per-key/per-reason counts plus two controls showing both refusal reasons with counts for one key) ready to wire into the compute dispatch/binding path once it lands, or wait until the first Part B compute dispatch slice opens?startup: test real census class under compile-time controls
NiiRoZz commentedon Nov 25, 2026
Update on my three claims above.
v_mov: merged as startup: lower v_mov_b32_sdwa in gfx2hlsl #2286.OOB_SELECT=3,NUM_RECORDSmultiplied by the stride), mostly after the entry block. I have a proven rule for a simpler case (the store's four registers are unmodified words of one load, inside the entry block, with read-back on WARP and hardware and mutant controls), but it makes no additional request translate, so I am not opening a pull request for it. The composite form builds on the stride-clear store work that is in progress elsewhere; I will take it after that lands, and anyone who wants it sooner is welcome to it.buffer_load_format_xyzw: unchanged, waits on startup: lower buffer_load_format_x/xy/xyz with the format from the buffer descriptor #2138.While reading the store handler I found three cases where
mainmay accept a store it should refuse. I am reproducing each with a source-built program and will file them as a separate issue with one claimable item per case.AI-assisted (Claude Code).
shader: translate packed D16 image stores in startup compute programs (…
startup: add bounded per-reason refusal census per pipeline key (#2301)
R0Y00 commentedon Nov 25, 2026
Two A items are now on
main: #2290 covers constant-mask MBCNT for groups of at most 32 threads, and #2300 covers full-RGBA packed D16image_storewith a fixed 2D table descriptor. I ran the source-built WARP and RTX 4060 Laptop cases and their negative controls. For Part B, #2300 publishes the v2 typed-UAV rowuav N tex2d float table P O channels 4. The runtime acceptance is still to bind a compatible view, forward a dispatch, and read back the addressed mip while an incompatible view is refused before submission.stan495 commentedon Nov 25, 2026
I'd like to take v_readfirstlane proof from Part A (
loop counter and one-path register are refused as unproven).Plan:
tools/startup/gfx2hlsl.pywhen either (1) no non-dominating or back-reaching path writes the SGPR (one-path register), or (2) every write to a uniform loop-counter SGPR across the loop is itself proven uniform and controlled only by uniform branches (loop counter), while continuing to refuse any SGPR written non-uniformly or conditionally under a non-uniform branch (e.g.s_mov_b32 s3, vcc_loon a loop back-edge orvccz/execz/non-uniformsccloops).tests/startup_gfx2hlsl_readfirstlane_recompute_check.pyand add a source-built gfx1013 compute fixture + WARP and hardware UAV readback + negative controls.NiiRoZz commentedon Nov 25, 2026
I'd like to take
TG_SIZE_ENfrom Part A. Thev_readfirstlaneproof is stan495's, so I leave that one.Plan, in the order the checklist asks:
s_and_b32 R, TG, 0xfc0correct on its own with a source-built gfx1013 compute program and a negative control;v_mbcnt_loread correct on its own, building on shader: lower masked bit counts in small startup compute groups #2290 rather than repeating it;TG_SIZE_ENfor the forms both proofs cover; every other form stays refused with a named reason.If either prerequisite cannot be shown from source-built programs I will say so here and release the claim instead of opening a PR.
AI-assisted (Claude Code).
RavenCurseBurg commentedon Nov 25, 2026
I'll take a first startup-compute LDS slice in Part A: aligned
ds_write_b32andds_read_b32across an explicit workgroups_barrier. I'll start with straight-line, full-EXEC programs, bounded addresses, and the LDS allocation from the compute register state. The source-built fixture will exchange data between lanes and keep consecutive groups' data separate. I'll check the output against a CPU reference on WARP and desktop hardware, with an incorrect-address control. #1566 covers the separatecompute_store_aotentry point.23 remaining items
R0Y00 commentedon Nov 25, 2026
The
buffer_store_format_xyzwslice landed in #2530 (e4e2b46d) after #2478. On the exact PR head I ranctest --preset release --no-tests=error -R '^startup_compute_store_format_xyzw' -V: 21 passed, zero skips, on WARP and RTX 4060 Laptop. The source-built fixture checks full output words and detects dropped stores, wrong component order, bounds/offset errors, packing mistakes and writes under the wrong EXEC mask. Its direct dispatch uses the sized UAV runner. The slot 67 binding path, the #2492 indirect fixture and live replay evidence remain separate.roansystemlabs commentedon Nov 25, 2026
I'd like to take the Part B item "A translated draw samples a compute-written texture". @NiiRoZz, it would stack on your #2470/#2490 chain, and @denn0x, #2603 carries compute runtime and draw-UAV code: if either of you already covers this or would rather keep it, say so and I'll step back and review.
Scope, first slice:
uav ... tex2dbinding from startup: translated compute Dispatch with 2D texture views, static samplers and a per-key census #2490; one translated draw on the same list samples it through an SRV after the UAV-to-SRV transition; the render target is read back.Evidence: WARP and an RTX 3070 with the debug layer on, stacked on #2490 with the base commit stated,
ctest --preset release --no-tests=error -j 1 -R '^startup_gfx2hlsl_compute_' -Vplus the new test's exact name, adapter and skip status. Negative controls: the draw recorded before the Dispatch reads the sentinel, a wrong-mip view is refused, and an untranslated Dispatch leaves the target clear.AI-assisted.
startup: compute input named by a resource heap record a root constan…
startup: accept compute execz live definitions whose reads are proven (…
brainbudt commentedon Nov 26, 2026
Note
🤖 GPT-6.2 Astra responding on behalf of brainbudt
I’m taking the Part A startup LDS follow-up for two disjoint
ds_write_b32fills before one unconditional workgroup barrier intools/startup/gfx2hlsl.py. Each lane in a 1D group writes one dword to each span using the same local-X byte address and distinct immediate offsets. The source-built gfx1013 fixture will read both spans after the barrier and check refusals for overlap, an uninitialized gap and allocation overflow. I’ll run the Linux LLVM checks and attempt WARP readback on disposable Windows. The tracker gives no dispatch count for this particular shape.startup: bind a compute heap record whose index is read from a table …
R0Y00 commentedon Nov 26, 2026
The two-bank LDS follow-up is on main in #2751 (6f696d4). The source-built readback exercised one workgroup barrier and kept the two disjoint initialized spans separate. On WARP and RTX 4060 Laptop the complete compute suite passed, and zeroing the second fill changed 128 of 320 words on each adapter. The tracker’s broader LDS work remains open. This fixture does not measure original-executable dispatch frequency.
startup: bind LOD-clamped static samplers (smpl) in the translated co…
startup: compute entry values from the words of a bound buffer descri…
startup: name the condition a compute buffer input failed instead of …
R0Y00 commentedon Nov 26, 2026
The focused input-range diagnostic is on main via #2624. The real translated dispatch matched all 320 output words on WARP and RTX 4060 Laptop. Five distinct invalid inputs each produced its expected reason and left output untouched. This covers identifying the refusal and leaves the custom-heap token path in #2625.
startup: bind a compute input behind a memory view token in its own r…
R0Y00 commentedon Nov 26, 2026
#2625 is on main at cd1ff54. A source-built translated compute dispatch bound the slot-70 custom-heap view token through the backing resource at the view offset. WARP and RTX 4060 Laptop each matched 320/320 output DWORDs after the input was written through the guest address. The five existing rejected inputs still left output untouched. This closes the fixture-sized token slice. Draw coverage and the original-executable replay remain open.
startup: lower compute image_store to 1D and 3D texture UAVs (#2902)