gfx2hlsl: accept mask-preserving lane-mask writes in an execz block #2715

Merged
tedin7 merged 11 commits from upstream-pr/2723 into main 2026-11-26 07:18:26 +00:00
tedin7 commented 2026-11-26 03:48:05 +00:00 (Migrated from github.com)

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


Part of #1723

What this unblocks: compute shaders whose compiler-made i1 phi (a lane mask with a per-lane old value, s_andn2 + exec-masked compare + s_or) is defined in an s_cbranch_execz block and read per lane after the join now translate instead of being refused with definition of <M>, live where the block joins.

What changed

phi_mask_ok (extends the i1-phi rule from #2505) now accepts, for a 32-bit lane mask M (vcc_lo or one sN) written inside an execz block:

  • preserving writes, no zeroing needed: s_andn2_b32 M, M, exec_lo, and s_or_b32 M, M, T where T was written in the block by s_and_b32 T, X, exec_lo or a v_cmp;
  • a v_cmp (not v_cmpx) into M only when M was zeroed before the branch;
  • s_orn2_b32 M, X, exec_lo only when M was set to all ones (s_mov_b32 M, -1) before the branch.

Why it is exact: the model skips a lane when its exec bit is clear, and the exec proof (#2509) keeps that bit clear through the block. The wave runs the block when any lane is active. So the model equals the wave iff the block leaves a skipped lane's mask bit unchanged. Preserving writes always do; compare/exec-copy writes only after zeroing; s_orn2 only after all ones. Zeroing and all-ones writes are never mixed, any other write of M (including an offset s_movk into M) stays refused, and whole-mask reads after the join stay refused. The exhaustive 4-lane check is in the test file.

No overlap with #2557: it covers absorbed reads and an andn2-only narrowed mask; this PR covers the blend and the compare/orn2 set-up forms and does not touch those two rules.

Tests

  • tests/startup_gfx2hlsl_compute_check.py: acceptance of the blend, andn2-only, vcc blend, zeroed compare and all-ones orn2; refusals for each missing set-up, an unmasked term, M not the first source, mixed classes, and whole-mask reads; exhaustive 4-lane check check_execz_mask_exact.
  • New dispatch cases P (blend) and Q (all-ones orn2): group 0 skips with the whole wave, groups 1 and 2 enter with 3 and 6 lanes, group 3 with all 8; CPU reference per thread. New controls: p-dropped-andn2, p-dropped-or, p-block-entered, q-block-entered, q-not-all-ones (registered in CMake for warp and hardware).

Verification

Linux (this is Stage-1, no Windows run):

  • python3 -I tests/startup_gfx2hlsl_compute_check.py -> pass (new checks fail on origin/main with s_andn2_b32 inside a block s_cbranch_execz skips per lane: definition of s20, live where the block joins)
  • python3 -B tests/startup_gfx2hlsl_compute_check.py binary llvm-mc-19 -> fixture words match llvm-mc
  • expected output of cases P and Q checked against a wave-level simulation of the assembly: equal for all 4 groups
  • regression: the gfx2hlsl/pixel Linux checks give identical results on this branch and on origin/main
  • llc shapes (i1 phi with false / per-lane old / true, big arm so s_cbranch_execz is emitted): blend and true now translate, the others unchanged

Win2025 (dev + release, head 27ad219ce, merged with current main): x2w_pipe.py win2025 2723 --py-checks tests/startup_gfx2hlsl_compute_check.py --targets offscreen_check --regex startup_gfx2hlsl_compute: 45/45 passed, including dispatch cases P and Q on warp and hardware and the five new controls (p-dropped-andn2, p-dropped-or, p-block-entered, q-block-entered, q-not-all-ones), each rejected at its first bad word.

Build and run: cmake --build --preset dev --target offscreen_check then ctest --preset dev --no-tests=error -R '^startup_gfx2hlsl_compute' -V.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6619072870 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T03:48:05Z. --- Part of #1723 What this unblocks: compute shaders whose compiler-made i1 phi (a lane mask with a per-lane old value, `s_andn2` + exec-masked compare + `s_or`) is defined in an `s_cbranch_execz` block and read per lane after the join now translate instead of being refused with `definition of <M>, live where the block joins`. ## What changed `phi_mask_ok` (extends the i1-phi rule from #2505) now accepts, for a 32-bit lane mask M (vcc_lo or one sN) written inside an execz block: - preserving writes, no zeroing needed: `s_andn2_b32 M, M, exec_lo`, and `s_or_b32 M, M, T` where T was written in the block by `s_and_b32 T, X, exec_lo` or a `v_cmp`; - a `v_cmp` (not `v_cmpx`) into M only when M was zeroed before the branch; - `s_orn2_b32 M, X, exec_lo` only when M was set to all ones (`s_mov_b32 M, -1`) before the branch. Why it is exact: the model skips a lane when its exec bit is clear, and the exec proof (#2509) keeps that bit clear through the block. The wave runs the block when any lane is active. So the model equals the wave iff the block leaves a skipped lane's mask bit unchanged. Preserving writes always do; compare/exec-copy writes only after zeroing; `s_orn2` only after all ones. Zeroing and all-ones writes are never mixed, any other write of M (including an offset `s_movk` into M) stays refused, and whole-mask reads after the join stay refused. The exhaustive 4-lane check is in the test file. No overlap with #2557: it covers absorbed reads and an andn2-only narrowed mask; this PR covers the blend and the compare/orn2 set-up forms and does not touch those two rules. ## Tests - `tests/startup_gfx2hlsl_compute_check.py`: acceptance of the blend, andn2-only, vcc blend, zeroed compare and all-ones orn2; refusals for each missing set-up, an unmasked term, M not the first source, mixed classes, and whole-mask reads; exhaustive 4-lane check `check_execz_mask_exact`. - New dispatch cases P (blend) and Q (all-ones orn2): group 0 skips with the whole wave, groups 1 and 2 enter with 3 and 6 lanes, group 3 with all 8; CPU reference per thread. New controls: `p-dropped-andn2`, `p-dropped-or`, `p-block-entered`, `q-block-entered`, `q-not-all-ones` (registered in CMake for warp and hardware). ## Verification Linux (this is Stage-1, no Windows run): - `python3 -I tests/startup_gfx2hlsl_compute_check.py` -> pass (new checks fail on origin/main with `s_andn2_b32 inside a block s_cbranch_execz skips per lane: definition of s20, live where the block joins`) - `python3 -B tests/startup_gfx2hlsl_compute_check.py binary llvm-mc-19` -> `fixture words match llvm-mc` - expected output of cases P and Q checked against a wave-level simulation of the assembly: equal for all 4 groups - regression: the gfx2hlsl/pixel Linux checks give identical results on this branch and on origin/main - llc shapes (i1 phi with false / per-lane old / true, big arm so `s_cbranch_execz` is emitted): blend and `true` now translate, the others unchanged Win2025 (dev + release, head 27ad219ce, merged with current main): `x2w_pipe.py win2025 2723 --py-checks tests/startup_gfx2hlsl_compute_check.py --targets offscreen_check --regex startup_gfx2hlsl_compute`: 45/45 passed, including dispatch cases P and Q on warp and hardware and the five new controls (p-dropped-andn2, p-dropped-or, p-block-entered, q-block-entered, q-not-all-ones), each rejected at its first bad word. Build and run: `cmake --build --preset dev --target offscreen_check` then `ctest --preset dev --no-tests=error -R '^startup_gfx2hlsl_compute' -V`. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-26 05:02:17 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T04:42:19Z.

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 27ad219ce0

ℹ️ 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:6068645988 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#pullrequestreview-6068645988). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T04:42:19Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `27ad219ce0` <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-26 05:02:17 +00:00 (Migrated from github.com)

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

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068761419 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#pullrequestreview-6068761419). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:57:46Z. **Review:** COMMENTED --- _No description provided._
tedin7 commented 2026-11-26 05:02:17 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:57:48Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068761710 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#pullrequestreview-6068761710). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:57:48Z. **Review:** COMMENTED --- _No description provided._
tedin7 commented 2026-11-26 05:02:27 +00:00 (Migrated from github.com)

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


@MasterDomino Ready for review on head 27ad219ce.

Independent gate review: main was merged into the branch first (CMake control list conflict resolved, both sides kept, no rebase, no force). Then I tried to break phi_mask_ok: a zeroed or all-ones mask overwritten before the branch, an unmasked term, exec widened inside the block before the s_andn2, s_orn2 with swapped sources, s_xor into the mask, a 64-bit s_andn2, an s_or into a different register read after the join, and whole-mask numeric reads of the mask or its term after the join (s_lshr, s_bcnt1, v_cvt, v_mov, s_and, s_add). All stay refused; only the blend, andn2-only, vcc blend, zeroed compare and all-ones orn2 forms translate. A break-it sweep of 166 shapes translates the same as origin/main.

Verification:

  • Linux: python3 -B tests/startup_gfx2hlsl_compute_check.py and ... binary llvm-mc-19 pass.
  • Win2025 (dev + release): x2w_pipe.py win2025 2723 --py-checks tests/startup_gfx2hlsl_compute_check.py --targets offscreen_check --regex startup_gfx2hlsl_compute: 45/45 passed, including the partial-wave dispatch cases P and Q (warp, hardware) and their wrong-value controls.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182749486 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#issuecomment-7182749486). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:36:59Z. --- @MasterDomino Ready for review on head 27ad219ce. Independent gate review: `main` was merged into the branch first (CMake control list conflict resolved, both sides kept, no rebase, no force). Then I tried to break `phi_mask_ok`: a zeroed or all-ones mask overwritten before the branch, an unmasked term, exec widened inside the block before the `s_andn2`, `s_orn2` with swapped sources, `s_xor` into the mask, a 64-bit `s_andn2`, an `s_or` into a different register read after the join, and whole-mask numeric reads of the mask or its term after the join (`s_lshr`, `s_bcnt1`, `v_cvt`, `v_mov`, `s_and`, `s_add`). All stay refused; only the blend, andn2-only, vcc blend, zeroed compare and all-ones orn2 forms translate. A break-it sweep of 166 shapes translates the same as `origin/main`. Verification: - Linux: `python3 -B tests/startup_gfx2hlsl_compute_check.py` and `... binary llvm-mc-19` pass. - Win2025 (dev + release): `x2w_pipe.py win2025 2723 --py-checks tests/startup_gfx2hlsl_compute_check.py --targets offscreen_check --regex startup_gfx2hlsl_compute`: 45/45 passed, including the partial-wave dispatch cases P and Q (warp, hardware) and their wrong-value controls. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-26 05:02:28 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T04:37:00Z.


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-26T04:42:21.627363Z 27ad219 Draft marked ready
ℹ️ 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:7182749674 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#issuecomment-7182749674). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T04:37:00Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"27ad219ce04f54d0d3cd318cdf214adcc95f47f8","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-26T04:42:21.627363Z">2026-11-26T04:42:21.627363Z</relative-time> | `27ad219` | Draft marked ready | <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-26 05:02:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T04:42:19Z.

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

@@ -2828,6 +2851,37 @@ def phi_mask_ok(self, key, b, t, effects, succ, targets, index):
                 todo.extend(succ[i])
         return True
 
+    @staticmethod
+    def exec_masked_def(base, ops, key):
+        """True when this instruction writes `key` ('sN' or 'vcc') with a value whose bit is 0 for a lane whose exec bit is
+        clear: s_and with exec_lo into it, or a v_cmp (not v_cmpx) into it."""
+        name = 'vcc_lo' if key == 'vcc' else key
+        if not ops or ops[0] != name:
+            return False
+        if base == 's_and_b32':
+            return len(ops) == 3 and 'exec_lo' in ops[1:]
+        return base.startswith('v_cmp') and not base.startswith('v_cmpx')
+
+    @staticmethod
+    def mask_write_class(base, ops, name, temps):
+        """'keep', 'zero' or 'ones' for a write of mask `name` inside an execz block (see phi_mask_ok), else None."""
+        key = 'vcc' if name == 'vcc_lo' else name
+        if base == 's_mov_b32' and ops[1:] == ['exec_lo']:
+            return 'zero'
+        if base == 's_and_b32' and len(ops) == 3 and 'exec_lo' in ops[1:]:
+            return 'zero'
+        if base.startswith('v_cmp') and not base.startswith('v_cmpx'):
+            return 'zero'
+        if base == 's_orn2_b32' and len(ops) == 3 and ops[2] == 'exec_lo':
+            return 'ones'
+        if base == 's_andn2_b32' and ops == [name, name, 'exec_lo']:
+            return 'keep'

P1 Badge Prove lane-bit encoding before accepting the new mask writes

In a Linux translation repro, changing case Q's block instruction to s_orn2_b32 s23, s7, exec_lo now succeeds where the parent refused it, but group 1/lane 1 gets mask bit 0 from the source instruction (s7 = 1, exec_lo = 7) and bit 1 from the emitted (s7 | ~exec) & 1, incorrectly inverting output word 9. The new keep path has the same encoding problem if case P initializes M with s_mov_b32 s23, 16: skipped lane 4 retains source bit 1 but reads bit 0 in HLSL. Require inputs whose bit 0 already represents the current lane, or project whole-word inputs before admitting these shapes; skipped-lane preservation alone does not establish correct translation.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4703970083 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#discussion_r4703970083). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T04:42:19Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 2878 ~~~~diff @@ -2828,6 +2851,37 @@ def phi_mask_ok(self, key, b, t, effects, succ, targets, index): todo.extend(succ[i]) return True + @staticmethod + def exec_masked_def(base, ops, key): + """True when this instruction writes `key` ('sN' or 'vcc') with a value whose bit is 0 for a lane whose exec bit is + clear: s_and with exec_lo into it, or a v_cmp (not v_cmpx) into it.""" + name = 'vcc_lo' if key == 'vcc' else key + if not ops or ops[0] != name: + return False + if base == 's_and_b32': + return len(ops) == 3 and 'exec_lo' in ops[1:] + return base.startswith('v_cmp') and not base.startswith('v_cmpx') + + @staticmethod + def mask_write_class(base, ops, name, temps): + """'keep', 'zero' or 'ones' for a write of mask `name` inside an execz block (see phi_mask_ok), else None.""" + key = 'vcc' if name == 'vcc_lo' else name + if base == 's_mov_b32' and ops[1:] == ['exec_lo']: + return 'zero' + if base == 's_and_b32' and len(ops) == 3 and 'exec_lo' in ops[1:]: + return 'zero' + if base.startswith('v_cmp') and not base.startswith('v_cmpx'): + return 'zero' + if base == 's_orn2_b32' and len(ops) == 3 and ops[2] == 'exec_lo': + return 'ones' + if base == 's_andn2_b32' and ops == [name, name, 'exec_lo']: + return 'keep' ~~~~ --- **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Prove lane-bit encoding before accepting the new mask writes** In a Linux translation repro, changing case Q's block instruction to `s_orn2_b32 s23, s7, exec_lo` now succeeds where the parent refused it, but group 1/lane 1 gets mask bit 0 from the source instruction (`s7 = 1`, `exec_lo = 7`) and bit 1 from the emitted `(s7 | ~exec) & 1`, incorrectly inverting output word 9. The new `keep` path has the same encoding problem if case P initializes M with `s_mov_b32 s23, 16`: skipped lane 4 retains source bit 1 but reads bit 0 in HLSL. Require inputs whose bit 0 already represents the current lane, or project whole-word inputs before admitting these shapes; skipped-lane preservation alone does not establish correct translation. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
chatgpt-codex-connector[bot commented 2026-11-26 05:02:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T04:42:19Z.

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

@@ -2566,7 +2566,12 @@ def execz_refusals(self):
         whose bit is 0 for any lane whose exec bit is clear there: the clear-mask proof keeps exec clear for that lane, and a copy of exec, or X & exec, has that bit clear. M is 0
         at the branch on every path (nothing branches or lands between the zeroing and the branch). So for a lane
         the model skips, the wave's M has that lane's bit 0 whether the wave ran the block or not, which is the
-        model's M (0); a lane that runs the block runs it in the model too. This holds only while M is read per
+        model's M (0); a lane that runs the block runs it in the model too. Writes that leave a skipped lane's bit
+        as it was are accepted for any M: `s_andn2_b32 M, M, exec_lo` and `s_or_b32 M, M, T` where T is an exec-masked
+        value computed in the block (`s_and_b32 T, X, exec_lo` or a v_cmp result), the blend the compiler emits for an
+        i1 phi whose other input is a per-lane value. A v_cmp into M (not v_cmpx) needs M zeroed before the branch
+        like the moves above, and `s_orn2_b32 M, X, exec_lo` needs M set to all ones (`s_mov_b32 M, -1`). Zeroing

P1 Badge Update the documented execz acceptance boundary

This broadens the public compute-translation capability, but docs/experiments.md:15352-15366 still requires M to be zeroed before the branch and explicitly lists missing/nonzero initialization and writes not sourced from exec as refusal conditions. That contradicts the newly accepted preserving, compare, and all-ones forms, leaving the capability reference describing the old behavior. Update the corresponding compute-stage section with the new accepted shapes and their restrictions.

AGENTS.md reference: AGENTS.md:L315-L316

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4703970088 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#discussion_r4703970088). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T04:42:19Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 2573 ~~~~diff @@ -2566,7 +2566,12 @@ def execz_refusals(self): whose bit is 0 for any lane whose exec bit is clear there: the clear-mask proof keeps exec clear for that lane, and a copy of exec, or X & exec, has that bit clear. M is 0 at the branch on every path (nothing branches or lands between the zeroing and the branch). So for a lane the model skips, the wave's M has that lane's bit 0 whether the wave ran the block or not, which is the - model's M (0); a lane that runs the block runs it in the model too. This holds only while M is read per + model's M (0); a lane that runs the block runs it in the model too. Writes that leave a skipped lane's bit + as it was are accepted for any M: `s_andn2_b32 M, M, exec_lo` and `s_or_b32 M, M, T` where T is an exec-masked + value computed in the block (`s_and_b32 T, X, exec_lo` or a v_cmp result), the blend the compiler emits for an + i1 phi whose other input is a per-lane value. A v_cmp into M (not v_cmpx) needs M zeroed before the branch + like the moves above, and `s_orn2_b32 M, X, exec_lo` needs M set to all ones (`s_mov_b32 M, -1`). Zeroing ~~~~ --- **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Update the documented execz acceptance boundary** This broadens the public compute-translation capability, but `docs/experiments.md:15352-15366` still requires M to be zeroed before the branch and explicitly lists missing/nonzero initialization and writes not sourced from exec as refusal conditions. That contradicts the newly accepted preserving, compare, and all-ones forms, leaving the capability reference describing the old behavior. Update the corresponding compute-stage section with the new accepted shapes and their restrictions. AGENTS.md reference: [AGENTS.md:L315-L316](https://github.com/R0Y00/Xbox2Windows/blob/27ad219ce04f54d0d3cd318cdf214adcc95f47f8/AGENTS.md#L315-L316) Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
tedin7 commented 2026-11-26 05:02:31 +00:00 (Migrated from github.com)

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

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

@@ -2828,6 +2851,37 @@ def phi_mask_ok(self, key, b, t, effects, succ, targets, index):
                 todo.extend(succ[i])
         return True
 
+    @staticmethod
+    def exec_masked_def(base, ops, key):
+        """True when this instruction writes `key` ('sN' or 'vcc') with a value whose bit is 0 for a lane whose exec bit is
+        clear: s_and with exec_lo into it, or a v_cmp (not v_cmpx) into it."""
+        name = 'vcc_lo' if key == 'vcc' else key
+        if not ops or ops[0] != name:
+            return False
+        if base == 's_and_b32':
+            return len(ops) == 3 and 'exec_lo' in ops[1:]
+        return base.startswith('v_cmp') and not base.startswith('v_cmpx')
+
+    @staticmethod
+    def mask_write_class(base, ops, name, temps):
+        """'keep', 'zero' or 'ones' for a write of mask `name` inside an execz block (see phi_mask_ok), else None."""
+        key = 'vcc' if name == 'vcc_lo' else name
+        if base == 's_mov_b32' and ops[1:] == ['exec_lo']:
+            return 'zero'
+        if base == 's_and_b32' and len(ops) == 3 and 'exec_lo' in ops[1:]:
+            return 'zero'
+        if base.startswith('v_cmp') and not base.startswith('v_cmpx'):
+            return 'zero'
+        if base == 's_orn2_b32' and len(ops) == 3 and ops[2] == 'exec_lo':
+            return 'ones'
+        if base == 's_andn2_b32' and ops == [name, name, 'exec_lo']:
+            return 'keep'

Confirmed and fixed in 94c692b4 (merged with main as 9ab28289).

The one-lane model reads a lane mask's bit 0, while the wave holds the lane's bit at bit lane. So a mask built from data (a group id, s_mov_b32 M, 16) was translated wrongly. Now every mask a block write uses must hold lane bits: a v_cmp, an s_and with exec and a lane mask, a copy of exec, or 0 / -1. Specifically:

  • s_orn2 M, X, exec_lo: X must be a lane mask (your s_orn2_b32 s23, s7, exec_lo case is refused);
  • the preserving s_andn2 / s_or blend: T must be an exec-masked lane mask, and M's last write before the branch must itself hold lane bits (so s_mov_b32 s23, 16 is refused);
  • s_and M, X, exec_lo (zeroing class): the same rule for X. This also closes the older group-id form, and I changed the existing test that expected it to be accepted.

Tests added in tests/startup_gfx2hlsl_compute_check.py (check_controls): refusals for s7 as X or T, s_mov_b32 s20, 16 as M, and M unknown; the accepted shapes now use compare-derived masks. Disabling the new M rule makes the s_mov_b32 s20, 16 control fail.

Commands run locally (Linux): python3 -B tests/startup_gfx2hlsl_compute_check.py, startup_gfx2hlsl_mask_overwrite_check.py, startup_gfx2hlsl_mask_data_check.py, startup_gfx2hlsl_refusals_check.py, startup_compute_translate_check.py: all pass; git diff --check clean.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4704063539 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#discussion_r4704063539). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:57:46Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 2878 ~~~~diff @@ -2828,6 +2851,37 @@ def phi_mask_ok(self, key, b, t, effects, succ, targets, index): todo.extend(succ[i]) return True + @staticmethod + def exec_masked_def(base, ops, key): + """True when this instruction writes `key` ('sN' or 'vcc') with a value whose bit is 0 for a lane whose exec bit is + clear: s_and with exec_lo into it, or a v_cmp (not v_cmpx) into it.""" + name = 'vcc_lo' if key == 'vcc' else key + if not ops or ops[0] != name: + return False + if base == 's_and_b32': + return len(ops) == 3 and 'exec_lo' in ops[1:] + return base.startswith('v_cmp') and not base.startswith('v_cmpx') + + @staticmethod + def mask_write_class(base, ops, name, temps): + """'keep', 'zero' or 'ones' for a write of mask `name` inside an execz block (see phi_mask_ok), else None.""" + key = 'vcc' if name == 'vcc_lo' else name + if base == 's_mov_b32' and ops[1:] == ['exec_lo']: + return 'zero' + if base == 's_and_b32' and len(ops) == 3 and 'exec_lo' in ops[1:]: + return 'zero' + if base.startswith('v_cmp') and not base.startswith('v_cmpx'): + return 'zero' + if base == 's_orn2_b32' and len(ops) == 3 and ops[2] == 'exec_lo': + return 'ones' + if base == 's_andn2_b32' and ops == [name, name, 'exec_lo']: + return 'keep' ~~~~ --- Confirmed and fixed in 94c692b4 (merged with main as 9ab28289). The one-lane model reads a lane mask's bit 0, while the wave holds the lane's bit at bit `lane`. So a mask built from data (a group id, `s_mov_b32 M, 16`) was translated wrongly. Now every mask a block write uses must hold lane bits: a `v_cmp`, an `s_and` with exec and a lane mask, a copy of exec, or 0 / -1. Specifically: - `s_orn2 M, X, exec_lo`: X must be a lane mask (your `s_orn2_b32 s23, s7, exec_lo` case is refused); - the preserving `s_andn2` / `s_or` blend: T must be an exec-masked lane mask, and M's last write before the branch must itself hold lane bits (so `s_mov_b32 s23, 16` is refused); - `s_and M, X, exec_lo` (zeroing class): the same rule for X. This also closes the older group-id form, and I changed the existing test that expected it to be accepted. Tests added in `tests/startup_gfx2hlsl_compute_check.py` (check_controls): refusals for s7 as X or T, `s_mov_b32 s20, 16` as M, and M unknown; the accepted shapes now use compare-derived masks. Disabling the new M rule makes the `s_mov_b32 s20, 16` control fail. Commands run locally (Linux): `python3 -B tests/startup_gfx2hlsl_compute_check.py`, `startup_gfx2hlsl_mask_overwrite_check.py`, `startup_gfx2hlsl_mask_data_check.py`, `startup_gfx2hlsl_refusals_check.py`, `startup_compute_translate_check.py`: all pass; `git diff --check` clean. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 05:02:31 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:57:48Z.

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

@@ -2566,7 +2566,12 @@ def execz_refusals(self):
         whose bit is 0 for any lane whose exec bit is clear there: the clear-mask proof keeps exec clear for that lane, and a copy of exec, or X & exec, has that bit clear. M is 0
         at the branch on every path (nothing branches or lands between the zeroing and the branch). So for a lane
         the model skips, the wave's M has that lane's bit 0 whether the wave ran the block or not, which is the
-        model's M (0); a lane that runs the block runs it in the model too. This holds only while M is read per
+        model's M (0); a lane that runs the block runs it in the model too. Writes that leave a skipped lane's bit
+        as it was are accepted for any M: `s_andn2_b32 M, M, exec_lo` and `s_or_b32 M, M, T` where T is an exec-masked
+        value computed in the block (`s_and_b32 T, X, exec_lo` or a v_cmp result), the blend the compiler emits for an
+        i1 phi whose other input is a per-lane value. A v_cmp into M (not v_cmpx) needs M zeroed before the branch
+        like the moves above, and `s_orn2_b32 M, X, exec_lo` needs M set to all ones (`s_mov_b32 M, -1`). Zeroing

Fixed in 94c692b4 / 9ab28289: docs/experiments.md (compute-stage execz section) now lists the preserving, compare and all-ones forms, the lane-bit requirement for every mask they use, the zeroing / all-ones set-up each one needs, and the cases that stay refused. The refusal list no longer says "a write of M that is not from exec". python3 -B tests/docs_links_check.py passes.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4704063738 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#discussion_r4704063738). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:57:48Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 2573 ~~~~diff @@ -2566,7 +2566,12 @@ def execz_refusals(self): whose bit is 0 for any lane whose exec bit is clear there: the clear-mask proof keeps exec clear for that lane, and a copy of exec, or X & exec, has that bit clear. M is 0 at the branch on every path (nothing branches or lands between the zeroing and the branch). So for a lane the model skips, the wave's M has that lane's bit 0 whether the wave ran the block or not, which is the - model's M (0); a lane that runs the block runs it in the model too. This holds only while M is read per + model's M (0); a lane that runs the block runs it in the model too. Writes that leave a skipped lane's bit + as it was are accepted for any M: `s_andn2_b32 M, M, exec_lo` and `s_or_b32 M, M, T` where T is an exec-masked + value computed in the block (`s_and_b32 T, X, exec_lo` or a v_cmp result), the blend the compiler emits for an + i1 phi whose other input is a per-lane value. A v_cmp into M (not v_cmpx) needs M zeroed before the branch + like the moves above, and `s_orn2_b32 M, X, exec_lo` needs M set to all ones (`s_mov_b32 M, -1`). Zeroing ~~~~ --- Fixed in 94c692b4 / 9ab28289: `docs/experiments.md` (compute-stage execz section) now lists the preserving, compare and all-ones forms, the lane-bit requirement for every mask they use, the zeroing / all-ones set-up each one needs, and the cases that stay refused. The refusal list no longer says "a write of M that is not from exec". `python3 -B tests/docs_links_check.py` passes. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 06:01:56 +00:00 (Migrated from github.com)

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

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068864805 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#pullrequestreview-6068864805). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T05:11:46Z. **Review:** COMMENTED --- _No description provided._
tedin7 commented 2026-11-26 06:01:56 +00:00 (Migrated from github.com)

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

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068865317 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#pullrequestreview-6068865317). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T05:11:51Z. **Review:** COMMENTED --- _No description provided._
tedin7 commented 2026-11-26 06:02:07 +00:00 (Migrated from github.com)

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


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

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj -- -j 2): 0.73s (configure 0.00s)
    • Test (ctest --preset dev -R 'startup_gfx2hlsl_compute_(controls|warp)' --parallel 6 --no-tests=error --output-on-failure): 2/2 passed (2.27s: startup_gfx2hlsl_compute_controls 0.51s, startup_gfx2hlsl_compute_warp 2.15s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj -- -j 2): 2.28s (configure 1.79s)
    • Test (ctest --preset release -R 'startup_gfx2hlsl_compute_(controls|warp)' --parallel 6 --no-tests=error --output-on-failure): 2/2 passed (2.13s: startup_gfx2hlsl_compute_controls 0.46s, startup_gfx2hlsl_compute_warp 2.02s)
  • Windows Python checks: tests/mesh_heap_sampler_check.py ok (0.6s), tests/startup_buffer_address_check.py ok (0.4s), tests/startup_buffer_format_word3_table_check.py ok (0.1s), tests/startup_compute_image_store_check.py ok (0.5s), tests/startup_compute_image_store_d16_check.py ok (0.5s), tests/startup_compute_request_offline_check.py ok (0.5s), tests/startup_compute_store_format_xyzw_check.py ok (0.2s), tests/startup_compute_translate_check.py ok (0.2s), tests/startup_flat_param_check.py ok (0.1s), tests/startup_gfx2hlsl_add_sub_co_check.py ok (0.1s), tests/startup_gfx2hlsl_add_sub_co_ci_check.py ok (0.1s), tests/startup_gfx2hlsl_bfm_b64_check.py ok (1.1s), tests/startup_gfx2hlsl_bit_alu_check.py ok (0.6s), tests/startup_gfx2hlsl_capture_check.py ok (0.9s), tests/startup_gfx2hlsl_cmp16_check.py ok (0.2s), tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.py ok (27.5s), tests/startup_gfx2hlsl_compare_dst_check.py ok (0.1s), tests/startup_gfx2hlsl_compute_check.py ok (0.4s), 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.2s), tests/startup_gfx2hlsl_cvt_pk_int16_check.py ok (0.2s), tests/startup_gfx2hlsl_f32_lg_check.py ok (1.1s), tests/startup_gfx2hlsl_f32_nan_check.py ok (4.3s), 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_heap_record_check.py ok (0.2s), 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.2s), tests/startup_gfx2hlsl_join_symbols_check.py ok (0.2s), 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.3s), tests/startup_gfx2hlsl_pack_absdiff_check.py ok (2.1s), tests/startup_gfx2hlsl_pack_b32_f16_check.py ok (0.1s), tests/startup_gfx2hlsl_readfirstlane_recompute_check.py ok (0.1s), tests/startup_gfx2hlsl_readfirstlane_uniform_check.py ok (0.1s), tests/startup_gfx2hlsl_refusals_check.py ok (0.5s), tests/startup_gfx2hlsl_root_check.py ok (0.7s), 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_quadmask_check.py ok (0.1s), tests/startup_gfx2hlsl_sad_check.py ok (0.3s), tests/startup_gfx2hlsl_sad_hi_msad_check.py ok (0.3s), tests/startup_gfx2hlsl_saveexec_same_reg_check.py ok (0.1s), tests/startup_gfx2hlsl_scalar_arity_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_brev_fold_check.py ok (0.1s), tests/startup_gfx2hlsl_scalar_m0_check.py ok (0.1s), tests/startup_gfx2hlsl_scalar_null_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_table_arity_check.py ok (0.3s), tests/startup_gfx2hlsl_sdwa_cndmask_check.py ok (0.2s), tests/startup_gfx2hlsl_sdwa_cvt_check.py ok (0.2s), tests/startup_gfx2hlsl_sgpr_spill_check.py ok (0.1s), 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 (4.7s), tests/startup_gfx2hlsl_sopk_accum_check.py ok (0.9s), tests/startup_gfx2hlsl_sopk_signext_check.py ok (0.1s), tests/startup_gfx2hlsl_spill_branches_check.py ok (0.8s), tests/startup_gfx2hlsl_swap_check.py ok (0.3s), tests/startup_gfx2hlsl_vopc_sdwa_check.py ok (3.6s), tests/startup_gfx2hlsl_waitcnt_depctr_check.py ok (0.1s), tests/startup_gfx2hlsl_watch_check.py ok (2.4s), tests/startup_image_2d_array_check.py ok (0.1s), tests/startup_image_3d_check.py ok (0.1s), tests/startup_image_gather_lz_check.py ok (0.5s), tests/startup_image_load_d16_check.py ok (0.8s), tests/startup_image_sample_a16_check.py ok (0.2s), tests/startup_image_sample_b_check.py ok (0.2s), tests/startup_image_sample_c_check.py ok (0.2s), tests/startup_image_sample_l_check.py ok (0.2s), tests/startup_image_sample_lod_check.py ok (0.5s), tests/startup_inline_sampler_check.py ok (0.1s), tests/startup_mesh57_depth_only_check.py ok (0.2s), tests/startup_mesh57_lane_spill_check.py ok (0.2s), tests/startup_mesh57_loop_check.py ok (0.2s), tests/startup_mesh57_loop_refusal_check.py ok (0.1s), tests/startup_mesh57_skeleton_check.py ok (0.9s), tests/startup_run_ps1_check.py ok (8.3s), tests/startup_run_sh_check.py skipped (0.1s), tests/startup_sampler_heap_check.py ok (0.1s), tests/startup_shader_cache_rekey_check.py ok (2.1s), tests/startup_smem_address_check.py ok (0.1s), tests/startup_stream_fetch_check.py ok (0.2s), tests/startup_stream_interface_check.py ok (0.2s), tests/startup_translator_check.py ok (0.3s)
  • sccache: 2/2 hits; wall 88.5s

Full-suite Win2025 run (dev + release, default pool) on the same head passed earlier: no failure other than a one-off startup_run_ps1_check failure under load on the first attempt, which passed on rerun (unrelated to this change).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7183500389 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#issuecomment-7183500389). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T05:27:22Z. --- Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `9ab2828926e6760fc8b99545c3b21efe74214dff`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target d3d12_xs_device_obj -- -j 2`): `0.73s` (configure `0.00s`) - Test (`ctest --preset dev -R 'startup_gfx2hlsl_compute_(controls|warp)' --parallel 6 --no-tests=error --output-on-failure`): **2/2 passed** (`2.27s`: `startup_gfx2hlsl_compute_controls` `0.51s`, `startup_gfx2hlsl_compute_warp` `2.15s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target d3d12_xs_device_obj -- -j 2`): `2.28s` (configure `1.79s`) - Test (`ctest --preset release -R 'startup_gfx2hlsl_compute_(controls|warp)' --parallel 6 --no-tests=error --output-on-failure`): **2/2 passed** (`2.13s`: `startup_gfx2hlsl_compute_controls` `0.46s`, `startup_gfx2hlsl_compute_warp` `2.02s`) - **Windows Python checks**: `tests/mesh_heap_sampler_check.py` ok (`0.6s`), `tests/startup_buffer_address_check.py` ok (`0.4s`), `tests/startup_buffer_format_word3_table_check.py` ok (`0.1s`), `tests/startup_compute_image_store_check.py` ok (`0.5s`), `tests/startup_compute_image_store_d16_check.py` ok (`0.5s`), `tests/startup_compute_request_offline_check.py` ok (`0.5s`), `tests/startup_compute_store_format_xyzw_check.py` ok (`0.2s`), `tests/startup_compute_translate_check.py` ok (`0.2s`), `tests/startup_flat_param_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_add_sub_co_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_add_sub_co_ci_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_bfm_b64_check.py` ok (`1.1s`), `tests/startup_gfx2hlsl_bit_alu_check.py` ok (`0.6s`), `tests/startup_gfx2hlsl_capture_check.py` ok (`0.9s`), `tests/startup_gfx2hlsl_cmp16_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.py` ok (`27.5s`), `tests/startup_gfx2hlsl_compare_dst_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_compute_check.py` ok (`0.4s`), `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.2s`), `tests/startup_gfx2hlsl_cvt_pk_int16_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_f32_lg_check.py` ok (`1.1s`), `tests/startup_gfx2hlsl_f32_nan_check.py` ok (`4.3s`), `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_heap_record_check.py` ok (`0.2s`), `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.2s`), `tests/startup_gfx2hlsl_join_symbols_check.py` ok (`0.2s`), `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.3s`), `tests/startup_gfx2hlsl_pack_absdiff_check.py` ok (`2.1s`), `tests/startup_gfx2hlsl_pack_b32_f16_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_readfirstlane_recompute_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_readfirstlane_uniform_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_refusals_check.py` ok (`0.5s`), `tests/startup_gfx2hlsl_root_check.py` ok (`0.7s`), `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_quadmask_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_sad_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_sad_hi_msad_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_saveexec_same_reg_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_scalar_arity_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_scalar_brev_fold_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_scalar_m0_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_scalar_null_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_scalar_table_arity_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_sdwa_cndmask_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_sdwa_cvt_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_sgpr_spill_check.py` ok (`0.1s`), `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 (`4.7s`), `tests/startup_gfx2hlsl_sopk_accum_check.py` ok (`0.9s`), `tests/startup_gfx2hlsl_sopk_signext_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_spill_branches_check.py` ok (`0.8s`), `tests/startup_gfx2hlsl_swap_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_vopc_sdwa_check.py` ok (`3.6s`), `tests/startup_gfx2hlsl_waitcnt_depctr_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_watch_check.py` ok (`2.4s`), `tests/startup_image_2d_array_check.py` ok (`0.1s`), `tests/startup_image_3d_check.py` ok (`0.1s`), `tests/startup_image_gather_lz_check.py` ok (`0.5s`), `tests/startup_image_load_d16_check.py` ok (`0.8s`), `tests/startup_image_sample_a16_check.py` ok (`0.2s`), `tests/startup_image_sample_b_check.py` ok (`0.2s`), `tests/startup_image_sample_c_check.py` ok (`0.2s`), `tests/startup_image_sample_l_check.py` ok (`0.2s`), `tests/startup_image_sample_lod_check.py` ok (`0.5s`), `tests/startup_inline_sampler_check.py` ok (`0.1s`), `tests/startup_mesh57_depth_only_check.py` ok (`0.2s`), `tests/startup_mesh57_lane_spill_check.py` ok (`0.2s`), `tests/startup_mesh57_loop_check.py` ok (`0.2s`), `tests/startup_mesh57_loop_refusal_check.py` ok (`0.1s`), `tests/startup_mesh57_skeleton_check.py` ok (`0.9s`), `tests/startup_run_ps1_check.py` ok (`8.3s`), `tests/startup_run_sh_check.py` skipped (`0.1s`), `tests/startup_sampler_heap_check.py` ok (`0.1s`), `tests/startup_shader_cache_rekey_check.py` ok (`2.1s`), `tests/startup_smem_address_check.py` ok (`0.1s`), `tests/startup_stream_fetch_check.py` ok (`0.2s`), `tests/startup_stream_interface_check.py` ok (`0.2s`), `tests/startup_translator_check.py` ok (`0.3s`) - `sccache`: 2/2 hits; wall `88.5s` Full-suite Win2025 run (dev + release, default pool) on the same head passed earlier: no failure other than a one-off `startup_run_ps1_check` failure under load on the first attempt, which passed on rerun (unrelated to this change). AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 06:02:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T05:27:23Z.


@MasterDomino #2723 is ready for review and merge. Head 9ab28289: both bot threads fixed and resolved (lane-bit inputs required for the new execz mask writes, docs updated). CI green, Win2025 WARP dev + release PASS on this exact head (receipt above, including startup_gfx2hlsl_compute_warp).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7183500613 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#issuecomment-7183500613). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T05:27:23Z. --- @MasterDomino #2723 is ready for review and merge. Head `9ab28289`: both bot threads fixed and resolved (lane-bit inputs required for the new execz mask writes, docs updated). CI green, Win2025 WARP dev + release PASS on this exact head (receipt above, including `startup_gfx2hlsl_compute_warp`). AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 06:02:09 +00:00 (Migrated from github.com)

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

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

@@ -2828,6 +2851,37 @@ def phi_mask_ok(self, key, b, t, effects, succ, targets, index):
                 todo.extend(succ[i])
         return True
 
+    @staticmethod
+    def exec_masked_def(base, ops, key):
+        """True when this instruction writes `key` ('sN' or 'vcc') with a value whose bit is 0 for a lane whose exec bit is
+        clear: s_and with exec_lo into it, or a v_cmp (not v_cmpx) into it."""
+        name = 'vcc_lo' if key == 'vcc' else key
+        if not ops or ops[0] != name:
+            return False
+        if base == 's_and_b32':
+            return len(ops) == 3 and 'exec_lo' in ops[1:]
+        return base.startswith('v_cmp') and not base.startswith('v_cmpx')
+
+    @staticmethod
+    def mask_write_class(base, ops, name, temps):
+        """'keep', 'zero' or 'ones' for a write of mask `name` inside an execz block (see phi_mask_ok), else None."""
+        key = 'vcc' if name == 'vcc_lo' else name
+        if base == 's_mov_b32' and ops[1:] == ['exec_lo']:
+            return 'zero'
+        if base == 's_and_b32' and len(ops) == 3 and 'exec_lo' in ops[1:]:
+            return 'zero'
+        if base.startswith('v_cmp') and not base.startswith('v_cmpx'):
+            return 'zero'
+        if base == 's_orn2_b32' and len(ops) == 3 and ops[2] == 'exec_lo':
+            return 'ones'
+        if base == 's_andn2_b32' and ops == [name, name, 'exec_lo']:
+            return 'keep'

Fix is in 94c692b4, head 9ab28289 (merged with main). CI on 9ab28289 is green: Linux Python checks, gfx1013 fixture translate, Windows build and test. Local commands: python3 -B tests/startup_gfx2hlsl_compute_check.py, startup_gfx2hlsl_mask_overwrite_check.py, startup_gfx2hlsl_mask_data_check.py, startup_gfx2hlsl_refusals_check.py, startup_compute_translate_check.py, tests/docs_links_check.py, git diff --check. Resolving; the Win2025 receipt follows on this head.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4704148856 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#discussion_r4704148856). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T05:11:46Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 2878 ~~~~diff @@ -2828,6 +2851,37 @@ def phi_mask_ok(self, key, b, t, effects, succ, targets, index): todo.extend(succ[i]) return True + @staticmethod + def exec_masked_def(base, ops, key): + """True when this instruction writes `key` ('sN' or 'vcc') with a value whose bit is 0 for a lane whose exec bit is + clear: s_and with exec_lo into it, or a v_cmp (not v_cmpx) into it.""" + name = 'vcc_lo' if key == 'vcc' else key + if not ops or ops[0] != name: + return False + if base == 's_and_b32': + return len(ops) == 3 and 'exec_lo' in ops[1:] + return base.startswith('v_cmp') and not base.startswith('v_cmpx') + + @staticmethod + def mask_write_class(base, ops, name, temps): + """'keep', 'zero' or 'ones' for a write of mask `name` inside an execz block (see phi_mask_ok), else None.""" + key = 'vcc' if name == 'vcc_lo' else name + if base == 's_mov_b32' and ops[1:] == ['exec_lo']: + return 'zero' + if base == 's_and_b32' and len(ops) == 3 and 'exec_lo' in ops[1:]: + return 'zero' + if base.startswith('v_cmp') and not base.startswith('v_cmpx'): + return 'zero' + if base == 's_orn2_b32' and len(ops) == 3 and ops[2] == 'exec_lo': + return 'ones' + if base == 's_andn2_b32' and ops == [name, name, 'exec_lo']: + return 'keep' ~~~~ --- Fix is in 94c692b4, head 9ab28289 (merged with main). CI on 9ab28289 is green: Linux Python checks, gfx1013 fixture translate, Windows build and test. Local commands: `python3 -B tests/startup_gfx2hlsl_compute_check.py`, `startup_gfx2hlsl_mask_overwrite_check.py`, `startup_gfx2hlsl_mask_data_check.py`, `startup_gfx2hlsl_refusals_check.py`, `startup_compute_translate_check.py`, `tests/docs_links_check.py`, `git diff --check`. Resolving; the Win2025 receipt follows on this head. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 06:02:09 +00:00 (Migrated from github.com)

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

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

@@ -2566,7 +2566,12 @@ def execz_refusals(self):
         whose bit is 0 for any lane whose exec bit is clear there: the clear-mask proof keeps exec clear for that lane, and a copy of exec, or X & exec, has that bit clear. M is 0
         at the branch on every path (nothing branches or lands between the zeroing and the branch). So for a lane
         the model skips, the wave's M has that lane's bit 0 whether the wave ran the block or not, which is the
-        model's M (0); a lane that runs the block runs it in the model too. This holds only while M is read per
+        model's M (0); a lane that runs the block runs it in the model too. Writes that leave a skipped lane's bit
+        as it was are accepted for any M: `s_andn2_b32 M, M, exec_lo` and `s_or_b32 M, M, T` where T is an exec-masked
+        value computed in the block (`s_and_b32 T, X, exec_lo` or a v_cmp result), the blend the compiler emits for an
+        i1 phi whose other input is a per-lane value. A v_cmp into M (not v_cmpx) needs M zeroed before the branch
+        like the moves above, and `s_orn2_b32 M, X, exec_lo` needs M set to all ones (`s_mov_b32 M, -1`). Zeroing

Fix is in 94c692b4, head 9ab28289 (merged with main). CI on 9ab28289 is green: Linux Python checks, gfx1013 fixture translate, Windows build and test. Local commands: python3 -B tests/startup_gfx2hlsl_compute_check.py, startup_gfx2hlsl_mask_overwrite_check.py, startup_gfx2hlsl_mask_data_check.py, startup_gfx2hlsl_refusals_check.py, startup_compute_translate_check.py, tests/docs_links_check.py, git diff --check. Resolving; the Win2025 receipt follows on this head.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4704149313 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#discussion_r4704149313). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T05:11:50Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 2573 ~~~~diff @@ -2566,7 +2566,12 @@ def execz_refusals(self): whose bit is 0 for any lane whose exec bit is clear there: the clear-mask proof keeps exec clear for that lane, and a copy of exec, or X & exec, has that bit clear. M is 0 at the branch on every path (nothing branches or lands between the zeroing and the branch). So for a lane the model skips, the wave's M has that lane's bit 0 whether the wave ran the block or not, which is the - model's M (0); a lane that runs the block runs it in the model too. This holds only while M is read per + model's M (0); a lane that runs the block runs it in the model too. Writes that leave a skipped lane's bit + as it was are accepted for any M: `s_andn2_b32 M, M, exec_lo` and `s_or_b32 M, M, T` where T is an exec-masked + value computed in the block (`s_and_b32 T, X, exec_lo` or a v_cmp result), the blend the compiler emits for an + i1 phi whose other input is a per-lane value. A v_cmp into M (not v_cmpx) needs M zeroed before the branch + like the moves above, and `s_orn2_b32 M, X, exec_lo` needs M set to all ones (`s_mov_b32 M, -1`). Zeroing ~~~~ --- Fix is in 94c692b4, head 9ab28289 (merged with main). CI on 9ab28289 is green: Linux Python checks, gfx1013 fixture translate, Windows build and test. Local commands: `python3 -B tests/startup_gfx2hlsl_compute_check.py`, `startup_gfx2hlsl_mask_overwrite_check.py`, `startup_gfx2hlsl_mask_data_check.py`, `startup_gfx2hlsl_refusals_check.py`, `startup_compute_translate_check.py`, `tests/docs_links_check.py`, `git diff --check`. Resolving; the Win2025 receipt follows on this head. AI-assisted; commands listed were executed locally.
MasterDomino commented 2026-11-26 07:00:18 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


Reviewed 9ab28289.

The accepted forms look exact:

  • s_andn2 M, M, exec_lo, and s_or M, M, T with T exec-masked in the block, leave a skipped lane's bit unchanged.
  • A compare, an exec copy, or an s_and with a lane mask needs M zeroed first.
  • s_orn2 M, X, exec_lo needs M set to all ones.
  • Other writes stay refused, and the EXEC-clear proof is still checked on its own for every exec write in the block.

Two requests before merge:

  1. Compute cache revision. This change refuses a form main translated: s_mov_b32 M, 0, then s_and_b32 M, s7, exec_lo with s7 a group id, whose cached HLSL reads the wrong bit. The existing compute test that accepted it is flipped here. main is now at x2w-startup-shader-19cs (since #2708), so please move to 20cs, so that stale cache entries are re-keyed:
    • compute_key in gfx2hlsl.py;
    • compute_revision in d3d12_draw.inl;
    • tests/startup_compute_request_offline_check.py.
  2. Two controls. Two one-line mutants pass startup_gfx2hlsl_compute_check.py and the WARP dispatch: one that lets zero and ones writes mix, and one that accepts s_andn2_b32 M, M, X for any X. The existing mixed-class control uses s7, so it's refused for the lane-bit reason instead. Please add:
    • one mixed case with a compare-derived operand, for example v_cmp_gt_u32 vcc_lo, 3, v0; s_mov_b32 s20, exec_lo; s_orn2_b32 s20, vcc_lo, exec_lo, after s_mov_b32 s20, 0 and again after -1;
    • one s_andn2_b32 s20, s20, vcc_lo refusal.

Smaller points:

  • Lane-mask check: lane_bit_keys treats any s_and_b32 M, X, exec_lo before the branch as lane bits, without the lane-mask check that the block's writes now get. The generic lowering of s_and_b32 s20, s7, exec_lo has the same gap on main, so that can be its own issue.
  • Formatting: there's a collapsed line continuation in phi_mask_ok (or any().
  • Docs: they list "s_orn2 outside the lane mask above" among exec writes, but the new form writes M, not exec. They also mention only s_mov_b32 M, 0/-1, while the code accepts s_movk_i32 too.

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_compute' 45/45, with cases P/Q and the five new controls on WARP and hardware.
  • Neighbours: ctest -R 'startup_gfx2hlsl|startup_compute_translate|startup_compute_request_offline' 277/278. The only failure is startup_gfx2hlsl_fma_mix_dispatch_hardware, as on main on this GPU (#2746).
  • Merged onto main: the controls and the dispatch pass (320 words, 0 mismatches on WARP and hardware), and each new dispatch control is rejected.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6069433944 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#pullrequestreview-6069433944). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-26T06:19:48Z. **Review:** CHANGES_REQUESTED --- Reviewed `9ab28289`. **The accepted forms look exact:** - `s_andn2 M, M, exec_lo`, and `s_or M, M, T` with T exec-masked in the block, leave a skipped lane's bit unchanged. - A compare, an `exec` copy, or an `s_and` with a lane mask needs M zeroed first. - `s_orn2 M, X, exec_lo` needs M set to all ones. - Other writes stay refused, and the EXEC-clear proof is still checked on its own for every `exec` write in the block. **Two requests before merge:** 1. **Compute cache revision.** This change refuses a form `main` translated: `s_mov_b32 M, 0`, then `s_and_b32 M, s7, exec_lo` with s7 a group id, whose cached HLSL reads the wrong bit. The existing compute test that accepted it is flipped here. `main` is now at `x2w-startup-shader-19cs` (since #2708), so please move to `20cs`, so that stale cache entries are re-keyed: - `compute_key` in `gfx2hlsl.py`; - `compute_revision` in `d3d12_draw.inl`; - `tests/startup_compute_request_offline_check.py`. 2. **Two controls.** Two one-line mutants pass `startup_gfx2hlsl_compute_check.py` and the WARP dispatch: one that lets `zero` and `ones` writes mix, and one that accepts `s_andn2_b32 M, M, X` for any X. The existing mixed-class control uses s7, so it's refused for the lane-bit reason instead. Please add: - one mixed case with a compare-derived operand, for example `v_cmp_gt_u32 vcc_lo, 3, v0; s_mov_b32 s20, exec_lo; s_orn2_b32 s20, vcc_lo, exec_lo`, after `s_mov_b32 s20, 0` and again after `-1`; - one `s_andn2_b32 s20, s20, vcc_lo` refusal. **Smaller points:** - **Lane-mask check:** `lane_bit_keys` treats any `s_and_b32 M, X, exec_lo` before the branch as lane bits, without the lane-mask check that the block's writes now get. The generic lowering of `s_and_b32 s20, s7, exec_lo` has the same gap on `main`, so that can be its own issue. - **Formatting:** there's a collapsed line continuation in `phi_mask_ok` (`or any(`). - **Docs:** they list "`s_orn2` outside the lane mask above" among exec writes, but the new form writes M, not `exec`. They also mention only `s_mov_b32 M, 0/-1`, while the code accepts `s_movk_i32` too. 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_compute'` 45/45, with cases P/Q and the five new controls on WARP and hardware. - **Neighbours:** `ctest -R 'startup_gfx2hlsl|startup_compute_translate|startup_compute_request_offline'` 277/278. The only failure is `startup_gfx2hlsl_fma_mix_dispatch_hardware`, as on `main` on this GPU (#2746). - **Merged onto `main`:** the controls and the dispatch pass (320 words, 0 mismatches on WARP and hardware), and each new dispatch control is rejected. AI-assisted; commands listed were executed locally.
R0Y00 commented 2026-11-26 07:00:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T06:32:35Z.

Review: APPROVED


The original head accepted s_and_b32 s20, s7, exec_lo before a preserving execz block, even though the ordinary group ID is not a projected lane mask. The new control reproduces this on the old code and refuses it now. A proven VCC source still translates. Host mask/descriptor controls and the full WARP and RTX compute dispatch suites pass.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6069535692 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#pullrequestreview-6069535692). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T06:32:35Z. **Review:** APPROVED --- The original head accepted s_and_b32 s20, s7, exec_lo before a preserving execz block, even though the ordinary group ID is not a projected lane mask. The new control reproduces this on the old code and refuses it now. A proven VCC source still translates. Host mask/descriptor controls and the full WARP and RTX compute dispatch suites pass.
MasterDomino commented 2026-11-26 07:00:28 +00:00 (Migrated from github.com)

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


@R0Y00, thanks. 1f0c65d3 closes the lane_bit_keys gap I noted (an s_and_b32 M, s7, exec_lo before the block) and adds the control for it.

My change request at 9ab28289 is still open on two points:

  1. Cache revision. This refuses a form that main translated with the wrong bit: s_mov_b32 M, 0, then s_and_b32 M, s7, exec_lo, with s7 a group id, inside a preserving execz block. The existing compute test that accepted it is flipped here. A shader cached under the current compute key keeps that wrong HLSL. This head still keys 18cs, and main is at 19cs. Do you want the bump past main (20cs), or is the stale entry acceptable to you? If it's fine without, I'll dismiss my request.
  2. Two controls for mutants that still pass:
    • zero and ones writes allowed to mix: needs a case with a compare-derived X, for example v_cmp_gt_u32 vcc_lo, 3, v0; s_mov_b32 s20, exec_lo; s_orn2_b32 s20, vcc_lo, exec_lo, after s_mov_b32 s20, 0 and again after -1;
    • s_andn2_b32 M, M, X accepted for any X: needs one refusal such as s_andn2_b32 s20, s20, vcc_lo.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7184560864 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#issuecomment-7184560864). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-26T06:34:14Z. --- @R0Y00, thanks. `1f0c65d3` closes the `lane_bit_keys` gap I noted (an `s_and_b32 M, s7, exec_lo` before the block) and adds the control for it. My change request at `9ab28289` is still open on two points: 1. **Cache revision.** This refuses a form that `main` translated with the wrong bit: `s_mov_b32 M, 0`, then `s_and_b32 M, s7, exec_lo`, with s7 a group id, inside a preserving execz block. The existing compute test that accepted it is flipped here. A shader cached under the current compute key keeps that wrong HLSL. This head still keys `18cs`, and `main` is at `19cs`. Do you want the bump past `main` (`20cs`), or is the stale entry acceptable to you? If it's fine without, I'll dismiss my request. 2. **Two controls** for mutants that still pass: - `zero` and `ones` writes allowed to mix: needs a case with a compare-derived X, for example `v_cmp_gt_u32 vcc_lo, 3, v0; s_mov_b32 s20, exec_lo; s_orn2_b32 s20, vcc_lo, exec_lo`, after `s_mov_b32 s20, 0` and again after `-1`; - `s_andn2_b32 M, M, X` accepted for any X: needs one refusal such as `s_andn2_b32 s20, s20, vcc_lo`. AI-assisted.
upstream-sync closed this pull request 2026-11-26 08:01:44 +00:00
MasterDomino commented 2026-11-26 08:01:44 +00:00 (Migrated from github.com)

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

Review: APPROVED


Approving 129fc835. Both points from my change request are addressed.

  1. Cache revision: both keys move to x2w-startup-shader-21 / 21cs. Against 1f0c65d3, the only other translator change is the line-continuation fix. startup_shader_cache_rekey_check.py and startup_shader_cache_key_check.py pass.

  2. Controls: both mutants that survived before are now caught by startup_gfx2hlsl_compute_check.py:

    • letting zero and ones writes mix (if stale or (...) → if stale:) fails on the new compare-derived mixed case;
    • accepting s_andn2_b32 M, M, X for any X fails on the new vcc_lo refusals.

    The new s_andn2_b32 s20, s20, vcc_lo word, 146a148a, matches llvm-mc 15 (binary mode: "fixture words match llvm-mc").

The head merges cleanly onto current main, and CI is green at the head.

Commands, on Windows 11 build 26300: python -B tests/startup_gfx2hlsl_compute_check.py (plus binary <llvm-mc 15>), startup_shader_cache_rekey_check.py, startup_shader_cache_key_check.py, startup_compute_request_offline_check.py and startup_gfx2hlsl_mask_overwrite_check.py: all exit 0.

Note for #2768, which also takes 21/21cs: once this lands, it needs 22/22cs.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6069948001 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#pullrequestreview-6069948001). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-26T07:18:12Z. **Review:** APPROVED --- Approving `129fc835`. Both points from my change request are addressed. 1. **Cache revision:** both keys move to `x2w-startup-shader-21` / `21cs`. Against `1f0c65d3`, the only other translator change is the line-continuation fix. `startup_shader_cache_rekey_check.py` and `startup_shader_cache_key_check.py` pass. 2. **Controls:** both mutants that survived before are now caught by `startup_gfx2hlsl_compute_check.py`: - letting `zero` and `ones` writes mix (`if stale or (...)` → `if stale:`) fails on the new compare-derived mixed case; - accepting `s_andn2_b32 M, M, X` for any X fails on the new `vcc_lo` refusals. The new `s_andn2_b32 s20, s20, vcc_lo` word, `146a148a`, matches llvm-mc 15 (`binary` mode: "fixture words match llvm-mc"). The head merges cleanly onto current `main`, and CI is green at the head. Commands, on Windows 11 build 26300: `python -B tests/startup_gfx2hlsl_compute_check.py` (plus `binary <llvm-mc 15>`), `startup_shader_cache_rekey_check.py`, `startup_shader_cache_key_check.py`, `startup_compute_request_offline_check.py` and `startup_gfx2hlsl_mask_overwrite_check.py`: all exit 0. Note for #2768, which also takes `21`/`21cs`: once this lands, it needs `22`/`22cs`. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 08:01:55 +00:00 (Migrated from github.com)

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


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

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check startup_indirect_draw_indexed startup_resource_retire_title startup_stream_consumer -- -j 2): 1.67s (configure 0.00s)
    • Test (ctest --preset dev -R '^startup_gfx2hlsl_compute|startup_compute_request_offline' --parallel 3 --no-tests=error --output-on-failure): 48/48 passed (7.35s: startup_gfx2hlsl_compute_mbcnt_warp 0.71s, startup_gfx2hlsl_compute_mbcnt_hardware 0.71s, startup_gfx2hlsl_compute_controls 0.69s, startup_gfx2hlsl_compute_dropped-store_warp 0.29s, startup_gfx2hlsl_compute_c-unpredicated_warp 0.30s, startup_gfx2hlsl_compute_warp 2.99s, startup_gfx2hlsl_compute_hardware 3.02s, startup_gfx2hlsl_compute_swapped-axes_warp 0.30s, startup_gfx2hlsl_compute_b-offset_warp 0.28s, startup_gfx2hlsl_compute_b-offset_hardware 0.28s, startup_gfx2hlsl_compute_c-unpredicated_hardware 0.28s, startup_gfx2hlsl_compute_dropped-store_hardware 0.29s, startup_gfx2hlsl_compute_swapped-axes_hardware 0.30s, startup_gfx2hlsl_compute_m-else-unswitched_hardware 0.28s, startup_gfx2hlsl_compute_n-dropped-broadcast_hardware 0.28s, startup_compute_request_offline 0.63s, startup_gfx2hlsl_compute_m-else-unswitched_warp 0.30s, startup_gfx2hlsl_compute_n-dropped-broadcast_warp 0.31s, startup_gfx2hlsl_compute_f-peer_warp 0.31s, startup_gfx2hlsl_compute_f-broadcast_hardware 0.29s, startup_gfx2hlsl_compute_o-mask-kept_warp 0.29s, startup_gfx2hlsl_compute_f-broadcast_warp 0.29s, startup_gfx2hlsl_compute_h-inner-unpredicated_hardware 0.30s, startup_gfx2hlsl_compute_k-block-entered_warp 0.31s, startup_gfx2hlsl_compute_n-unmasked_warp 0.32s, startup_gfx2hlsl_compute_f-peer_hardware 0.29s, startup_gfx2hlsl_compute_k-block-entered_hardware 0.30s, startup_gfx2hlsl_compute_h-inner-unpredicated_warp 0.28s, startup_gfx2hlsl_compute_g-swapped-offsets_hardware 0.27s, startup_gfx2hlsl_compute_n-unmasked_hardware 0.29s, startup_gfx2hlsl_compute_j-scalar-dropped_hardware 0.27s, startup_gfx2hlsl_compute_g-overlap_warp 0.30s, startup_gfx2hlsl_compute_g-swapped-offsets_warp 0.28s, startup_gfx2hlsl_compute_g-overlap_hardware 0.30s, startup_gfx2hlsl_compute_j-scalar-dropped_warp 0.30s, startup_gfx2hlsl_compute_o-mask-kept_hardware 0.29s, startup_gfx2hlsl_compute_f-second-fill_warp 0.30s, startup_gfx2hlsl_compute_p-dropped-andn2_warp 0.33s, startup_gfx2hlsl_compute_p-dropped-or_warp 0.32s, startup_gfx2hlsl_compute_p-block-entered_warp 0.33s, startup_gfx2hlsl_compute_q-block-entered_warp 0.30s, startup_gfx2hlsl_compute_q-not-all-ones_warp 0.30s, startup_gfx2hlsl_compute_f-second-fill_hardware 0.31s, startup_gfx2hlsl_compute_p-dropped-andn2_hardware 0.32s, startup_gfx2hlsl_compute_p-dropped-or_hardware 0.32s, startup_gfx2hlsl_compute_p-block-entered_hardware 0.32s, startup_gfx2hlsl_compute_q-block-entered_hardware 0.28s, startup_gfx2hlsl_compute_q-not-all-ones_hardware 0.28s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check startup_indirect_draw_indexed startup_resource_retire_title startup_stream_consumer -- -j 2): 7.36s (configure 0.00s)
    • Test (ctest --preset release -R '^startup_gfx2hlsl_compute|startup_compute_request_offline' --parallel 3 --no-tests=error --output-on-failure): 48/48 passed (7.87s: startup_gfx2hlsl_compute_mbcnt_warp 0.65s, startup_gfx2hlsl_compute_b-offset_warp 0.33s, startup_gfx2hlsl_compute_c-unpredicated_warp 0.32s, startup_gfx2hlsl_compute_controls 0.79s, startup_gfx2hlsl_compute_dropped-store_warp 0.29s, startup_gfx2hlsl_compute_dropped-store_hardware 0.33s, startup_gfx2hlsl_compute_warp 3.01s, startup_gfx2hlsl_compute_swapped-axes_hardware 0.30s, startup_gfx2hlsl_compute_hardware 3.05s, startup_gfx2hlsl_compute_swapped-axes_warp 0.29s, startup_gfx2hlsl_compute_b-offset_hardware 0.37s, startup_gfx2hlsl_compute_c-unpredicated_hardware 0.35s, startup_gfx2hlsl_compute_m-else-unswitched_warp 0.32s, startup_gfx2hlsl_compute_n-dropped-broadcast_warp 0.28s, startup_compute_request_offline 0.73s, startup_gfx2hlsl_compute_mbcnt_hardware 0.73s, startup_gfx2hlsl_compute_m-else-unswitched_hardware 0.44s, startup_gfx2hlsl_compute_n-dropped-broadcast_hardware 0.48s, startup_gfx2hlsl_compute_g-swapped-offsets_hardware 0.41s, startup_gfx2hlsl_compute_f-broadcast_warp 0.33s, startup_gfx2hlsl_compute_f-peer_warp 0.32s, startup_gfx2hlsl_compute_h-inner-unpredicated_warp 0.37s, startup_gfx2hlsl_compute_j-scalar-dropped_warp 0.36s, startup_gfx2hlsl_compute_k-block-entered_warp 0.39s, startup_gfx2hlsl_compute_k-block-entered_hardware 0.38s, startup_gfx2hlsl_compute_g-overlap_warp 0.36s, startup_gfx2hlsl_compute_g-swapped-offsets_warp 0.31s, startup_gfx2hlsl_compute_j-scalar-dropped_hardware 0.33s, startup_gfx2hlsl_compute_f-peer_hardware 0.30s, startup_gfx2hlsl_compute_h-inner-unpredicated_hardware 0.30s, startup_gfx2hlsl_compute_f-broadcast_hardware 0.31s, startup_gfx2hlsl_compute_g-overlap_hardware 0.29s, startup_gfx2hlsl_compute_f-second-fill_warp 0.30s, startup_gfx2hlsl_compute_n-unmasked_warp 0.29s, startup_gfx2hlsl_compute_o-mask-kept_warp 0.29s, startup_gfx2hlsl_compute_p-dropped-andn2_warp 0.31s, startup_gfx2hlsl_compute_p-dropped-or_warp 0.32s, startup_gfx2hlsl_compute_p-block-entered_warp 0.30s, startup_gfx2hlsl_compute_q-block-entered_warp 0.32s, startup_gfx2hlsl_compute_q-not-all-ones_warp 0.32s, startup_gfx2hlsl_compute_f-second-fill_hardware 0.29s, startup_gfx2hlsl_compute_o-mask-kept_hardware 0.27s, startup_gfx2hlsl_compute_n-unmasked_hardware 0.31s, startup_gfx2hlsl_compute_p-dropped-andn2_hardware 0.30s, startup_gfx2hlsl_compute_p-dropped-or_hardware 0.34s, startup_gfx2hlsl_compute_p-block-entered_hardware 0.32s, startup_gfx2hlsl_compute_q-block-entered_hardware 0.30s, startup_gfx2hlsl_compute_q-not-all-ones_hardware 0.27s)
  • Windows Python checks: tests/mesh_heap_sampler_check.py ok (0.7s), tests/startup_buffer_address_check.py ok (0.5s), tests/startup_buffer_format_word3_table_check.py ok (0.1s), tests/startup_compute_global_load_check.py ok (0.2s), tests/startup_compute_image_store_check.py ok (0.6s), tests/startup_compute_image_store_d16_check.py ok (0.5s), tests/startup_compute_request_offline_check.py ok (0.5s), tests/startup_compute_store_format_xyzw_check.py ok (0.2s), tests/startup_compute_translate_check.py ok (0.2s), tests/startup_flat_param_check.py ok (0.2s), tests/startup_gfx2hlsl_add_sub_co_check.py ok (0.1s), tests/startup_gfx2hlsl_add_sub_co_ci_check.py ok (0.2s), tests/startup_gfx2hlsl_bfm_b64_check.py ok (1.2s), tests/startup_gfx2hlsl_bit_alu_check.py ok (0.7s), tests/startup_gfx2hlsl_capture_check.py ok (1.2s), tests/startup_gfx2hlsl_cmp16_check.py ok (0.3s), tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.py ok (33.6s), tests/startup_gfx2hlsl_compare_dst_check.py ok (0.1s), tests/startup_gfx2hlsl_compute_check.py ok (0.6s), tests/startup_gfx2hlsl_const_copy_join_check.py ok (0.1s), 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.2s), tests/startup_gfx2hlsl_cvt_pk_int16_check.py ok (0.3s), tests/startup_gfx2hlsl_f32_lg_check.py ok (1.3s), tests/startup_gfx2hlsl_f32_nan_check.py ok (4.9s), tests/startup_gfx2hlsl_fma_mix_check.py ok (0.2s), tests/startup_gfx2hlsl_getpc_refusal_check.py ok (0.2s), tests/startup_gfx2hlsl_handler_arity_check.py ok (0.1s), tests/startup_gfx2hlsl_heap_record_check.py ok (0.2s), tests/startup_gfx2hlsl_heap_word_check.py ok (0.2s), 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.2s), 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 (2.5s), tests/startup_gfx2hlsl_pack_b32_f16_check.py ok (0.2s), tests/startup_gfx2hlsl_readfirstlane_load_recompute_check.py ok (0.1s), tests/startup_gfx2hlsl_readfirstlane_recompute_check.py ok (0.1s), tests/startup_gfx2hlsl_readfirstlane_uniform_check.py ok (0.1s), tests/startup_gfx2hlsl_refusals_check.py ok (0.6s), tests/startup_gfx2hlsl_root_check.py ok (0.9s), 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_quadmask_b64_check.py ok (0.1s), tests/startup_gfx2hlsl_s_quadmask_check.py ok (0.1s), tests/startup_gfx2hlsl_sad_check.py ok (0.4s), tests/startup_gfx2hlsl_sad_hi_msad_check.py ok (0.3s), 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.4s), tests/startup_gfx2hlsl_sdwa_cndmask_check.py ok (0.2s), 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 (5.8s), tests/startup_gfx2hlsl_sopk_accum_check.py ok (1.1s), tests/startup_gfx2hlsl_sopk_signext_check.py ok (0.1s), tests/startup_gfx2hlsl_spill_branches_check.py ok (1.1s), tests/startup_gfx2hlsl_swap_check.py ok (0.3s), tests/startup_gfx2hlsl_vopc_sdwa_check.py ok (4.5s), tests/startup_gfx2hlsl_waitcnt_depctr_check.py ok (0.1s), tests/startup_gfx2hlsl_watch_check.py ok (2.7s), 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.6s), tests/startup_image_load_d16_check.py ok (1.0s), tests/startup_image_sample_a16_check.py ok (0.2s), tests/startup_image_sample_b_check.py ok (0.2s), tests/startup_image_sample_c_check.py ok (0.3s), tests/startup_image_sample_l_check.py ok (0.2s), tests/startup_image_sample_lod_check.py ok (0.6s), tests/startup_inline_sampler_check.py ok (0.2s), tests/startup_mesh57_depth_only_check.py ok (0.2s), tests/startup_mesh57_lane_spill_check.py ok (0.2s), tests/startup_mesh57_loop_check.py ok (0.2s), tests/startup_mesh57_loop_refusal_check.py ok (0.2s), tests/startup_mesh57_skeleton_check.py ok (1.2s), tests/startup_run_ps1_check.py ok (10.8s), 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 (2.8s), tests/startup_smem_address_check.py ok (0.2s), tests/startup_stream_fetch_check.py ok (0.2s), tests/startup_stream_interface_check.py ok (0.2s), tests/startup_translator_check.py ok (0.5s)
  • sccache: 20/20 hits; wall 119.5s
  • Real GPU: tested on RTX 3090 through vkd3d-proton (Linux): 55/55 at 129fc835 (the PR tests, warp-named ones run on that GPU there, not on WARP)
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7185317611 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#issuecomment-7185317611). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T07:18:34Z. --- Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `129fc835bc599507d52e650093934c3cab537070`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check startup_indirect_draw_indexed startup_resource_retire_title startup_stream_consumer -- -j 2`): `1.67s` (configure `0.00s`) - Test (`ctest --preset dev -R '^startup_gfx2hlsl_compute|startup_compute_request_offline' --parallel 3 --no-tests=error --output-on-failure`): **48/48 passed** (`7.35s`: `startup_gfx2hlsl_compute_mbcnt_warp` `0.71s`, `startup_gfx2hlsl_compute_mbcnt_hardware` `0.71s`, `startup_gfx2hlsl_compute_controls` `0.69s`, `startup_gfx2hlsl_compute_dropped-store_warp` `0.29s`, `startup_gfx2hlsl_compute_c-unpredicated_warp` `0.30s`, `startup_gfx2hlsl_compute_warp` `2.99s`, `startup_gfx2hlsl_compute_hardware` `3.02s`, `startup_gfx2hlsl_compute_swapped-axes_warp` `0.30s`, `startup_gfx2hlsl_compute_b-offset_warp` `0.28s`, `startup_gfx2hlsl_compute_b-offset_hardware` `0.28s`, `startup_gfx2hlsl_compute_c-unpredicated_hardware` `0.28s`, `startup_gfx2hlsl_compute_dropped-store_hardware` `0.29s`, `startup_gfx2hlsl_compute_swapped-axes_hardware` `0.30s`, `startup_gfx2hlsl_compute_m-else-unswitched_hardware` `0.28s`, `startup_gfx2hlsl_compute_n-dropped-broadcast_hardware` `0.28s`, `startup_compute_request_offline` `0.63s`, `startup_gfx2hlsl_compute_m-else-unswitched_warp` `0.30s`, `startup_gfx2hlsl_compute_n-dropped-broadcast_warp` `0.31s`, `startup_gfx2hlsl_compute_f-peer_warp` `0.31s`, `startup_gfx2hlsl_compute_f-broadcast_hardware` `0.29s`, `startup_gfx2hlsl_compute_o-mask-kept_warp` `0.29s`, `startup_gfx2hlsl_compute_f-broadcast_warp` `0.29s`, `startup_gfx2hlsl_compute_h-inner-unpredicated_hardware` `0.30s`, `startup_gfx2hlsl_compute_k-block-entered_warp` `0.31s`, `startup_gfx2hlsl_compute_n-unmasked_warp` `0.32s`, `startup_gfx2hlsl_compute_f-peer_hardware` `0.29s`, `startup_gfx2hlsl_compute_k-block-entered_hardware` `0.30s`, `startup_gfx2hlsl_compute_h-inner-unpredicated_warp` `0.28s`, `startup_gfx2hlsl_compute_g-swapped-offsets_hardware` `0.27s`, `startup_gfx2hlsl_compute_n-unmasked_hardware` `0.29s`, `startup_gfx2hlsl_compute_j-scalar-dropped_hardware` `0.27s`, `startup_gfx2hlsl_compute_g-overlap_warp` `0.30s`, `startup_gfx2hlsl_compute_g-swapped-offsets_warp` `0.28s`, `startup_gfx2hlsl_compute_g-overlap_hardware` `0.30s`, `startup_gfx2hlsl_compute_j-scalar-dropped_warp` `0.30s`, `startup_gfx2hlsl_compute_o-mask-kept_hardware` `0.29s`, `startup_gfx2hlsl_compute_f-second-fill_warp` `0.30s`, `startup_gfx2hlsl_compute_p-dropped-andn2_warp` `0.33s`, `startup_gfx2hlsl_compute_p-dropped-or_warp` `0.32s`, `startup_gfx2hlsl_compute_p-block-entered_warp` `0.33s`, `startup_gfx2hlsl_compute_q-block-entered_warp` `0.30s`, `startup_gfx2hlsl_compute_q-not-all-ones_warp` `0.30s`, `startup_gfx2hlsl_compute_f-second-fill_hardware` `0.31s`, `startup_gfx2hlsl_compute_p-dropped-andn2_hardware` `0.32s`, `startup_gfx2hlsl_compute_p-dropped-or_hardware` `0.32s`, `startup_gfx2hlsl_compute_p-block-entered_hardware` `0.32s`, `startup_gfx2hlsl_compute_q-block-entered_hardware` `0.28s`, `startup_gfx2hlsl_compute_q-not-all-ones_hardware` `0.28s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check startup_indirect_draw_indexed startup_resource_retire_title startup_stream_consumer -- -j 2`): `7.36s` (configure `0.00s`) - Test (`ctest --preset release -R '^startup_gfx2hlsl_compute|startup_compute_request_offline' --parallel 3 --no-tests=error --output-on-failure`): **48/48 passed** (`7.87s`: `startup_gfx2hlsl_compute_mbcnt_warp` `0.65s`, `startup_gfx2hlsl_compute_b-offset_warp` `0.33s`, `startup_gfx2hlsl_compute_c-unpredicated_warp` `0.32s`, `startup_gfx2hlsl_compute_controls` `0.79s`, `startup_gfx2hlsl_compute_dropped-store_warp` `0.29s`, `startup_gfx2hlsl_compute_dropped-store_hardware` `0.33s`, `startup_gfx2hlsl_compute_warp` `3.01s`, `startup_gfx2hlsl_compute_swapped-axes_hardware` `0.30s`, `startup_gfx2hlsl_compute_hardware` `3.05s`, `startup_gfx2hlsl_compute_swapped-axes_warp` `0.29s`, `startup_gfx2hlsl_compute_b-offset_hardware` `0.37s`, `startup_gfx2hlsl_compute_c-unpredicated_hardware` `0.35s`, `startup_gfx2hlsl_compute_m-else-unswitched_warp` `0.32s`, `startup_gfx2hlsl_compute_n-dropped-broadcast_warp` `0.28s`, `startup_compute_request_offline` `0.73s`, `startup_gfx2hlsl_compute_mbcnt_hardware` `0.73s`, `startup_gfx2hlsl_compute_m-else-unswitched_hardware` `0.44s`, `startup_gfx2hlsl_compute_n-dropped-broadcast_hardware` `0.48s`, `startup_gfx2hlsl_compute_g-swapped-offsets_hardware` `0.41s`, `startup_gfx2hlsl_compute_f-broadcast_warp` `0.33s`, `startup_gfx2hlsl_compute_f-peer_warp` `0.32s`, `startup_gfx2hlsl_compute_h-inner-unpredicated_warp` `0.37s`, `startup_gfx2hlsl_compute_j-scalar-dropped_warp` `0.36s`, `startup_gfx2hlsl_compute_k-block-entered_warp` `0.39s`, `startup_gfx2hlsl_compute_k-block-entered_hardware` `0.38s`, `startup_gfx2hlsl_compute_g-overlap_warp` `0.36s`, `startup_gfx2hlsl_compute_g-swapped-offsets_warp` `0.31s`, `startup_gfx2hlsl_compute_j-scalar-dropped_hardware` `0.33s`, `startup_gfx2hlsl_compute_f-peer_hardware` `0.30s`, `startup_gfx2hlsl_compute_h-inner-unpredicated_hardware` `0.30s`, `startup_gfx2hlsl_compute_f-broadcast_hardware` `0.31s`, `startup_gfx2hlsl_compute_g-overlap_hardware` `0.29s`, `startup_gfx2hlsl_compute_f-second-fill_warp` `0.30s`, `startup_gfx2hlsl_compute_n-unmasked_warp` `0.29s`, `startup_gfx2hlsl_compute_o-mask-kept_warp` `0.29s`, `startup_gfx2hlsl_compute_p-dropped-andn2_warp` `0.31s`, `startup_gfx2hlsl_compute_p-dropped-or_warp` `0.32s`, `startup_gfx2hlsl_compute_p-block-entered_warp` `0.30s`, `startup_gfx2hlsl_compute_q-block-entered_warp` `0.32s`, `startup_gfx2hlsl_compute_q-not-all-ones_warp` `0.32s`, `startup_gfx2hlsl_compute_f-second-fill_hardware` `0.29s`, `startup_gfx2hlsl_compute_o-mask-kept_hardware` `0.27s`, `startup_gfx2hlsl_compute_n-unmasked_hardware` `0.31s`, `startup_gfx2hlsl_compute_p-dropped-andn2_hardware` `0.30s`, `startup_gfx2hlsl_compute_p-dropped-or_hardware` `0.34s`, `startup_gfx2hlsl_compute_p-block-entered_hardware` `0.32s`, `startup_gfx2hlsl_compute_q-block-entered_hardware` `0.30s`, `startup_gfx2hlsl_compute_q-not-all-ones_hardware` `0.27s`) - **Windows Python checks**: `tests/mesh_heap_sampler_check.py` ok (`0.7s`), `tests/startup_buffer_address_check.py` ok (`0.5s`), `tests/startup_buffer_format_word3_table_check.py` ok (`0.1s`), `tests/startup_compute_global_load_check.py` ok (`0.2s`), `tests/startup_compute_image_store_check.py` ok (`0.6s`), `tests/startup_compute_image_store_d16_check.py` ok (`0.5s`), `tests/startup_compute_request_offline_check.py` ok (`0.5s`), `tests/startup_compute_store_format_xyzw_check.py` ok (`0.2s`), `tests/startup_compute_translate_check.py` ok (`0.2s`), `tests/startup_flat_param_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_add_sub_co_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_add_sub_co_ci_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_bfm_b64_check.py` ok (`1.2s`), `tests/startup_gfx2hlsl_bit_alu_check.py` ok (`0.7s`), `tests/startup_gfx2hlsl_capture_check.py` ok (`1.2s`), `tests/startup_gfx2hlsl_cmp16_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.py` ok (`33.6s`), `tests/startup_gfx2hlsl_compare_dst_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_compute_check.py` ok (`0.6s`), `tests/startup_gfx2hlsl_const_copy_join_check.py` ok (`0.1s`), `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.2s`), `tests/startup_gfx2hlsl_cvt_pk_int16_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_f32_lg_check.py` ok (`1.3s`), `tests/startup_gfx2hlsl_f32_nan_check.py` ok (`4.9s`), `tests/startup_gfx2hlsl_fma_mix_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_getpc_refusal_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_handler_arity_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_heap_record_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_heap_word_check.py` ok (`0.2s`), `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.2s`), `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 (`2.5s`), `tests/startup_gfx2hlsl_pack_b32_f16_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_readfirstlane_load_recompute_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_readfirstlane_recompute_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_readfirstlane_uniform_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_refusals_check.py` ok (`0.6s`), `tests/startup_gfx2hlsl_root_check.py` ok (`0.9s`), `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_quadmask_b64_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_s_quadmask_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_sad_check.py` ok (`0.4s`), `tests/startup_gfx2hlsl_sad_hi_msad_check.py` ok (`0.3s`), `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.4s`), `tests/startup_gfx2hlsl_sdwa_cndmask_check.py` ok (`0.2s`), `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 (`5.8s`), `tests/startup_gfx2hlsl_sopk_accum_check.py` ok (`1.1s`), `tests/startup_gfx2hlsl_sopk_signext_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_spill_branches_check.py` ok (`1.1s`), `tests/startup_gfx2hlsl_swap_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_vopc_sdwa_check.py` ok (`4.5s`), `tests/startup_gfx2hlsl_waitcnt_depctr_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_watch_check.py` ok (`2.7s`), `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.6s`), `tests/startup_image_load_d16_check.py` ok (`1.0s`), `tests/startup_image_sample_a16_check.py` ok (`0.2s`), `tests/startup_image_sample_b_check.py` ok (`0.2s`), `tests/startup_image_sample_c_check.py` ok (`0.3s`), `tests/startup_image_sample_l_check.py` ok (`0.2s`), `tests/startup_image_sample_lod_check.py` ok (`0.6s`), `tests/startup_inline_sampler_check.py` ok (`0.2s`), `tests/startup_mesh57_depth_only_check.py` ok (`0.2s`), `tests/startup_mesh57_lane_spill_check.py` ok (`0.2s`), `tests/startup_mesh57_loop_check.py` ok (`0.2s`), `tests/startup_mesh57_loop_refusal_check.py` ok (`0.2s`), `tests/startup_mesh57_skeleton_check.py` ok (`1.2s`), `tests/startup_run_ps1_check.py` ok (`10.8s`), `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 (`2.8s`), `tests/startup_smem_address_check.py` ok (`0.2s`), `tests/startup_stream_fetch_check.py` ok (`0.2s`), `tests/startup_stream_interface_check.py` ok (`0.2s`), `tests/startup_translator_check.py` ok (`0.5s`) - `sccache`: 20/20 hits; wall `119.5s` - Real GPU: tested on RTX 3090 through vkd3d-proton (Linux): 55/55 at `129fc835` (the PR tests, warp-named ones run on that GPU there, not on WARP)
tedin7 commented 2026-11-26 08:01:55 +00:00 (Migrated from github.com)

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


@MasterDomino both requests and the smaller points are done at head 129fc835b (merged with current main, on top of the lane-bit commit 1f0c65d37).

  1. Compute cache revision. The key moved to x2w-startup-shader-21cs in compute_key (gfx2hlsl.py), compute_revision (d3d12_draw.inl) and tests/startup_compute_request_offline_check.py (known-answer key 0x90041d02ef75b4e9). main is already at 20/20cs (#2006), and startup_shader_cache_rekey_check.py requires the pixel and compute revisions to move together, so the pixel revision is 21 too, with its known-answer keys and literals in the other tests that spell it, and the note in docs/startup-runtime.md.
  2. Controls, in startup_gfx2hlsl_compute_check.py:
    • mixed classes with a compare-derived operand (v_cmp_gt_u32 vcc_lo, 3, v0; s_mov_b32 s20, exec_lo; s_orn2_b32 s20, vcc_lo, exec_lo) after s_mov_b32 s20, 0 and again after -1: refused;
    • s_andn2_b32 s20, s20, vcc_lo after 0, with no setting, and after -1: refused.
      I ran both of your mutants locally: allowing zero + ones to mix, and accepting s_andn2_b32 M, M, X for any X. Each now fails the check with accepted, expected a refusal naming 'definition of s20, live where the block joins'.
  3. Smaller points. The collapsed line continuation in phi_mask_ok is split. The docs now say s_orn2 into exec (the new form writes M), and mention s_movk_i32 M, 0. The lane_bit_keys gap stays out of this PR, as you suggested.

Commands run:

  • python3 -B tests/startup_gfx2hlsl_compute_check.py, startup_compute_request_offline_check.py, startup_shader_cache_rekey_check.py, startup_shader_cache_key_check.py, startup_gfx2hlsl_fract_check.py and the other tests that spell the revision -> pass
  • Windows Server 2025 dev + release on 129fc835b: ctest -R '^startup_gfx2hlsl_compute|startup_compute_request_offline' 48/48 on both, plus the full py-check list; receipt in the comment below

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7185317898 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2723#issuecomment-7185317898). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T07:18:35Z. --- @MasterDomino both requests and the smaller points are done at head `129fc835b` (merged with current `main`, on top of the lane-bit commit `1f0c65d37`). 1. **Compute cache revision.** The key moved to `x2w-startup-shader-21cs` in `compute_key` (`gfx2hlsl.py`), `compute_revision` (`d3d12_draw.inl`) and `tests/startup_compute_request_offline_check.py` (known-answer key `0x90041d02ef75b4e9`). `main` is already at `20`/`20cs` (#2006), and `startup_shader_cache_rekey_check.py` requires the pixel and compute revisions to move together, so the pixel revision is `21` too, with its known-answer keys and literals in the other tests that spell it, and the note in `docs/startup-runtime.md`. 2. **Controls**, in `startup_gfx2hlsl_compute_check.py`: - mixed classes with a compare-derived operand (`v_cmp_gt_u32 vcc_lo, 3, v0; s_mov_b32 s20, exec_lo; s_orn2_b32 s20, vcc_lo, exec_lo`) after `s_mov_b32 s20, 0` and again after `-1`: refused; - `s_andn2_b32 s20, s20, vcc_lo` after `0`, with no setting, and after `-1`: refused. I ran both of your mutants locally: allowing `zero` + `ones` to mix, and accepting `s_andn2_b32 M, M, X` for any X. Each now fails the check with `accepted, expected a refusal naming 'definition of s20, live where the block joins'`. 3. **Smaller points.** The collapsed line continuation in `phi_mask_ok` is split. The docs now say `s_orn2` into exec (the new form writes M), and mention `s_movk_i32 M, 0`. The `lane_bit_keys` gap stays out of this PR, as you suggested. Commands run: - `python3 -B tests/startup_gfx2hlsl_compute_check.py`, `startup_compute_request_offline_check.py`, `startup_shader_cache_rekey_check.py`, `startup_shader_cache_key_check.py`, `startup_gfx2hlsl_fract_check.py` and the other tests that spell the revision -> pass - Windows Server 2025 dev + release on `129fc835b`: `ctest -R '^startup_gfx2hlsl_compute|startup_compute_request_offline'` 48/48 on both, plus the full py-check list; receipt in the comment below AI-assisted; commands listed were executed locally.
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!2715
No description provided.