compute: accept VCC and EXEC in direct 64-bit s_not and s_cselect #3264

Manually merged
github merged 2 commits from github-bot/gh-3262 into gh-pr/3262/base 2026-11-28 03:30:22 +00:00 AGit
Owner

@⁠Leyukaka on GitHub · 2026-11-28 02:30 UTC · original
Leyukaka:s-not-b64-exec → main · +173 −12 · 5 files · 2 commits · merged 2026-11-28 03:26 UTC

Part of #2935 and #3226. Target branch main. Rebased on main 0637fced now that #3247 is merged: one commit.

Change (src/gfx1013_direct_compute.inl, the s_cselect_b64 / s_not_b64 block):

  • s_not_b64 and s_cselect_b64 accept VCC (106) and EXEC (126) as 64-bit sources. Both words are read from the existing SALU register slots: VCC/VCC_HI and EXEC/EXEC_HI, in wave32 and wave64.
  • s_not_b64 may write EXEC. It uses the same pair of writes (dst, dst + 1) as s_bfm_b64 in #3247 and the s_*_b64 / s_*_saveexec_b64 mask operations already on main. The SCC write moves after the destination writes, with no behaviour change.
  • On VCC in wave64: #3247 and my earlier comment on #3226 kept VCC refused there, because nothing guarantees both its words. Here VCC is read the way s_mov_b64 and the _b64 mask operations on main already read it (operand32(106) plus pair_high, so 107). Ballot writers publish both words through the exchange. As on main for those operations, a VCC_HI that was never written is not refused in wave64; wave32 initialises it to 0.
  • Odd SGPRs, M0 and the other special registers stay refused, as does s_cselect_b64 into EXEC.
  • docs/experiments/native-salu64-ops.md now says s_not_b64 may write EXEC. It lists the VCC/EXEC sources and the new test command.

Tests. The setup was Windows 11 with an NVIDIA GeForce RTX 5080 and DXC from the Windows SDK 10.0.26100, Release.

  • New native_s_not_b64_exec_controls and _hardware reuse the #3247 fixture, in wave32 and wave64. They cover:
    • NOT from EXEC and from VCC, plus VCC all ones, so SCC is 0;
    • CSELECT of EXEC and VCC under SCC 0 and 1;
    • NOT into EXEC, followed by a per-lane store.
  • The readback checks both result words, SCC, the guard words and, after the EXEC write, which lanes stored.
  • The controls also check refusals for an odd SGPR source, an M0 source (in either CSELECT position), and CSELECT into EXEC.
  • With main's compile_dxil before this change, the controls stop at "invalid s_not_b64 source".
  • Mutation checks by hand:
    • swapping the CSELECT arms fails the hardware test;
    • refusing the EXEC destination again fails both tests.
  • tests/native_salu64_check.py refused s_not_b64 s24, vcc. That control now uses EXEC_HI (127, odd), which stays refused.
  • On a full build, ctest -R "native_|startup_compute|compile_dxil|salu" passed 417 of 418 before the rebase. native_scalar_lds_hardware fails as on main. After the rebase on 0637fced, the native_s_not_b64_exec, native_salu, native_wave64_exec_salu, cselect and native_direct_container tests pass, 22 of 22.

Measured with compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests, #3247 on main 7364e6a9 against this change on that base. This was measured before #3247 was merged and not re-measured after the rebase. The merged #3247 has the same source and test changes (it adds docs only), but main has advanced 12 commits since 7364e6a9, so only the differences below carry over, not the totals.

  • Local capture of 2,689 requests: 522 to 528 compile. Of the 21 programs that stopped at these refusals, 6 compile. The others stop later:
    • 5 at "unbound numeric SGPR";
    • 4 at "direct descriptor address outside bound table";
    • 2 at "unsupported wave64 scalar operation";
    • 2 at image modifiers;
    • 1 at v_rcp_f16;
    • 1 at a DS opcode.
  • The 882 requests of #3226: 141 to 143, 20,902 dispatches.
  • No program that compiled before stops compiling.
  • Counts and instruction shape only.

AI-assisted.

**@⁠Leyukaka** on GitHub · 2026-11-28 02:30 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3262) `Leyukaka:s-not-b64-exec` → `main` · +173 −12 · 5 files · 2 commits · merged 2026-11-28 03:26 UTC Part of #2935 and #3226. Target branch `main`. Rebased on `main` `0637fced` now that #3247 is merged: one commit. **Change** (`src/gfx1013_direct_compute.inl`, the `s_cselect_b64` / `s_not_b64` block): - `s_not_b64` and `s_cselect_b64` accept VCC (106) and EXEC (126) as 64-bit sources. Both words are read from the existing SALU register slots: VCC/VCC_HI and EXEC/EXEC_HI, in wave32 and wave64. - `s_not_b64` may write EXEC. It uses the same pair of writes (`dst`, `dst + 1`) as `s_bfm_b64` in #3247 and the `s_*_b64` / `s_*_saveexec_b64` mask operations already on `main`. The SCC write moves after the destination writes, with no behaviour change. - On VCC in wave64: #3247 and my earlier comment on #3226 kept VCC refused there, because nothing guarantees both its words. Here VCC is read the way `s_mov_b64` and the `_b64` mask operations on `main` already read it (`operand32(106)` plus `pair_high`, so 107). Ballot writers publish both words through the exchange. As on `main` for those operations, a VCC_HI that was never written is not refused in wave64; wave32 initialises it to 0. - Odd SGPRs, M0 and the other special registers stay refused, as does `s_cselect_b64` into EXEC. - `docs/experiments/native-salu64-ops.md` now says `s_not_b64` may write EXEC. It lists the VCC/EXEC sources and the new test command. **Tests.** The setup was Windows 11 with an NVIDIA GeForce RTX 5080 and DXC from the Windows SDK 10.0.26100, Release. - New `native_s_not_b64_exec_controls` and `_hardware` reuse the #3247 fixture, in wave32 and wave64. They cover: - NOT from EXEC and from VCC, plus VCC all ones, so SCC is 0; - CSELECT of EXEC and VCC under SCC 0 and 1; - NOT into EXEC, followed by a per-lane store. - The readback checks both result words, SCC, the guard words and, after the EXEC write, which lanes stored. - The controls also check refusals for an odd SGPR source, an M0 source (in either CSELECT position), and CSELECT into EXEC. - With `main`'s `compile_dxil` before this change, the controls stop at "invalid s_not_b64 source". - Mutation checks by hand: - swapping the CSELECT arms fails the hardware test; - refusing the EXEC destination again fails both tests. - `tests/native_salu64_check.py` refused `s_not_b64 s24, vcc`. That control now uses EXEC_HI (127, odd), which stays refused. - On a full build, `ctest -R "native_|startup_compute|compile_dxil|salu"` passed 417 of 418 before the rebase. `native_scalar_lds_hardware` fails as on `main`. After the rebase on `0637fced`, the `native_s_not_b64_exec`, `native_salu`, `native_wave64_exec_salu`, `cselect` and `native_direct_container` tests pass, 22 of 22. **Measured** with `compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests`, #3247 on `main` `7364e6a9` against this change on that base. This was measured before #3247 was merged and not re-measured after the rebase. The merged #3247 has the same source and test changes (it adds docs only), but `main` has advanced 12 commits since `7364e6a9`, so only the differences below carry over, not the totals. - Local capture of 2,689 requests: 522 to 528 compile. Of the 21 programs that stopped at these refusals, 6 compile. The others stop later: - 5 at "unbound numeric SGPR"; - 4 at "direct descriptor address outside bound table"; - 2 at "unsupported wave64 scalar operation"; - 2 at image modifiers; - 1 at `v_rcp_f16`; - 1 at a DS opcode. - The 882 requests of #3226: 141 to 143, 20,902 dispatches. - No program that compiled before stops compiling. - Counts and instruction shape only. AI-assisted.
EXEC (126) is accepted as the even source pair of s_bcnt0/s_bcnt1,
s_ff0/s_ff1 and s_flbit *_b64, and as the s_bfm_b64 destination. In the
wave64 model each host half holds both EXEC words: both are set at entry,
lane-mask writers publish both through the exchange, and scalar writes are
identical in both halves; VCC has no such guarantee and stays
refused as a source and as the s_bfm_b64 destination.

New test native_wave64_exec_salu (wave64 64 and 128 threads, wave32 32):
a sparse EXEC count, s_bfm_b64 exec, 16, 0 and exec, 32, 32, with three
refusal controls. Depends on #3006 for the wave64 model.
s_not_b64 and s_cselect_b64 now take VCC and EXEC as 64-bit sources in
direct compute, reading both words from the existing SALU register
slots (VCC_HI, EXEC_HI), and s_not_b64 may write EXEC through the same
pair of writes the other 64-bit SALU mask operations use. s_not_b64
writes SCC after its destination. Odd SGPRs, M0 and other special
registers stay refused, as does s_cselect_b64 into EXEC.

New test native_s_not_b64_exec (controls, hardware) covers NOT from
EXEC and VCC, CSELECT under SCC 0 and 1, and NOT into EXEC with a
per-lane store, in wave32 and wave64. native_salu64_controls refused
s_not_b64 from VCC; that control now uses EXEC_HI (127), which stays
refused.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 02:34:16 +00:00
github-bot force-pushed github-bot/gh-3262 from 794d168613 to 1b58e0e16f 2026-11-28 03:11:41 +00:00 Compare
github-bot changed target branch from main to gh-pr/3262/base 2026-11-28 03:30:21 +00:00
github manually merged commit 0cc54d1c63 into gh-pr/3262/base 2026-11-28 03:30:22 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-28 03:26 UTC · original · reviewed

Review of head 0cc54d1c (the PR's own change is the same as 1b58e0e1; the new head only merges current main). The dependency #3247 is merged.

What I checked:

  • src/gfx1013_direct_compute.inl, the s_cselect_b64 / s_not_b64 block: both words of a VCC (106/107) or EXEC (126/127) source now come from operand32 plus pair_high, the same reads the s_mov_b64 and _b64 mask operations already use. Odd SGPRs, M0 and the other special registers stay refused, and so does s_cselect_b64 into EXEC. s_not_b64 into EXEC writes both words through the same write(dst) / write(dst + 1) pair as the SAVEEXEC path; the SCC write after the destination writes is computed from the same lo | hi, so it is unchanged.
  • Inline constants and the literal go through the same pair_high as before the change.
  • Tests: native_s_not_b64_exec_controls (wave32 and wave64 compiles, plus the odd SGPR / M0 / CSELECT-into-EXEC refusals) and native_s_not_b64_exec_hardware (real D3D12 readback of both result words, SCC, the guard words, and which lanes store after NOT into EXEC). The expected words come from a plain 64-bit Python reference, not from the translator. The native_salu64_check.py control moved from VCC (now accepted) to EXEC_HI (odd, still refused).

Commands run:

  • Linux: python3 tests/docs_links_check.py ok, python3 tests/bidi_controls_check.py ok, git diff --check origin/main...HEAD clean, python3 -m py_compile on both touched test files ok.
  • Windows Server 2025, D3D12 WARP 1.0.22 (the hardware test ran on WARP, it did not skip), -R '^native_(s_not_b64_exec_controls|s_not_b64_exec_hardware|salu64_controls|salu64_hardware|wave64_exec_salu_hardware|compute_clear|direct_container)$': dev 7/7 passed, release 7/7 passed.
  • Mutation 1 (the high word of a 64-bit source read from the low word, in this block only): native_s_not_b64_exec_hardware fails at wave32 not_exec, word 520.
  • Mutation 2 (s_not_b64 writes SCC = 0): native_s_not_b64_exec_hardware fails at wave32 not_exec, word 776 (the SCC plane).

No blocking findings. The receipt follows in a separate comment.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-28 03:26 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3262#pullrequestreview-6095427698) · **reviewed** Review of head `0cc54d1c` (the PR's own change is the same as `1b58e0e1`; the new head only merges current `main`). The dependency #3247 is merged. What I checked: - `src/gfx1013_direct_compute.inl`, the `s_cselect_b64` / `s_not_b64` block: both words of a VCC (106/107) or EXEC (126/127) source now come from `operand32` plus `pair_high`, the same reads the `s_mov_b64` and `_b64` mask operations already use. Odd SGPRs, M0 and the other special registers stay refused, and so does `s_cselect_b64` into EXEC. `s_not_b64` into EXEC writes both words through the same `write(dst)` / `write(dst + 1)` pair as the SAVEEXEC path; the SCC write after the destination writes is computed from the same `lo | hi`, so it is unchanged. - Inline constants and the literal go through the same `pair_high` as before the change. - Tests: `native_s_not_b64_exec_controls` (wave32 and wave64 compiles, plus the odd SGPR / M0 / CSELECT-into-EXEC refusals) and `native_s_not_b64_exec_hardware` (real D3D12 readback of both result words, SCC, the guard words, and which lanes store after NOT into EXEC). The expected words come from a plain 64-bit Python reference, not from the translator. The `native_salu64_check.py` control moved from VCC (now accepted) to EXEC_HI (odd, still refused). Commands run: - Linux: `python3 tests/docs_links_check.py` ok, `python3 tests/bidi_controls_check.py` ok, `git diff --check origin/main...HEAD` clean, `python3 -m py_compile` on both touched test files ok. - Windows Server 2025, D3D12 WARP 1.0.22 (the hardware test ran on WARP, it did not skip), `-R '^native_(s_not_b64_exec_controls|s_not_b64_exec_hardware|salu64_controls|salu64_hardware|wave64_exec_salu_hardware|compute_clear|direct_container)$'`: dev 7/7 passed, release 7/7 passed. - Mutation 1 (the high word of a 64-bit source read from the low word, in this block only): `native_s_not_b64_exec_hardware` fails at wave32 `not_exec`, word 520. - Mutation 2 (`s_not_b64` writes SCC = 0): `native_s_not_b64_exec_hardware` fails at wave32 `not_exec`, word 776 (the SCC plane). No blocking findings. The receipt follows in a separate comment. AI-assisted; commands listed were executed locally.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-28 03:26 UTC · original

Win2025 WARP receipt for head 0cc54d1c after updating with main.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 0cc54d1c63332718df6726de2c2515890c4ed757:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target compile_dxil native_store_replay -- -j 3): 8.23s (configure 0.00s)
    • Test (ctest --preset dev -R '^native_(s_not_b64_exec_controls|s_not_b64_exec_hardware|salu64_controls|salu64_hardware|wave64_exec_salu_hardware|compute_clear|direct_container)$' --parallel 4 --no-tests=error --output-on-failure): 7/7 passed (14.94s: native_salu64_controls 0.26s, native_compute_clear 0.40s, native_s_not_b64_exec_hardware 1.80s, native_s_not_b64_exec_controls 1.89s, native_salu64_hardware 2.03s, native_wave64_exec_salu_hardware 1.81s, native_direct_container 14.28s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target compile_dxil native_store_replay -- -j 3): 30.68s (configure 0.00s)
    • Test (ctest --preset release -R '^native_(s_not_b64_exec_controls|s_not_b64_exec_hardware|salu64_controls|salu64_hardware|wave64_exec_salu_hardware|compute_clear|direct_container)$' --parallel 4 --no-tests=error --output-on-failure): 7/7 passed (12.66s: native_salu64_controls 0.17s, native_compute_clear 0.26s, native_s_not_b64_exec_controls 0.97s, native_s_not_b64_exec_hardware 0.95s, native_salu64_hardware 1.16s, native_wave64_exec_salu_hardware 0.97s, native_direct_container 12.22s)
  • sccache: 1/8 hits; wall 48.6s
    tested: 0cc54d1c via fetch (pull/3262/head, no patch)

The new tests native_s_not_b64_exec_controls and native_s_not_b64_exec_hardware (on WARP, not skipped) and the changed native_salu64_controls ran in both legs.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-28 03:26 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3262#issuecomment-7233072919) Win2025 WARP receipt for head 0cc54d1c after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `0cc54d1c63332718df6726de2c2515890c4ed757`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target compile_dxil native_store_replay -- -j 3`): `8.23s` (configure `0.00s`) - Test (`ctest --preset dev -R '^native_(s_not_b64_exec_controls|s_not_b64_exec_hardware|salu64_controls|salu64_hardware|wave64_exec_salu_hardware|compute_clear|direct_container)$' --parallel 4 --no-tests=error --output-on-failure`): **7/7 passed** (`14.94s`: `native_salu64_controls` `0.26s`, `native_compute_clear` `0.40s`, `native_s_not_b64_exec_hardware` `1.80s`, `native_s_not_b64_exec_controls` `1.89s`, `native_salu64_hardware` `2.03s`, `native_wave64_exec_salu_hardware` `1.81s`, `native_direct_container` `14.28s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target compile_dxil native_store_replay -- -j 3`): `30.68s` (configure `0.00s`) - Test (`ctest --preset release -R '^native_(s_not_b64_exec_controls|s_not_b64_exec_hardware|salu64_controls|salu64_hardware|wave64_exec_salu_hardware|compute_clear|direct_container)$' --parallel 4 --no-tests=error --output-on-failure`): **7/7 passed** (`12.66s`: `native_salu64_controls` `0.17s`, `native_compute_clear` `0.26s`, `native_s_not_b64_exec_controls` `0.97s`, `native_s_not_b64_exec_hardware` `0.95s`, `native_salu64_hardware` `1.16s`, `native_wave64_exec_salu_hardware` `0.97s`, `native_direct_container` `12.22s`) - `sccache`: 1/8 hits; wall `48.6s` tested: 0cc54d1c via fetch (pull/3262/head, no patch) The new tests `native_s_not_b64_exec_controls` and `native_s_not_b64_exec_hardware` (on WARP, not skipped) and the changed `native_salu64_controls` ran in both legs. AI-assisted; commands listed were executed locally.
This discussion has been locked. Commenting is limited to contributors.
No description provided.