Skip to content

direct compute: untranslated compute shaders of a start-up run ranked by dispatches, with first refusals on main #3224

Backlog

Description

@Leyukaka

Part of #2935. A ranking of the compute shaders that had no translation in a start-up run, by how often the title dispatched them, with each one's first refusal on current main. The goal is to pick the next direct-compute work by impact. Contributions welcome: please claim a family in a comment so we do not overlap.

Run. One local start-up run of the title on the Series S profile, about 10 minutes, built from main c45bf9ab plus a local diagnostic patch (miss logging and an optional solid fill for untranslated draws; translator and compute dispatch path unchanged). It got past the loading artwork into the first 3D scene. That scene renders white: 72 graphics pipelines were translated and 490 were missing. Counts and instruction shape only below. No shader keys or title data.

Method. The dispatch counts come from the runtime's own compute census key ...: N dispatches, 0 translated, first refusal: no translation lines (last value per key). 882 compute shaders were dispatched with no translation, 13,403,432 dispatches in total. I copied their requests from that run's shader cache and ran compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests from main 14d56502 on them. The wave size is bit 20 of .sa dword 4 (#2999).

By first refusal on main 14d56502:

First refusal on main Shaders wave32 Dispatches Share
direct resource-heap load requires the selected GPU slot and its view type 322 316 4,299,928 32.1%
direct descriptor address outside bound table 82 48 3,016,736 22.5%
unbound numeric SGPR sN 156 24 2,545,711 19.0%
compiles on main 110 36 1,601,006 11.9%
unimplemented direct SDWA operand profile 4 0 524,763 3.9%
numeric SCC from a symbolic descriptor field 3 1 323,795 2.4%
direct DXIL lowering for s_or_saveexec_b32 55 55 265,486 2.0%
direct image opcode or descriptor modifiers 54 29 233,735 1.7%
26 other first refusals 96 592,272 4.4%

So 110 of them (11.9% of the dispatches) already compile on current main. Three families account for 73.6%.

Top 20 shaders:

Rank Dispatches Share Wave First refusal on main 14d56502
1 934,961 7.0% wave32 direct resource-heap load requires the selected GPU slot and its view type
2 592,591 4.4% wave64 unbound numeric SGPR s11
3 478,592 3.6% wave64 unimplemented direct SDWA operand profile
4 388,856 2.9% wave64 compiles on main
5 329,032 2.5% wave64 unbound numeric SGPR s29
6 329,032 2.5% wave64 unbound numeric SGPR s29
7 329,032 2.5% wave64 compiles on main
8 302,306 2.3% wave64 numeric SCC from a symbolic descriptor field
9 252,852 1.9% wave32 unbound numeric SGPR s10
10 231,683 1.7% wave64 direct descriptor address outside bound table
11 225,647 1.7% wave64 direct descriptor address outside bound table
12 183,789 1.4% wave32 direct descriptor address outside bound table
13 176,407 1.3% wave32 direct resource-heap load requires the selected GPU slot and its view type
14 161,202 1.2% wave64 compiles on main
15 160,185 1.2% wave32 direct resource-heap load requires the selected GPU slot and its view type
16 159,402 1.2% wave32 direct resource-heap load requires the selected GPU slot and its view type
17 151,433 1.1% wave64 direct descriptor address outside bound table
18 149,560 1.1% wave64 unbound numeric SGPR s29
19 147,258 1.1% wave32 direct descriptor address outside bound table
20 126,171 0.9% wave32 direct descriptor address outside bound table

The top 10 account for 31.1% of the dispatches and the top 20 for 43.3%.

Dispatches the runtime refused at binding time. These are compute shaders that do have a translation. The census gives these first refusals:

Runtime refusal (compute census) Shaders Dispatches
an output is not an aliased placed buffer range with unordered access 25 1,861,476
an input is in a placed buffer that does not alias title memory 53 920,176
an input buffer view token's resource does not hold its range 3 476,733
an input view token is not a buffer view of a desktop resource 6 346,160
5 other runtime refusals 11 61,219

Related work I found:

I have not checked whether #3063 or #3221 clear any of these. They are third-party branches, and I did not build them.

AI-assisted.

Main integration update. #3783 adds native C++ lowering for six global sub-dword _d16 and _d16_hi load encodings. The source-built GPU replay covers signed and unsigned loads, destination-half preservation and cross-DWORD reads. The dispatch counts in the original census have yet to be remeasured against current main.

Activity

  1. RonLogic commented on Nov 27, 2026

    @RonLogic
    Contributor

    I’ll investigate the numeric SCC from a symbolic descriptor field family on main. I’ll start with an original fixture that observes SCC after extracting a buffer stride and after s_max_u32. The goal is to recover the status from validated descriptor metadata while keeping descriptor provenance symbolic and preserving refusals for fields the runtime cannot supply. If you can share the opcode and masked field for the rank-8 refusal, just the instruction shape would help target the first slice.

  2. Not-Saii commented on Nov 27, 2026

    @Not-Saii
    Contributor

    I'll take the largest runtime refusal in the second table: an output is not an aliased placed buffer range with unordered access (25 shaders, 1,861,476 dispatches). These shaders already have a translation, so this is runtime work in src/startup_stubs/d3d12_compute_dispatch.inl (the output branch of the binding loop) and doesn't overlap the translator families claimed above.

    That one message covers five different conditions. The code comment there already names two of them as a known shortcut: view tokens and copied placements.

    1. The output words are a view token.
    2. No placed buffer aliases the address (a copied placement or no placement).
    3. The resource's initial state is not COMMON.
    4. The offset is not 16-byte aligned.
    5. The resource has no ALLOW_UNORDERED_ACCESS flag.

    Plan.

    1. Split the message into one reason per condition, with no change in what is accepted, and add a source-built fixture that triggers each reason.
    2. Measure which reasons these 25 shaders hit in a local start-up run (counts only).
    3. Lower the dominant case in its own PR with a GPU readback test and a negative control. Cases that stay refused keep their own named reasons.

    @Leyukaka, if your census already logs the descriptor words or the placement kind for these outputs, a breakdown by condition would let me skip step 2.

    Environment: Windows 11 build 26300, NVIDIA GeForce RTX 4090 (driver 32.0.16.1088), Windows SDK 10.0.26100, plus WARP.

    AI-assisted.

  3. R0Y00 commented on Nov 27, 2026

    @R0Y00
    Owner

    Two existing paths to reuse before opening another implementation PR:

    For direct descriptor address outside bound table, #3221's fixture covers a single enabled heap whose SGPR count matches exactly. Grouping that bucket by root flags and remaining user SGPRs would tell us which requests it can address. The counts here were measured with the 14d56502 compiler, so please include the compiler commit in reruns.

  4. Not-Saii commented on Nov 27, 2026

    @Not-Saii
    Contributor

    I'll also take the unbound numeric SGPR sN family (156 shaders, 2,545,711 dispatches, 132 of them wave64). The refusal comes from require_numeric in src/gfx1013_compute_native.cpp: the program reads a scalar register that holds no known numeric value at that point.

    Plan.

    1. A counts-only census at current main (c7215add, compiler commit stated with every number). It looks at these requests in a local start-up capture and groups them by refused register, by the instruction that reads it, by how that register was last written, by the entry layout (user SGPR count, the TGID/TG_SIZE enables from the request's RSRC2 word) and by wave size. I'll post the grouping here with instruction shapes only.
    2. Fix the dominant cause in its own PR with a source-built fixture, a GPU readback and a negative control. One example would be an entry register that the direct path doesn't bind. The other causes keep their refusal.

    The family is mostly wave64, so I'll check how it interacts with #2999 / #3006 (wave size from .sa) and coordinate rather than overlap. @Leyukaka, if you already know where the s11 and s29 reads come from, a pointer would help.

    Environment: Windows 11 build 26300, NVIDIA GeForce RTX 4090 (driver 32.0.16.1088), Windows SDK 10.0.26100, plus WARP.

    AI-assisted.

  5. legacy-code-archaeologist commented on Nov 27, 2026

    @legacy-code-archaeologist
    Contributor

    I'll take the "unsupported packed binary16 arithmetic source" follow-on refusal (noted under Rank 3 after #3220) to accept inline binary16 float (240..248) and integer (128..208) constants in v_pk_add_f16, v_pk_mul_f16, v_pk_fma_f16, and v_pk_min_f16/v_pk_max_f16 on main.

    Plan:

    1. Share a packed_f16_inline_constant() helper between DirectCompute::packed_f16_alu() and DirectCompute::packed_minmax() in src/gfx1013_direct_compute.inl (preserving gfx1013's [31:16] = 0 encoding for 240..248 and 32-bit sign-extended encoding for 128..208).
    2. Add a source-built fixture (ir, controls, compute, pixel on WARP and hardware) covering all 9 inline f16 constants, op_sel_hi high-half zeroing, neg_lo/neg_hi, single-rounding FMA tie witnesses with inline 0.5, inline integer constants, and kept refusals (vcc, m0, exec, scc, 240..248 on integer min/max, clamp).

    AI-assisted.

  6. SimSalabimse commented on Nov 28, 2026

    @SimSalabimse
    Contributor

    I'm claiming the "numeric SCC from a symbolic descriptor field" family (3 shaders, about 2.4% of the dispatches, almost all of it from the rank 8 shader).

    The direct path raises that refusal after a byte-window descriptor rewrite, when it thinks a later instruction reads the SCC from that rewrite. The OOB selector already has a known SCC, s_mul_i32 doesn't write SCC, and the SOP1 false positives are already merged (#3189). The small follow-up I want to do: s_absdiff_i32, s_min_u32, s_min_i32 and s_max_i32 already write SCC in the direct lowering but are still treated as SCC readers. I'll classify them as writers, add a source-built compile case next to the existing ones, and keep the s_cselect case refused.

    I won't invent a numeric SCC for a field that can be zero. If rank 8 really branches or cselects on that SCC, it'll still stop there and I'll say so. This stands on its own, separate from the open wave-size (#3006) and s_or_saveexec (#3193) work.

    AI-Assisted

  7. RonLogic commented on Nov 28, 2026

    @RonLogic
    Contributor

    The first symbolic-descriptor SCC slice is in #3227, tested at e1b3f898 over main 7fcde81f. It covers live SCC from the 14-bit buffer SRV stride and from both operand orders of s_max_u32 with 1. The in-process and published paths both matched 12 groups for four descriptor strides on RTX 4070 and WARP 1.0.22, with the untouched output preserved. The clean base refuses this source-built fixture. Capture coverage for the rank-8 case still needs the instruction shape.

  8. legacy-code-archaeologist commented on Nov 28, 2026

    @legacy-code-archaeologist
    Contributor

    Filed #3226 and opened #3230 targeting main to accept inline binary16 float (240..248, with [31:16] = 0 per gfx1013) and inline integer (128..208) constants in DirectCompute::packed_f16_alu() and DirectCompute::packed_minmax() (native_packed_f16_inline_ir, controls, pixel_warp, and pixel_hardware passed on Intel HD Graphics 530; compute_hardware skipped 77).

    AI-assisted.

  9. RonLogic commented on Nov 28, 2026

    @RonLogic
    Contributor

    @SimSalabimse your SCC-liveness classification work complements #3227. My fixture reads SCC immediately after the descriptor operations, so it exercises a genuinely live flag. Your subsequent scalar writers should avoid requesting stride metadata where the earlier flag is dead. I’ll keep #3227 scoped to the live flag cases.

  10. Leyukaka commented on Nov 28, 2026

    @Leyukaka
    CollaboratorAuthor

    @Not-Saii, on where the reads come from. Measured with the 14d56502 compiler on the 882 requests of this issue:

    On the output refusal, the census line carries the four descriptor words of the first refused call of each shader, which is enough to split the 25:

    • 23 shaders (1,840,666 dispatches) have the view-token marker in word 0, which is your condition 1 and the startup: bind compute outputs named by a buffer UAV view token #2961 path.
    • 2 shaders (20,810) have all four words zero, so the byte count is zero and no placed buffer is looked up. That is your condition 2.
    • None of them gets as far as the state, alignment or flag checks.

    Two notes from the #3006 side:

    AI-assisted.

  11. Not-Saii commented on Nov 28, 2026

    @Not-Saii
    Contributor

    First-refusal counts for an output is not an aliased placed buffer range with unordered access, measured with the split in #3229 in one local 300 s start-up run. Build 79edac55; the translator is at ad306425, and its gfx2hlsl.py is unchanged since 2e12dd8e. Counts only.

    The census keeps one reason per key, the first one that key was refused with, and counts all of its untranslated dispatches under it. These are first-refusal buckets, not counts per condition: a later dispatch of the same key can fail on another condition.

    First refusal of the key Keys Untranslated dispatches of those keys
    an output buffer descriptor is a view token 23 141,224
    an output buffer descriptor has zero records 2 2,015
    size, crossing, unplaced, copied placement, initial state, alignment, unordered-access flag 0 (no key had one of these first refusals) 0
    • In the first refused dispatch of each of the 23 keys, the token named a view created through device slot 19, the form startup: bind compute outputs named by a buffer UAV view token #2961 binds.
    • In that of each of the two zero-record keys, the descriptor was all zero.
    • No key had a copied placement, the initial state, alignment or the unordered-access flag as its first refusal, so I won't open a second implementation PR for those. runtime: name each refused condition of a compute output buffer #3229 stays as the diagnostic.
    • In a run of the parent build with the same settings, the same 25 keys had the old reason as their first refusal: 505,473 of 5,490,863 compute dispatches. This run made 1,490,517 compute dispatches in all, so the share in these buckets is about the same (9.2% and 9.6%).

    The compiler commit differs from the issue's 14d56502 counts.

    Edited after review on #3229: the table is labelled as first-refusal buckets, and the zero row is qualified.

    AI-assisted.

  12. Not-Saii commented on Nov 28, 2026

    @Not-Saii
    Contributor

    Follow-up to the counts above: the same 300 s start-up run with #2961 merged locally into #3229. The merge keeps #2961's token branch and drops reason 1 of the split, as #3229 describes. Build 51aef000 (local, not pushed); the translator is the same as before. Counts only, as first-refusal buckets like the table above.

    What happened to the 23 keys whose first refusal was an output buffer descriptor is a view token without #2961:

    With #2961 Keys Dispatches
    every dispatch translated, no refusal 12 32,043
    first refusal: an entry value reads the descriptor of an output named by a view token 10 9,372 untranslated
    first refusal: an output buffer view range is empty, unaligned or outside its resource 1 190,397 untranslated

    This run made 2,453,727 compute dispatches in all (1,490,517 without #2961), so dispatch counts are only comparable within one run.

    Edited after review on #3229: rows are labelled as first-refusal buckets.

    AI-assisted.

  13. Not-Saii commented on Nov 28, 2026

    @Not-Saii
    Contributor

    Census results for unbound numeric SGPR sN. Thanks @Leyukaka, your numbers reproduce on my side.

    Inputs.

    • One local start-up run: 300 s, runtime built from main 2e12dd8e.
    • 878 compute shaders were dispatched with no translation (5,490,804 dispatches). I copied their slot 67 requests out of that run's shader cache.
    • Compiler: main 7fcde81f, compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests.
    • A local diagnostic patch adds the analysis symbol held in the refused register to the message. Behind a second switch, it applies shader: read the wave size of slot 67 compute requests from .sa #3006's wave-size rule: bit 20 of .sa dword 4 clear and more than 32 threads means wave64. Both are off by default, and the patch is not for a PR.
    • Dispatch counts are the last compute census value per key, so they are smaller than the issue's.

    On main: 156 shaders stop first at this refusal, 132 of them wave64. That is the issue's count. They account for 769,918 dispatches in this run.

    • In 115 of the 132 wave64 shaders, the refused register is the odd word of an SGPR pair. Before the read, a VOP3 compare (v_cmp_*_e64 sN-1, ...) writes only the even word, and the read is a 64-bit scalar ALU op on s[N-1:N]. Most are s_and_b64, s_nor_b64 or s_or_b64.
      • In 38 of them, the odd word still holds a symbol from an earlier s_load descriptor, so it is a stale descriptor field, not unbound.
      • The other 17 wave64 shaders read a 32-bit or even register. Mostly that is s_bfe_u32 on a descriptor word.
    • Neither the entry layout nor TGID/TG_SIZE plays a part in the wave64 cases: the system SGPRs are already bound.
    • With shader: read the wave size of slot 67 compute requests from .sa #3006's rule applied: 100 of the 156 leave this refusal and 27 of them compile. 56 still stop here (24 wave32, 32 wave64), with 214,183 dispatches. These are the same counts as yours.
    • Among the 73 that leave the refusal but don't compile, the most common next refusal is multi-wave64 exchange requires converged group control flow (33).

    So the largest cause is #3006 itself. I'm not going to duplicate it, and I'm narrowing my claim to the 56 that remain.

    The 56 that remain, by the reading instruction and the symbol in the register:

    Wave Symbol in the register Reader Shaders Dispatches
    wave32 unbound (leftover user SGPR) s_add_u32 8 144,783
    wave32 resource-heap table s_add_u32 4 17,346
    wave64 unbound s_and_b64 / s_orn2_b64 / s_add_u32 19 23,185
    wave64 s_load descriptor word s_bfe_u32 / s_or_b64 / v_cmpx 13 11,519
    wave32 unbound s_and_b32 / s_nand_b32 6 11,037
    wave32 s_load descriptor word s_bfe_u32 4 3,161
    wave32 unbound s_getpc_b64 2 3,152

    The first two rows, 12 shaders and 162,129 dispatches, have one shape: a waterfall loop that loads a buffer descriptor at the resource-heap base plus a lane-selected byte offset.

    v_readfirstlane_b32 sI, vX
    v_cmpx_eq_i32_e32   sI, vX
    s_add_u32           sLo, s10, sI     ; resource-heap base + byte offset
    s_add_u32           sHi, 0, src_scc
    s_load_dwordx4      s[D:D+3], s[sLo:sHi], 0x0
    s_bfe_u32           ..., s(D+1), ...  ; stride
    s_max_u32 / s_and_b32 / s_mul_i32 on the descriptor words
    

    Plan, revised: a PR on main that lowers this address form: the heap base plus a register byte offset (s_add_u32 lo, then s_add_u32 hi, 0, scc) followed by s_load at offset 0. It becomes the same indexed heap descriptor the compiler already builds for an SMEM register offset.

    Environment: Windows 11 build 26300, NVIDIA GeForce RTX 4090 (driver 32.0.16.1088), Windows SDK 10.0.26100, plus WARP.

    AI-assisted.

  14. 91 remaining items

  15. timbot103 commented on Dec 2, 2026

    @timbot103
    Contributor

    Claiming three independent unclaimed native direct-compute slices on main (158ef794), each as its own small PR with source-built fixtures and fail-closed controls:

    1. root_buffer_uav runtime manifest & binding (src/direct_compute_cache.cpp + src/startup_stubs/d3d12_compute_dispatch.inl): the native compute translator already emits ComputeViewKind::root_buffer_uav, and runtime: bind root_buffer_srv in native compute #3780 covers root_buffer_srv only. I will publish uav <i> root <param> in format_compute_runtime_manifest and bind it on the published/native compute route with strict placement/alignment/aliasing checks.
    2. partial final wave in multi-wave group (src/gfx1013_compute_native.cpp / src/gfx1013_direct_compute.inl, 2 shaders / 9,070 dispatches in the census above): support non-multiple multi-wave compute threadgroup shapes safely in direct DXIL (masking/guarding tail lanes where needed and keeping unproven wave exchanges/reductions refused), complementing shader: fix GFX10.13 TG_SIZE_EN wave-base bits [11:6] and wave count (Part of #2413, #3224) #3796.
    3. numeric SCC from a symbolic descriptor field (src/gfx1013_direct_compute.inl, 2 shaders / 430,886 dispatches in the 900 s census): audit uses_scc_after and prepare_descriptor_strides / symbolic descriptor-field SCC handling and lower provable descriptor-stride/UAV/overwriter cases while keeping genuinely data-dependent symbolic SCC refused.

    Environment: Windows 11 (26200), MSVC 19.44, Ninja, Windows SDK 10.0.26100, NVIDIA GeForce RTX 5080 (driver 32.0.16.2140) + WARP. Source-built fixtures only.

    AI-assisted.

  16. timbot103 commented on Dec 2, 2026

    @timbot103
    Contributor

    All three claimed #3224 slices are up as independent PRs against main (158ef79), each verified in both Debug and Release on app-local WARP 1.0.22 and NVIDIA GeForce RTX 5080 (driver 32.0.16.2140, Windows 11 26200.9974, MSVC 19.44, Windows SDK 10.0.26100.0):

    1. **
      oot_buffer_uav manifest & runtime binding:** runtime: publish and bind root_buffer_uav in native compute (Part of #3224, #2935) #3811 (Debug 4/4 + Release 4/4 passed on WARP & RTX 5080; 320/320 words + 13 refusal controls)
    2. partial final wave in multi-wave group: shader: support partial final waves in native direct compute (Part of #3224, #2935) #3808 (Debug 13/13 + Release 13/13 passed on WARP & RTX 5080; 18 readback cases + full-EXEC tail control + refusal controls)
    3. **
      umeric SCC from a symbolic descriptor field:** compute: bind fixed UAV strides and lower stride compares for descriptor SCC (Part of #3224, #2935) #3809 (Debug 14/14 + Release 12/12 passed on WARP & RTX 5080; fixed raw UAV stride binding, explicit stride compares, 25/25 SCC liveness mutation checks, and mesh/heap regressions)

    AI-assisted.

  17. added 2 commits that reference this issue on Dec 2, 2026
  18. added 3 commits that reference this issue on Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: P0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions