compute: accept VCC as destination in 64-bit scalar bitset #3416

Manually merged
github merged 1 commit from github-bot/gh-3414 into main 2026-11-29 08:45:43 +00:00 AGit
Owner

@⁠Ammmae0x on GitHub · 2026-11-28 23:41 UTC · original
Ammmae0x:compute/salu-bitset64-vcc → main · +272 −1 · 3 files · 1 commits · merged 2026-11-29 08:43 UTC

Accept VCC (106) as the destination of s_bitset0_b64 / s_bitset1_b64 in the direct C++ compute path.

Refs #3226, #2935

  • src/gfx1013_direct_compute.inl: the bitset guard now allows dst == 106 when the form is a 64-bit pair in compute mode (operand32(i, 106/107) already reads/writes vcc_lo/vcc_hi). EXEC (126), M0 (124), odd SGPRs, a non-pair VCC destination in b32, and VCC in the graphics-input path are still refused with the existing "bitset requires a general scalar destination or aligned pair" message. preserves_sop1 already lists both 64-bit bitset forms, so SCC tracking is unchanged (bitset leaves SCC alone).
  • No existing control refused VCC on the 64-bit forms: tests/compute_salu_bitset_check.py refuses VCC only for s_bitset1_b32 (unchanged), and its 64-bit refusals belong to the separate Python AOT translator. No docs change was applicable.
  • New tests/native_salu_bitset64_vcc_check.py + tests/cmake/native_salu_bitset64_vcc.cmake (_controls / _hardware, SKIP_RETURN_CODE 77, TIMEOUT 60): 16 cases (12 wave64, 4 wave32) running s_bitset0_b64 then s_bitset1_b64 on VCC from the same initial pair, covering low-word bits 0..31, high-word bits 32..63, wrapped indices 64/65/96/127, SGPR, inline and literal bit indices, the preserved other half, and preserved SCC (both 0 and 1). 8 negative controls (EXEC, M0, odd SGPR, b32 with VCC, for both ops) and 5 reference mutants.

Linux checks (this host, no DXC/Windows):

  • tests/form_coverage_check.py: passed
  • tests/docs_links_check.py: passed (160 files, 682 links)
  • tests/bidi_controls_check.py: passed (2582 files)
  • py_compile on the new test: passed
  • Offline harness (oracle vs independent 64-bit model, instruction-word decoding, refusal pinning, guard text): 144 checks passed
  • 5/5 spot-mutations on /tmp copies failed as expected; /tmp cleaned
  • tests/compute_salu_bitset_check.py controls: passed

Windows verification (compile_dxil, native CTest) still pending.

Windows Verification (9efc1be6)

Commit: 9efc1be668ec8e61a021310781673f7b37f9371c (Windows 11 build 26100.7623)
Adapter: NVIDIA GeForce RTX 4050 Laptop GPU (10de:28e1), driver 32.0.15.9186 (D3D12 debug layer not enabled by native_store_replay)
dev:
  cmake --build --preset dev --target compile_dxil native_store_replay
  $env:XBOX2WINDOWS_ADAPTER='NVIDIA'; ctest --preset dev --no-tests=error -R '^(native_salu_bitset64_vcc_|compute_salu_bitset)' --output-on-failure
  -> 2/2 passed, 0 failed, 0 skipped (5.26s; _hardware suite passed on RTX 4050)
Repo checks: form_coverage_check, docs_links_check, bidi_controls_check -> 3/3 passed
AI-assisted.
**@⁠Ammmae0x** on GitHub · 2026-11-28 23:41 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3414) `Ammmae0x:compute/salu-bitset64-vcc` → `main` · +272 −1 · 3 files · 1 commits · merged 2026-11-29 08:43 UTC Accept `VCC` (`106`) as the destination of `s_bitset0_b64` / `s_bitset1_b64` in the direct C++ compute path. Refs #3226, #2935 - `src/gfx1013_direct_compute.inl`: the bitset guard now allows `dst == 106` when the form is a 64-bit pair in compute mode (`operand32(i, 106/107)` already reads/writes `vcc_lo`/`vcc_hi`). `EXEC` (`126`), `M0` (`124`), odd SGPRs, a non-pair `VCC` destination in `b32`, and `VCC` in the graphics-input path are still refused with the existing `"bitset requires a general scalar destination or aligned pair"` message. `preserves_sop1` already lists both 64-bit bitset forms, so SCC tracking is unchanged (bitset leaves SCC alone). - No existing control refused `VCC` on the 64-bit forms: `tests/compute_salu_bitset_check.py` refuses `VCC` only for `s_bitset1_b32` (unchanged), and its 64-bit refusals belong to the separate Python AOT translator. No docs change was applicable. - New `tests/native_salu_bitset64_vcc_check.py` + `tests/cmake/native_salu_bitset64_vcc.cmake` (`_controls` / `_hardware`, `SKIP_RETURN_CODE 77`, `TIMEOUT 60`): 16 cases (12 wave64, 4 wave32) running `s_bitset0_b64` then `s_bitset1_b64` on `VCC` from the same initial pair, covering low-word bits 0..31, high-word bits 32..63, wrapped indices 64/65/96/127, SGPR, inline and literal bit indices, the preserved other half, and preserved `SCC` (both 0 and 1). 8 negative controls (EXEC, M0, odd SGPR, `b32` with VCC, for both ops) and 5 reference mutants. Linux checks (this host, no DXC/Windows): - `tests/form_coverage_check.py`: passed - `tests/docs_links_check.py`: passed (160 files, 682 links) - `tests/bidi_controls_check.py`: passed (2582 files) - `py_compile` on the new test: passed - Offline harness (oracle vs independent 64-bit model, instruction-word decoding, refusal pinning, guard text): 144 checks passed - 5/5 spot-mutations on `/tmp` copies failed as expected; `/tmp` cleaned - `tests/compute_salu_bitset_check.py controls`: passed Windows verification (compile_dxil, native CTest) still pending. ### Windows Verification (9efc1be6) ```text Commit: 9efc1be668ec8e61a021310781673f7b37f9371c (Windows 11 build 26100.7623) Adapter: NVIDIA GeForce RTX 4050 Laptop GPU (10de:28e1), driver 32.0.15.9186 (D3D12 debug layer not enabled by native_store_replay) dev: cmake --build --preset dev --target compile_dxil native_store_replay $env:XBOX2WINDOWS_ADAPTER='NVIDIA'; ctest --preset dev --no-tests=error -R '^(native_salu_bitset64_vcc_|compute_salu_bitset)' --output-on-failure -> 2/2 passed, 0 failed, 0 skipped (5.26s; _hardware suite passed on RTX 4050) Repo checks: form_coverage_check, docs_links_check, bidi_controls_check -> 3/3 passed AI-assisted. ``` <!-- WIN-VERIFY: passed | sha=9efc1be668ec8e61a021310781673f7b37f9371c -->
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 23:44:50 +00:00
Author
Owner

@⁠Leyukaka on GitHub · 2026-11-29 04:15 UTC · original · approved these changes

Approve 9efc1be6. Reviewed by reading the diff and the cited sources; nothing built or run here. Line numbers are on main (212d4b5f) unless marked.

  • src/gfx1013_direct_compute.inl: the guard (:3815 on main, :3818 at this head; refusal :3816 -> :3819) now also accepts a b64 destination of 106 in compute, and nothing else. 107 (odd), m0, EXEC, a b32 VCC destination and graphics input stay refused. The body is unchanged: the index and both words (operand32(i, dst), operand32(i, dst + 1)) are read before either write, and the index is masked to S0[5:0] (shift masks 5 bits, :1376-1378; a & 32 selects the word). This matches D.u64[S0.u[5:0]] = 0/1, SCC unchanged (tests/startup_gfx2hlsl_s_bitset64_check.py:10-11), with a 32-bit S0 (tools/disasm_rdna2.py:2402). In compute, 106/107 are ordinary numeric words for operand32 (:180-183). The analysis resets both words for SOP1 _b64 (src/gfx1013_compute_native.cpp:807-819), and preserves_sop1 lists both forms (:2759-2767).
  • No test on main asserts this refusal. tests/compute_salu_bitset_check.py:132,138-139 go through the Python AOT path.
  • Tests, by reading only: restoring the old guard fails the 4 positive compiles in _controls. Dropping pair && fails the two b32 VCC controls; widening == 106 to >= 106 fails the EXEC and m0 controls. Dropping !graphics_input has no control, but operand32 already refuses 106 in graphics (:176-177). The _controls DXIL checks only look for or/and/xor i32 and for the absence of four i64 patterns, and the 5 "reference mutants" mutate the Python reference, not the C++. A wrong value would be caught only by _hardware. Not covered: VCC as both destination and index.
  • CI: neither new test runs on this PR, because the pr preset filter (CMakePresets.json:51) has no native_salu_*. The non-PR job runs dev with -E '_hardware$' (.github/workflows/windows.yml:498), so the _hardware evidence is the author's run in the PR body.
  • git merge-tree of this head onto main is clean. #3406 (@@ -3639), #3408 (@@ -3680), #3409 (@@ -3700) and #3414 (@@ -3563) change other hunks of the same file than this one (@@ -3812) and share no test or doc file with it; the combined merge was not checked.
  • Nit: unlike #3406, #3408, #3409 and #3414, this PR adds no docs/experiments/ entry for the new test (CONTRIBUTING.md:30,88).
**@⁠Leyukaka** on GitHub · 2026-11-29 04:15 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3414#pullrequestreview-6101366809) · **approved these changes** Approve `9efc1be6`. Reviewed by reading the diff and the cited sources; nothing built or run here. Line numbers are on `main` (`212d4b5f`) unless marked. - `src/gfx1013_direct_compute.inl`: the guard (`:3815` on `main`, `:3818` at this head; refusal `:3816` -> `:3819`) now also accepts a `b64` destination of 106 in compute, and nothing else. 107 (odd), `m0`, EXEC, a `b32` VCC destination and graphics input stay refused. The body is unchanged: the index and both words (`operand32(i, dst)`, `operand32(i, dst + 1)`) are read before either write, and the index is masked to `S0[5:0]` (`shift` masks 5 bits, `:1376-1378`; `a & 32` selects the word). This matches `D.u64[S0.u[5:0]] = 0/1`, SCC unchanged (`tests/startup_gfx2hlsl_s_bitset64_check.py:10-11`), with a 32-bit `S0` (`tools/disasm_rdna2.py:2402`). In compute, 106/107 are ordinary numeric words for `operand32` (`:180-183`). The analysis resets both words for SOP1 `_b64` (`src/gfx1013_compute_native.cpp:807-819`), and `preserves_sop1` lists both forms (`:2759-2767`). - No test on `main` asserts this refusal. `tests/compute_salu_bitset_check.py:132,138-139` go through the Python AOT path. - Tests, by reading only: restoring the old guard fails the 4 positive compiles in `_controls`. Dropping `pair &&` fails the two `b32` VCC controls; widening `== 106` to `>= 106` fails the EXEC and `m0` controls. Dropping `!graphics_input` has no control, but `operand32` already refuses 106 in graphics (`:176-177`). The `_controls` DXIL checks only look for `or/and/xor i32` and for the absence of four i64 patterns, and the 5 "reference mutants" mutate the Python reference, not the C++. A wrong value would be caught only by `_hardware`. Not covered: VCC as both destination and index. - CI: neither new test runs on this PR, because the `pr` preset filter (`CMakePresets.json:51`) has no `native_salu_*`. The non-PR job runs `dev` with `-E '_hardware$'` (`.github/workflows/windows.yml:498`), so the `_hardware` evidence is the author's run in the PR body. - `git merge-tree` of this head onto `main` is clean. #3406 (`@@ -3639`), #3408 (`@@ -3680`), #3409 (`@@ -3700`) and #3414 (`@@ -3563`) change other hunks of the same file than this one (`@@ -3812`) and share no test or doc file with it; the combined merge was not checked. - Nit: unlike #3406, #3408, #3409 and #3414, this PR adds no `docs/experiments/` entry for the new test (`CONTRIBUTING.md:30,88`).
github manually merged commit 57d615311f into main 2026-11-29 08:45:43 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.