Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
0192a5e
feat: record the compute root signature and descriptor tables (slots …
tedin7 Nov 24, 2026
682b0e0
feat: record compute descriptor tables (slot 35) and clear them on a …
tedin7 Nov 25, 2026
bb6b9a1
merge: keep the main-based compute root rework over the first draft
tedin7 Nov 25, 2026
033f40c
startup: record SetComputeRoot32BitConstant(s) (list slots 37, 39)
tedin7 Nov 24, 2026
9c87260
merge: sync with origin/main (keep compute tables and compute root SR…
tedin7 Nov 25, 2026
d8cc1ac
feat: record command-list slot 14 Dispatch on the desktop list
tedin7 Nov 24, 2026
48635dd
startup: refuse Dispatch under a compute root with unforwarded argume…
tedin7 Nov 25, 2026
7307c2f
startup: gate Dispatch on bound compute root SRVs and a pipeline buil…
tedin7 Nov 25, 2026
cffe8ce
startup: record SetComputeRoot32BitConstant(s) (list slots 37, 39)
tedin7 Nov 24, 2026
e0966b9
feat: record command-list slot 14 Dispatch on the desktop list
tedin7 Nov 24, 2026
f3b91dd
startup: refuse Dispatch under a compute root with unforwarded argume…
tedin7 Nov 25, 2026
c18cacb
startup: gate Dispatch on bound compute root SRVs and a pipeline buil…
tedin7 Nov 25, 2026
24c5f55
fix: pass pipeline root out-param in slot86 mesh cached pipeline build
tedin7 Nov 25, 2026
8a4df52
Merge origin/main into x2w-frontier-slot14-dispatch
tedin7 Nov 25, 2026
be1bce6
Merge branch 'pr1803' into startup/compute-dispatch-translated
NiiRoZz Nov 25, 2026
9828b5d
fix: track which compute root constant words were set; drop slot 40 c…
tedin7 Nov 25, 2026
44f0a23
Merge branch 'pr1974' into startup/compute-dispatch-translated
NiiRoZz Nov 25, 2026
2e25282
Merge branch 'pr1975' into startup/compute-dispatch-translated
NiiRoZz Nov 25, 2026
1e567a0
Dispatch translated compute programs with raw table buffers
NiiRoZz Nov 25, 2026
aca6e89
Log untranslated compute dispatches on their own line budget
NiiRoZz Nov 25, 2026
8e14a74
Count compute dispatches per key with their first refusal
NiiRoZz Nov 25, 2026
f2f7bfc
Dispatch translated compute programs that store to 2D textures
NiiRoZz Nov 25, 2026
15e8b7a
Dispatch translated compute programs that read 2D textures
NiiRoZz Nov 25, 2026
509dc53
Check a compute manifest without entry values at Dispatch
NiiRoZz Nov 25, 2026
d3c396c
Document texture views and the census of translated compute Dispatch
NiiRoZz Nov 25, 2026
70b27f2
Check the device on every 64th translated Dispatch and drop a livenes…
NiiRoZz Nov 25, 2026
d0b9e77
Compute dispatch: allow two outputs of one texture, refuse packed out…
NiiRoZz Nov 25, 2026
6e64faa
Merge branch 'main' into startup/compute-dispatch-translated
tedin7 Nov 25, 2026
771b935
Merge origin/main into pr2470
NiiRoZz Nov 25, 2026
15cdaff
Merge pr2470 (origin/main) into pr2490
NiiRoZz Nov 25, 2026
b49c738
Merge remote-tracking branch 'fork/startup/compute-dispatch-translate…
NiiRoZz Nov 25, 2026
f67f80a
Merge branch 'pr2470' into pr2490
NiiRoZz Nov 25, 2026
f5c3c85
startup: compute input named by a resource heap record a root constan…
NiiRoZz Nov 25, 2026
b6bc3c3
startup: drop a heap record control whose branch target was inside an…
NiiRoZz Nov 25, 2026
5bade3c
Merge main into the heap record branch
NiiRoZz Nov 25, 2026
7bbd141
Merge remote-tracking branch 'origin/main' into startup/compute-dispa…
NiiRoZz Nov 25, 2026
fdba779
startup: read the stage kind as the other handlers do in the heap load
NiiRoZz Nov 25, 2026
d17d262
Merge the current slot 14 Dispatch head (8a4df523)
NiiRoZz Nov 25, 2026
a205217
Merge the current root-constant store head (9828b5d8); pin the entry-…
NiiRoZz Nov 25, 2026
c821b4b
startup: avoid calling the compute driver after process termination b…
RavenCurseBurg Nov 25, 2026
67f25a9
Merge the reworked dispatch branch; a compute list transitions a samp…
NiiRoZz Nov 25, 2026
1f5fb5e
Repair a broken line in the dispatch check
NiiRoZz Nov 25, 2026
7728caf
Merge branch 'pr2470' into pr2490
NiiRoZz Nov 25, 2026
76ce41b
Pin four existing texture dispatch refusals: integer view format, man…
NiiRoZz Nov 25, 2026
1efce19
Merge the reworked dispatch and texture branches
NiiRoZz Nov 25, 2026
b306d44
Merge remote-tracking branch 'origin/main' into HEAD
NiiRoZz Nov 25, 2026
f5b0303
Drop the repeated compute root reset left by merging two slot 14 snap…
NiiRoZz Nov 25, 2026
190e00a
Merge startup/compute-dispatch-translated (f5b03039) into startup/com…
NiiRoZz Nov 25, 2026
5e185ab
Merge upstream main; use upstream's process-exit flag and DllMain
NiiRoZz Nov 25, 2026
63875b3
Merge commit '1991fd08a123604ae9c9ffb90de16d201214589a' into startup/…
NiiRoZz Nov 25, 2026
1991fd0
Merge commit '5e185ab7df261b7574e92eca77df063b69bb0ba5' into pr2490-fu
NiiRoZz Nov 25, 2026
8e393e1
Merge upstream main
NiiRoZz Nov 25, 2026
9caf8fd
Merge remote-tracking branch 'origin/main' into startup/compute-dispa…
NiiRoZz Nov 25, 2026
9d74bec
Merge branch 'startup/compute-dispatch-translated' into startup/compu…
NiiRoZz Nov 25, 2026
d756657
Merge remote-tracking branch 'fork/startup/compute-dispatch-textures'…
NiiRoZz Nov 25, 2026
60304f3
Merge upstream main
NiiRoZz Nov 26, 2026
206749e
Merge upstream main
NiiRoZz Nov 26, 2026
d3fe030
Merge upstream main
NiiRoZz Nov 26, 2026
28c44d5
Merge upstream main
NiiRoZz Nov 26, 2026
29ee504
Merge origin/main into startup/compute-dispatch-heap-rootconst
tedin7 Nov 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ jobs:
(["tests/startup_compute_image_store_check.py", "--llvm-mc", "llvm-mc-15"], {}),
(["tests/startup_compute_image_store_d16_check.py", "--llvm-mc", "llvm-mc-15"], {}),
(["tests/startup_compute_readfirstlane_check.py", "--llvm-mc", "llvm-mc-15"], {}),
(["tests/startup_gfx2hlsl_heap_record_check.py", "--llvm-mc", "llvm-mc-15"], {}),
(["tests/startup_compute_gather_l_check.py", "--llvm-mc", "llvm-mc-15"], {}),
(["tests/startup_compute_buffer_atomics_check.py", "--llvm-mc", "llvm-mc-15"], {}),
(["tests/startup_compute_store_d16_x_check.py", "binary", "llvm-mc-15"], {}),
Expand Down Expand Up @@ -280,6 +281,7 @@ jobs:
tests/startup_joined_table_pointer_check.py \
tests/startup_gfx2hlsl_readfirstlane_recompute_check.py \
tests/startup_compute_readfirstlane_check.py \
tests/startup_gfx2hlsl_heap_record_check.py \
tests/startup_gfx2hlsl_calculated_target_check.py \
tests/startup_triage_run_check.py \
tests/startup_run_ps1_check.py \
Expand Down
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ python3 -m venv out/pe-env
./out/pe-env/bin/python -B tests/startup_gfx2hlsl_compute_check.py
./out/pe-env/bin/python -B tests/startup_compute_image_store_check.py
./out/pe-env/bin/python -B tests/startup_compute_image_store_d16_check.py
./out/pe-env/bin/python -B tests/startup_gfx2hlsl_heap_record_check.py
./out/pe-env/bin/python -B tests/startup_compute_store_format_xyzw_check.py
./out/pe-env/bin/python -B tests/startup_compute_translate_check.py
./out/pe-env/bin/python -B tests/startup_gfx2hlsl_swap_check.py
Expand Down
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3220,6 +3220,8 @@ if(EXISTS "${INTAKE_PYTHON}")
"${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_compute_image_store_check.py")
add_test(NAME startup_compute_image_store_d16 COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_compute_image_store_d16_check.py")
add_test(NAME startup_gfx2hlsl_heap_record COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_heap_record_check.py")
add_test(NAME startup_compute_readfirstlane COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_compute_readfirstlane_check.py")
add_test(NAME startup_compute_gather_l COMMAND "${INTAKE_PYTHON}" -B
Expand Down Expand Up @@ -4130,6 +4132,17 @@ if(EXISTS "${INTAKE_PYTHON}")
PROPERTIES TIMEOUT 120 SKIP_RETURN_CODE 77)
set_tests_properties(startup_compute_translate_e2e_wrong_group_${adapter} PROPERTIES
PASS_REGULAR_EXPRESSION "control wrong-group: rejected at word=[0-9]+ ")
add_test(NAME startup_compute_dispatch_${adapter} COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_compute_dispatch_check.py" "$<TARGET_FILE:startup_stream_consumer>"
"${DXC_EXECUTABLE}" ${adapter})
add_test(NAME startup_compute_dispatch_texture_${adapter} COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_compute_dispatch_texture_check.py" "$<TARGET_FILE:startup_stream_consumer>"
"${DXC_EXECUTABLE}" ${adapter})
add_test(NAME startup_compute_dispatch_heap_${adapter} COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_compute_dispatch_heap_check.py" "$<TARGET_FILE:startup_stream_consumer>"
"${DXC_EXECUTABLE}" ${adapter})
set_tests_properties(startup_compute_dispatch_${adapter} startup_compute_dispatch_texture_${adapter}
startup_compute_dispatch_heap_${adapter} PROPERTIES TIMEOUT 120 SKIP_RETURN_CODE 77)
endforeach()
add_test(NAME startup_stream_adapter_filter COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_stream_rasterizer_check.py"
Expand Down
42 changes: 42 additions & 0 deletions docs/experiments.md
Original file line number Diff line number Diff line change
Expand Up @@ -15984,6 +15984,17 @@ ctest --preset dev --no-tests=error -R "^startup_image_sample_d_draw_(warp|hardw

`tests/startup_gfx2hlsl_mul24_align_check.py` translates each instruction, evaluates the emitted text on the CPU against a reference written with unbounded integers, and checks that `v_mul_hi_u32_u24` is refused. Run with `python3 -B tests/startup_gfx2hlsl_mul24_align_check.py` (`ctest --preset dev --no-tests=error -R '^startup_gfx2hlsl_mul24_align$' -V`). `tests/startup_gfx2hlsl_mul24_align_draw_check.py` draws the six translated instructions through FXC `ps_5_1` and DXC `ps_6_0` and compares the GPU readback with the same reference (`startup_gfx2hlsl_mul24_align_warp` and `_hardware`); both compilers run before the test fails, so one compiler's failure does not hide the other's result. The draw covers the six translated instructions only.

## Startup list Dispatch

Command-list slot 14 (`Dispatch`) is recorded on the desktop list only when the list is open and direct or compute, a desktop compute pipeline and a desktop compute root signature are bound, the compute root declares no static samplers and only root SRV parameters (slot 43), the compute pipeline was built against that same root signature, every root SRV the root declares was set since the root was bound (a rejected or unaligned replacement clears its binding), and every group count is at most 65535. Zero groups on an axis is forwarded and runs nothing. A root with other parameters is refused with `compute root arguments are not forwarded`, a pipeline from another root with `compute pipeline was built against another root signature`, an unset or rejected root SRV with `a compute root SRV is not bound`, because this path forwards none of the compute root-argument slots (35, 37, 39, 41, 45) to the desktop list and the dispatch would run with them unset. Other refusals are logged as `x2w-render Dispatch(x, y, z) refused: <reason>`.

Only the decision is checked: `tests/startup_list_dispatch_check.cpp` runs without a device and its five mutated runs must fail. Executing a dispatch on a GPU, with real results read back, is not verified yet.

```powershell
cmake --build --preset dev --target startup_list_dispatch_check
ctest --preset dev --no-tests=error -R "^startup_list_dispatch" -V
```

## Non-constant scalar symbols at branch targets in the startup translator

Follow-up to #2279, which drops scalar constants at a join that another path writes, over the textual range between
Expand All @@ -16006,6 +16017,37 @@ is 0, so bit 0 of the result is 0 (1 for `s_orn2_b64`) whatever S holds. This re
a lane whose exec bit is 0 takes the branch; it is pure Python only, not run on a GPU, and its words are built from
the field layouts rather than assembled.

## Translated compute Dispatch

With a device slot 67 placeholder bound, command-list slot 14 looks up the translation of the pipeline's published request (`<key>.txt` with `stage cs`, and `<key>.cs.cso`) and records it on the desktop list. It binds, from the compute descriptor tables of slot 35: raw buffers named by 16-byte hardware buffer descriptors, and 2D textures named by the token of a view the caller created (device slot 18 for an input, slot 19 for an output the program stores `float4` to). `smp` manifest lines become static samplers, and entry values come from the compute root constants of slots 37 and 39. A buffer input must resolve to a complete GPU-backed range; a buffer output must be a placed buffer that aliases the caller's memory and allows unordered access; a texture view must be 2D, created on the desktop, and for an output have a float or normalized format that is not packed, on a texture that is not also an input of the call. Any other manifest line (other texture kinds, sampler heaps, comparison samplers, root views, `stride` and `descword3` entry values) leaves the pipeline untranslated, and a Dispatch that cannot be bound completely is refused with one logged reason: no Dispatch is recorded and nothing is bound (the upload of an input texture the caller filled in memory may already be recorded; it only syncs content). No view is ever bound null. The entry values live in the compute root-constant store of #1975: a word no slot 37 or 39 call wrote since the compute root was set (slot 33 with another root, or a list reset) has no value and is refused with `an entry value was not set since the compute root`; setting the same root again keeps the words, and the graphics words of slot 40 are separate.

`tests/startup_compute_dispatch_check.py` drives a source-built gfx1013 program through the stand-in's list on WARP and on a physical adapter (exit 77 without one) and reads the 320 output words back from the aliased memory. Controls in the same run: before the offline translation, without a Dispatch, and with the two descriptors exchanged, every output word must keep its sentinel. The two entry values arrive through slot 37 and slot 39, with other values written through slot 40 in between; `dispatch-same-root` must still give the expected words, and five refused modes must log their reason and keep the sentinels: a missing word, another compute root set and the first set again, a list reset, a compute root that is not the pipeline's, and one buffer named as input and output. `tests/startup_compute_dispatch_texture_check.py` does the same for a program that stores to a 32x8 RGBA16_FLOAT texture (1024 halves read back through CopyTextureRegion; controls: before translation, without a Dispatch, a texture without unordered access) and for the raw buffer program with a level-zero sample of a 1x1 texture XORed into each stored word (control: no view at the table entry). The texture output program is also bound under a manifest edited to declare no entry values.

The log line `x2w-render compute dispatches: translated <n>, refused <n>, no translation <n>, not modelled <n>` follows the render totals; "not modelled" counts calls whose manifest exists but holds a line the runtime does not bind. It is followed by a census: the refused calls per first refusal reason of their key, and every dispatched key by call count, each with its count, the calls recorded and the first refused table descriptor.

Measured on three fixture programs. The sampling fixture uses a 1x1 texture, so it does not tell sampler filter or address modes apart. Programs with other texture kinds, sampler heaps, the same texture as input and output, or buffer outputs in memory that is not aliased are not dispatched.

```powershell
cmake --build --preset dev --target startup_stream_consumer
ctest --preset dev --no-tests=error -R "^startup_compute_dispatch_" -V
```

### An input named by a resource heap record

A compute root signature that indexes the resource heap directly (root flag 0x400) passes the heap pointer in one SGPR after the root parameters. `gfx2hlsl.py` lowers one form of a load through that pointer: `s_lshl_b32 R, <root constant word>, 5`, then, with no write of `R` and no branch target in between, `s_load_dwordx4 D, s[H:H+1], R` with a constant zero in `s[H+1]` and no `offset:` modifier. `D` is then a buffer descriptor, and the manifest names it `srv <i> buf heap rootconst <parameter> <word>`. Slot 32 now records the title memory of the list's view heap on every call; at Dispatch the stand-in reads the 16-byte descriptor at byte `word << 5` (32-bit arithmetic, as the program computes it) of that memory and binds the buffer through the path a `table` record takes. A record outside the heap refuses the dispatch (`a heap record is outside the list's view heap`) and binds nothing.

Every other form keeps a refusal that names it: another shift or index, an index register written again, a branch target between the shift and the load, a high word that is not a constant zero, an `offset:` modifier, eight dwords (an image record), and an index read from a buffer (`s_load of a resource heap record whose index is read from a buffer`). A formatted load or a store through such a record, and the graphics stages, are refused as before.

`tests/startup_gfx2hlsl_heap_record_check.py` compares the manifest and the HLSL of a source-built gfx1013 program whole, runs 19 refused controls and one translator mutation (without the write tracking, a refused control translates), and with `--llvm-mc` reassembles every instruction. `tests/startup_compute_dispatch_heap_check.py` dispatches that program through the stand-in's list on WARP and on a physical adapter (exit 77 without one): the input descriptor is only in heap record 2, records 0 and 1 hold the output's descriptor, and all 320 output words must match; before translation and for a record outside the heap every word keeps its sentinel. Changing the runtime's shift to 4, or ignoring the index, makes the dispatch test fail (`an output buffer is also an input`).

Measured on one synthetic program. The offset is a literal byte offset into the title's heap memory, as a table offset is; a heap whose descriptor increment on the desktop adapter is not 32 bytes (WARP is such an adapter, so its run covers the literal offset only) is not checked against a caller that addresses records by that increment. In a local set of 184 compute programs with a register-offset load through the heap pointer, every such load lowers in 4 programs and none of the 184 translates yet: 151 hold a load whose index is read from a buffer, and the 4 stop at other instructions.

```powershell
python -B tests/startup_gfx2hlsl_heap_record_check.py --llvm-mc llvm-mc-15
cmake --build --preset dev --target startup_stream_consumer
ctest --preset dev --no-tests=error -R "^startup_compute_dispatch_heap_" -V
```

## Startup compute dual-offset/stride-64 LDS ops and 32-bit LDS atomics

[`tools/startup/gfx2hlsl.py`](../tools/startup/gfx2hlsl.py) (`lds_dual`, `lds_atomic`, `_lds_general_barrier_ok`, refs `#1541`, `#2274`) lowers the remaining 32-bit RDNA 2 DS dual-offset/stride-64 and unsigned/bitwise atomic instructions onto `groupshared uint lds[N]` (`COMPUTE_PGM_RSRC2.GRANULATED_LDS_SIZE`, nonzero and `<= 32 KiB` / 8192 dwords):
Expand Down
Loading
Loading