shader: lower s_nor_b32 and s_nand_b32 on lane mask in gfx2hlsl (Part of #1723) #2023

Closed
tedin7 wants to merge 8 commits from upstream-pr/2030 into main
tedin7 commented 2026-11-24 23:27:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T23:27:14Z.


Part of #1723

What this unblocks: Run 20 census #9 (64/61 pairs).

Source: AMD RDNA 2 instruction set architecture guide, the SOP2 instructions s_nor_b32 and s_nand_b32 (bitwise on the 32-bit scalar operands) and the EXEC / wave32 description (a write to exec_lo in wave64 leaves the high half unchanged).

gfx2hlsl refused s_nor_b32 and s_nand_b32 whenever an operand or the destination was a lane mask. They now lower on a mask when every source is a lane mask: bit i of ~(a op b) depends only on bit i of each source, so the lane's own bit is exact. The destination may be an SGPR (any stage) or exec_lo (only for compute with at most 32 threads per group, the one wave32 proof available; pixel, vertex, mesh and larger compute groups keep refusing it, because a write to exec_lo leaves lanes 32..63 of a wave64 wave unchanged). s_xnor_b32, a vcc_lo or high-half destination, mixed mask and word sources, and s_pack_hh_b32_b16 on a lane mask stay refused.

SCC is not emitted for these forms: translate() refuses a program that can read it.

Changes:

  • tools/startup/gfx2hlsl.py: lane-complement lowering of s_nor_b32 / s_nand_b32 on masks, with the wave32 gate for the exec_lo destination.
  • tests/startup_gfx2hlsl_s_nor_nand_check.py (new, registered in CMakeLists.txt, with _dispatch_warp / _dispatch_hardware D3D12 UAV readback variants): per-bit CPU reference, GPU readback, and stage_checks() for the stage gate.
  • tests/startup_gfx2hlsl_sop2_complement_check.py: refusal checks narrowed to the forms that stay refused; the shared probe is a 32-thread compute stage.
  • docs/experiments.md: the accepted forms and the stage rule.

Verification (head ef54c20a638f7d0ff72dc3747c6a82158273207a):

  • Linux: python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.py, ..._sop2_complement_check.py, ..._waitcnt_depctr_check.py ok. Without the stage gate, s_nor_nand_check fails on the wave64 cases.
  • Win2025 receipt (named tests): see the comment thread (dev 4/4, release 4/4).
  • tested on RTX 3090 through vkd3d-proton (Linux): 4/4 (startup_gfx2hlsl_sop2_complement, startup_gfx2hlsl_s_nor_nand, startup_gfx2hlsl_s_nor_nand_dispatch_warp, startup_gfx2hlsl_s_nor_nand_dispatch_hardware). The warp-named test ran on the GPU there, not on WARP.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6593496662 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T23:27:14Z. --- Part of #1723 What this unblocks: Run 20 census #9 (64/61 pairs). Source: [AMD RDNA 2 instruction set architecture guide](https://www.amd.com/content/dam/amd/en/documents/radeon-tech-docs/instruction-set-architectures/rdna2-shader-instruction-set-architecture.pdf), the SOP2 instructions `s_nor_b32` and `s_nand_b32` (bitwise on the 32-bit scalar operands) and the EXEC / wave32 description (a write to `exec_lo` in wave64 leaves the high half unchanged). `gfx2hlsl` refused `s_nor_b32` and `s_nand_b32` whenever an operand or the destination was a lane mask. They now lower on a mask when every source is a lane mask: bit i of `~(a op b)` depends only on bit i of each source, so the lane's own bit is exact. The destination may be an SGPR (any stage) or `exec_lo` (only for compute with at most 32 threads per group, the one wave32 proof available; pixel, vertex, mesh and larger compute groups keep refusing it, because a write to `exec_lo` leaves lanes 32..63 of a wave64 wave unchanged). `s_xnor_b32`, a `vcc_lo` or high-half destination, mixed mask and word sources, and `s_pack_hh_b32_b16` on a lane mask stay refused. SCC is not emitted for these forms: translate() refuses a program that can read it. Changes: - `tools/startup/gfx2hlsl.py`: lane-complement lowering of `s_nor_b32` / `s_nand_b32` on masks, with the wave32 gate for the `exec_lo` destination. - `tests/startup_gfx2hlsl_s_nor_nand_check.py` (new, registered in `CMakeLists.txt`, with `_dispatch_warp` / `_dispatch_hardware` D3D12 UAV readback variants): per-bit CPU reference, GPU readback, and `stage_checks()` for the stage gate. - `tests/startup_gfx2hlsl_sop2_complement_check.py`: refusal checks narrowed to the forms that stay refused; the shared probe is a 32-thread compute stage. - `docs/experiments.md`: the accepted forms and the stage rule. Verification (head `ef54c20a638f7d0ff72dc3747c6a82158273207a`): - Linux: `python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.py`, `..._sop2_complement_check.py`, `..._waitcnt_depctr_check.py` ok. Without the stage gate, `s_nor_nand_check` fails on the wave64 cases. - Win2025 receipt (named tests): see the comment thread (dev 4/4, release 4/4). - tested on RTX 3090 through vkd3d-proton (Linux): 4/4 (`startup_gfx2hlsl_sop2_complement`, `startup_gfx2hlsl_s_nor_nand`, `startup_gfx2hlsl_s_nor_nand_dispatch_warp`, `startup_gfx2hlsl_s_nor_nand_dispatch_hardware`). The `warp`-named test ran on the GPU there, not on WARP. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-25 00:05:01 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:33:45Z.

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 117d2fd03b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6049116962 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#pullrequestreview-6049116962). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T23:33:45Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `117d2fd03b` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
tedin7 commented 2026-11-25 01:01:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T00:50:40Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6049854424 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#pullrequestreview-6049854424). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T00:50:40Z. **Review:** COMMENTED --- _No description provided._
tedin7 commented 2026-11-25 01:01:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T00:50:41Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6049854750 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#pullrequestreview-6049854750). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T00:50:41Z. **Review:** COMMENTED --- _No description provided._
tedin7 commented 2026-11-25 01:01:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T00:50:43Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6049855162 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#pullrequestreview-6049855162). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T00:50:43Z. **Review:** COMMENTED --- _No description provided._
chatgpt-codex-connector[bot commented 2026-11-25 01:01:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:27:27Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T23:33:48.586887Z 117d2fd PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7147421377 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#issuecomment-7147421377). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T23:27:27Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"117d2fd03be3cf52e4ffe6dd897cddc66474f96f","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-24T23:33:48.586887Z">2026-11-24T23:33:48.586887Z</relative-time> | `117d2fd` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
chatgpt-codex-connector[bot commented 2026-11-25 01:02:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:33:45Z.

Code review location: tools/startup/gfx2hlsl.py; line 680

@@ -675,8 +675,9 @@ def low(tok):
         dname = low(ops[0])
         word_complement = base in ('s_nand_b32', 's_nor_b32', 's_xnor_b32')
         word_pack = base == 's_pack_hh_b32_b16'
-        if word_complement or word_pack:
-            # The per-lane mask cannot supply the full word needed by these operations.
+        if base == 's_xnor_b32' or word_pack:
+            # The per-lane mask cannot supply the full word needed by these operations. s_nand_b32 and
+            # s_nor_b32 on a lane mask act on each lane's own bit, like s_and_b32 and s_or_b32.

P1 Badge Reject unprojected scalar words in the new mask forms

For a newly accepted mask form containing a scalar word whose bits are not all identical, the shared lowering uses bit 0 for every HLSL invocation. For example, s_nor_b32 vcc_lo, 1, 0 now emits a zero vcc, whereas the ISA result is 0xfffffffe; consequently, the supported v_cndmask_b32 selects the wrong arm in lanes 1–31. s_nand_b32 vcc_lo, 1, -1 has the same issue. Keep these raw-word forms refused until their operands are projected to the actual lane, and cover a nonzero lane rather than testing only supplied 0/1 bits.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4688020387 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#discussion_r4688020387). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T23:33:45Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 680 ~~~~diff @@ -675,8 +675,9 @@ def low(tok): dname = low(ops[0]) word_complement = base in ('s_nand_b32', 's_nor_b32', 's_xnor_b32') word_pack = base == 's_pack_hh_b32_b16' - if word_complement or word_pack: - # The per-lane mask cannot supply the full word needed by these operations. + if base == 's_xnor_b32' or word_pack: + # The per-lane mask cannot supply the full word needed by these operations. s_nand_b32 and + # s_nor_b32 on a lane mask act on each lane's own bit, like s_and_b32 and s_or_b32. ~~~~ --- **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Reject unprojected scalar words in the new mask forms** For a newly accepted mask form containing a scalar word whose bits are not all identical, the shared lowering uses bit 0 for every HLSL invocation. For example, `s_nor_b32 vcc_lo, 1, 0` now emits a zero `vcc`, whereas the ISA result is `0xfffffffe`; consequently, the supported `v_cndmask_b32` selects the wrong arm in lanes 1–31. `s_nand_b32 vcc_lo, 1, -1` has the same issue. Keep these raw-word forms refused until their operands are projected to the actual lane, and cover a nonzero lane rather than testing only supplied 0/1 bits. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
chatgpt-codex-connector[bot commented 2026-11-25 01:02:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:33:45Z.

Code review location: tools/startup/gfx2hlsl.py; line 678

@@ -675,8 +675,9 @@ def low(tok):
         dname = low(ops[0])
         word_complement = base in ('s_nand_b32', 's_nor_b32', 's_xnor_b32')
         word_pack = base == 's_pack_hh_b32_b16'
-        if word_complement or word_pack:
-            # The per-lane mask cannot supply the full word needed by these operations.
+        if base == 's_xnor_b32' or word_pack:

P2 Badge Keep high-half mask destinations on the refusal path

For a pixel shader containing s_nor_b32 vcc_hi, 0, 0 or an exec_hi destination, removing this guard reaches reg_range(dname)[1] in scalar() with None, raising an uncaught TypeError; both NAND variants behave identically. The previous revision raises Unsupported, which translate_to() catches to produce a .fail record. The new exception instead terminates the pending-cache loop and prevents later requests from being translated. Keep rejecting the unmodelled high halves separately when enabling the low-half forms.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4688020403 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#discussion_r4688020403). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T23:33:45Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 678 ~~~~diff @@ -675,8 +675,9 @@ def low(tok): dname = low(ops[0]) word_complement = base in ('s_nand_b32', 's_nor_b32', 's_xnor_b32') word_pack = base == 's_pack_hh_b32_b16' - if word_complement or word_pack: - # The per-lane mask cannot supply the full word needed by these operations. + if base == 's_xnor_b32' or word_pack: ~~~~ --- **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Keep high-half mask destinations on the refusal path** For a pixel shader containing `s_nor_b32 vcc_hi, 0, 0` or an `exec_hi` destination, removing this guard reaches `reg_range(dname)[1]` in `scalar()` with `None`, raising an uncaught `TypeError`; both NAND variants behave identically. The previous revision raises `Unsupported`, which `translate_to()` catches to produce a `.fail` record. The new exception instead terminates the pending-cache loop and prevents later requests from being translated. Keep rejecting the unmodelled high halves separately when enabling the low-half forms. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
chatgpt-codex-connector[bot commented 2026-11-25 01:02:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:33:45Z.

Code review location: CMakeLists.txt; line 2188

@@ -2183,6 +2183,9 @@ if(EXISTS "${INTAKE_PYTHON}")
     # 32-bit scalar complement logic: s_nand_b32, s_nor_b32 and s_xnor_b32 against an integer reference (#1919).
     add_test(NAME startup_gfx2hlsl_sop2_complement COMMAND "${INTAKE_PYTHON}" -B
         "${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_sop2_complement_check.py")
+    # s_nand_b32 and s_nor_b32 on a lane mask (exec, vcc, compare-result SGPRs), per-lane bit against a reference (#1723).
+    add_test(NAME startup_gfx2hlsl_s_nor_nand COMMAND "${INTAKE_PYTHON}" -B
+        "${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_s_nor_nand_check.py")

P1 Badge Document the expanded lane-mask capability and its limits

The newly accepted mask operations change a public translator capability, but this commit updates neither README.md nor docs/experiments.md. Root AGENTS.md requires one of those documentation updates for public capability changes. Record the supported operand scope, the per-lane SCC limitation, the reproduction command, and the CPU-only validation scope so contributors can reproduce the result and distinguish accepted lowering from verified GPU behavior.

AGENTS.md reference: AGENTS.md:L209-L210

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4688020412 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#discussion_r4688020412). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T23:33:45Z. **Code review location:** `CMakeLists.txt`; line 2188 ~~~~diff @@ -2183,6 +2183,9 @@ if(EXISTS "${INTAKE_PYTHON}") # 32-bit scalar complement logic: s_nand_b32, s_nor_b32 and s_xnor_b32 against an integer reference (#1919). add_test(NAME startup_gfx2hlsl_sop2_complement COMMAND "${INTAKE_PYTHON}" -B "${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_sop2_complement_check.py") + # s_nand_b32 and s_nor_b32 on a lane mask (exec, vcc, compare-result SGPRs), per-lane bit against a reference (#1723). + add_test(NAME startup_gfx2hlsl_s_nor_nand COMMAND "${INTAKE_PYTHON}" -B + "${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_s_nor_nand_check.py") ~~~~ --- **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Document the expanded lane-mask capability and its limits** The newly accepted mask operations change a public translator capability, but this commit updates neither `README.md` nor `docs/experiments.md`. Root `AGENTS.md` requires one of those documentation updates for public capability changes. Record the supported operand scope, the per-lane SCC limitation, the reproduction command, and the CPU-only validation scope so contributors can reproduce the result and distinguish accepted lowering from verified GPU behavior. AGENTS.md reference: [AGENTS.md:L209-L210](https://github.com/R0Y00/Xbox2Windows/blob/117d2fd03be3cf52e4ffe6dd897cddc66474f96f/AGENTS.md#L209-L210) Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
tedin7 commented 2026-11-25 01:02:17 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T00:50:39Z.

Code review location: tools/startup/gfx2hlsl.py; line 680

@@ -675,8 +675,9 @@ def low(tok):
         dname = low(ops[0])
         word_complement = base in ('s_nand_b32', 's_nor_b32', 's_xnor_b32')
         word_pack = base == 's_pack_hh_b32_b16'
-        if word_complement or word_pack:
-            # The per-lane mask cannot supply the full word needed by these operations.
+        if base == 's_xnor_b32' or word_pack:
+            # The per-lane mask cannot supply the full word needed by these operations. s_nand_b32 and
+            # s_nor_b32 on a lane mask act on each lane's own bit, like s_and_b32 and s_or_b32.

Fixed in e73b1f01: nand/nor now refuse any form that mixes a lane mask with a raw scalar word (inline constant or plain SGPR); the test covers vcc_lo,1,0 and vcc_lo,1,-1. Ran: python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.py (PASS). AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4688679247 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#discussion_r4688679247). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T00:50:39Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 680 ~~~~diff @@ -675,8 +675,9 @@ def low(tok): dname = low(ops[0]) word_complement = base in ('s_nand_b32', 's_nor_b32', 's_xnor_b32') word_pack = base == 's_pack_hh_b32_b16' - if word_complement or word_pack: - # The per-lane mask cannot supply the full word needed by these operations. + if base == 's_xnor_b32' or word_pack: + # The per-lane mask cannot supply the full word needed by these operations. s_nand_b32 and + # s_nor_b32 on a lane mask act on each lane's own bit, like s_and_b32 and s_or_b32. ~~~~ --- Fixed in e73b1f01: nand/nor now refuse any form that mixes a lane mask with a raw scalar word (inline constant or plain SGPR); the test covers vcc_lo,1,0 and vcc_lo,1,-1. Ran: python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.py (PASS). AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 01:02:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T00:50:41Z.

Code review location: tools/startup/gfx2hlsl.py; line 678

@@ -675,8 +675,9 @@ def low(tok):
         dname = low(ops[0])
         word_complement = base in ('s_nand_b32', 's_nor_b32', 's_xnor_b32')
         word_pack = base == 's_pack_hh_b32_b16'
-        if word_complement or word_pack:
-            # The per-lane mask cannot supply the full word needed by these operations.
+        if base == 's_xnor_b32' or word_pack:

Fixed in e73b1f01: exec_hi/vcc_hi operands and destinations raise Unsupported again (no TypeError); covered by the refused forms in the test. Ran: python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.py and startup_gfx2hlsl_sop2_complement_check.py (PASS). AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4688679544 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#discussion_r4688679544). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T00:50:41Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 678 ~~~~diff @@ -675,8 +675,9 @@ def low(tok): dname = low(ops[0]) word_complement = base in ('s_nand_b32', 's_nor_b32', 's_xnor_b32') word_pack = base == 's_pack_hh_b32_b16' - if word_complement or word_pack: - # The per-lane mask cannot supply the full word needed by these operations. + if base == 's_xnor_b32' or word_pack: ~~~~ --- Fixed in e73b1f01: exec_hi/vcc_hi operands and destinations raise Unsupported again (no TypeError); covered by the refused forms in the test. Ran: python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.py and startup_gfx2hlsl_sop2_complement_check.py (PASS). AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 01:02:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T00:50:43Z.

Code review location: CMakeLists.txt; line 2188

@@ -2183,6 +2183,9 @@ if(EXISTS "${INTAKE_PYTHON}")
     # 32-bit scalar complement logic: s_nand_b32, s_nor_b32 and s_xnor_b32 against an integer reference (#1919).
     add_test(NAME startup_gfx2hlsl_sop2_complement COMMAND "${INTAKE_PYTHON}" -B
         "${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_sop2_complement_check.py")
+    # s_nand_b32 and s_nor_b32 on a lane mask (exec, vcc, compare-result SGPRs), per-lane bit against a reference (#1723).
+    add_test(NAME startup_gfx2hlsl_s_nor_nand COMMAND "${INTAKE_PYTHON}" -B
+        "${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_s_nor_nand_check.py")

Fixed in e73b1f01: docs/experiments.md now records the operand scope, the per-lane SCC limit, the refused forms, the repro command and CPU-only scope. AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4688679864 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#discussion_r4688679864). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T00:50:43Z. **Code review location:** `CMakeLists.txt`; line 2188 ~~~~diff @@ -2183,6 +2183,9 @@ if(EXISTS "${INTAKE_PYTHON}") # 32-bit scalar complement logic: s_nand_b32, s_nor_b32 and s_xnor_b32 against an integer reference (#1919). add_test(NAME startup_gfx2hlsl_sop2_complement COMMAND "${INTAKE_PYTHON}" -B "${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_sop2_complement_check.py") + # s_nand_b32 and s_nor_b32 on a lane mask (exec, vcc, compare-result SGPRs), per-lane bit against a reference (#1723). + add_test(NAME startup_gfx2hlsl_s_nor_nand COMMAND "${INTAKE_PYTHON}" -B + "${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_s_nor_nand_check.py") ~~~~ --- Fixed in e73b1f01: docs/experiments.md now records the operand scope, the per-lane SCC limit, the refused forms, the repro command and CPU-only scope. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-25 14:04:28 +00:00
tedin7 commented 2026-11-25 14:05:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T13:51:47Z.


Closing this PR for now to keep the Windows test queue short. Nothing is wrong with it and the branch stays as it is.

We will reopen it once the queue is clear, re-run the Win2025 WARP checks at its head, and post the result here.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7164398918 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#issuecomment-7164398918). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T13:51:47Z. --- Closing this PR for now to keep the Windows test queue short. Nothing is wrong with it and the branch stays as it is. We will reopen it once the queue is clear, re-run the Win2025 WARP checks at its head, and post the result here. AI-assisted; commands listed were executed locally.
upstream-sync reopened this pull request 2026-11-25 23:01:40 +00:00
Leyukaka commented 2026-11-25 23:02:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-25T22:45:26Z.


The exec_lo destination of this PR is the first refusal for 23 requests in a local start-up capture (s_nor_b32 exec_lo, <mask>, <mask>, counts only), at main fc97ade. #2459 took the SGPR-destination forms and left a vcc_lo or exec_lo destination refused.

You wrote that you will reopen this once the Windows queue is clear. Since #2459 merged in between, the branch now overlaps it. If you would rather not rebase, I can port the exec_lo part onto current main, with you credited as co-author and the remaining SCC case guarded the way #2459 does. I will leave it until tomorrow, or hand it back as soon as you pick it up.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7176751315 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#issuecomment-7176751315). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-25T22:45:26Z. --- The `exec_lo` destination of this PR is the first refusal for 23 requests in a local start-up capture (`s_nor_b32 exec_lo, <mask>, <mask>`, counts only), at main `fc97ade`. #2459 took the SGPR-destination forms and left a `vcc_lo` or `exec_lo` destination refused. You wrote that you will reopen this once the Windows queue is clear. Since #2459 merged in between, the branch now overlaps it. If you would rather not rebase, I can port the `exec_lo` part onto current main, with you credited as co-author and the remaining SCC case guarded the way #2459 does. I will leave it until tomorrow, or hand it back as soon as you pick it up. AI-assisted.
Leyukaka commented 2026-11-25 23:02:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-25T22:49:07Z.


Changing my timeline above: I am taking the exec_lo part over now, since there has been no activity on this PR since 13:51. I will port it onto current main with you as co-author, and hand it back if you resume.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7176822594 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#issuecomment-7176822594). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-25T22:49:07Z. --- Changing my timeline above: I am taking the `exec_lo` part over now, since there has been no activity on this PR since 13:51. I will port it onto current main with you as co-author, and hand it back if you resume. AI-assisted.
Leyukaka commented 2026-11-26 00:01:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-25T23:46:36Z.


I see you reopened this at 23:00 UTC, so I am handing the exec_lo part back as promised and will not open a competing PR. If it saves you a rebase over #2459: my port of that part onto fc97ade is commit 482bade0 on branch snor-exec-lo in my fork. It accepts only NAND and NOR into exec_lo with all-mask sources, leaves SCC unmodelled like the SGPR forms, and keeps XNOR, vcc_lo, exec_hi and pairs refused. Your exec_lo cases and the source-bit table are in its test. Use any of it or none.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7178034377 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#issuecomment-7178034377). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-25T23:46:36Z. --- I see you reopened this at 23:00 UTC, so I am handing the `exec_lo` part back as promised and will not open a competing PR. If it saves you a rebase over #2459: my port of that part onto `fc97ade` is commit `482bade0` on branch `snor-exec-lo` in my fork. It accepts only NAND and NOR into `exec_lo` with all-mask sources, leaves SCC unmodelled like the SGPR forms, and keeps XNOR, `vcc_lo`, `exec_hi` and pairs refused. Your `exec_lo` cases and the source-bit table are in its test. Use any of it or none. AI-assisted.
tedin7 commented 2026-11-26 01:02:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:36:46Z.


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

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target offscreen_check d3d12_xs_device_obj -- -j 2): 86.67s (configure 0.00s)
    • Test (ctest --preset dev -R '^startup_gfx2hlsl_(s_nor_nand|sop2_complement)' --parallel 4 --no-tests=error --output-on-failure): 4/4 passed (11.26s: startup_gfx2hlsl_s_nor_nand 0.28s, startup_gfx2hlsl_s_nor_nand_dispatch_hardware 0.68s, startup_gfx2hlsl_s_nor_nand_dispatch_warp 0.72s, startup_gfx2hlsl_sop2_complement 11.06s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target offscreen_check d3d12_xs_device_obj -- -j 2): 69.16s (configure 0.00s)
    • Test (ctest --preset release -R '^startup_gfx2hlsl_(s_nor_nand|sop2_complement)' --parallel 4 --no-tests=error --output-on-failure): 4/4 passed (5.74s: startup_gfx2hlsl_s_nor_nand 0.20s, startup_gfx2hlsl_s_nor_nand_dispatch_warp 0.54s, startup_gfx2hlsl_s_nor_nand_dispatch_hardware 0.53s, startup_gfx2hlsl_sop2_complement 5.62s)
  • Windows Python checks: tests/mesh_heap_sampler_check.py ok (0.9s), tests/startup_buffer_address_check.py ok (0.6s), tests/startup_buffer_format_word3_table_check.py ok (0.1s), tests/startup_compute_request_offline_check.py ok (0.7s), tests/startup_compute_store_format_xyzw_check.py ok (0.3s), tests/startup_compute_translate_check.py ok (0.3s), tests/startup_flat_param_check.py ok (0.2s), tests/startup_gfx2hlsl_add_sub_co_check.py ok (0.2s), tests/startup_gfx2hlsl_add_sub_co_ci_check.py ok (0.2s), tests/startup_gfx2hlsl_bit_alu_check.py ok (1.0s), tests/startup_gfx2hlsl_capture_check.py ok (1.4s), tests/startup_gfx2hlsl_cmp16_check.py ok (0.4s), tests/startup_gfx2hlsl_compare_dst_check.py ok (0.1s), tests/startup_gfx2hlsl_compute_check.py ok (0.6s), tests/startup_gfx2hlsl_cselect_mask_check.py ok (0.1s), tests/startup_gfx2hlsl_cvt_alu_check.py ok (0.3s), tests/startup_gfx2hlsl_cvt_off_f32_i4_check.py ok (0.3s), tests/startup_gfx2hlsl_cvt_pk_int16_check.py ok (0.4s), tests/startup_gfx2hlsl_f32_lg_check.py ok (1.9s), tests/startup_gfx2hlsl_f32_nan_check.py ok (8.2s), tests/startup_gfx2hlsl_fma_mix_check.py ok (0.1s), tests/startup_gfx2hlsl_getpc_refusal_check.py ok (0.1s), tests/startup_gfx2hlsl_handler_arity_check.py ok (0.1s), tests/startup_gfx2hlsl_image_arity_check.py ok (0.1s), tests/startup_gfx2hlsl_image_get_lod_check.py ok (0.2s), tests/startup_gfx2hlsl_int_med3_check.py ok (0.2s), tests/startup_gfx2hlsl_interp_p2_hi_check.py ok (0.3s), tests/startup_gfx2hlsl_join_symbols_check.py ok (0.3s), tests/startup_gfx2hlsl_loop_constants_check.py ok (0.1s), tests/startup_gfx2hlsl_mask_data_check.py ok (0.1s), tests/startup_gfx2hlsl_mask_overwrite_check.py ok (0.1s), tests/startup_gfx2hlsl_operand_count_check.py ok (0.5s), tests/startup_gfx2hlsl_pack_absdiff_check.py ok (4.3s), tests/startup_gfx2hlsl_pack_b32_f16_check.py ok (0.2s), tests/startup_gfx2hlsl_readfirstlane_recompute_check.py ok (0.2s), tests/startup_gfx2hlsl_readfirstlane_uniform_check.py ok (0.2s), tests/startup_gfx2hlsl_refusals_check.py ok (0.9s), tests/startup_gfx2hlsl_root_check.py ok (1.2s), tests/startup_gfx2hlsl_s_nor_nand_check.py ok (0.2s), tests/startup_gfx2hlsl_sad_check.py ok (0.5s), tests/startup_gfx2hlsl_saveexec_same_reg_check.py ok (0.1s), tests/startup_gfx2hlsl_scalar_arity_check.py ok (0.3s), tests/startup_gfx2hlsl_scalar_brev_fold_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_m0_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_table_arity_check.py ok (0.4s), tests/startup_gfx2hlsl_sdwa_cvt_check.py ok (0.4s), tests/startup_gfx2hlsl_sgpr_spill_check.py ok (0.2s), tests/startup_gfx2hlsl_shift64_check.py ok (0.3s), tests/startup_gfx2hlsl_sload_const_offset_check.py ok (0.1s), tests/startup_gfx2hlsl_smem_offset_check.py ok (0.1s), tests/startup_gfx2hlsl_sop2_complement_check.py ok (9.3s), tests/startup_gfx2hlsl_sopk_accum_check.py ok (1.5s), tests/startup_gfx2hlsl_sopk_signext_check.py ok (0.3s), tests/startup_gfx2hlsl_swap_check.py ok (0.6s), tests/startup_gfx2hlsl_vopc_sdwa_check.py ok (7.3s), tests/startup_gfx2hlsl_waitcnt_depctr_check.py ok (0.2s), tests/startup_gfx2hlsl_watch_check.py ok (3.1s), tests/startup_image_2d_array_check.py ok (0.3s), tests/startup_image_3d_check.py ok (0.3s), tests/startup_image_gather_lz_check.py ok (0.9s), tests/startup_image_load_d16_check.py ok (1.7s), tests/startup_image_sample_a16_check.py ok (0.4s), tests/startup_image_sample_b_check.py ok (0.3s), tests/startup_image_sample_c_check.py ok (0.3s), tests/startup_image_sample_l_check.py ok (0.3s), tests/startup_image_sample_lod_check.py ok (0.9s), tests/startup_inline_sampler_check.py ok (0.2s), tests/startup_mesh57_loop_refusal_check.py ok (0.3s), tests/startup_mesh57_skeleton_check.py ok (0.7s), tests/startup_run_ps1_check.py ok (19.0s), tests/startup_run_sh_check.py skipped (0.1s), tests/startup_sampler_heap_check.py ok (0.2s), tests/startup_shader_cache_rekey_check.py ok (3.5s), tests/startup_smem_address_check.py ok (0.2s), tests/startup_stream_fetch_check.py ok (0.3s), tests/startup_stream_interface_check.py ok (0.3s), tests/startup_translator_check.py ok (0.7s)
  • sccache: 10/119 hits; wall 252.5s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7178936465 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#issuecomment-7178936465). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T00:36:46Z. --- Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `392a40de0685e69fc27c2d78950d95ff9984aa35`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target offscreen_check d3d12_xs_device_obj -- -j 2`): `86.67s` (configure `0.00s`) - Test (`ctest --preset dev -R '^startup_gfx2hlsl_(s_nor_nand|sop2_complement)' --parallel 4 --no-tests=error --output-on-failure`): **4/4 passed** (`11.26s`: `startup_gfx2hlsl_s_nor_nand` `0.28s`, `startup_gfx2hlsl_s_nor_nand_dispatch_hardware` `0.68s`, `startup_gfx2hlsl_s_nor_nand_dispatch_warp` `0.72s`, `startup_gfx2hlsl_sop2_complement` `11.06s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target offscreen_check d3d12_xs_device_obj -- -j 2`): `69.16s` (configure `0.00s`) - Test (`ctest --preset release -R '^startup_gfx2hlsl_(s_nor_nand|sop2_complement)' --parallel 4 --no-tests=error --output-on-failure`): **4/4 passed** (`5.74s`: `startup_gfx2hlsl_s_nor_nand` `0.20s`, `startup_gfx2hlsl_s_nor_nand_dispatch_warp` `0.54s`, `startup_gfx2hlsl_s_nor_nand_dispatch_hardware` `0.53s`, `startup_gfx2hlsl_sop2_complement` `5.62s`) - **Windows Python checks**: `tests/mesh_heap_sampler_check.py` ok (`0.9s`), `tests/startup_buffer_address_check.py` ok (`0.6s`), `tests/startup_buffer_format_word3_table_check.py` ok (`0.1s`), `tests/startup_compute_request_offline_check.py` ok (`0.7s`), `tests/startup_compute_store_format_xyzw_check.py` ok (`0.3s`), `tests/startup_compute_translate_check.py` ok (`0.3s`), `tests/startup_flat_param_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_add_sub_co_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_add_sub_co_ci_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_bit_alu_check.py` ok (`1.0s`), `tests/startup_gfx2hlsl_capture_check.py` ok (`1.4s`), `tests/startup_gfx2hlsl_cmp16_check.py` ok (`0.4s`), `tests/startup_gfx2hlsl_compare_dst_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_compute_check.py` ok (`0.6s`), `tests/startup_gfx2hlsl_cselect_mask_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_cvt_alu_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_cvt_off_f32_i4_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_cvt_pk_int16_check.py` ok (`0.4s`), `tests/startup_gfx2hlsl_f32_lg_check.py` ok (`1.9s`), `tests/startup_gfx2hlsl_f32_nan_check.py` ok (`8.2s`), `tests/startup_gfx2hlsl_fma_mix_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_getpc_refusal_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_handler_arity_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_image_arity_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_image_get_lod_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_int_med3_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_interp_p2_hi_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_join_symbols_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_loop_constants_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_mask_data_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_mask_overwrite_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_operand_count_check.py` ok (`0.5s`), `tests/startup_gfx2hlsl_pack_absdiff_check.py` ok (`4.3s`), `tests/startup_gfx2hlsl_pack_b32_f16_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_readfirstlane_recompute_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_readfirstlane_uniform_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_refusals_check.py` ok (`0.9s`), `tests/startup_gfx2hlsl_root_check.py` ok (`1.2s`), `tests/startup_gfx2hlsl_s_nor_nand_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_sad_check.py` ok (`0.5s`), `tests/startup_gfx2hlsl_saveexec_same_reg_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_scalar_arity_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_scalar_brev_fold_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_scalar_m0_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_scalar_table_arity_check.py` ok (`0.4s`), `tests/startup_gfx2hlsl_sdwa_cvt_check.py` ok (`0.4s`), `tests/startup_gfx2hlsl_sgpr_spill_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_shift64_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_sload_const_offset_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_smem_offset_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_sop2_complement_check.py` ok (`9.3s`), `tests/startup_gfx2hlsl_sopk_accum_check.py` ok (`1.5s`), `tests/startup_gfx2hlsl_sopk_signext_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_swap_check.py` ok (`0.6s`), `tests/startup_gfx2hlsl_vopc_sdwa_check.py` ok (`7.3s`), `tests/startup_gfx2hlsl_waitcnt_depctr_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_watch_check.py` ok (`3.1s`), `tests/startup_image_2d_array_check.py` ok (`0.3s`), `tests/startup_image_3d_check.py` ok (`0.3s`), `tests/startup_image_gather_lz_check.py` ok (`0.9s`), `tests/startup_image_load_d16_check.py` ok (`1.7s`), `tests/startup_image_sample_a16_check.py` ok (`0.4s`), `tests/startup_image_sample_b_check.py` ok (`0.3s`), `tests/startup_image_sample_c_check.py` ok (`0.3s`), `tests/startup_image_sample_l_check.py` ok (`0.3s`), `tests/startup_image_sample_lod_check.py` ok (`0.9s`), `tests/startup_inline_sampler_check.py` ok (`0.2s`), `tests/startup_mesh57_loop_refusal_check.py` ok (`0.3s`), `tests/startup_mesh57_skeleton_check.py` ok (`0.7s`), `tests/startup_run_ps1_check.py` ok (`19.0s`), `tests/startup_run_sh_check.py` skipped (`0.1s`), `tests/startup_sampler_heap_check.py` ok (`0.2s`), `tests/startup_shader_cache_rekey_check.py` ok (`3.5s`), `tests/startup_smem_address_check.py` ok (`0.2s`), `tests/startup_stream_fetch_check.py` ok (`0.3s`), `tests/startup_stream_interface_check.py` ok (`0.3s`), `tests/startup_translator_check.py` ok (`0.7s`) - `sccache`: 10/119 hits; wall `252.5s` AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 01:02:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:36:47Z.


@MasterDomino ready for review/merge: head 392a40de, CI green, Win2025 WARP dev+release receipt on this exact head posted above.

@Leyukaka thank you for the exec_lo port. #2459 took the SGPR-destination forms, so I merged main (merge commit, no force-push), kept main's lowering and brought over only your exec_lo destination from 482bade0, with you as co-author. SCC is not modelled, as in the SGPR forms, and vcc_lo, exec_hi, pairs and XNOR into exec_lo stay refused. I replaced the old per-lane test with startup_gfx2hlsl_s_nor_nand plus _dispatch_warp and _dispatch_hardware: a D3D12 UAV readback of NOR and NAND into exec_lo and an SGPR over every pair of source bits, against an integer reference. Your exec_lo cases in startup_gfx2hlsl_sop2_complement stay.

Verification (Win2025, head 392a40de): ctest --preset dev and --preset release with -R '^startup_gfx2hlsl_(s_nor_nand|sop2_complement)': 4/4 passed each. Linux: python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.py and tests/startup_gfx2hlsl_sop2_complement_check.py pass.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7178936652 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#issuecomment-7178936652). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T00:36:47Z. --- @MasterDomino ready for review/merge: head `392a40de`, CI green, Win2025 WARP dev+release receipt on this exact head posted above. @Leyukaka thank you for the `exec_lo` port. #2459 took the SGPR-destination forms, so I merged main (merge commit, no force-push), kept main's lowering and brought over only your `exec_lo` destination from `482bade0`, with you as co-author. SCC is not modelled, as in the SGPR forms, and `vcc_lo`, `exec_hi`, pairs and XNOR into `exec_lo` stay refused. I replaced the old per-lane test with `startup_gfx2hlsl_s_nor_nand` plus `_dispatch_warp` and `_dispatch_hardware`: a D3D12 UAV readback of NOR and NAND into `exec_lo` and an SGPR over every pair of source bits, against an integer reference. Your `exec_lo` cases in `startup_gfx2hlsl_sop2_complement` stay. Verification (Win2025, head `392a40de`): `ctest --preset dev` and `--preset release` with `-R '^startup_gfx2hlsl_(s_nor_nand|sop2_complement)'`: 4/4 passed each. Linux: `python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.py` and `tests/startup_gfx2hlsl_sop2_complement_check.py` pass. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 04:04:38 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:30:21Z.


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

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2): 6.52s (configure 2.53s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2): 1.80s (configure 3.94s)
  • Windows Python checks: tests/mesh_heap_sampler_check.py ok (1.1s), tests/startup_buffer_address_check.py ok (0.8s), tests/startup_buffer_format_word3_table_check.py ok (0.1s), tests/startup_compute_request_offline_check.py ok (0.9s), tests/startup_compute_store_format_xyzw_check.py ok (0.5s), tests/startup_compute_translate_check.py ok (0.4s), tests/startup_flat_param_check.py ok (0.3s), tests/startup_gfx2hlsl_add_sub_co_check.py ok (0.2s), tests/startup_gfx2hlsl_add_sub_co_ci_check.py ok (0.3s), tests/startup_gfx2hlsl_bit_alu_check.py ok (1.3s), tests/startup_gfx2hlsl_capture_check.py ok (1.9s), tests/startup_gfx2hlsl_cmp16_check.py ok (0.5s), tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.py ok (48.4s), tests/startup_gfx2hlsl_compare_dst_check.py ok (0.1s), tests/startup_gfx2hlsl_compute_check.py ok (0.5s), tests/startup_gfx2hlsl_cselect_mask_check.py ok (0.1s), tests/startup_gfx2hlsl_cvt_alu_check.py ok (0.2s), tests/startup_gfx2hlsl_cvt_off_f32_i4_check.py ok (0.3s), tests/startup_gfx2hlsl_cvt_pk_int16_check.py ok (0.3s), tests/startup_gfx2hlsl_f32_lg_check.py ok (1.6s), tests/startup_gfx2hlsl_f32_nan_check.py ok (6.4s), tests/startup_gfx2hlsl_fma_mix_check.py ok (0.1s), tests/startup_gfx2hlsl_getpc_refusal_check.py ok (0.1s), tests/startup_gfx2hlsl_handler_arity_check.py ok (0.2s), tests/startup_gfx2hlsl_heap_record_check.py ok (0.3s), tests/startup_gfx2hlsl_image_arity_check.py ok (0.1s), tests/startup_gfx2hlsl_image_get_lod_check.py ok (0.2s), tests/startup_gfx2hlsl_int_med3_check.py ok (0.1s), tests/startup_gfx2hlsl_interp_p2_hi_check.py ok (0.3s), tests/startup_gfx2hlsl_join_symbols_check.py ok (0.3s), tests/startup_gfx2hlsl_loop_constants_check.py ok (0.1s), tests/startup_gfx2hlsl_mask_data_check.py ok (0.1s), tests/startup_gfx2hlsl_mask_overwrite_check.py ok (0.1s), tests/startup_gfx2hlsl_operand_count_check.py ok (0.4s), tests/startup_gfx2hlsl_pack_absdiff_check.py ok (3.0s), tests/startup_gfx2hlsl_pack_b32_f16_check.py ok (0.2s), tests/startup_gfx2hlsl_readfirstlane_recompute_check.py ok (0.1s), tests/startup_gfx2hlsl_readfirstlane_uniform_check.py ok (0.2s), tests/startup_gfx2hlsl_refusals_check.py ok (0.8s), tests/startup_gfx2hlsl_root_check.py ok (1.0s), tests/startup_gfx2hlsl_s_abs_check.py ok (0.1s), tests/startup_gfx2hlsl_s_bitset_check.py ok (0.1s), tests/startup_gfx2hlsl_s_ff0_check.py ok (0.1s), tests/startup_gfx2hlsl_s_ff1_check.py ok (0.1s), tests/startup_gfx2hlsl_s_flbit_check.py ok (0.1s), tests/startup_gfx2hlsl_s_nor_nand_check.py ok (0.2s), tests/startup_gfx2hlsl_s_quadmask_check.py ok (0.1s), tests/startup_gfx2hlsl_sad_check.py ok (0.4s), tests/startup_gfx2hlsl_saveexec_same_reg_check.py ok (0.1s), tests/startup_gfx2hlsl_scalar_arity_check.py ok (0.3s), tests/startup_gfx2hlsl_scalar_brev_fold_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_m0_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_null_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_table_arity_check.py ok (0.5s), tests/startup_gfx2hlsl_sdwa_cndmask_check.py ok (0.3s), tests/startup_gfx2hlsl_sdwa_cvt_check.py ok (0.3s), tests/startup_gfx2hlsl_sgpr_spill_check.py ok (0.2s), tests/startup_gfx2hlsl_shift64_check.py ok (0.2s), tests/startup_gfx2hlsl_sload_const_offset_check.py ok (0.1s), tests/startup_gfx2hlsl_smem_offset_check.py ok (0.1s), tests/startup_gfx2hlsl_sop2_complement_check.py ok (7.1s), tests/startup_gfx2hlsl_sopk_accum_check.py ok (1.2s), tests/startup_gfx2hlsl_sopk_signext_check.py ok (0.2s), tests/startup_gfx2hlsl_spill_branches_check.py ok (1.2s), tests/startup_gfx2hlsl_swap_check.py ok (0.4s), tests/startup_gfx2hlsl_vopc_sdwa_check.py ok (6.1s), tests/startup_gfx2hlsl_waitcnt_depctr_check.py ok (0.1s), tests/startup_gfx2hlsl_watch_check.py ok (2.9s), tests/startup_image_2d_array_check.py ok (0.2s), tests/startup_image_3d_check.py ok (0.2s), tests/startup_image_gather_lz_check.py ok (0.8s), tests/startup_image_load_d16_check.py ok (1.4s), tests/startup_image_sample_a16_check.py ok (0.3s), tests/startup_image_sample_b_check.py ok (0.3s), tests/startup_image_sample_c_check.py ok (0.3s), tests/startup_image_sample_l_check.py ok (0.3s), tests/startup_image_sample_lod_check.py ok (0.9s), tests/startup_inline_sampler_check.py ok (0.2s), tests/startup_mesh57_depth_only_check.py ok (0.3s), tests/startup_mesh57_lane_spill_check.py ok (0.3s), tests/startup_mesh57_loop_check.py ok (0.3s), tests/startup_mesh57_loop_refusal_check.py ok (0.2s), tests/startup_mesh57_skeleton_check.py ok (1.9s), tests/startup_run_ps1_check.py ok (16.6s), tests/startup_run_sh_check.py skipped (0.1s), tests/startup_sampler_heap_check.py ok (0.2s), tests/startup_shader_cache_rekey_check.py ok (3.2s), tests/startup_smem_address_check.py ok (0.2s), tests/startup_stream_fetch_check.py ok (0.3s), tests/startup_stream_interface_check.py ok (0.3s), tests/startup_translator_check.py ok (0.6s)
  • sccache: 1314/1415 hits; wall 151.1s
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7181777460 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#issuecomment-7181777460). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T03:30:21Z. --- Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `9d9dbe9147256a3d1223e7cfb61803c985c31c9a`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2`): `6.52s` (configure `2.53s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2`): `1.80s` (configure `3.94s`) - **Windows Python checks**: `tests/mesh_heap_sampler_check.py` ok (`1.1s`), `tests/startup_buffer_address_check.py` ok (`0.8s`), `tests/startup_buffer_format_word3_table_check.py` ok (`0.1s`), `tests/startup_compute_request_offline_check.py` ok (`0.9s`), `tests/startup_compute_store_format_xyzw_check.py` ok (`0.5s`), `tests/startup_compute_translate_check.py` ok (`0.4s`), `tests/startup_flat_param_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_add_sub_co_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_add_sub_co_ci_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_bit_alu_check.py` ok (`1.3s`), `tests/startup_gfx2hlsl_capture_check.py` ok (`1.9s`), `tests/startup_gfx2hlsl_cmp16_check.py` ok (`0.5s`), `tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.py` ok (`48.4s`), `tests/startup_gfx2hlsl_compare_dst_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_compute_check.py` ok (`0.5s`), `tests/startup_gfx2hlsl_cselect_mask_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_cvt_alu_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_cvt_off_f32_i4_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_cvt_pk_int16_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_f32_lg_check.py` ok (`1.6s`), `tests/startup_gfx2hlsl_f32_nan_check.py` ok (`6.4s`), `tests/startup_gfx2hlsl_fma_mix_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_getpc_refusal_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_handler_arity_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_heap_record_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_image_arity_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_image_get_lod_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_int_med3_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_interp_p2_hi_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_join_symbols_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_loop_constants_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_mask_data_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_mask_overwrite_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_operand_count_check.py` ok (`0.4s`), `tests/startup_gfx2hlsl_pack_absdiff_check.py` ok (`3.0s`), `tests/startup_gfx2hlsl_pack_b32_f16_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_readfirstlane_recompute_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_readfirstlane_uniform_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_refusals_check.py` ok (`0.8s`), `tests/startup_gfx2hlsl_root_check.py` ok (`1.0s`), `tests/startup_gfx2hlsl_s_abs_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_s_bitset_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_s_ff0_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_s_ff1_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_s_flbit_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_s_nor_nand_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_s_quadmask_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_sad_check.py` ok (`0.4s`), `tests/startup_gfx2hlsl_saveexec_same_reg_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_scalar_arity_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_scalar_brev_fold_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_scalar_m0_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_scalar_null_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_scalar_table_arity_check.py` ok (`0.5s`), `tests/startup_gfx2hlsl_sdwa_cndmask_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_sdwa_cvt_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_sgpr_spill_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_shift64_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_sload_const_offset_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_smem_offset_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_sop2_complement_check.py` ok (`7.1s`), `tests/startup_gfx2hlsl_sopk_accum_check.py` ok (`1.2s`), `tests/startup_gfx2hlsl_sopk_signext_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_spill_branches_check.py` ok (`1.2s`), `tests/startup_gfx2hlsl_swap_check.py` ok (`0.4s`), `tests/startup_gfx2hlsl_vopc_sdwa_check.py` ok (`6.1s`), `tests/startup_gfx2hlsl_waitcnt_depctr_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_watch_check.py` ok (`2.9s`), `tests/startup_image_2d_array_check.py` ok (`0.2s`), `tests/startup_image_3d_check.py` ok (`0.2s`), `tests/startup_image_gather_lz_check.py` ok (`0.8s`), `tests/startup_image_load_d16_check.py` ok (`1.4s`), `tests/startup_image_sample_a16_check.py` ok (`0.3s`), `tests/startup_image_sample_b_check.py` ok (`0.3s`), `tests/startup_image_sample_c_check.py` ok (`0.3s`), `tests/startup_image_sample_l_check.py` ok (`0.3s`), `tests/startup_image_sample_lod_check.py` ok (`0.9s`), `tests/startup_inline_sampler_check.py` ok (`0.2s`), `tests/startup_mesh57_depth_only_check.py` ok (`0.3s`), `tests/startup_mesh57_lane_spill_check.py` ok (`0.3s`), `tests/startup_mesh57_loop_check.py` ok (`0.3s`), `tests/startup_mesh57_loop_refusal_check.py` ok (`0.2s`), `tests/startup_mesh57_skeleton_check.py` ok (`1.9s`), `tests/startup_run_ps1_check.py` ok (`16.6s`), `tests/startup_run_sh_check.py` skipped (`0.1s`), `tests/startup_sampler_heap_check.py` ok (`0.2s`), `tests/startup_shader_cache_rekey_check.py` ok (`3.2s`), `tests/startup_smem_address_check.py` ok (`0.2s`), `tests/startup_stream_fetch_check.py` ok (`0.3s`), `tests/startup_stream_interface_check.py` ok (`0.3s`), `tests/startup_translator_check.py` ok (`0.6s`) - `sccache`: 1314/1415 hits; wall `151.1s`
tedin7 commented 2026-11-26 04:04:38 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:30:22Z.


@MasterDomino: #2030 is ready for review/merge.

What changed: merged current main into the branch (one conflict in tools/startup/gfx2hlsl.py, kept both the address-carry handling from main and the lane-mask complement SCC refusal from this PR). New head 9d9dbe91.

Verification:

  • python3 tests/startup_gfx2hlsl_s_nor_nand_check.py ok
  • python3 tests/startup_gfx2hlsl_sop2_complement_check.py PASS
  • CI on 9d9dbe91: Linux checks, gfx1013 fixtures and Windows build all pass
  • Win2025 WARP dev + release PASS on 9d9dbe9147256a3d1223e7cfb61803c985c31c9a (receipt in the comment above)

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7181777815 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#issuecomment-7181777815). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T03:30:22Z. --- @MasterDomino: #2030 is ready for review/merge. What changed: merged current main into the branch (one conflict in `tools/startup/gfx2hlsl.py`, kept both the address-carry handling from main and the lane-mask complement SCC refusal from this PR). New head `9d9dbe91`. Verification: - `python3 tests/startup_gfx2hlsl_s_nor_nand_check.py` ok - `python3 tests/startup_gfx2hlsl_sop2_complement_check.py` PASS - CI on `9d9dbe91`: Linux checks, gfx1013 fixtures and Windows build all pass - Win2025 WARP dev + release PASS on `9d9dbe9147256a3d1223e7cfb61803c985c31c9a` (receipt in the comment above) AI-assisted; commands listed were executed locally.
R0Y00 commented 2026-11-26 06:01:44 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T05:50:04Z.

Review: CHANGES_REQUESTED


The four-bit-pair fixtures passed on WARP and RTX, but the new EXEC_LO form is accepted by the mesh-stage lowering too. The slot 57 profile is known wave64. A probe with kind=ms and two marked mask sources emits exec = (~(s1 | s2)) & 1 for s_nor_b32 exec_lo, s1, s2 and likewise for NAND, so upper lanes are changed even though the instruction only writes EXEC_LO. Please require a proven wave32 mask for the new EXEC_LO forms, or explicitly preserve lanes 32–63 in wave64. Add a case with an active upper lane and an inactive low lane result so the current lowering fails. The existing SCC-read refusals should remain.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6069158910 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#pullrequestreview-6069158910). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T05:50:04Z. **Review:** CHANGES_REQUESTED --- The four-bit-pair fixtures passed on WARP and RTX, but the new EXEC_LO form is accepted by the mesh-stage lowering too. The slot 57 profile is known wave64. A probe with kind=ms and two marked mask sources emits exec = (~(s1 | s2)) & 1 for s_nor_b32 exec_lo, s1, s2 and likewise for NAND, so upper lanes are changed even though the instruction only writes EXEC_LO. Please require a proven wave32 mask for the new EXEC_LO forms, or explicitly preserve lanes 32–63 in wave64. Add a case with an active upper lane and an inactive low lane result so the current lowering fails. The existing SCC-read refusals should remain.
MasterDomino commented 2026-11-26 07:00:08 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T06:19:46Z.

Review: CHANGES_REQUESTED


Reviewed 9d9dbe91. I agree with @R0Y00's open change request.

The exec_lo destination is accepted for every stage kind. A unit probe with kind='ms' (slot 57 mesh is wave64) and two marked mask sources emits exec = (~(s1 | s2)) & 1; for s_nor_b32 exec_lo, s1, s2, and NAND does the same. That write also changes lanes 32–63 of a wave64 wave.

  • What to change: accept the exec_lo destination only for a proven wave32 stage: pixel, or compute with at most 32 threads per group, as the b32 waterfall close already requires (gfx2hlsl.py:~2606).
  • Test: add the upper-lane case R0Y00 asked for.
  • Related: existing s_and_b32 / s_or_b32 / s_mov_b32 writes into exec_lo show the same behaviour in that probe. That can be a separate issue.

The branch also conflicts with main since #2580, in tools/startup/gfx2hlsl.py, where main's mark_heap_index call follows set_s. Keeping that call and dropping the moved lane_complement block should resolve it. Please also refresh the PR description: it still says a vcc_lo destination is accepted and that SCC uses the per-lane projection, and the code now refuses both.

Otherwise the lane semantics look right:

  • NOR/NAND bit i depends only on bit i of each source.
  • Compare masks are zero in inactive lanes, and VGPR writes are guarded after the exec write, so a reactivated lane computes the hardware bit.
  • SCC isn't emitted, and a later read of it is refused.

No cache revision bump is needed: 60 of 72 probe programs translate identically on main and on this head, and the 12 that differ were refused on main.

Runs: Windows 11 build 26300; AMD Radeon RX 9070 XT (driver 32.0.32029.2010); WARP 10.0.26100.9818.

  • Targeted: ctest --preset dev --no-tests=error -R '^startup_gfx2hlsl_(s_nor_nand|sop2_complement)' 4/4, including dispatch on WARP and hardware.
  • Neighbours: ctest -R startup_gfx2hlsl 252/253. The failure, startup_gfx2hlsl_fma_mix_dispatch_hardware, also fails on main on this GPU (#2746).
  • Mutants: five one-line mutants are each caught by startup_gfx2hlsl_sop2_complement: XNOR into exec_lo, a vcc_lo destination into exec_lo, mixed sources into exec_lo, SCC emitted, and scc_effect dropped. The new s_nor_nand check itself catches none of them; it covers only accepted forms and the readback.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6069433519 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#pullrequestreview-6069433519). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-26T06:19:46Z. **Review:** CHANGES_REQUESTED --- Reviewed `9d9dbe91`. I agree with @R0Y00's open change request. **The `exec_lo` destination is accepted for every stage kind.** A unit probe with `kind='ms'` (slot 57 mesh is wave64) and two marked mask sources emits `exec = (~(s1 | s2)) & 1;` for `s_nor_b32 exec_lo, s1, s2`, and NAND does the same. That write also changes lanes 32–63 of a wave64 wave. - **What to change:** accept the `exec_lo` destination only for a proven wave32 stage: pixel, or compute with at most 32 threads per group, as the b32 waterfall close already requires (`gfx2hlsl.py:~2606`). - **Test:** add the upper-lane case R0Y00 asked for. - **Related:** existing `s_and_b32` / `s_or_b32` / `s_mov_b32` writes into `exec_lo` show the same behaviour in that probe. That can be a separate issue. **The branch also conflicts with `main`** since #2580, in `tools/startup/gfx2hlsl.py`, where `main`'s `mark_heap_index` call follows `set_s`. Keeping that call and dropping the moved `lane_complement` block should resolve it. Please also refresh the PR description: it still says a `vcc_lo` destination is accepted and that SCC uses the per-lane projection, and the code now refuses both. **Otherwise the lane semantics look right:** - NOR/NAND bit i depends only on bit i of each source. - Compare masks are zero in inactive lanes, and VGPR writes are guarded after the `exec` write, so a reactivated lane computes the hardware bit. - SCC isn't emitted, and a later read of it is refused. **No cache revision bump is needed:** 60 of 72 probe programs translate identically on `main` and on this head, and the 12 that differ were refused on `main`. Runs: Windows 11 build 26300; AMD Radeon RX 9070 XT (driver 32.0.32029.2010); WARP 10.0.26100.9818. - **Targeted:** `ctest --preset dev --no-tests=error -R '^startup_gfx2hlsl_(s_nor_nand|sop2_complement)'` 4/4, including dispatch on WARP and hardware. - **Neighbours:** `ctest -R startup_gfx2hlsl` 252/253. The failure, `startup_gfx2hlsl_fma_mix_dispatch_hardware`, also fails on `main` on this GPU (#2746). - **Mutants:** five one-line mutants are each caught by `startup_gfx2hlsl_sop2_complement`: XNOR into `exec_lo`, a `vcc_lo` destination into `exec_lo`, mixed sources into `exec_lo`, SCC emitted, and `scc_effect` dropped. The new `s_nor_nand` check itself catches none of them; it covers only accepted forms and the readback. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 08:01:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T07:58:58Z.


@MasterDomino @R0Y00 thanks, both points are addressed at ef54c20a638f7d0ff72dc3747c6a82158273207a.

  1. exec_lo destination in a wave64 stage. s_nor_b32 / s_nand_b32 into exec_lo is now accepted only for compute with at most 32 threads per group, the same proof the b32 waterfall close uses (gfx2hlsl.py, next to mask_source). The slot 57 mesh stage, vertex stages and compute groups above 32 threads refuse it with ... on a lane mask. I did not include pixel: the translator has no wave size proof there (require_spill_lanes_apart says "the wave size is unknown" for ps/vs), so I kept it refused rather than assume wave32. If you want pixel accepted, tell me what proves it and I will add that proof.
  2. Test. startup_gfx2hlsl_s_nor_nand_check.py gains stage_checks(): both opcodes into exec_lo for ps, vs, ms, cs of 64 and 8x8 threads (refused) and cs of 32 and 8x4 threads (accepted), plus the s3 destination staying accepted in a mesh stage. Without the gate this check fails (the wave64 cases are accepted); with it, it passes. The shared Probe in startup_gfx2hlsl_sop2_complement_check.py is now a 32-thread compute stage, so the existing accepted-form cases keep their meaning.
  3. Conflict with main. Merged origin/main, kept main's mark_heap_index call and the salu_align4 write, dropped the moved lane_complement block.
  4. Description. Refreshed: vcc_lo and SCC reads are refused, and the stage rule above. docs/experiments.md states the wave32 requirement.
  5. Related s_and_b32 / s_or_b32 / s_mov_b32 into exec_lo. Left for a separate issue, as you suggested.

Linux, from the worktree at this head: python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.py ok; python3 -B tests/startup_gfx2hlsl_sop2_complement_check.py ok; python3 -B tests/startup_gfx2hlsl_waitcnt_depctr_check.py ok; every tests/startup_gfx2hlsl_*_check.py passes except the two draw checks that need DXC arguments (export_null_draw, mul24_align_draw).

The Win2025 receipt (named tests) follows in an edit to this comment.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7186049815 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#issuecomment-7186049815). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T07:58:58Z. --- @MasterDomino @R0Y00 thanks, both points are addressed at `ef54c20a638f7d0ff72dc3747c6a82158273207a`. 1. **`exec_lo` destination in a wave64 stage.** `s_nor_b32` / `s_nand_b32` into `exec_lo` is now accepted only for compute with at most 32 threads per group, the same proof the b32 waterfall close uses (`gfx2hlsl.py`, next to `mask_source`). The slot 57 mesh stage, vertex stages and compute groups above 32 threads refuse it with `... on a lane mask`. I did not include pixel: the translator has no wave size proof there (`require_spill_lanes_apart` says "the wave size is unknown" for `ps`/`vs`), so I kept it refused rather than assume wave32. If you want pixel accepted, tell me what proves it and I will add that proof. 2. **Test.** `startup_gfx2hlsl_s_nor_nand_check.py` gains `stage_checks()`: both opcodes into `exec_lo` for ps, vs, ms, cs of 64 and 8x8 threads (refused) and cs of 32 and 8x4 threads (accepted), plus the `s3` destination staying accepted in a mesh stage. Without the gate this check fails (the wave64 cases are accepted); with it, it passes. The shared `Probe` in `startup_gfx2hlsl_sop2_complement_check.py` is now a 32-thread compute stage, so the existing accepted-form cases keep their meaning. 3. **Conflict with `main`.** Merged `origin/main`, kept `main`'s `mark_heap_index` call and the `salu_align4` write, dropped the moved `lane_complement` block. 4. **Description.** Refreshed: `vcc_lo` and SCC reads are refused, and the stage rule above. `docs/experiments.md` states the wave32 requirement. 5. **Related `s_and_b32` / `s_or_b32` / `s_mov_b32` into `exec_lo`.** Left for a separate issue, as you suggested. Linux, from the worktree at this head: `python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.py` ok; `python3 -B tests/startup_gfx2hlsl_sop2_complement_check.py` ok; `python3 -B tests/startup_gfx2hlsl_waitcnt_depctr_check.py` ok; every `tests/startup_gfx2hlsl_*_check.py` passes except the two draw checks that need DXC arguments (`export_null_draw`, `mul24_align_draw`). The Win2025 receipt (named tests) follows in an edit to this comment. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 08:01:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T07:59:10Z.


Win2025 receipt at ef54c20a638f7d0ff72dc3747c6a82158273207a (Windows Server 2025 build 26100, MSVC 14.44.35207, D3D12 WARP), tests run by name:

  • ctest --preset dev -R '^(startup_gfx2hlsl_s_nor_nand|startup_gfx2hlsl_sop2_complement)' --no-tests=error: 4/4 passed: startup_gfx2hlsl_s_nor_nand, startup_gfx2hlsl_s_nor_nand_dispatch_warp, startup_gfx2hlsl_s_nor_nand_dispatch_hardware, startup_gfx2hlsl_sop2_complement.
  • ctest --preset release with the same regex: 4/4 passed, same four tests.

@MasterDomino @R0Y00 ready for another look.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7186053462 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#issuecomment-7186053462). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T07:59:10Z. --- Win2025 receipt at `ef54c20a638f7d0ff72dc3747c6a82158273207a` (Windows Server 2025 build 26100, MSVC 14.44.35207, D3D12 WARP), tests run by name: - `ctest --preset dev -R '^(startup_gfx2hlsl_s_nor_nand|startup_gfx2hlsl_sop2_complement)' --no-tests=error`: **4/4 passed**: `startup_gfx2hlsl_s_nor_nand`, `startup_gfx2hlsl_s_nor_nand_dispatch_warp`, `startup_gfx2hlsl_s_nor_nand_dispatch_hardware`, `startup_gfx2hlsl_sop2_complement`. - `ctest --preset release` with the same regex: **4/4 passed**, same four tests. @MasterDomino @R0Y00 ready for another look. AI-assisted; commands listed were executed locally.
MasterDomino commented 2026-11-26 09:04:37 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T08:03:31Z.

Review: APPROVED


Approving ef54c20a. My change request at 9d9dbe91 is addressed.

  1. exec_lo destination. NOR/NAND into exec_lo is now accepted only for compute groups of at most 32 threads (wave32_stage), where lanes 32..63 hold no thread. Pixel, vertex, mesh and larger compute groups refuse it.
    • Mutant: with the gate forced on (wave32_stage = True or ...), startup_gfx2hlsl_s_nor_nand_check.py fails on the new stage_checks(): the ps, cs (64, 1, 1) and cs (8, 8, 1) cases are no longer refused.
    • Pixel: keeping it refused without a wave-size proof is the right call.
  2. Conflict and description: resolved and refreshed. The branch merges cleanly onto current main, and CI is green at the head.

No cache revision bump is needed: main refuses these exec_lo forms, and this head only adds translations for compute groups of at most 32 threads.

Commands, on Windows 11 build 26300, at ef54c20a: python -B tests/startup_gfx2hlsl_{s_nor_nand,sop2_complement,compute,mask_overwrite}_check.py, all exit 0.

@R0Y00, the head now enforces the wave32 requirement from your change request. If you agree, please clear it and I'll merge (or merge it yourself).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6070404988 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#pullrequestreview-6070404988). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-26T08:03:31Z. **Review:** APPROVED --- Approving `ef54c20a`. My change request at `9d9dbe91` is addressed. 1. **`exec_lo` destination.** NOR/NAND into `exec_lo` is now accepted only for compute groups of at most 32 threads (`wave32_stage`), where lanes 32..63 hold no thread. Pixel, vertex, mesh and larger compute groups refuse it. - **Mutant:** with the gate forced on (`wave32_stage = True or ...`), `startup_gfx2hlsl_s_nor_nand_check.py` fails on the new `stage_checks()`: the ps, cs (64, 1, 1) and cs (8, 8, 1) cases are no longer refused. - **Pixel:** keeping it refused without a wave-size proof is the right call. 2. **Conflict and description:** resolved and refreshed. The branch merges cleanly onto current `main`, and CI is green at the head. **No cache revision bump is needed:** `main` refuses these `exec_lo` forms, and this head only adds translations for compute groups of at most 32 threads. Commands, on Windows 11 build 26300, at `ef54c20a`: `python -B tests/startup_gfx2hlsl_{s_nor_nand,sop2_complement,compute,mask_overwrite}_check.py`, all exit 0. @R0Y00, the head now enforces the wave32 requirement from your change request. If you agree, please clear it and I'll merge (or merge it yourself). AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 09:04:55 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T08:59:03Z.


@R0Y00 the change request of 2026-11-26 05:50Z (on 9d9dbe91: s_nor_b32 / s_nand_b32 into exec_lo accepted in the mesh stage, which is wave64) has been addressed at head ef54c20a:

  • exec_lo as the destination is now accepted only for compute with at most 32 threads per group, the one wave32 proof available. Pixel, vertex, mesh (slot 57) and larger compute groups refuse it, so lanes 32..63 of a wave64 wave are never changed (9b326a3f, f8022065, ef54c20a).
  • A bare probe with no stage is treated as a pixel stage by the gate.
  • Without the stage gate, startup_gfx2hlsl_s_nor_nand fails on the wave64 cases; the SCC-read refusals are unchanged.
  • Win2025 at ef54c20a: dev 4/4 and release 4/4 passed, tests run by name (receipt in this thread).
  • Real GPU (RTX 3090 through vkd3d-proton, Linux): 4/4.
  • MasterDomino approved this head on 2026-11-26 08:03Z; CI is green.

Please re-review this head, or dismiss the old change request if you agree it is resolved.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7187263348 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#issuecomment-7187263348). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T08:59:03Z. --- @R0Y00 the change request of 2026-11-26 05:50Z (on 9d9dbe91: `s_nor_b32` / `s_nand_b32` into `exec_lo` accepted in the mesh stage, which is wave64) has been addressed at head `ef54c20a`: - `exec_lo` as the destination is now accepted only for compute with at most 32 threads per group, the one wave32 proof available. Pixel, vertex, mesh (slot 57) and larger compute groups refuse it, so lanes 32..63 of a wave64 wave are never changed (9b326a3f, f8022065, ef54c20a). - A bare probe with no stage is treated as a pixel stage by the gate. - Without the stage gate, `startup_gfx2hlsl_s_nor_nand` fails on the wave64 cases; the SCC-read refusals are unchanged. - Win2025 at `ef54c20a`: dev 4/4 and release 4/4 passed, tests run by name (receipt in this thread). - Real GPU (RTX 3090 through vkd3d-proton, Linux): 4/4. - MasterDomino approved this head on 2026-11-26 08:03Z; CI is green. Please re-review this head, or dismiss the old change request if you agree it is resolved. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-26 11:02:40 +00:00
MasterDomino commented 2026-11-26 11:02:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T10:09:46Z.


@tedin7, ef54c20a now conflicts with main (700522ef) in tools/startup/gfx2hlsl.py, after #2736 and the other recent translator merges. Could you merge main again? I'll re-check the new head (the s_nor_nand / sop2_complement checks and the wave32-gate mutant). This PR needs no cache bump, so no revision line should move.

The merge also still needs @R0Y00 to re-review or dismiss his change request at 9d9dbe91.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7188990791 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#issuecomment-7188990791). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-26T10:09:46Z. --- @tedin7, `ef54c20a` now conflicts with `main` (`700522ef`) in `tools/startup/gfx2hlsl.py`, after #2736 and the other recent translator merges. Could you merge `main` again? I'll re-check the new head (the `s_nor_nand` / `sop2_complement` checks and the wave32-gate mutant). This PR needs no cache bump, so no revision line should move. The merge also still needs @R0Y00 to re-review or dismiss his change request at `9d9dbe91`. AI-assisted.
tedin7 commented 2026-11-26 11:02:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T10:12:18Z.


Withdrawn: shader translation is moving to the native C++ frontend (see #870), so we are not continuing this change to the Python translator. The branch stays available if any part is useful later. Thank you to everyone who reviewed and tested it.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7189048403 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2030#issuecomment-7189048403). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T10:12:18Z. --- Withdrawn: shader translation is moving to the native C++ frontend (see #870), so we are not continuing this change to the Python translator. The branch stays available if any part is useful later. Thank you to everyone who reviewed and tested it.

Pull request closed

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!2023
No description provided.