compute: use vcc_hi as a wave32 lane mask in direct compute #3336

Manually merged
github merged 2 commits from github-bot/gh-3334 into gh-pr/3334/base 2026-11-28 11:27:46 +00:00 AGit
Owner

@⁠Leyukaka on GitHub · 2026-11-28 10:29 UTC · original
Leyukaka:compute-wave32-carry-vcc-hi → main · +198 −4 · 4 files · 2 commits · merged 2026-11-28 11:11 UTC

Part of #3226.

In a guest wave32 direct compute program, s107 (vcc_hi) is an ordinary numeric scalar register. Some programs use it as a lane mask: v_cmp_*_e64 vcc_hi, v_add_co_ci_u32_e64 vD, vcc_hi, ..., s_and_b32 vcc_hi, ..., v_cndmask_b32_e64 ..., vcc_hi, and vcc_hi as a carry-in.

  • transfer() (src/gfx1013_compute_native.cpp) accepts 107 as a carry-out destination in the wave32 model of direct compute.
  • src/gfx1013_direct_compute.inl accepts 107 as the v_cndmask_b32 mask source and as the carry-in source. Graphics stages keep both refusals.
  • translate_program refuses all three uses when the guest is wave64. A wave64 request of at most 32 threads runs on the wave32 model, and there 107 would be an odd pair.

Tests (Windows 11, RTX 5080, SDK 10.0.26100 DXC, Release, main 3926a289 plus this commit):

  • native_carry_vcc_hi_controls checks the DXIL for this chain: a carry into s105, then v_add_co_ci_u32_e64 v16, vcc_hi, 0, v16, s105, v_cndmask_b32_e64 v20, 0, 1, vcc_hi, and v_add_co_ci_u32_e64 v20, s104, 0, v20, vcc_hi. It checks that vcc_hi gets the carry ballot, that vcc_lo keeps its seed, and that the final v20 and its carry depend on vcc_hi. Four requests stay refused: wave64 with 64 threads, wave64 with 32 threads, and sdst m0 or ttmp0.
  • On main the positive program is refused with unsupported carry mask destination.
  • native_carry_vcc_hi_hardware passes on 32 lanes: vcc_hi = 0xAAAAAAAA, vcc_lo unchanged, and the last add gives 2 on odd lanes. native_carry_vcc_hi_warp reports a capability skip (77).
  • ctest -R "native_|startup_compute|compile_dxil|salu": 530 of 531 before the last test-only change. native_scalar_lds_hardware fails as on main.
  • 882 captured compute requests, compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests: 250 to 252. The added programs weigh 12,846 dispatches in that run. None is lost, and the existing output is byte-identical.

Not covered: no source mutations were run. The wave64 refusals of the v_cndmask_b32 and carry-in sources and v_mad_u64_u32 with sdst vcc_hi have no test.

**@⁠Leyukaka** on GitHub · 2026-11-28 10:29 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3334) `Leyukaka:compute-wave32-carry-vcc-hi` → `main` · +198 −4 · 4 files · 2 commits · merged 2026-11-28 11:11 UTC Part of #3226. In a guest wave32 direct compute program, s107 (`vcc_hi`) is an ordinary numeric scalar register. Some programs use it as a lane mask: `v_cmp_*_e64 vcc_hi`, `v_add_co_ci_u32_e64 vD, vcc_hi, ...`, `s_and_b32 vcc_hi, ...`, `v_cndmask_b32_e64 ..., vcc_hi`, and `vcc_hi` as a carry-in. - `transfer()` (`src/gfx1013_compute_native.cpp`) accepts 107 as a carry-out destination in the wave32 model of direct compute. - `src/gfx1013_direct_compute.inl` accepts 107 as the `v_cndmask_b32` mask source and as the carry-in source. Graphics stages keep both refusals. - `translate_program` refuses all three uses when the guest is wave64. A wave64 request of at most 32 threads runs on the wave32 model, and there 107 would be an odd pair. Tests (Windows 11, RTX 5080, SDK 10.0.26100 DXC, Release, `main` `3926a289` plus this commit): - `native_carry_vcc_hi_controls` checks the DXIL for this chain: a carry into s105, then `v_add_co_ci_u32_e64 v16, vcc_hi, 0, v16, s105`, `v_cndmask_b32_e64 v20, 0, 1, vcc_hi`, and `v_add_co_ci_u32_e64 v20, s104, 0, v20, vcc_hi`. It checks that `vcc_hi` gets the carry ballot, that `vcc_lo` keeps its seed, and that the final `v20` and its carry depend on `vcc_hi`. Four requests stay refused: wave64 with 64 threads, wave64 with 32 threads, and sdst `m0` or `ttmp0`. - On `main` the positive program is refused with `unsupported carry mask destination`. - `native_carry_vcc_hi_hardware` passes on 32 lanes: `vcc_hi` = `0xAAAAAAAA`, `vcc_lo` unchanged, and the last add gives 2 on odd lanes. `native_carry_vcc_hi_warp` reports a capability skip (77). - `ctest -R "native_|startup_compute|compile_dxil|salu"`: 530 of 531 before the last test-only change. `native_scalar_lds_hardware` fails as on `main`. - 882 captured compute requests, `compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests`: 250 to 252. The added programs weigh 12,846 dispatches in that run. None is lost, and the existing output is byte-identical. Not covered: no source mutations were run. The wave64 refusals of the `v_cndmask_b32` and carry-in sources and `v_mad_u64_u32` with sdst `vcc_hi` have no test.
In a guest wave32 direct compute program s107 (vcc_hi) is an ordinary
numeric scalar register. It is now accepted as a carry-out destination,
as the v_cndmask_b32 mask source and as a carry-in source. A guest wave64
request that runs on the wave32 model, where 107 would be an odd pair,
and graphics stages keep the existing refusals.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 10:30:15 +00:00
github-bot changed target branch from main to gh-pr/3334/base 2026-11-28 11:27:43 +00:00
github manually merged commit c9036f5fe9 into gh-pr/3334/base 2026-11-28 11:27:46 +00:00
Author
Owner

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

Review of head c9036f5f (the PR's own change is unchanged; the new head only merges current main).

What I checked:

  • src/gfx1013_compute_native.cpp: s107 is accepted as a carry-out destination only for direct compute, non-graphics, non-wave64. translate_program refuses all three uses (carry-out, v_cndmask_b32 mask source, _ci_ carry-in) when the guest is wave64, including the narrow wave64 model, so the odd-pair case stays refused.
  • src/gfx1013_direct_compute.inl: the carry-in limit moves from 106 to 107 and v_cndmask_b32 keeps its refusal for graphics stages. Graphics refusals are unchanged.
  • Tests native_carry_vcc_hi_controls (DXIL chain plus four refusals) and native_carry_vcc_hi_warp (real D3D12 readback of the lane mask and the dependent adds against a CPU reference; it ran and did not skip).
  • No other open PR covers this slice; the dependency base is already in main.

Commands run:

  • Linux: git diff --check origin/main...HEAD clean, python3 -m py_compile tests/native_carry_vcc_hi_check.py ok.
  • Windows Server 2025, D3D12 WARP 1.0.22, -R '^native_(carry_vcc_hi_(controls|warp)|direct_container|salu64_controls)$': dev 4/4 passed, release 4/4 passed.
  • Mutation 1 (the wave64 carry-destination refusal removed): native_carry_vcc_hi_controls fails at the narrow wave64 case.
  • Mutation 2 (s107 no longer accepted as carry-out): both native_carry_vcc_hi_controls and native_carry_vcc_hi_warp fail with unsupported carry mask destination.

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

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-28 11:11 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3334#pullrequestreview-6097404288) · **reviewed** Review of head `c9036f5f` (the PR's own change is unchanged; the new head only merges current `main`). What I checked: - `src/gfx1013_compute_native.cpp`: s107 is accepted as a carry-out destination only for direct compute, non-graphics, non-wave64. `translate_program` refuses all three uses (carry-out, `v_cndmask_b32` mask source, `_ci_` carry-in) when the guest is wave64, including the narrow wave64 model, so the odd-pair case stays refused. - `src/gfx1013_direct_compute.inl`: the carry-in limit moves from 106 to 107 and `v_cndmask_b32` keeps its refusal for graphics stages. Graphics refusals are unchanged. - Tests `native_carry_vcc_hi_controls` (DXIL chain plus four refusals) and `native_carry_vcc_hi_warp` (real D3D12 readback of the lane mask and the dependent adds against a CPU reference; it ran and did not skip). - No other open PR covers this slice; the dependency base is already in `main`. Commands run: - Linux: `git diff --check origin/main...HEAD` clean, `python3 -m py_compile tests/native_carry_vcc_hi_check.py` ok. - Windows Server 2025, D3D12 WARP 1.0.22, `-R '^native_(carry_vcc_hi_(controls|warp)|direct_container|salu64_controls)$'`: dev 4/4 passed, release 4/4 passed. - Mutation 1 (the wave64 carry-destination refusal removed): `native_carry_vcc_hi_controls` fails at the `narrow wave64` case. - Mutation 2 (s107 no longer accepted as carry-out): both `native_carry_vcc_hi_controls` and `native_carry_vcc_hi_warp` fail with `unsupported carry mask destination`. 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 11:11 UTC · original

Win2025 WARP receipt for head c9036f5f after updating with main.

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

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target compile_dxil offscreen_check native_store_replay -- -j 3): 18.16s (configure 6.00s)
    • Test (ctest --preset dev -R '^native_(carry_vcc_hi_(controls|warp)|direct_container|salu64_controls)$' --parallel 4 --no-tests=error --output-on-failure): 4/4 passed (12.80s: native_salu64_controls 0.20s, native_carry_vcc_hi_warp 0.84s, native_carry_vcc_hi_controls 0.92s, native_direct_container 12.32s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target compile_dxil offscreen_check native_store_replay -- -j 3): 43.72s (configure 2.30s)
    • Test (ctest --preset release -R '^native_(carry_vcc_hi_(controls|warp)|direct_container|salu64_controls)$' --parallel 4 --no-tests=error --output-on-failure): 4/4 passed (11.57s: native_salu64_controls 0.16s, native_carry_vcc_hi_warp 0.64s, native_carry_vcc_hi_controls 0.69s, native_direct_container 11.21s)
  • sccache: 257/271 hits; wall 64.1s

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-28 11:11 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3334#issuecomment-7238381082) Win2025 WARP receipt for head c9036f5f after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `c9036f5fe9c5649e1d800b0d45f4da8f4adfe2f5`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target compile_dxil offscreen_check native_store_replay -- -j 3`): `18.16s` (configure `6.00s`) - Test (`ctest --preset dev -R '^native_(carry_vcc_hi_(controls|warp)|direct_container|salu64_controls)$' --parallel 4 --no-tests=error --output-on-failure`): **4/4 passed** (`12.80s`: `native_salu64_controls` `0.20s`, `native_carry_vcc_hi_warp` `0.84s`, `native_carry_vcc_hi_controls` `0.92s`, `native_direct_container` `12.32s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target compile_dxil offscreen_check native_store_replay -- -j 3`): `43.72s` (configure `2.30s`) - Test (`ctest --preset release -R '^native_(carry_vcc_hi_(controls|warp)|direct_container|salu64_controls)$' --parallel 4 --no-tests=error --output-on-failure`): **4/4 passed** (`11.57s`: `native_salu64_controls` `0.16s`, `native_carry_vcc_hi_warp` `0.64s`, `native_carry_vcc_hi_controls` `0.69s`, `native_direct_container` `11.21s`) - `sccache`: 257/271 hits; wall `64.1s` AI-assisted; commands listed were executed locally.
This discussion has been locked. Commenting is limited to contributors.
No description provided.