compute: accept EXEC as a 64-bit scalar operand in direct compute #3245

Merged
Leyukaka merged 2 commits from upstream-pr/3245 into main 2026-11-28 03:03:09 +00:00
Leyukaka commented 2026-11-28 01:39:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-28T01:39:13Z.


Part of #2935, claimed in #3224 (item 1 of my third comment there). Target branch main.

Change (src/gfx1013_direct_compute.inl): direct compute accepts EXEC (126) as a 64-bit scalar operand.

  • It is accepted as the even source pair of s_bcnt0/s_bcnt1, s_ff0/s_ff1, s_flbit_i32_b64 and s_flbit_i32_i64, which were refused as "invalid s_bcnt1_i32_b64 source" and the like.
  • It is accepted as the s_bfm_b64 destination, which was refused as "invalid s_bfm_b64 destination".
  • With the wave64 model from #3006, each host half holds both EXEC words. Both are set at entry (wave64 requires complete guest waves), lane-mask writers publish both words through the exchange, and scalar writes are identical in both halves. So a replicated scalar read or write of the pair is correct in both halves.
  • VCC stays refused as such a source and as the s_bfm_b64 destination. Nothing guarantees both of its words in wave64, for example after a write to vcc_lo alone.
  • tests/native_salu_bitscan64_check.py: its EXEC-source refusal control now uses exec_hi (127), which stays refused, because EXEC (126) is accepted.

Tests. The setup was Windows 11 with an NVIDIA GeForce RTX 5080 and DXC from the Windows SDK 10.0.26100, Release, on main 7364e6a9 plus this commit.

  • New native_wave64_exec_salu_hardware covers wave64 requests with 64 and 128 threads, two groups each:
    • s_bcnt1_i32_b64 on a sparse EXEC that spans both halves, giving 15 in the first guest wave and 16 in the second;
    • s_bfm_b64 exec, 16, 0, after which only guest lanes 0-15 store;
    • s_bfm_b64 exec, 32, 32, after which only lanes 32-63 store;
    • a wave32 s_bcnt1_i32_b64 on EXEC with an explicit exec_hi.
  • Refusal controls: s_bcnt1_i32_b64 on VCC, s_bfm_b64 into VCC, and an odd source pair.
  • Against main's compile_dxil, the new test stops at "invalid s_bcnt1_i32_b64 source".
  • 17 tests pass with -R "native_wave64|native_salu|native_slot67|native_direct_container".
  • Mutation check by hand: refusing EXEC as a source again fails the new test.

Measured with compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests, main 7364e6a9 against this commit.

  • Local capture of 2,689 requests: 494 to 522 compile.
  • Requests of one start-up run: 507 to 535.
  • The 882 requests of #3224: 128 to 141. The 13 new programs account for 81,320 dispatches of that run.
  • The new programs used to stop at the s_bfm_b64 destination, s_bcnt1_i32_b64 source or s_ff1_i32_b64 source refusals above.
  • No program that compiled before stops compiling.
  • Counts and instruction shape only.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5535443469 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3245). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-28T01:39:13Z. --- Part of #2935, claimed in #3224 (item 1 of my third comment there). Target branch `main`. **Change** (`src/gfx1013_direct_compute.inl`): direct compute accepts EXEC (126) as a 64-bit scalar operand. - It is accepted as the even source pair of `s_bcnt0/s_bcnt1`, `s_ff0/s_ff1`, `s_flbit_i32_b64` and `s_flbit_i32_i64`, which were refused as "invalid s_bcnt1_i32_b64 source" and the like. - It is accepted as the `s_bfm_b64` destination, which was refused as "invalid s_bfm_b64 destination". - With the wave64 model from #3006, each host half holds both EXEC words. Both are set at entry (wave64 requires complete guest waves), lane-mask writers publish both words through the exchange, and scalar writes are identical in both halves. So a replicated scalar read or write of the pair is correct in both halves. - VCC stays refused as such a source and as the `s_bfm_b64` destination. Nothing guarantees both of its words in wave64, for example after a write to `vcc_lo` alone. - `tests/native_salu_bitscan64_check.py`: its EXEC-source refusal control now uses `exec_hi` (127), which stays refused, because EXEC (126) is accepted. **Tests.** The setup was Windows 11 with an NVIDIA GeForce RTX 5080 and DXC from the Windows SDK 10.0.26100, Release, on `main` `7364e6a9` plus this commit. - New `native_wave64_exec_salu_hardware` covers wave64 requests with 64 and 128 threads, two groups each: - `s_bcnt1_i32_b64` on a sparse EXEC that spans both halves, giving 15 in the first guest wave and 16 in the second; - `s_bfm_b64 exec, 16, 0`, after which only guest lanes 0-15 store; - `s_bfm_b64 exec, 32, 32`, after which only lanes 32-63 store; - a wave32 `s_bcnt1_i32_b64` on EXEC with an explicit `exec_hi`. - Refusal controls: `s_bcnt1_i32_b64` on VCC, `s_bfm_b64` into VCC, and an odd source pair. - Against `main`'s `compile_dxil`, the new test stops at "invalid s_bcnt1_i32_b64 source". - 17 tests pass with `-R "native_wave64|native_salu|native_slot67|native_direct_container"`. - Mutation check by hand: refusing EXEC as a source again fails the new test. **Measured** with `compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests`, `main` `7364e6a9` against this commit. - Local capture of 2,689 requests: 494 to 522 compile. - Requests of one start-up run: 507 to 535. - The 882 requests of #3224: 128 to 141. The 13 new programs account for 81,320 dispatches of that run. - The new programs used to stop at the `s_bfm_b64` destination, `s_bcnt1_i32_b64` source or `s_ff1_i32_b64` source refusals above. - No program that compiled before stops compiling. - Counts and instruction shape only. AI-assisted.
R0Y00 commented 2026-11-28 02:48:19 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-28T02:48:19Z.

Review: CHANGES_REQUESTED


Reviewed 01dc357b5b on main 4d7265c0 (trial 6d0c144a788d0ef1a9dc8ac099d3f5fecdcce2de). The EXEC low and high words are read as a pair for the bit operations, and the mask instruction writes both words. The 64- and 128-thread fixtures tested masks spanning both host halves, write suppression outside EXEC, and the wave32 high-word control. VCC and odd pairs still refuse in the affected operations. Both Debug and Release /O2 passed 7/7, no skips.

ctest --test-dir <build> --no-tests=error --output-on-failure -j 1 -R "^native_(direct_container|wave_request_hardware|wave64_exec_salu_hardware|salu_bitscan64_(controls|hardware)|salu64_(controls|hardware))$"

RTX 4060 Laptop, driver 32.0.16.1656, Windows 11 26200.9974, standalone replay without the debug layer. Required Windows CI passed.

Please update docs/experiments/native-direct-salu-bitscan64.md and docs/experiments/native-salu64-ops.md before merge. The former still lists EXEC as a source refusal (the control is now EXEC_HI), and the latter says EXEC destinations are refused without listing the new s_bfm_b64 case. Please include the new fixture command and keep the unrelated CSELECT/NOT limits for #3262.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6095258724 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3245#pullrequestreview-6095258724). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-28T02:48:19Z. **Review:** CHANGES_REQUESTED --- Reviewed 01dc357b5be9 on main 4d7265c0 (trial 6d0c144a788d0ef1a9dc8ac099d3f5fecdcce2de). The EXEC low and high words are read as a pair for the bit operations, and the mask instruction writes both words. The 64- and 128-thread fixtures tested masks spanning both host halves, write suppression outside EXEC, and the wave32 high-word control. VCC and odd pairs still refuse in the affected operations. Both Debug and Release /O2 passed 7/7, no skips. ``` ctest --test-dir <build> --no-tests=error --output-on-failure -j 1 -R "^native_(direct_container|wave_request_hardware|wave64_exec_salu_hardware|salu_bitscan64_(controls|hardware)|salu64_(controls|hardware))$" ``` RTX 4060 Laptop, driver 32.0.16.1656, Windows 11 26200.9974, standalone replay without the debug layer. Required Windows CI passed. Please update docs/experiments/native-direct-salu-bitscan64.md and docs/experiments/native-salu64-ops.md before merge. The former still lists EXEC as a source refusal (the control is now EXEC_HI), and the latter says EXEC destinations are refused without listing the new s_bfm_b64 case. Please include the new fixture command and keep the unrelated CSELECT/NOT limits for #3262.
Leyukaka commented 2026-11-28 02:54:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-28T02:54:56Z.


Thanks for testing it. Pushed 08b6cff5, docs only:

  • docs/experiments/native-direct-salu-bitscan64.md now lists EXEC (both words, in wave32 and wave64) as a valid S0. It says the fixture reads it back with s_bcnt1_i32_b64 only. It explains that the source refusal control uses exec_hi because of that, and gives the native_wave64_exec_salu_hardware command.
  • docs/experiments/native-salu64-ops.md now lists s_bfm_b64 into EXEC. The s_cselect_b64 / s_not_b64 EXEC destination refusal is kept, and that limit is left to #3262. The note also covers what the new fixture checks: exec, 16, 0 and exec, 32, 32 in wave64 64- and 128-thread groups, through a per-lane store. It gives the command as well.

No code change.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7232675392 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3245#issuecomment-7232675392). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-28T02:54:56Z. --- Thanks for testing it. Pushed `08b6cff5`, docs only: - `docs/experiments/native-direct-salu-bitscan64.md` now lists EXEC (both words, in wave32 and wave64) as a valid `S0`. It says the fixture reads it back with `s_bcnt1_i32_b64` only. It explains that the source refusal control uses `exec_hi` because of that, and gives the `native_wave64_exec_salu_hardware` command. - `docs/experiments/native-salu64-ops.md` now lists `s_bfm_b64` into EXEC. The `s_cselect_b64` / `s_not_b64` EXEC destination refusal is kept, and that limit is left to #3262. The note also covers what the new fixture checks: `exec, 16, 0` and `exec, 32, 32` in wave64 64- and 128-thread groups, through a per-lane store. It gives the command as well. No code change. AI-assisted.
R0Y00 commented 2026-11-28 03:03:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-28T03:03:02Z.

Review: APPROVED


Reviewed 08b6cff511. Its change from 01dc357b is limited to the two experiment notes. Both describe accepted EXEC pairs, the EXEC_HI negative and the coverage actually run. The CSELECT and NOT limits remain documented for #3262.

I reran the seven focused cases on main c827d8ba plus this head (tree 6fc3db43c84b2e1098808c23e27f98a07cf164ba). Debug and Release /O2 each passed 7/7, zero skips. The docs link check passed. Main a0b45d43 adds only the staging guard and its documentation/preset fixture, giving clean tree 2d76d3f3e7 with the same compiler and EXEC fixture files.

ctest --test-dir <build> --no-tests=error --output-on-failure -j 1 -R "^native_(direct_container|wave_request_hardware|wave64_exec_salu_hardware|salu_bitscan64_(controls|hardware)|salu64_(controls|hardware))$"
python -B tests/docs_links_check.py

RTX 4060 Laptop, driver 32.0.16.1656, Windows 11 26200.9974, standalone replay without the debug layer. Required Windows CI passed on 08b6cff5.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6095318903 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3245#pullrequestreview-6095318903). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-28T03:03:02Z. **Review:** APPROVED --- Reviewed 08b6cff511cc. Its change from 01dc357b is limited to the two experiment notes. Both describe accepted EXEC pairs, the EXEC_HI negative and the coverage actually run. The CSELECT and NOT limits remain documented for #3262. I reran the seven focused cases on main c827d8ba plus this head (tree 6fc3db43c84b2e1098808c23e27f98a07cf164ba). Debug and Release /O2 each passed 7/7, zero skips. The docs link check passed. Main a0b45d43 adds only the staging guard and its documentation/preset fixture, giving clean tree 2d76d3f3e7a4ac7a175fe15f5f712c5dd8784649 with the same compiler and EXEC fixture files. ``` ctest --test-dir <build> --no-tests=error --output-on-failure -j 1 -R "^native_(direct_container|wave_request_hardware|wave64_exec_salu_hardware|salu_bitscan64_(controls|hardware)|salu64_(controls|hardware))$" python -B tests/docs_links_check.py ``` RTX 4060 Laptop, driver 32.0.16.1656, Windows 11 26200.9974, standalone replay without the debug layer. Required Windows CI passed on 08b6cff5.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!3245
No description provided.