shader: lower two disjoint LDS dword fills before a compute barrier #2751

Manually merged
github merged 1 commit from gh-pr/2751/head into gh-pr/2751/base 2026-11-27 01:20:03 +00:00
Owner

@⁠brainbudt on GitHub · 2026-11-26 05:53 UTC · original
brainbudt:shader/lds-two-disjoint-fills → main · +71 −18 · 4 files · 1 commits · merged 2026-11-26 06:02 UTC

Problem

The startup compute translator accepts one per-lane LDS fill. It refuses a second consecutive ds_write_b32 even when the same local-X address and two immediate offsets prove that every lane writes distinct words in both banks. On 601eb62, the original proof accepts case F and refuses the new source with LDS exchange needs one bounded dword per local X ID.

Change

Track both initialized byte ranges through one unconditional workgroup barrier. Each read must fit entirely inside one range. The new gfx1013 fixture writes two banks, reads a peer lane from the first and broadcasts lane 37 from the second. The host tests cover reversed bank order, omitted or overlapping fills, a read in the gap, a third fill, unproven addresses, GDS and malformed encodings.

Scope

Refs #2274. This claimed Part A follow-up covers consecutive dword stores in a straight-line, full-EXEC 1D workgroup. The tracker gives an aggregate LDS count and does not report the frequency of this two-bank shape.

Verification

  • Linux x86-64 (Python 3.12.16, LLVM 15.0.6): the python-linux workflow command passed all 196 checks and the pixel-binary LLVM matrix passed all 124 checks. python -B tests/startup_gfx2hlsl_compute_check.py binary llvm-mc-15 reproduced the fixture bytes.
  • Rebased onto origin/main (594bb3c) and verified python3 -B tests/startup_gfx2hlsl_compute_check.py passes cleanly.
  • Windows 11 build 26200, Microsoft Basic Render Driver 10.0.26100.9818, DXC 1.9.2609.5 (D3D12 debug layer unavailable): python -B tests/startup_gfx2hlsl_compute_check.py dispatch dxc.exe offscreen_check.exe warp matched all 320 words in each of 26 cases using the upstream GPU-check artifact (e9ae884f).
  • Negative control: python -B tests/startup_gfx2hlsl_compute_check.py control f-second-fill dxc.exe offscreen_check.exe warp detected 128 incorrect words when the second fill wrote zero (first mismatch: word 1, expected 00000094, actual 00000000). Physical GPU readback remains outstanding.
  • To reproduce with a built Windows checkout: ctest --preset release --no-tests=error -j 1 -R '^startup_gfx2hlsl_compute_(controls|(f-second-fill_)?(warp|hardware))$' -V.

Reviewed with mistral-loop: APPROVE (2 rounds, mistral-large-4-0 + deepseek-v4-1-flash-1017).
Created with gpt-6.2-astra in Codex (orchestrated with Gemini 4 Neon in T3 Code).

**@⁠brainbudt** on GitHub · 2026-11-26 05:53 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2751) `brainbudt:shader/lds-two-disjoint-fills` → `main` · +71 −18 · 4 files · 1 commits · merged 2026-11-26 06:02 UTC ## Problem The startup compute translator accepts one per-lane LDS fill. It refuses a second consecutive `ds_write_b32` even when the same local-X address and two immediate offsets prove that every lane writes distinct words in both banks. On `601eb62`, the original proof accepts case F and refuses the new source with `LDS exchange needs one bounded dword per local X ID`. ## Change Track both initialized byte ranges through one unconditional workgroup barrier. Each read must fit entirely inside one range. The new gfx1013 fixture writes two banks, reads a peer lane from the first and broadcasts lane 37 from the second. The host tests cover reversed bank order, omitted or overlapping fills, a read in the gap, a third fill, unproven addresses, GDS and malformed encodings. ## Scope Refs #2274. This [claimed Part A follow-up](https://git.gtahub.st/github/R0Y00--Xbox2Windows/issues/2274) covers consecutive dword stores in a straight-line, full-EXEC 1D workgroup. The tracker gives an aggregate LDS count and does not report the frequency of this two-bank shape. ## Verification - Linux x86-64 (Python 3.12.16, LLVM 15.0.6): the `python-linux` workflow command passed all 196 checks and the `pixel-binary` LLVM matrix passed all 124 checks. `python -B tests/startup_gfx2hlsl_compute_check.py binary llvm-mc-15` reproduced the fixture bytes. - Rebased onto `origin/main` (`594bb3c`) and verified `python3 -B tests/startup_gfx2hlsl_compute_check.py` passes cleanly. - Windows 11 build 26200, Microsoft Basic Render Driver `10.0.26100.9818`, DXC `1.9.2609.5` (D3D12 debug layer unavailable): `python -B tests/startup_gfx2hlsl_compute_check.py dispatch dxc.exe offscreen_check.exe warp` matched all 320 words in each of 26 cases using the upstream [GPU-check artifact](https://github.com/R0Y00/Xbox2Windows/actions/runs/45699000690/artifacts/15063912674) (`e9ae884f`). - Negative control: `python -B tests/startup_gfx2hlsl_compute_check.py control f-second-fill dxc.exe offscreen_check.exe warp` detected 128 incorrect words when the second fill wrote zero (first mismatch: word 1, expected `00000094`, actual `00000000`). Physical GPU readback remains outstanding. - To reproduce with a built Windows checkout: `ctest --preset release --no-tests=error -j 1 -R '^startup_gfx2hlsl_compute_(controls|(f-second-fill_)?(warp|hardware))$' -V`. --- Reviewed with mistral-loop: APPROVE (2 rounds, `mistral-large-4-0` + `deepseek-v4-1-flash-1017`). Created with gpt-6.2-astra in Codex (orchestrated with Gemini 4 Neon in T3 Code).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:20:02 +00:00
github manually merged commit 19214e73b5 into gh-pr/2751/base 2026-11-27 01:20:03 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-26 06:01 UTC · original · approved these changes

Reviewed the two disjoint fill ranges, single barrier and initialized-read bounds. The full source-built compute dispatch suite and the f-second-fill mutation ran after combining with main 5f27d8cf, on Windows 11 build 26200 with WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656. The mutation changed 128 of 320 words on each adapter, first word 1 (00000094 vs 00000000). Debug-layer errors and warnings were zero.

**@⁠R0Y00** on GitHub · 2026-11-26 06:01 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2751#pullrequestreview-6069252801) · **approved these changes** Reviewed the two disjoint fill ranges, single barrier and initialized-read bounds. The full source-built compute dispatch suite and the f-second-fill mutation ran after combining with main 5f27d8cf, on Windows 11 build 26200 with WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656. The mutation changed 128 of 320 words on each adapter, first word 1 (00000094 vs 00000000). Debug-layer errors and warnings were zero.
This discussion has been locked. Commenting is limited to contributors.
No description provided.