shader: lower v_mad_u64_u32 and v_mad_i64_i32 in gfx2hlsl (Part of #1723) #2040

Merged
tedin7 merged 12 commits from upstream-pr/2047 into main 2026-11-26 05:47:38 +00:00
tedin7 commented 2026-11-24 23:37:52 +00:00 (Migrated from github.com)

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


Part of #1723

What this unblocks: shaders that use 64-bit multiply-add (v_mad_u64_u32, v_mad_i64_i32) now translate in gfx2hlsl.py instead of being refused.

  • Lowers D = S0 * S1 + S2 modulo 2^64 into a v[d:d+1] pair using 16-bit partial products (no 64-bit HLSL type).
  • Unsigned form writes the carry-out of the 64-bit add to vcc, vcc_lo or one SGPR (tracked as a lane mask, so v_cndmask_b32 can read it).
  • Signed form is accepted only with the null destination (its carry-out is not established); other forms, modifiers and wrong operand shapes are refused.
  • Same semantics as the existing pixel_aot lowering (#1278).

Verification: (local Linux run; Win2025 not run for this pure-Python change)

  • python3 -I -B tests/startup_gfx2hlsl_mad64_check.py: pass (700 inputs per form against a 64-bit Python reference, carry mask, overlap, 7 refusals).
  • Same test against origin/main gfx2hlsl.py: fails (mulhi32 missing).
  • startup_gfx2hlsl_shift64_check.py, _bit_alu_check.py, _op_refusals_check.py, _operand_count_check.py, _mad_check.py: pass.
  • Registered as startup_gfx2hlsl_mad64 in CMakeLists.txt.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6593641718 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2047). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T23:37:52Z. --- Part of #1723 What this unblocks: shaders that use 64-bit multiply-add (`v_mad_u64_u32`, `v_mad_i64_i32`) now translate in `gfx2hlsl.py` instead of being refused. - Lowers `D = S0 * S1 + S2` modulo 2^64 into a `v[d:d+1]` pair using 16-bit partial products (no 64-bit HLSL type). - Unsigned form writes the carry-out of the 64-bit add to `vcc`, `vcc_lo` or one SGPR (tracked as a lane mask, so `v_cndmask_b32` can read it). - Signed form is accepted only with the `null` destination (its carry-out is not established); other forms, modifiers and wrong operand shapes are refused. - Same semantics as the existing `pixel_aot` lowering (#1278). Verification: (local Linux run; Win2025 not run for this pure-Python change) - `python3 -I -B tests/startup_gfx2hlsl_mad64_check.py`: pass (700 inputs per form against a 64-bit Python reference, carry mask, overlap, 7 refusals). - Same test against `origin/main` `gfx2hlsl.py`: fails (`mulhi32 missing`). - `startup_gfx2hlsl_shift64_check.py`, `_bit_alu_check.py`, `_op_refusals_check.py`, `_operand_count_check.py`, `_mad_check.py`: pass. - Registered as `startup_gfx2hlsl_mad64` in `CMakeLists.txt`. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-25 01:01:18 +00:00 (Migrated from github.com)

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

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e6e8f6b571

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

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

Review: COMMENTED


No description provided.

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

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


Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T23:43:38.707995Z e6e8f6b PR opened
ℹ️ About Codex in GitHub

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

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

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

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

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T23:45:36Z.


Ran it, broke the helpers six ways — all caught — and checked the arithmetic against exact 64-bit values

out/pe-env/Scripts/python.exe -B tests/startup_gfx2hlsl_mad64_check.py
PASS      exit 0
mutation result
mulhi32 drops mid >> 16 caught
mulhi32 builds mid without p00 >> 16 caught
mad64u: c0 = lo < pl → lo <= pl caught
mad64u: hi = hs + c0 → hi = hs caught
mad64u: the carry-out z only looks at hs < ph caught
mad64i drops one sign-correction term caught

The second one is the one I expected to survive: dropping p00 >> 16 from mid changes the high product only when a low-word product carries into
the middle term, which needs operands above 0xffff in a specific pattern. It is caught.

The arithmetic, against a reference that uses real 64-bit integers

I transcribed mulhi32, mad64u and mad64i and compared the resulting 64-bit value with a * b + (chi:clo) computed exactly, for both the
unsigned and the signed reading of the two 32-bit factors:

edge values (0, 1, 2, 0x7fffffff, 0x80000000, 0xfffe, 0xffff, 0x10000, 0xfffffffe, 0xffffffff)
  x four (clo, chi) pairs: 400 cases   unsigned mismatches 0   signed mismatches 0

random: 200000 cases                unsigned mismatches 0   signed mismatches 0

and the lane-mask carry-out on its own:

z vs the true carry out of the 64-bit add: 0 mismatches in 50000 random cases

That last check is the one I would keep if you only kept one: z is assembled from two comparisons (hs < ph and hi < hs), and a
single-comparison version is exactly mutation five — which survives a text comparison but not a value comparison.

The mulhi32 decomposition, written out

a*b = p11·2^32 + (p01 + p10)·2^16 + p00, so the high word is p11 + (p01 >> 16) + (p10 >> 16) + carry-out-of-mid, where
mid = (p00 >> 16) + (p01 & 0xffff) + (p10 & 0xffff). All four terms are needed and all four are pinned by the mutations above. This is worth a
sentence in the helper comment: a reader who knows the identity will check it in ten seconds, and one who does not will assume p00 only affects
pl.

Two design choices I would like stated in the description

  1. The signed form's carry-out is not established, so only null is accepted. That is an honest refusal, and it is the right call — but it means
    v_mad_i64_i32 with a real lane mask is still a refusal after this PR, so the PR does not "unblock signed 64-bit carry chains". The title says
    "lower v_mad_u64_u32 and v_mad_i64_i32", which reads as both being complete.
  2. mad64i returns z = 0u rather than omitting it. Given the caller never reads it in the signed path, that is fine; a comment saying so would
    stop someone from "fixing" it later.

What I could not check

No shader compiled or run — the checks above evaluate the emitted expressions in Python. The claim that this matches the pixel_aot lowering from
#1278 is a comparison I did not make; if the two emit different expressions for the same instruction, that is the thing a reviewer cannot see from
either file alone.

Notes

  • AI-assisted review.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7147763024 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2047#issuecomment-7147763024). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-24T23:45:36Z. --- ## Ran it, broke the helpers six ways — all caught — and checked the arithmetic against exact 64-bit values ```powershell out/pe-env/Scripts/python.exe -B tests/startup_gfx2hlsl_mad64_check.py PASS exit 0 ``` | mutation | result | |---|---| | `mulhi32` drops `mid >> 16` | **caught** | | `mulhi32` builds `mid` without `p00 >> 16` | **caught** | | `mad64u`: `c0 = lo < pl` → `lo <= pl` | **caught** | | `mad64u`: `hi = hs + c0` → `hi = hs` | **caught** | | `mad64u`: the carry-out `z` only looks at `hs < ph` | **caught** | | `mad64i` drops one sign-correction term | **caught** | The second one is the one I expected to survive: dropping `p00 >> 16` from `mid` changes the high product only when a low-word product carries into the middle term, which needs operands above `0xffff` in a specific pattern. It is caught. ## The arithmetic, against a reference that uses real 64-bit integers I transcribed `mulhi32`, `mad64u` and `mad64i` and compared the resulting 64-bit value with `a * b + (chi:clo)` computed exactly, for both the unsigned and the signed reading of the two 32-bit factors: ```text edge values (0, 1, 2, 0x7fffffff, 0x80000000, 0xfffe, 0xffff, 0x10000, 0xfffffffe, 0xffffffff) x four (clo, chi) pairs: 400 cases unsigned mismatches 0 signed mismatches 0 random: 200000 cases unsigned mismatches 0 signed mismatches 0 ``` and the lane-mask carry-out on its own: ```text z vs the true carry out of the 64-bit add: 0 mismatches in 50000 random cases ``` That last check is the one I would keep if you only kept one: `z` is assembled from **two** comparisons (`hs < ph` and `hi < hs`), and a single-comparison version is exactly mutation five — which survives a text comparison but not a value comparison. ## The `mulhi32` decomposition, written out `a*b = p11·2^32 + (p01 + p10)·2^16 + p00`, so the high word is `p11 + (p01 >> 16) + (p10 >> 16) + carry-out-of-mid`, where `mid = (p00 >> 16) + (p01 & 0xffff) + (p10 & 0xffff)`. All four terms are needed and all four are pinned by the mutations above. This is worth a sentence in the helper comment: a reader who knows the identity will check it in ten seconds, and one who does not will assume `p00` only affects `pl`. ## Two design choices I would like stated in the description 1. **The signed form's carry-out is not established, so only `null` is accepted.** That is an honest refusal, and it is the right call — but it means `v_mad_i64_i32` with a real lane mask is *still* a refusal after this PR, so the PR does not "unblock signed 64-bit carry chains". The title says "lower `v_mad_u64_u32` and `v_mad_i64_i32`", which reads as both being complete. 2. **`mad64i` returns `z = 0u`** rather than omitting it. Given the caller never reads it in the signed path, that is fine; a comment saying so would stop someone from "fixing" it later. ## What I could not check No shader compiled or run — the checks above evaluate the emitted expressions in Python. The claim that this matches the `pixel_aot` lowering from #1278 is a comparison I did not make; if the two emit different expressions for the same instruction, that is the thing a reviewer cannot see from either file alone. ## Notes - AI-assisted review.
chatgpt-codex-connector[bot commented 2026-11-25 01:02:12 +00:00 (Migrated from github.com)

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

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

@@ -1568,6 +1568,53 @@ def op_v_lshrrev_b64(self, ops, mods):
 
     def op_v_ashrrev_i64(self, ops, mods):
         self.shift64(ops, mods, 'shr64i')
+
+    def mad64(self, ops, mods, signed):
+        """v_mad_u64_u32 / v_mad_i64_i32: D = S0 * S1 + S2 modulo 2^64, two 32-bit factors, 64-bit S2.
+
+        The unsigned form also writes the carry-out of the 64-bit add to a lane mask. The signed carry-out
+        is not established, so the signed form is accepted only with the discarding null destination."""
+        name = 'v_mad_i64_i32' if signed else 'v_mad_u64_u32'
+        if mods:
+            raise Unsupported('%s with %s' % (name, mods))
+        if len(ops) != 5:
+            raise Unsupported('%s with %d operands, expected 5' % (name, len(ops)))
+        dst = reg_range(ops[0])
+        if not dst or dst[0] != 'v' or dst[2] != dst[1] + 1 or dst[2] > 255:
+            raise Unsupported('%s destination %s' % (name, ops[0]))
+        mask = ops[1]
+        mask_reg = reg_range(mask)
+        if signed:
+            if mask != 'null':
+                raise Unsupported('%s carry-out %s: only null is lowered' % (name, mask))
+        elif mask not in ('vcc', 'vcc_lo') and not (
+                mask_reg and mask_reg[0] == 's' and mask_reg[1] == mask_reg[2] and mask_reg[1] <= 105):
+            raise Unsupported('%s carry-out %s' % (name, mask))
+        for tok in ops[2:4]:
+            r = reg_range(tok)
+            if tok in FLOATS or tok in ('exec', 'exec_lo') or (
+                    r and (r[1] != r[2] or (r[0] == 'v' and r[1] > 255) or (r[0] == 's' and r[1] > 105))):
+                raise Unsupported('%s factor %s' % (name, tok))

P2 Badge Reject lane masks as numeric MAD64 inputs

If MAD64 reads vcc_lo or an SGPR previously written as a compare/carry mask, u() supplies the per-lane 0/1 projection rather than the architectural 32-bit mask. For example, on a fully active wave32, v_mad_u64_u32 v[12:13], s60, 1, 1, -1 followed by v_mad_u64_u32 v[14:15], vcc_lo, s60, 1, 0 is accepted here and computes v14 = 1, although the architectural s60 contains 0xffffffff and the correct result is v14 = 0xffffffff. Reject VCC and SGPRs in self.masks as integer inputs, including either SGPR word of S2, unless the full mask is reconstructed; otherwise this newly supported form silently miscompiles.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4688122682 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2047#discussion_r4688122682). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T23:43:36Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 1597 ~~~~diff @@ -1568,6 +1568,53 @@ def op_v_lshrrev_b64(self, ops, mods): def op_v_ashrrev_i64(self, ops, mods): self.shift64(ops, mods, 'shr64i') + + def mad64(self, ops, mods, signed): + """v_mad_u64_u32 / v_mad_i64_i32: D = S0 * S1 + S2 modulo 2^64, two 32-bit factors, 64-bit S2. + + The unsigned form also writes the carry-out of the 64-bit add to a lane mask. The signed carry-out + is not established, so the signed form is accepted only with the discarding null destination.""" + name = 'v_mad_i64_i32' if signed else 'v_mad_u64_u32' + if mods: + raise Unsupported('%s with %s' % (name, mods)) + if len(ops) != 5: + raise Unsupported('%s with %d operands, expected 5' % (name, len(ops))) + dst = reg_range(ops[0]) + if not dst or dst[0] != 'v' or dst[2] != dst[1] + 1 or dst[2] > 255: + raise Unsupported('%s destination %s' % (name, ops[0])) + mask = ops[1] + mask_reg = reg_range(mask) + if signed: + if mask != 'null': + raise Unsupported('%s carry-out %s: only null is lowered' % (name, mask)) + elif mask not in ('vcc', 'vcc_lo') and not ( + mask_reg and mask_reg[0] == 's' and mask_reg[1] == mask_reg[2] and mask_reg[1] <= 105): + raise Unsupported('%s carry-out %s' % (name, mask)) + for tok in ops[2:4]: + r = reg_range(tok) + if tok in FLOATS or tok in ('exec', 'exec_lo') or ( + r and (r[1] != r[2] or (r[0] == 'v' and r[1] > 255) or (r[0] == 's' and r[1] > 105))): + raise Unsupported('%s factor %s' % (name, tok)) ~~~~ --- **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Reject lane masks as numeric MAD64 inputs** If MAD64 reads `vcc_lo` or an SGPR previously written as a compare/carry mask, `u()` supplies the per-lane 0/1 projection rather than the architectural 32-bit mask. For example, on a fully active wave32, `v_mad_u64_u32 v[12:13], s60, 1, 1, -1` followed by `v_mad_u64_u32 v[14:15], vcc_lo, s60, 1, 0` is accepted here and computes `v14 = 1`, although the architectural `s60` contains `0xffffffff` and the correct result is `v14 = 0xffffffff`. Reject VCC and SGPRs in `self.masks` as integer inputs, including either SGPR word of S2, unless the full mask is reconstructed; otherwise this newly supported form silently miscompiles. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
tedin7 commented 2026-11-25 01:02:19 +00:00 (Migrated from github.com)

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

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

@@ -1568,6 +1568,53 @@ def op_v_lshrrev_b64(self, ops, mods):
 
     def op_v_ashrrev_i64(self, ops, mods):
         self.shift64(ops, mods, 'shr64i')
+
+    def mad64(self, ops, mods, signed):
+        """v_mad_u64_u32 / v_mad_i64_i32: D = S0 * S1 + S2 modulo 2^64, two 32-bit factors, 64-bit S2.
+
+        The unsigned form also writes the carry-out of the 64-bit add to a lane mask. The signed carry-out
+        is not established, so the signed form is accepted only with the discarding null destination."""
+        name = 'v_mad_i64_i32' if signed else 'v_mad_u64_u32'
+        if mods:
+            raise Unsupported('%s with %s' % (name, mods))
+        if len(ops) != 5:
+            raise Unsupported('%s with %d operands, expected 5' % (name, len(ops)))
+        dst = reg_range(ops[0])
+        if not dst or dst[0] != 'v' or dst[2] != dst[1] + 1 or dst[2] > 255:
+            raise Unsupported('%s destination %s' % (name, ops[0]))
+        mask = ops[1]
+        mask_reg = reg_range(mask)
+        if signed:
+            if mask != 'null':
+                raise Unsupported('%s carry-out %s: only null is lowered' % (name, mask))
+        elif mask not in ('vcc', 'vcc_lo') and not (
+                mask_reg and mask_reg[0] == 's' and mask_reg[1] == mask_reg[2] and mask_reg[1] <= 105):
+            raise Unsupported('%s carry-out %s' % (name, mask))
+        for tok in ops[2:4]:
+            r = reg_range(tok)
+            if tok in FLOATS or tok in ('exec', 'exec_lo') or (
+                    r and (r[1] != r[2] or (r[0] == 'v' and r[1] > 255) or (r[0] == 's' and r[1] > 105))):
+                raise Unsupported('%s factor %s' % (name, tok))

Fixed in b9a3844d. MAD64 now refuses VCC and any SGPR tracked as a lane mask (including either word of S2) as an integer input, so the s60 example is rejected instead of miscompiled. Added refusal cases plus a control showing a non-mask scalar is still accepted. Ran: python3 tests/startup_gfx2hlsl_mad64_check.py and all tests/startup_gfx2hlsl_*_check.py locally, all pass.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4688736249 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2047#discussion_r4688736249). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T00:58:09Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 1597 ~~~~diff @@ -1568,6 +1568,53 @@ def op_v_lshrrev_b64(self, ops, mods): def op_v_ashrrev_i64(self, ops, mods): self.shift64(ops, mods, 'shr64i') + + def mad64(self, ops, mods, signed): + """v_mad_u64_u32 / v_mad_i64_i32: D = S0 * S1 + S2 modulo 2^64, two 32-bit factors, 64-bit S2. + + The unsigned form also writes the carry-out of the 64-bit add to a lane mask. The signed carry-out + is not established, so the signed form is accepted only with the discarding null destination.""" + name = 'v_mad_i64_i32' if signed else 'v_mad_u64_u32' + if mods: + raise Unsupported('%s with %s' % (name, mods)) + if len(ops) != 5: + raise Unsupported('%s with %d operands, expected 5' % (name, len(ops))) + dst = reg_range(ops[0]) + if not dst or dst[0] != 'v' or dst[2] != dst[1] + 1 or dst[2] > 255: + raise Unsupported('%s destination %s' % (name, ops[0])) + mask = ops[1] + mask_reg = reg_range(mask) + if signed: + if mask != 'null': + raise Unsupported('%s carry-out %s: only null is lowered' % (name, mask)) + elif mask not in ('vcc', 'vcc_lo') and not ( + mask_reg and mask_reg[0] == 's' and mask_reg[1] == mask_reg[2] and mask_reg[1] <= 105): + raise Unsupported('%s carry-out %s' % (name, mask)) + for tok in ops[2:4]: + r = reg_range(tok) + if tok in FLOATS or tok in ('exec', 'exec_lo') or ( + r and (r[1] != r[2] or (r[0] == 'v' and r[1] > 255) or (r[0] == 's' and r[1] > 105))): + raise Unsupported('%s factor %s' % (name, tok)) ~~~~ --- Fixed in b9a3844d. MAD64 now refuses VCC and any SGPR tracked as a lane mask (including either word of S2) as an integer input, so the s60 example is rejected instead of miscompiled. Added refusal cases plus a control showing a non-mask scalar is still accepted. Ran: python3 tests/startup_gfx2hlsl_mad64_check.py and all tests/startup_gfx2hlsl_*_check.py locally, all pass. AI-assisted; commands listed were executed locally.
Makto94 commented 2026-11-25 11:02:31 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Makto94 on 2026-11-25T10:43:24Z.


First hardware run reported in this thread: startup_gfx2hlsl_mad64_hardware passes on head ce9b7342 with both FXC and DXC.

.\tools\dev.ps1; ctest --preset dev --no-tests=error -j1 -R '^startup_gfx2hlsl_mad64_hardware$' -V

Environment: NVIDIA GeForce RTX 3070 Ti (10de:2482), driver 32.0.16.2101, Windows 11 build 26300.9974, Debug build, fxc 10.0.26100.9457, dxc 1.9.2602.17, D3D12 debug layer enabled, hardware run serial on an idle machine, 0 capability skips (77). The log has 18 fxc lines and 18 dxc lines (16 draw rows, 8 u64 and 8 i64, and 2 "mutation: fails as expected" rows per compiler), and debug_errors=0 debug_warnings=0 on all 36 runs.
Same head, WARP and CPU checks: 100% tests passed, 0 tests failed out of 2 (startup_gfx2hlsl_mad64, startup_gfx2hlsl_mad64_warp); the WARP test has 18 fxc lines, 18 dxc lines and debug_errors=0 debug_warnings=0 on all 36 runs.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7160085165 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2047#issuecomment-7160085165). Originally posted by [Makto94](https://github.com/Makto94) on 2026-11-25T10:43:24Z. --- First hardware run reported in this thread: `startup_gfx2hlsl_mad64_hardware` passes on head ce9b7342 with both FXC and DXC. ```powershell .\tools\dev.ps1; ctest --preset dev --no-tests=error -j1 -R '^startup_gfx2hlsl_mad64_hardware$' -V ``` Environment: NVIDIA GeForce RTX 3070 Ti (`10de:2482`), driver 32.0.16.2101, Windows 11 build 26300.9974, Debug build, fxc 10.0.26100.9457, dxc 1.9.2602.17, D3D12 debug layer enabled, hardware run serial on an idle machine, 0 capability skips (77). The log has 18 `fxc ` lines and 18 `dxc ` lines (16 draw rows, 8 `u64` and 8 `i64`, and 2 "mutation: fails as expected" rows per compiler), and `debug_errors=0 debug_warnings=0` on all 36 runs. Same head, WARP and CPU checks: `100% tests passed, 0 tests failed out of 2` (`startup_gfx2hlsl_mad64`, `startup_gfx2hlsl_mad64_warp`); the WARP test has 18 `fxc ` lines, 18 `dxc ` lines and `debug_errors=0 debug_warnings=0` on all 36 runs.
tedin7 commented 2026-11-25 12:01:55 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T11:54:42Z.


Thank you @ChazY11 for the six-mutation run with exact 64-bit checks, and @Makto94 for the RTX 3070 Ti run at ce9b7342 (startup_gfx2hlsl_mad64_hardware passed with FXC and DXC, CPU and WARP 2/2). Recorded as extra evidence for this PR.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7161668738 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2047#issuecomment-7161668738). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T11:54:42Z. --- Thank you @ChazY11 for the six-mutation run with exact 64-bit checks, and @Makto94 for the RTX 3070 Ti run at `ce9b7342` (`startup_gfx2hlsl_mad64_hardware` passed with FXC and DXC, CPU and WARP 2/2). Recorded as extra evidence for this PR. AI-assisted; commands listed were executed locally.
thepatrickworld commented 2026-11-25 13:01:04 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-25T13:00:37Z.


Run at head ce9b7342, on the AMD adapter (adapter=AMD Radeon RX 9070 XT), backend hardware, both compilers.

startup_flat_param words=0000001e,00000000,00000000,00000000
dxc i64 draw 7: 0000001e,00000000,00000000,00000000

16 readbacks per compiler — eight u64 and eight i64 draws — all matching their references, plus one mutation run per family per compiler that reads its mutated words. Nothing divergent: the 64-bit multiply-add lands on the right words under fxc (ps_5_1) and under dxc (ps_6_0).

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7163163140 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2047#issuecomment-7163163140). Originally posted by [thepatrickworld](https://github.com/thepatrickworld) on 2026-11-25T13:00:37Z. --- Run at head `ce9b7342`, on the AMD adapter (`adapter=AMD Radeon RX 9070 XT`), backend `hardware`, both compilers. ``` startup_flat_param words=0000001e,00000000,00000000,00000000 dxc i64 draw 7: 0000001e,00000000,00000000,00000000 ``` 16 readbacks per compiler — eight `u64` and eight `i64` draws — all matching their references, plus one mutation run per family per compiler that reads its mutated words. Nothing divergent: the 64-bit multiply-add lands on the right words under `fxc` (ps_5_1) and under `dxc` (ps_6_0). _AI-assisted._
upstream-sync closed this pull request 2026-11-25 14:04:32 +00:00
tedin7 commented 2026-11-25 14:05:11 +00:00 (Migrated from github.com)

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


Thank you @thepatrickworld for the AMD Radeon RX 9070 XT run.

startup_gfx2hlsl_mad64_hardware at head ce9b7342 on the hardware backend: 16 readbacks per compiler (eight u64, eight i64) match their references under both fxc (ps_5_1) and dxc (ps_6_0), and the mutation runs fail as expected. No divergence.

What it means for the PR: this is a third independent hardware result (after the RTX 3070 Ti run and the earlier mutation run), and the first on an AMD adapter. No code change needed.

Note: the current head is 50051c12. It differs from ce9b7342 by a merge of origin/main into the branch. The merge pulls in other, unrelated gfx2hlsl.py changes from main; the mad64 helpers and tests/startup_gfx2hlsl_mad64_check.py are not touched by it.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7164238326 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2047#issuecomment-7164238326). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T13:45:12Z. --- Thank you @thepatrickworld for the AMD Radeon RX 9070 XT run. `startup_gfx2hlsl_mad64_hardware` at head `ce9b7342` on the `hardware` backend: 16 readbacks per compiler (eight `u64`, eight `i64`) match their references under both `fxc` (ps_5_1) and `dxc` (ps_6_0), and the mutation runs fail as expected. No divergence. What it means for the PR: this is a third independent hardware result (after the RTX 3070 Ti run and the earlier mutation run), and the first on an AMD adapter. No code change needed. Note: the current head is `50051c12`. It differs from `ce9b7342` by a merge of `origin/main` into the branch. The merge pulls in other, unrelated `gfx2hlsl.py` changes from main; the mad64 helpers and `tests/startup_gfx2hlsl_mad64_check.py` are not touched by it. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 14:05:13 +00:00 (Migrated from github.com)

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


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

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

AI-assisted; commands listed were executed locally.

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

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


@MasterDomino #2047 is ready for review/merge.

What changed since the last head:

  • Merged current main (one CMakeLists.txt conflict, both sides kept).
  • Fix: the SGPR carry-out mask of v_mad_u64_u32 is now tracked as varying (per-lane), not uniform. New check in startup_gfx2hlsl_mad64_check.py fails on the old code and passes now.
  • startup_gfx2hlsl_mad64_check.py (controls and binary) is now registered in .github/workflows/windows.yml.

Head: 9bd7e5d894037ac0e7e8dfb7f2be1396398d0bba. CI is green on this head.

Verification (Windows Server 2025 Build 26100, MSVC 14.44.35207, D3D12 WARP, exact head above):

  • x2w_pipe.py win2025 2047 --wait 7200 --keep-release: dev + release PASS.
  • x2w_pipe.py win2025 2047 --wait 7200 --keep-release --targets offscreen_check --regex '^startup_gfx2hlsl_mad64': dev and release both run startup_gfx2hlsl_mad64 (pure-Python 64-bit reference), startup_gfx2hlsl_mad64_warp (D3D12 WARP draw readback vs CPU reference) and startup_gfx2hlsl_mad64_hardware; 3/3 passed in each preset.
  • Linux: python3 -I -B tests/startup_gfx2hlsl_mad64_check.py pass.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7179000926 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2047#issuecomment-7179000926). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T00:40:33Z. --- @MasterDomino #2047 is ready for review/merge. What changed since the last head: - Merged current `main` (one `CMakeLists.txt` conflict, both sides kept). - Fix: the SGPR carry-out mask of `v_mad_u64_u32` is now tracked as varying (per-lane), not uniform. New check in `startup_gfx2hlsl_mad64_check.py` fails on the old code and passes now. - `startup_gfx2hlsl_mad64_check.py` (controls and `binary`) is now registered in `.github/workflows/windows.yml`. Head: `9bd7e5d894037ac0e7e8dfb7f2be1396398d0bba`. CI is green on this head. Verification (Windows Server 2025 Build 26100, MSVC 14.44.35207, D3D12 WARP, exact head above): - `x2w_pipe.py win2025 2047 --wait 7200 --keep-release`: dev + release PASS. - `x2w_pipe.py win2025 2047 --wait 7200 --keep-release --targets offscreen_check --regex '^startup_gfx2hlsl_mad64'`: dev and release both run `startup_gfx2hlsl_mad64` (pure-Python 64-bit reference), `startup_gfx2hlsl_mad64_warp` (D3D12 WARP draw readback vs CPU reference) and `startup_gfx2hlsl_mad64_hardware`; 3/3 passed in each preset. - Linux: `python3 -I -B tests/startup_gfx2hlsl_mad64_check.py` pass. AI-assisted; commands listed were executed locally.
thepatrickworld commented 2026-11-26 02:05:10 +00:00 (Migrated from github.com)

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


Fresh hardware run at the current head. The AMD run I posted in this thread was at ce9b7342, and this head changes behaviour (the v_mad_u64_u32 carry-out mask is varying now), so that one does not cover it.

Environment, read on the machine: Windows 11 25H2, build 26200.9974, MSVC tools 14.44.35207, AMD Radeon RX 9070 XT (1002:7550, driver 32.0.32029.2010), dev preset, head 9bd7e5d8.

cmake --build --preset dev --target offscreen_check
ctest --preset dev --no-tests=error -R "^startup_gfx2hlsl_mad64"
1/3 Test #995: startup_gfx2hlsl_mad64 ............   Passed    0.58 sec
2/3 Test #996: startup_gfx2hlsl_mad64_warp .......   Passed    8.29 sec
3/3 Test #997: startup_gfx2hlsl_mad64_hardware ...   Passed   11.98 sec
100% tests passed out of 3

All three filtered tests report Passed; the output contains no skipped or failed entry. A verbose run of the hardware test alone (separate invocation: 1/1 ... Passed 11.89 sec) confirms the adapter it actually drew on, and the raw readback words:

997: adapter=AMD Radeon RX 9070 XT vendor=1002 device=7550
997: driver=32.0.32029.2010
997: fxc u64 draw 0: 00000000,fffffffe,3f800000,00000000
997: fxc u64 mutation: fails as expected, reads 00000000,fffffffd,3f800000,00000000
997: dxc i64 mutation: fails as expected, reads 00000000,ffffffff,00000000,00000000

Sixteen draw readbacks per compiler under fxc and dxc (32), each matching its reference; plus four mutation readbacks, one per form per compiler, for 36 in all — and those four fail as they must.

Only the AMD adapter appears in this run (vendor=1002 device=7550, driver 32.0.32029.2010). The RTX numbers in this thread are not from here.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7179528668 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2047#issuecomment-7179528668). Originally posted by [thepatrickworld](https://github.com/thepatrickworld) on 2026-11-26T01:11:46Z. --- Fresh hardware run at the current head. The AMD run I posted in this thread was at `ce9b7342`, and this head changes behaviour (the `v_mad_u64_u32` carry-out mask is varying now), so that one does not cover it. Environment, read on the machine: Windows 11 25H2, build `26200.9974`, MSVC tools `14.44.35207`, AMD Radeon RX 9070 XT (`1002:7550`, driver `32.0.32029.2010`), `dev` preset, head `9bd7e5d8`. ```powershell cmake --build --preset dev --target offscreen_check ctest --preset dev --no-tests=error -R "^startup_gfx2hlsl_mad64" ``` ```text 1/3 Test #995: startup_gfx2hlsl_mad64 ............ Passed 0.58 sec 2/3 Test #996: startup_gfx2hlsl_mad64_warp ....... Passed 8.29 sec 3/3 Test #997: startup_gfx2hlsl_mad64_hardware ... Passed 11.98 sec 100% tests passed out of 3 ``` All three filtered tests report `Passed`; the output contains no skipped or failed entry. A verbose run of the hardware test alone (separate invocation: `1/1 ... Passed 11.89 sec`) confirms the adapter it actually drew on, and the raw readback words: ```text 997: adapter=AMD Radeon RX 9070 XT vendor=1002 device=7550 997: driver=32.0.32029.2010 997: fxc u64 draw 0: 00000000,fffffffe,3f800000,00000000 997: fxc u64 mutation: fails as expected, reads 00000000,fffffffd,3f800000,00000000 997: dxc i64 mutation: fails as expected, reads 00000000,ffffffff,00000000,00000000 ``` Sixteen draw readbacks per compiler under `fxc` and `dxc` (32), each matching its reference; plus four mutation readbacks, one per form per compiler, for 36 in all — and those four fail as they must. Only the AMD adapter appears in this run (`vendor=1002 device=7550`, driver `32.0.32029.2010`). The RTX numbers in this thread are not from here. _AI-assisted._
tedin7 commented 2026-11-26 04:04:38 +00:00 (Migrated from github.com)

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


@thepatrickworld thank you for the fresh AMD Radeon RX 9070 XT run at 9bd7e5d8: 3/3 startup_gfx2hlsl_mad64* passed, 32 draw readbacks plus 4 mutation readbacks matched. No defect there, so no code change for it.

That head had a merge conflict with main in .github/workflows/windows.yml (both sides added a test to the lists). I merged origin/main and kept both sides: new head 5a6dad42, no force-push, CI green (Linux checks, gfx1013 fixtures, Windows build and test).

@MasterDomino #2047 is ready for review/merge at 5a6dad42.

Verification, all executed locally:

  • git merge origin/main, then python3 -B tests/startup_gfx2hlsl_mad64_check.py and python3 -B tests/startup_gfx2hlsl_mul_hi_i32_check.py: ok.
  • Win2025 full run on 5a6dad42: PASS on the second run. The first run failed only in tests/startup_run_ps1_check.py (an 80-column wrap of a PowerShell warning, a load-dependent check on main, not this change), so I re-ran once.
  • Focused Win2025 run (--targets offscreen_check --regex '^startup_gfx2hlsl_(mad64|mul_hi_i32)'), receipt below.

AI-assisted; commands listed were executed locally.

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

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target offscreen_check -- -j 2): 1.91s (configure 0.00s)
    • Test (ctest --preset dev -R '^startup_gfx2hlsl_(mad64|mul_hi_i32)' --parallel 2 --no-tests=error --output-on-failure): 6/6 passed (6.20s: startup_gfx2hlsl_mad64 0.52s, startup_gfx2hlsl_mad64_warp 4.98s, startup_gfx2hlsl_mad64_hardware 4.31s, startup_gfx2hlsl_mul_hi_i32_controls 0.17s, startup_gfx2hlsl_mul_hi_i32_warp 1.00s, startup_gfx2hlsl_mul_hi_i32_hardware 0.91s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target offscreen_check -- -j 2): 6.21s (configure 0.00s)
    • Test (ctest --preset release -R '^startup_gfx2hlsl_(mad64|mul_hi_i32)' --parallel 2 --no-tests=error --output-on-failure): 6/6 passed (4.86s: startup_gfx2hlsl_mad64 0.49s, startup_gfx2hlsl_mad64_warp 3.40s, startup_gfx2hlsl_mul_hi_i32_controls 0.18s, startup_gfx2hlsl_mad64_hardware 3.43s, startup_gfx2hlsl_mul_hi_i32_warp 0.84s, startup_gfx2hlsl_mul_hi_i32_hardware 0.82s)
  • Windows Python checks: tests/mesh_heap_sampler_check.py ok (1.1s), tests/startup_buffer_address_check.py ok (0.7s), tests/startup_buffer_format_word3_table_check.py ok (0.1s), tests/startup_compute_request_offline_check.py ok (0.8s), tests/startup_compute_store_format_xyzw_check.py ok (0.3s), tests/startup_compute_translate_check.py ok (0.3s), tests/startup_flat_param_check.py ok (0.2s), tests/startup_gfx2hlsl_add_sub_co_check.py ok (0.1s), tests/startup_gfx2hlsl_add_sub_co_ci_check.py ok (0.2s), tests/startup_gfx2hlsl_bit_alu_check.py ok (0.9s), tests/startup_gfx2hlsl_capture_check.py ok (1.3s), tests/startup_gfx2hlsl_cmp16_check.py ok (0.3s), tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.py ok (47.4s), tests/startup_gfx2hlsl_compare_dst_check.py ok (0.2s), tests/startup_gfx2hlsl_compute_check.py ok (0.8s), tests/startup_gfx2hlsl_cselect_mask_check.py ok (0.2s), tests/startup_gfx2hlsl_cvt_alu_check.py ok (0.3s), tests/startup_gfx2hlsl_cvt_off_f32_i4_check.py ok (0.4s), tests/startup_gfx2hlsl_cvt_pk_int16_check.py ok (0.6s), tests/startup_gfx2hlsl_f32_lg_check.py ok (2.5s), tests/startup_gfx2hlsl_f32_nan_check.py ok (9.5s), 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.2s), tests/startup_gfx2hlsl_heap_record_check.py ok (0.3s), tests/startup_gfx2hlsl_image_arity_check.py ok (0.2s), tests/startup_gfx2hlsl_image_get_lod_check.py ok (0.3s), tests/startup_gfx2hlsl_int_med3_check.py ok (0.2s), tests/startup_gfx2hlsl_interp_p2_hi_check.py ok (0.4s), tests/startup_gfx2hlsl_join_symbols_check.py ok (0.3s), tests/startup_gfx2hlsl_loop_constants_check.py ok (0.2s), tests/startup_gfx2hlsl_mask_data_check.py ok (0.2s), tests/startup_gfx2hlsl_mask_overwrite_check.py ok (0.2s), tests/startup_gfx2hlsl_operand_count_check.py ok (0.6s), tests/startup_gfx2hlsl_pack_absdiff_check.py ok (4.9s), tests/startup_gfx2hlsl_pack_b32_f16_check.py ok (0.3s), tests/startup_gfx2hlsl_readfirstlane_recompute_check.py ok (0.2s), tests/startup_gfx2hlsl_readfirstlane_uniform_check.py ok (0.2s), tests/startup_gfx2hlsl_refusals_check.py ok (0.9s), tests/startup_gfx2hlsl_root_check.py ok (1.1s), tests/startup_gfx2hlsl_s_abs_check.py ok (0.1s), tests/startup_gfx2hlsl_s_bitset_check.py ok (0.2s), tests/startup_gfx2hlsl_s_ff0_check.py ok (0.1s), tests/startup_gfx2hlsl_s_ff1_check.py ok (0.2s), tests/startup_gfx2hlsl_s_flbit_check.py ok (0.2s), tests/startup_gfx2hlsl_s_quadmask_check.py ok (0.2s), tests/startup_gfx2hlsl_sad_check.py ok (0.6s), tests/startup_gfx2hlsl_saveexec_same_reg_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_arity_check.py ok (0.4s), tests/startup_gfx2hlsl_scalar_brev_fold_check.py ok (0.3s), tests/startup_gfx2hlsl_scalar_m0_check.py ok (0.3s), tests/startup_gfx2hlsl_scalar_null_check.py ok (0.3s), 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.4s), tests/startup_gfx2hlsl_sgpr_spill_check.py ok (0.2s), tests/startup_gfx2hlsl_shift64_check.py ok (0.3s), tests/startup_gfx2hlsl_sload_const_offset_check.py ok (0.1s), tests/startup_gfx2hlsl_smem_offset_check.py ok (0.1s), tests/startup_gfx2hlsl_sop2_complement_check.py ok (8.0s), tests/startup_gfx2hlsl_sopk_accum_check.py ok (1.1s), tests/startup_gfx2hlsl_sopk_signext_check.py ok (0.2s), tests/startup_gfx2hlsl_spill_branches_check.py ok (1.0s), tests/startup_gfx2hlsl_swap_check.py ok (0.3s), tests/startup_gfx2hlsl_vopc_sdwa_check.py ok (4.6s), tests/startup_gfx2hlsl_waitcnt_depctr_check.py ok (0.1s), tests/startup_gfx2hlsl_watch_check.py ok (2.5s), tests/startup_image_2d_array_check.py ok (0.2s), tests/startup_image_3d_check.py ok (0.1s), 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.2s), 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.4s), tests/startup_run_ps1_check.py ok (11.6s), 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.3s), 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.3s), tests/startup_translator_check.py ok (0.5s)
  • sccache: 182/209 hits; wall 143.2s
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7181767077 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2047#issuecomment-7181767077). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T03:29:38Z. --- @thepatrickworld thank you for the fresh AMD Radeon RX 9070 XT run at `9bd7e5d8`: 3/3 `startup_gfx2hlsl_mad64*` passed, 32 draw readbacks plus 4 mutation readbacks matched. No defect there, so no code change for it. That head had a merge conflict with `main` in `.github/workflows/windows.yml` (both sides added a test to the lists). I merged `origin/main` and kept both sides: new head `5a6dad42`, no force-push, CI green (Linux checks, gfx1013 fixtures, Windows build and test). @MasterDomino #2047 is ready for review/merge at `5a6dad42`. Verification, all executed locally: - `git merge origin/main`, then `python3 -B tests/startup_gfx2hlsl_mad64_check.py` and `python3 -B tests/startup_gfx2hlsl_mul_hi_i32_check.py`: ok. - Win2025 full run on `5a6dad42`: PASS on the second run. The first run failed only in `tests/startup_run_ps1_check.py` (an 80-column wrap of a PowerShell warning, a load-dependent check on `main`, not this change), so I re-ran once. - Focused Win2025 run (`--targets offscreen_check --regex '^startup_gfx2hlsl_(mad64|mul_hi_i32)'`), receipt below. AI-assisted; commands listed were executed locally. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `5a6dad42af4e6f546ea3b97536da1727096a4104`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target offscreen_check -- -j 2`): `1.91s` (configure `0.00s`) - Test (`ctest --preset dev -R '^startup_gfx2hlsl_(mad64|mul_hi_i32)' --parallel 2 --no-tests=error --output-on-failure`): **6/6 passed** (`6.20s`: `startup_gfx2hlsl_mad64` `0.52s`, `startup_gfx2hlsl_mad64_warp` `4.98s`, `startup_gfx2hlsl_mad64_hardware` `4.31s`, `startup_gfx2hlsl_mul_hi_i32_controls` `0.17s`, `startup_gfx2hlsl_mul_hi_i32_warp` `1.00s`, `startup_gfx2hlsl_mul_hi_i32_hardware` `0.91s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target offscreen_check -- -j 2`): `6.21s` (configure `0.00s`) - Test (`ctest --preset release -R '^startup_gfx2hlsl_(mad64|mul_hi_i32)' --parallel 2 --no-tests=error --output-on-failure`): **6/6 passed** (`4.86s`: `startup_gfx2hlsl_mad64` `0.49s`, `startup_gfx2hlsl_mad64_warp` `3.40s`, `startup_gfx2hlsl_mul_hi_i32_controls` `0.18s`, `startup_gfx2hlsl_mad64_hardware` `3.43s`, `startup_gfx2hlsl_mul_hi_i32_warp` `0.84s`, `startup_gfx2hlsl_mul_hi_i32_hardware` `0.82s`) - **Windows Python checks**: `tests/mesh_heap_sampler_check.py` ok (`1.1s`), `tests/startup_buffer_address_check.py` ok (`0.7s`), `tests/startup_buffer_format_word3_table_check.py` ok (`0.1s`), `tests/startup_compute_request_offline_check.py` ok (`0.8s`), `tests/startup_compute_store_format_xyzw_check.py` ok (`0.3s`), `tests/startup_compute_translate_check.py` ok (`0.3s`), `tests/startup_flat_param_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_add_sub_co_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_add_sub_co_ci_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_bit_alu_check.py` ok (`0.9s`), `tests/startup_gfx2hlsl_capture_check.py` ok (`1.3s`), `tests/startup_gfx2hlsl_cmp16_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.py` ok (`47.4s`), `tests/startup_gfx2hlsl_compare_dst_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_compute_check.py` ok (`0.8s`), `tests/startup_gfx2hlsl_cselect_mask_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_cvt_alu_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_cvt_off_f32_i4_check.py` ok (`0.4s`), `tests/startup_gfx2hlsl_cvt_pk_int16_check.py` ok (`0.6s`), `tests/startup_gfx2hlsl_f32_lg_check.py` ok (`2.5s`), `tests/startup_gfx2hlsl_f32_nan_check.py` ok (`9.5s`), `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.2s`), `tests/startup_gfx2hlsl_heap_record_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_image_arity_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_image_get_lod_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_int_med3_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_interp_p2_hi_check.py` ok (`0.4s`), `tests/startup_gfx2hlsl_join_symbols_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_loop_constants_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_mask_data_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_mask_overwrite_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_operand_count_check.py` ok (`0.6s`), `tests/startup_gfx2hlsl_pack_absdiff_check.py` ok (`4.9s`), `tests/startup_gfx2hlsl_pack_b32_f16_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_readfirstlane_recompute_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_readfirstlane_uniform_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_refusals_check.py` ok (`0.9s`), `tests/startup_gfx2hlsl_root_check.py` ok (`1.1s`), `tests/startup_gfx2hlsl_s_abs_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_s_bitset_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_s_ff0_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_s_ff1_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_s_flbit_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_s_quadmask_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_sad_check.py` ok (`0.6s`), `tests/startup_gfx2hlsl_saveexec_same_reg_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_scalar_arity_check.py` ok (`0.4s`), `tests/startup_gfx2hlsl_scalar_brev_fold_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_scalar_m0_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_scalar_null_check.py` ok (`0.3s`), `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.4s`), `tests/startup_gfx2hlsl_sgpr_spill_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_shift64_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_sload_const_offset_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_smem_offset_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_sop2_complement_check.py` ok (`8.0s`), `tests/startup_gfx2hlsl_sopk_accum_check.py` ok (`1.1s`), `tests/startup_gfx2hlsl_sopk_signext_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_spill_branches_check.py` ok (`1.0s`), `tests/startup_gfx2hlsl_swap_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_vopc_sdwa_check.py` ok (`4.6s`), `tests/startup_gfx2hlsl_waitcnt_depctr_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_watch_check.py` ok (`2.5s`), `tests/startup_image_2d_array_check.py` ok (`0.2s`), `tests/startup_image_3d_check.py` ok (`0.1s`), `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.2s`), `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.4s`), `tests/startup_run_ps1_check.py` ok (`11.6s`), `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.3s`), `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.3s`), `tests/startup_translator_check.py` ok (`0.5s`) - `sccache`: 182/209 hits; wall `143.2s`
upstream-sync closed this pull request 2026-11-26 06:01:44 +00:00
R0Y00 commented 2026-11-26 06:01:45 +00:00 (Migrated from github.com)

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

Review: APPROVED


Reviewed the 32-bit partial products, signed high-word correction and unsigned 64-bit carry. With main 1ec01d70 combined, the Python controls and the FXC/DXC draw suite passed on WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656 on Windows 11 build 26200. The carry/limb mutation read back the expected wrong words. Signed carry remains refused except when discarded.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6069137501 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2047#pullrequestreview-6069137501). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T05:47:28Z. **Review:** APPROVED --- Reviewed the 32-bit partial products, signed high-word correction and unsigned 64-bit carry. With main 1ec01d70 combined, the Python controls and the FXC/DXC draw suite passed on WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656 on Windows 11 build 26200. The carry/limb mutation read back the expected wrong words. Signed carry remains refused except when discarded.
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!2040
No description provided.