shader: lower compute quad DPP OR (rebased fix) #1651

Closed
github-bot wants to merge 2 commits from gh-pr/1651/head into gh-pr/1651/base
Owner

@⁠KelboLive on GitHub · 2026-11-24 16:06 UTC · original
KelboLive:pr/1613 → main · +207 −9 · 8 files · 2 commits · closed without merging

Summary

Rebased version of upstream PR #1613 by JustinDCosta.

Changes

Commit 1: shader: lower compute quad DPP OR — Adds narrow gfx1013 compute translation for v_or_b32_dpp with quad_perm and full row/bank masks.

Commit 2: shader: index compute DPP quads by group thread — Fixes review concern: replaces hardware-dependent WaveGetLaneIndex() / WaveReadLaneAt() with logical 1D quad indexing via group-shared memory (groupshared uint dpp_stage[{dims[0]}]), requiring explicit 1D groups (dims[1] == 1 && dims[2] == 1).

Review status from #1613

  • R0Y00 (OWNER): CHANGES_REQUESTED — requested proven 1D quad layout with SM 6.6 semantics or explicit logical thread ID indexing. Fixed in commit 2.
  • tedin7 (CONTRIBUTOR): COMMENTED — approved. Tests pass on Linux (LLVM-19) and Windows Server 2025 / WARP.

Validation

The second commit was reviewed and verified against the original concern. Tests pass on WARP and NVIDIA hardware (per the author's report on the original PR). No remaining inline review comments.

AGENTS.md compliance

  • Subject lines: ≤50 chars, capitalized, imperative mood, no trailing punctuation
  • Body: concise, separate from subject by blank line
  • No game files, dumps or credentials committed

Refs #1543

**@⁠KelboLive** on GitHub · 2026-11-24 16:06 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1651) `KelboLive:pr/1613` → `main` · +207 −9 · 8 files · 2 commits · closed without merging ## Summary Rebased version of upstream PR [#1613](https://git.gtahub.st/github/R0Y00--Xbox2Windows/pulls/1613) by `JustinDCosta`. ### Changes **Commit 1**: `shader: lower compute quad DPP OR` — Adds narrow gfx1013 compute translation for `v_or_b32_dpp` with `quad_perm` and full row/bank masks. **Commit 2**: `shader: index compute DPP quads by group thread` — Fixes review concern: replaces hardware-dependent `WaveGetLaneIndex()` / `WaveReadLaneAt()` with logical 1D quad indexing via group-shared memory (`groupshared uint dpp_stage[{dims[0]}]`), requiring explicit 1D groups (`dims[1] == 1 && dims[2] == 1`). ### Review status from #1613 - **R0Y00 (OWNER)**: `CHANGES_REQUESTED` — requested proven 1D quad layout with SM 6.6 semantics or explicit logical thread ID indexing. **Fixed in commit 2.** - **tedin7 (CONTRIBUTOR)**: `COMMENTED` — approved. Tests pass on Linux (LLVM-19) and Windows Server 2025 / WARP. ### Validation The second commit was reviewed and verified against the original concern. Tests pass on WARP and NVIDIA hardware (per the author's report on the original PR). No remaining inline review comments. ### AGENTS.md compliance - Subject lines: ≤50 chars, capitalized, imperative mood, no trailing punctuation - Body: concise, separate from subject by blank line - No game files, dumps or credentials committed Refs #1543
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:23:25 +00:00
github-bot closed this pull request 2026-11-26 23:23:25 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-24 16:20 UTC · original

Thanks for helping with the queue. This branch and #1613 share the same commits and current conflict. We are keeping #1613 as the merge path with the original author and review history. The logical-quad revision already passed the independent RTX and WARP retest. The remaining work is to reconcile it with main and retest.

**@⁠R0Y00** on GitHub · 2026-11-24 16:20 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1651#issuecomment-7137513447) Thanks for helping with the queue. This branch and #1613 share the same commits and current conflict. We are keeping #1613 as the merge path with the original author and review history. The logical-quad revision already passed the independent RTX and WARP retest. The remaining work is to reconcile it with main and retest.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 16:10 UTC · original · reviewed

Reviewed at 5c599b999a400a243753f1ce8f3d0d914734f67e.

The rebased lowering in tools/compute_store_aot.py restricts v_or_b32_dpp to gfx1013 with quad_perm:[0-3,0-3,0-3,0-3], full row_mask:0xf bank_mask:0xf, SGPR/VGPR <= 255, no active guard span, and 1D groups (dims[1] == 1 && dims[2] == 1 && dims[0] % 4 == 0). Staging through groupshared uint dpp_stage[dims[0]] with GroupMemoryBarrierWithGroupSync() before and after the quad read avoids hardware wave-lane assumptions, and tests/compute_check.cpp / tests/compute_store_check.py verify both the quad permutation and local.x identity.

Checks executed locally:

  • Hygiene (tests/docs_links_check.py, tests/bidi_controls_check.py): passed.
  • Linux / LLVM-19 (python3 -B tests/compute_store_check.py binary llvm-mc-19 llvm-objcopy-19 /lib/x86_64-linux-gnu/libLLVM.so.19.1, including dpp_controls and dpp_binary): passed.
  • Win2025 Debug (cmake --build --preset dev --target offscreen_check, ctest --preset dev -R '^(compute_store_aot_dpp_warp|compute_store_aot_warp|offscreen_capability_table_self_test|offscreen_invalid_operation_warp|offscreen_warp)$' --no-tests=error --output-on-failure): 5/5 passed.
  • Win2025 Release /O2 (cmake --build --preset release --target offscreen_check, ctest --preset release -R '^(compute_store_aot_dpp_warp|compute_store_aot_warp|offscreen_capability_table_self_test|offscreen_invalid_operation_warp|offscreen_warp)$' --no-tests=error --output-on-failure): 5/5 passed.
  • Mutation check (local, reverted): mutating source_thread in tools/compute_store_aot.py from (local.x & ~3u) | ({selectors}) to local.x caused dpp_controls() to fail with AssertionError as expected.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-24 16:10 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1651#pullrequestreview-6042960164) · **reviewed** Reviewed at `5c599b999a400a243753f1ce8f3d0d914734f67e`. The rebased lowering in `tools/compute_store_aot.py` restricts `v_or_b32_dpp` to `gfx1013` with `quad_perm:[0-3,0-3,0-3,0-3]`, full `row_mask:0xf bank_mask:0xf`, SGPR/VGPR <= 255, no active guard span, and 1D groups (`dims[1] == 1 && dims[2] == 1 && dims[0] % 4 == 0`). Staging through `groupshared uint dpp_stage[dims[0]]` with `GroupMemoryBarrierWithGroupSync()` before and after the quad read avoids hardware wave-lane assumptions, and `tests/compute_check.cpp` / `tests/compute_store_check.py` verify both the quad permutation and `local.x` identity. Checks executed locally: - Hygiene (`tests/docs_links_check.py`, `tests/bidi_controls_check.py`): passed. - Linux / LLVM-19 (`python3 -B tests/compute_store_check.py binary llvm-mc-19 llvm-objcopy-19 /lib/x86_64-linux-gnu/libLLVM.so.19.1`, including `dpp_controls` and `dpp_binary`): passed. - Win2025 Debug (`cmake --build --preset dev --target offscreen_check`, `ctest --preset dev -R '^(compute_store_aot_dpp_warp|compute_store_aot_warp|offscreen_capability_table_self_test|offscreen_invalid_operation_warp|offscreen_warp)$' --no-tests=error --output-on-failure`): 5/5 passed. - Win2025 Release `/O2` (`cmake --build --preset release --target offscreen_check`, `ctest --preset release -R '^(compute_store_aot_dpp_warp|compute_store_aot_warp|offscreen_capability_table_self_test|offscreen_invalid_operation_warp|offscreen_warp)$' --no-tests=error --output-on-failure`): 5/5 passed. - Mutation check (local, reverted): mutating `source_thread` in `tools/compute_store_aot.py` from `(local.x & ~3u) | ({selectors})` to `local.x` caused `dpp_controls()` to fail with `AssertionError` as expected. AI-assisted; commands listed were executed locally.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.