shader: lower 24-bit multiply, xnor, alignbit and alignbyte in gfx2hlsl (Part of #1723) #2070

Merged
tedin7 merged 11 commits from upstream-pr/2077 into main 2026-11-25 23:18:44 +00:00
tedin7 commented 2026-11-25 00:03:15 +00:00 (Migrated from github.com)

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


Part of #1723

What this unblocks: startup pixel/vertex shaders that use 24-bit integer multiplies, v_xnor_b32 or the bit/byte funnel shifts now translate to HLSL instead of being refused.

Adds to tools/startup/gfx2hlsl.py: v_mul_i32_i24, v_mul_hi_i32_i24, v_mul_hi_u32_u24, v_mad_i32_i24, v_xnor_b32, v_alignbit_b32, v_alignbyte_b32. None were on origin/main or in an open PR. The hi forms stay inside 32-bit integers by splitting each 24-bit field into two 12-bit halves, and the funnel shifts guard the shift-by-32 case.

New test tests/startup_gfx2hlsl_mul24_align_check.py (registered as startup_gfx2hlsl_mul24_align in CMakeLists.txt): translates each instruction with the real translator, evaluates the emitted HLSL on the CPU and compares with an unbounded-integer reference.

Verification:

  • python3 -B tests/startup_gfx2hlsl_mul24_align_check.py on origin/main: exit 1 (Unsupported: v_mul_i32_i24).
  • Same command with this change: exit 0 (1690 inputs per 24-bit op, 6422 per bit op, e64 spellings checked).
  • python3 -B tests/startup_gfx2hlsl_bit_alu_check.py, startup_gfx2hlsl_op_refusals_check.py, startup_gfx2hlsl_operand_count_check.py, startup_gfx2hlsl_refusals_check.py: all exit 0.
  • Not run: Win2025 GPU draw (this is a CPU-evaluated check only).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6593981541 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2077). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T00:03:15Z. --- Part of #1723 What this unblocks: startup pixel/vertex shaders that use 24-bit integer multiplies, `v_xnor_b32` or the bit/byte funnel shifts now translate to HLSL instead of being refused. Adds to `tools/startup/gfx2hlsl.py`: `v_mul_i32_i24`, `v_mul_hi_i32_i24`, `v_mul_hi_u32_u24`, `v_mad_i32_i24`, `v_xnor_b32`, `v_alignbit_b32`, `v_alignbyte_b32`. None were on `origin/main` or in an open PR. The hi forms stay inside 32-bit integers by splitting each 24-bit field into two 12-bit halves, and the funnel shifts guard the shift-by-32 case. New test `tests/startup_gfx2hlsl_mul24_align_check.py` (registered as `startup_gfx2hlsl_mul24_align` in `CMakeLists.txt`): translates each instruction with the real translator, evaluates the emitted HLSL on the CPU and compares with an unbounded-integer reference. Verification: - `python3 -B tests/startup_gfx2hlsl_mul24_align_check.py` on `origin/main`: exit 1 (`Unsupported: v_mul_i32_i24`). - Same command with this change: exit 0 (1690 inputs per 24-bit op, 6422 per bit op, e64 spellings checked). - `python3 -B tests/startup_gfx2hlsl_bit_alu_check.py`, `startup_gfx2hlsl_op_refusals_check.py`, `startup_gfx2hlsl_operand_count_check.py`, `startup_gfx2hlsl_refusals_check.py`: all exit 0. - Not run: Win2025 GPU draw (this is a CPU-evaluated check only). AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-25 01:01:31 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T00:07:44Z.

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 54c215a788

ℹ️ 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:6049494724 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2077#pullrequestreview-6049494724). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T00:07:44Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `54c215a788` <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>
chatgpt-codex-connector[bot commented 2026-11-25 01:02:01 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T00:03:29Z.


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-25T00:07:46.559263Z 54c215a 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:7148090300 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2077#issuecomment-7148090300). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T00:03:29Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"54c215a78863750786c203ecaeb58dfa216ac3d4","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-25T00:07:46.559263Z">2026-11-25T00:07:46.559263Z</relative-time> | `54c215a` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
chatgpt-codex-connector[bot commented 2026-11-25 01:02:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T00:07:44Z.

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

@@ -1864,6 +1864,49 @@ def declarations(self):
     'v_ffbh_i32': (1, '({0} == 0u || {0} == 0xffffffffu ? 0xffffffffu : 31u - firstbithigh(asint({0}) < 0 ? ~{0} : {0}))'),
     'v_bfrev_b32': (1, 'reversebits({0})'),
 }
+
+
+def _mul24_hi(signed):
+    """High 32 bits of the 48-bit product of two 24-bit fields, in 32-bit integer arithmetic.
+
+    With a = ah * 2^12 + al (al in 0..4095, ah the top 12 bits, sign-extended for the signed form) the product is
+    hh * 2^24 + mid * 2^12 + lo, so p >> 12 = hh * 2^12 + (mid + (lo >> 12)) exactly, and the result is that value
+    shifted right by 20 once hh * 2^12 is split into (hh >> 8) * 2^20 and (hh & 255) * 2^12 to stay inside 32 bits.
+    """
+    if signed:
+        def top(n):
+            return '(asint({%d} << 8) >> 20)' % n
+
+        def low(n):
+            return 'asint({%d} & 0xfffu)' % n
+        mask, wrap = '255', 'asuint(%s)'
+    else:
+        def top(n):
+            return '(({%d} >> 12) & 0xfffu)' % n
+
+        def low(n):
+            return '({%d} & 0xfffu)' % n
+        mask, wrap = '255u', '%s'
+    hh = '(%s * %s)' % (top(0), top(1))
+    mid = '(%s * %s + %s * %s)' % (top(0), low(1), low(0), top(1))
+    r = '(%s + ((%s * %s) >> 12))' % (mid, low(0), low(1))
+    return wrap % ('((%s >> 8) + (((((%s & %s) << 12) + %s)) >> 20))' % (hh, hh, mask, r))
+
+
+VEC_U.update({
+    # AMD RDNA 2 ISA reference: the 24-bit multiplies read the low 24 bits of each source, the signed forms as a
+    # two's complement field. The mul and mad forms keep the low 32 bits of the product; the hi forms keep bits 63..32
+    # of the 48-bit product. The 24-bit field is sign-extended with a left shift of 8 and an arithmetic right shift.
+    'v_mul_i32_i24': (2, 'asuint((asint({0} << 8) >> 8) * (asint({1} << 8) >> 8))'),
+    'v_mad_i32_i24': (3, 'asuint((asint({0} << 8) >> 8) * (asint({1} << 8) >> 8)) + {2}'),
+    'v_mul_hi_u32_u24': (2, _mul24_hi(False)),
+    'v_mul_hi_i32_i24': (2, _mul24_hi(True)),
+    'v_xnor_b32': (2, '~({0} ^ {1})'),
+    # v_alignbit_b32 takes bits [S2[4:0] + 31 : S2[4:0]] of the 64-bit value {S0, S1}; a zero shift returns S1 and
+    # the guard avoids a shift by 32. v_alignbyte_b32 does the same with S2[1:0] * 8 bits.
+    'v_alignbit_b32': (3, '(({2} & 31u) == 0u ? {1} : (({1} >> ({2} & 31u)) | ({0} << (32u - ({2} & 31u)))))'),

P1 Badge Update the documented startup opcode capabilities

This adds support for v_alignbit_b32 and the signed/high 24-bit multiplies, but docs/experiments.md:11586 still explicitly lists those operations as not lowered. Contributors consulting the capability documentation therefore receive an incorrect support boundary. The root AGENTS.md requires updating the relevant README row or experiment documentation when a public capability changes; update that section with the newly supported forms and the CPU-only reproduction command.

AGENTS.md reference: AGENTS.md:L211-L212

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4688358981 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2077#discussion_r4688358981). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T00:07:44Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 1907 ~~~~diff @@ -1864,6 +1864,49 @@ def declarations(self): 'v_ffbh_i32': (1, '({0} == 0u || {0} == 0xffffffffu ? 0xffffffffu : 31u - firstbithigh(asint({0}) < 0 ? ~{0} : {0}))'), 'v_bfrev_b32': (1, 'reversebits({0})'), } + + +def _mul24_hi(signed): + """High 32 bits of the 48-bit product of two 24-bit fields, in 32-bit integer arithmetic. + + With a = ah * 2^12 + al (al in 0..4095, ah the top 12 bits, sign-extended for the signed form) the product is + hh * 2^24 + mid * 2^12 + lo, so p >> 12 = hh * 2^12 + (mid + (lo >> 12)) exactly, and the result is that value + shifted right by 20 once hh * 2^12 is split into (hh >> 8) * 2^20 and (hh & 255) * 2^12 to stay inside 32 bits. + """ + if signed: + def top(n): + return '(asint({%d} << 8) >> 20)' % n + + def low(n): + return 'asint({%d} & 0xfffu)' % n + mask, wrap = '255', 'asuint(%s)' + else: + def top(n): + return '(({%d} >> 12) & 0xfffu)' % n + + def low(n): + return '({%d} & 0xfffu)' % n + mask, wrap = '255u', '%s' + hh = '(%s * %s)' % (top(0), top(1)) + mid = '(%s * %s + %s * %s)' % (top(0), low(1), low(0), top(1)) + r = '(%s + ((%s * %s) >> 12))' % (mid, low(0), low(1)) + return wrap % ('((%s >> 8) + (((((%s & %s) << 12) + %s)) >> 20))' % (hh, hh, mask, r)) + + +VEC_U.update({ + # AMD RDNA 2 ISA reference: the 24-bit multiplies read the low 24 bits of each source, the signed forms as a + # two's complement field. The mul and mad forms keep the low 32 bits of the product; the hi forms keep bits 63..32 + # of the 48-bit product. The 24-bit field is sign-extended with a left shift of 8 and an arithmetic right shift. + 'v_mul_i32_i24': (2, 'asuint((asint({0} << 8) >> 8) * (asint({1} << 8) >> 8))'), + 'v_mad_i32_i24': (3, 'asuint((asint({0} << 8) >> 8) * (asint({1} << 8) >> 8)) + {2}'), + 'v_mul_hi_u32_u24': (2, _mul24_hi(False)), + 'v_mul_hi_i32_i24': (2, _mul24_hi(True)), + 'v_xnor_b32': (2, '~({0} ^ {1})'), + # v_alignbit_b32 takes bits [S2[4:0] + 31 : S2[4:0]] of the 64-bit value {S0, S1}; a zero shift returns S1 and + # the guard avoids a shift by 32. v_alignbyte_b32 does the same with S2[1:0] * 8 bits. + 'v_alignbit_b32': (3, '(({2} & 31u) == 0u ? {1} : (({1} >> ({2} & 31u)) | ({0} << (32u - ({2} & 31u)))))'), ~~~~ --- **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Update the documented startup opcode capabilities** This adds support for `v_alignbit_b32` and the signed/high 24-bit multiplies, but `docs/experiments.md:11586` still explicitly lists those operations as not lowered. Contributors consulting the capability documentation therefore receive an incorrect support boundary. The root `AGENTS.md` requires updating the relevant README row or experiment documentation when a public capability changes; update that section with the newly supported forms and the CPU-only reproduction command. AGENTS.md reference: [AGENTS.md:L211-L212](https://github.com/R0Y00/Xbox2Windows/blob/54c215a78863750786c203ecaeb58dfa216ac3d4/AGENTS.md#L211-L212) Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
tedin7 commented 2026-11-25 02:01:39 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T01:03:46Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6049963478 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2077#pullrequestreview-6049963478). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T01:03:46Z. **Review:** COMMENTED --- _No description provided._
tedin7 commented 2026-11-25 02:02:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T01:03:46Z.

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

@@ -1864,6 +1864,49 @@ def declarations(self):
     'v_ffbh_i32': (1, '({0} == 0u || {0} == 0xffffffffu ? 0xffffffffu : 31u - firstbithigh(asint({0}) < 0 ? ~{0} : {0}))'),
     'v_bfrev_b32': (1, 'reversebits({0})'),
 }
+
+
+def _mul24_hi(signed):
+    """High 32 bits of the 48-bit product of two 24-bit fields, in 32-bit integer arithmetic.
+
+    With a = ah * 2^12 + al (al in 0..4095, ah the top 12 bits, sign-extended for the signed form) the product is
+    hh * 2^24 + mid * 2^12 + lo, so p >> 12 = hh * 2^12 + (mid + (lo >> 12)) exactly, and the result is that value
+    shifted right by 20 once hh * 2^12 is split into (hh >> 8) * 2^20 and (hh & 255) * 2^12 to stay inside 32 bits.
+    """
+    if signed:
+        def top(n):
+            return '(asint({%d} << 8) >> 20)' % n
+
+        def low(n):
+            return 'asint({%d} & 0xfffu)' % n
+        mask, wrap = '255', 'asuint(%s)'
+    else:
+        def top(n):
+            return '(({%d} >> 12) & 0xfffu)' % n
+
+        def low(n):
+            return '({%d} & 0xfffu)' % n
+        mask, wrap = '255u', '%s'
+    hh = '(%s * %s)' % (top(0), top(1))
+    mid = '(%s * %s + %s * %s)' % (top(0), low(1), low(0), top(1))
+    r = '(%s + ((%s * %s) >> 12))' % (mid, low(0), low(1))
+    return wrap % ('((%s >> 8) + (((((%s & %s) << 12) + %s)) >> 20))' % (hh, hh, mask, r))
+
+
+VEC_U.update({
+    # AMD RDNA 2 ISA reference: the 24-bit multiplies read the low 24 bits of each source, the signed forms as a
+    # two's complement field. The mul and mad forms keep the low 32 bits of the product; the hi forms keep bits 63..32
+    # of the 48-bit product. The 24-bit field is sign-extended with a left shift of 8 and an arithmetic right shift.
+    'v_mul_i32_i24': (2, 'asuint((asint({0} << 8) >> 8) * (asint({1} << 8) >> 8))'),
+    'v_mad_i32_i24': (3, 'asuint((asint({0} << 8) >> 8) * (asint({1} << 8) >> 8)) + {2}'),
+    'v_mul_hi_u32_u24': (2, _mul24_hi(False)),
+    'v_mul_hi_i32_i24': (2, _mul24_hi(True)),
+    'v_xnor_b32': (2, '~({0} ^ {1})'),
+    # v_alignbit_b32 takes bits [S2[4:0] + 31 : S2[4:0]] of the 64-bit value {S0, S1}; a zero shift returns S1 and
+    # the guard avoids a shift by 32. v_alignbyte_b32 does the same with S2[1:0] * 8 bits.
+    'v_alignbit_b32': (3, '(({2} & 31u) == 0u ? {1} : (({1} >> ({2} & 31u)) | ({0} << (32u - ({2} & 31u)))))'),

Fixed in f2222c75 (rebased on current main, pending push to this branch). New section in docs/experiments.md lists the seven lowered forms, refusals, the CPU check and the WARP/hardware draw runs (hardware reported separately), and the check is added to AGENTS.md and the CI list.

AI-assisted; commands listed were executed locally: python3 -B tests/startup_gfx2hlsl_mul24_align_check.py, startup_gfx2hlsl_bit_alu_check.py, startup_translator_check.py, docs_links_check.py.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4688774289 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2077#discussion_r4688774289). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T01:03:46Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 1907 ~~~~diff @@ -1864,6 +1864,49 @@ def declarations(self): 'v_ffbh_i32': (1, '({0} == 0u || {0} == 0xffffffffu ? 0xffffffffu : 31u - firstbithigh(asint({0}) < 0 ? ~{0} : {0}))'), 'v_bfrev_b32': (1, 'reversebits({0})'), } + + +def _mul24_hi(signed): + """High 32 bits of the 48-bit product of two 24-bit fields, in 32-bit integer arithmetic. + + With a = ah * 2^12 + al (al in 0..4095, ah the top 12 bits, sign-extended for the signed form) the product is + hh * 2^24 + mid * 2^12 + lo, so p >> 12 = hh * 2^12 + (mid + (lo >> 12)) exactly, and the result is that value + shifted right by 20 once hh * 2^12 is split into (hh >> 8) * 2^20 and (hh & 255) * 2^12 to stay inside 32 bits. + """ + if signed: + def top(n): + return '(asint({%d} << 8) >> 20)' % n + + def low(n): + return 'asint({%d} & 0xfffu)' % n + mask, wrap = '255', 'asuint(%s)' + else: + def top(n): + return '(({%d} >> 12) & 0xfffu)' % n + + def low(n): + return '({%d} & 0xfffu)' % n + mask, wrap = '255u', '%s' + hh = '(%s * %s)' % (top(0), top(1)) + mid = '(%s * %s + %s * %s)' % (top(0), low(1), low(0), top(1)) + r = '(%s + ((%s * %s) >> 12))' % (mid, low(0), low(1)) + return wrap % ('((%s >> 8) + (((((%s & %s) << 12) + %s)) >> 20))' % (hh, hh, mask, r)) + + +VEC_U.update({ + # AMD RDNA 2 ISA reference: the 24-bit multiplies read the low 24 bits of each source, the signed forms as a + # two's complement field. The mul and mad forms keep the low 32 bits of the product; the hi forms keep bits 63..32 + # of the 48-bit product. The 24-bit field is sign-extended with a left shift of 8 and an arithmetic right shift. + 'v_mul_i32_i24': (2, 'asuint((asint({0} << 8) >> 8) * (asint({1} << 8) >> 8))'), + 'v_mad_i32_i24': (3, 'asuint((asint({0} << 8) >> 8) * (asint({1} << 8) >> 8)) + {2}'), + 'v_mul_hi_u32_u24': (2, _mul24_hi(False)), + 'v_mul_hi_i32_i24': (2, _mul24_hi(True)), + 'v_xnor_b32': (2, '~({0} ^ {1})'), + # v_alignbit_b32 takes bits [S2[4:0] + 31 : S2[4:0]] of the 64-bit value {S0, S1}; a zero shift returns S1 and + # the guard avoids a shift by 32. v_alignbyte_b32 does the same with S2[1:0] * 8 bits. + 'v_alignbit_b32': (3, '(({2} & 31u) == 0u ? {1} : (({1} >> ({2} & 31u)) | ({0} << (32u - ({2} & 31u)))))'), ~~~~ --- Fixed in f2222c75 (rebased on current main, pending push to this branch). New section in docs/experiments.md lists the seven lowered forms, refusals, the CPU check and the WARP/hardware draw runs (hardware reported separately), and the check is added to AGENTS.md and the CI list. AI-assisted; commands listed were executed locally: python3 -B tests/startup_gfx2hlsl_mul24_align_check.py, startup_gfx2hlsl_bit_alu_check.py, startup_translator_check.py, docs_links_check.py.
thepatrickworld commented 2026-11-25 03:01:23 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-25T02:38:25Z.


I ran this on a real AMD card (RX 9070 XT, driver 32.0.32029.2010), which is the first GPU run of startup_gfx2hlsl_mul24_align_draw_check.py — the PR body says the Win2025 GPU draw was not run.

dxc: the whole draw passes on hardware. fxc: it fails on v_mul_hi_u32_u24, identically on WARP, so the adapter is not involved:

fxc v_mul_hi_u32_u24 inputs [(8388607, 8388607, 0), (8388608, 8388608, 1), (16777215, 16777215, 4294967295), (8388609, 8388607, 5)]
startup_flat_param mismatch expected=00003fff,00004000,0000ffff,00003fff actual=00000000,00000000,00000000,00000000

The three ops that come before it in the same loop — v_mul_i32_i24, v_mad_i32_i24, v_mul_hi_i32_i24 — pass under the same fxc.

The artifact: compiling the emitted pixel shader with fxc /T ps_5_1 gives

ps_5_1
dcl_globalFlags refactoringAllowed
dcl_output o0.xyzw
mov o0.xyzw, l(0,0,0,0)
ret

No dcl_input at all: the whole expression is folded to a constant, and the shader reads nothing. Its signed twin declares its inputs (dcl_input_ps constant v3.xyzw, v4.xyzw) and computes. With /Od the unsigned one also produces the expected code (dcl_input_ps constant v3.xyzw, v4.xyzw, then ishl/ushr), so this is the optimizer, not the emission — and dxc emits correct code from the same source.

Two things I tried before writing this, both still fold to zero under fxc: replacing the overflowing (v0 << 8) >> 20 top with the equivalent (v0 >> 12) & 0xfff, and umulhi (which does not exist in HLSL — error X3004: undeclared identifier, my mistake).

What I think it means: the startup path compiles its shaders with fxc (find_fxc in gfx2hlsl.py), so an op that fxc folds to zero is silently wrong there even though the CPU check and the dxc draw are green. Either restructuring the unsigned form, or marking the op as not fxc-safe with a pointer to this, seems worth it before merge.

Limits: one fxc build (10.0.26100.0, Windows SDK), AMD RDNA2 only, no NVIDIA card here, so I can't say whether the same fold appears elsewhere — and I have not isolated which sub-expression triggers it.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7150985844 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2077#issuecomment-7150985844). Originally posted by [thepatrickworld](https://github.com/thepatrickworld) on 2026-11-25T02:38:25Z. --- I ran this on a real AMD card (RX 9070 XT, driver 32.0.32029.2010), which is the first GPU run of `startup_gfx2hlsl_mul24_align_draw_check.py` — the PR body says the Win2025 GPU draw was not run. **dxc: the whole draw passes on hardware.** **fxc: it fails on `v_mul_hi_u32_u24`,** identically on WARP, so the adapter is not involved: ``` fxc v_mul_hi_u32_u24 inputs [(8388607, 8388607, 0), (8388608, 8388608, 1), (16777215, 16777215, 4294967295), (8388609, 8388607, 5)] startup_flat_param mismatch expected=00003fff,00004000,0000ffff,00003fff actual=00000000,00000000,00000000,00000000 ``` The three ops that come before it in the same loop — `v_mul_i32_i24`, `v_mad_i32_i24`, `v_mul_hi_i32_i24` — pass under the same fxc. The artifact: compiling the emitted pixel shader with `fxc /T ps_5_1` gives ``` ps_5_1 dcl_globalFlags refactoringAllowed dcl_output o0.xyzw mov o0.xyzw, l(0,0,0,0) ret ``` No `dcl_input` at all: the whole expression is folded to a constant, and the shader reads nothing. Its signed twin declares its inputs (`dcl_input_ps constant v3.xyzw`, `v4.xyzw`) and computes. With `/Od` the unsigned one also produces the expected code (`dcl_input_ps constant v3.xyzw`, `v4.xyzw`, then `ishl`/`ushr`), so this is the optimizer, not the emission — and dxc emits correct code from the same source. Two things I tried before writing this, both still fold to zero under fxc: replacing the overflowing `(v0 << 8) >> 20` top with the equivalent `(v0 >> 12) & 0xfff`, and `umulhi` (which does not exist in HLSL — `error X3004: undeclared identifier`, my mistake). What I think it means: the startup path compiles its shaders with fxc (`find_fxc` in `gfx2hlsl.py`), so an op that fxc folds to zero is silently wrong there even though the CPU check and the dxc draw are green. Either restructuring the unsigned form, or marking the op as not fxc-safe with a pointer to this, seems worth it before merge. Limits: one fxc build (10.0.26100.0, Windows SDK), AMD RDNA2 only, no NVIDIA card here, so I can't say whether the same fold appears elsewhere — and I have not isolated which sub-expression triggers it. _AI-assisted._
Makto94 commented 2026-11-25 11:02:29 +00:00 (Migrated from github.com)

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


startup_gfx2hlsl_mul24_align_warp fails on WARP at head d9214336, with the all-zero readback that thepatrickworld reported earlier in this thread. The failure comes from the fxc branch. The dxc branch passes on this head on WARP when run alone.

Command

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

Observed (two runs, same result)

The fxc ops v_mul_i32_i24, v_mad_i32_i24 and v_mul_hi_i32_i24 pass. Then:

AssertionError: fxc v_mul_hi_u32_u24 inputs [(8388607, 8388607, 0), (8388608, 8388608, 1), (16777215, 16777215, 4294967295), (8388609, 8388607, 5)]
startup_flat_param mismatch expected=00003fff,00004000,0000ffff,00003fff actual=00000000,00000000,00000000,00000000
flat parameter readback differs

dxc branch, run alone on the same head and adapter

The fxc argument of startup_gfx2hlsl_mul24_align_draw_check.py is optional (check_draw(dxc, renderer, adapter, fxc=None)). I ran the command of the ctest test without it:

python -B tests/startup_gfx2hlsl_mul24_align_draw_check.py draw <dxc.exe> <offscreen_check.exe> warp

Result: exit code 0. The log has 21 dxc lines: 3 chunks each for v_mul_i32_i24, v_mad_i32_i24, v_mul_hi_i32_i24, v_mul_hi_u32_u24, v_xnor_b32, v_alignbit_b32 and v_alignbyte_b32. v_mul_hi_u32_u24 passes under dxc on WARP, with debug_errors=0 debug_warnings=0.

Measured

  • In the ctest run, the DXC branch did not start. check_draw() runs all ops with fxc first, and the assertion stops the test. That log has 0 dxc result lines.
  • thepatrickworld's fxc /T ps_5_1 disassembly earlier in this thread shows the shader folded to mov o0.xyzw, l(0,0,0,0). I did not repeat it on this head.
  • This head contains 5c8e82d7 ("fix: read the unsigned 24-bit fields with a shift pair so FXC keeps the high product"). The fxc readback of v_mul_hi_u32_u24 is still zero here.
  • The pull request job does not run this test; the push job does. In .github/workflows/windows.yml at this head:
    • On pull_request the job runs ctest --preset pr --no-tests=error ... (line 334). The pr preset does not select startup_gfx2hlsl_mul24_align*. The Windows CI run on this head lists 31 tests and none is mul24.
    • On other events, including push to main, the job runs ctest --preset dev --no-tests=error --parallel 4 -E '_hardware$' ... (line 339). The name startup_gfx2hlsl_mul24_align_warp does not end in _hardware, so this selection includes it.
    • I did not run the push job. By the measurement above, I expect it to fail on this test after merge, unless a later commit changes the result or CI behaves differently from this machine.
  • startup_gfx2hlsl_mul24_align (non-draw) passes.

Environment: Windows 11 build 26300; fxc.exe 10.0.26100.9457 (SDK 10.0.26100.0); dxc 1.9.2602.17; WARP "Microsoft Basic Render Driver" 1414:008c, driver 10.0.26100.9818; D3D12 debug layer enabled, debug_errors=0 debug_warnings=0; Debug build. No hardware run in this comment.

Suggestion

Run the DXC branch even when the fxc branch fails, then report both results at the end. This does not change the pass criteria. It makes the fxc-only failure visible in a single run.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7159516866 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2077#issuecomment-7159516866). Originally posted by [Makto94](https://github.com/Makto94) on 2026-11-25T10:18:30Z. --- `startup_gfx2hlsl_mul24_align_warp` fails on WARP at head `d9214336`, with the all-zero readback that thepatrickworld reported earlier in this thread. The failure comes from the fxc branch. The dxc branch passes on this head on WARP when run alone. **Command** ```powershell .\tools\dev.ps1; ctest --preset dev --no-tests=error -j1 -R '^startup_gfx2hlsl_mul24_align_warp$' -V ``` **Observed (two runs, same result)** The fxc ops `v_mul_i32_i24`, `v_mad_i32_i24` and `v_mul_hi_i32_i24` pass. Then: ``` AssertionError: fxc v_mul_hi_u32_u24 inputs [(8388607, 8388607, 0), (8388608, 8388608, 1), (16777215, 16777215, 4294967295), (8388609, 8388607, 5)] startup_flat_param mismatch expected=00003fff,00004000,0000ffff,00003fff actual=00000000,00000000,00000000,00000000 flat parameter readback differs ``` **dxc branch, run alone on the same head and adapter** The `fxc` argument of `startup_gfx2hlsl_mul24_align_draw_check.py` is optional (`check_draw(dxc, renderer, adapter, fxc=None)`). I ran the command of the ctest test without it: ``` python -B tests/startup_gfx2hlsl_mul24_align_draw_check.py draw <dxc.exe> <offscreen_check.exe> warp ``` Result: exit code 0. The log has 21 `dxc` lines: 3 chunks each for `v_mul_i32_i24`, `v_mad_i32_i24`, `v_mul_hi_i32_i24`, `v_mul_hi_u32_u24`, `v_xnor_b32`, `v_alignbit_b32` and `v_alignbyte_b32`. `v_mul_hi_u32_u24` passes under dxc on WARP, with `debug_errors=0 debug_warnings=0`. **Measured** - In the ctest run, the DXC branch did not start. `check_draw()` runs all ops with fxc first, and the assertion stops the test. That log has 0 `dxc` result lines. - thepatrickworld's `fxc /T ps_5_1` disassembly earlier in this thread shows the shader folded to `mov o0.xyzw, l(0,0,0,0)`. I did not repeat it on this head. - This head contains `5c8e82d7` ("fix: read the unsigned 24-bit fields with a shift pair so FXC keeps the high product"). The fxc readback of `v_mul_hi_u32_u24` is still zero here. - The pull request job does not run this test; the push job does. In `.github/workflows/windows.yml` at this head: - On `pull_request` the job runs `ctest --preset pr --no-tests=error ...` (line 334). The `pr` preset does not select `startup_gfx2hlsl_mul24_align*`. The Windows CI run on this head lists 31 tests and none is mul24. - On other events, including push to `main`, the job runs `ctest --preset dev --no-tests=error --parallel 4 -E '_hardware$' ...` (line 339). The name `startup_gfx2hlsl_mul24_align_warp` does not end in `_hardware`, so this selection includes it. - I did not run the push job. By the measurement above, I expect it to fail on this test after merge, unless a later commit changes the result or CI behaves differently from this machine. - `startup_gfx2hlsl_mul24_align` (non-draw) passes. **Environment**: Windows 11 build 26300; `fxc.exe` 10.0.26100.9457 (SDK 10.0.26100.0); `dxc` 1.9.2602.17; WARP "Microsoft Basic Render Driver" 1414:008c, driver 10.0.26100.9818; D3D12 debug layer enabled, `debug_errors=0 debug_warnings=0`; Debug build. No hardware run in this comment. **Suggestion** Run the DXC branch even when the fxc branch fails, then report both results at the end. This does not change the pass criteria. It makes the fxc-only failure visible in a single run.
Makto94 commented 2026-11-25 11:02:30 +00:00 (Migrated from github.com)

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


Hardware result for head d9214336, on an RTX 3070 Ti (10de:2482, driver 32.0.16.2101, Windows 11 build 26300.9974, fxc 10.0.26100.9457, dxc 1.9.2602.17, debug layer enabled, 0 capability skips (77)). It matches the WARP result in my earlier comment.

.\tools\dev.ps1; ctest --preset dev --no-tests=error -j1 -R '^startup_gfx2hlsl_mul24_align_hardware$' -V
  • FXC fails at the same op: AssertionError: fxc v_mul_hi_u32_u24 ... with startup_flat_param mismatch expected=00003fff,00004000,0000ffff,00003fff actual=00000000,00000000,00000000,00000000. The FXC ops before it (v_mul_i32_i24, v_mad_i32_i24, v_mul_hi_i32_i24) pass.
  • DXC alone (same script command without the fxc argument) printed 21 dxc result lines, 3 per op for all 7 ops, with no traceback, exit code 0. All 21 draws report debug_errors=0 debug_warnings=0.
  • Not measured on this head: AMD and Intel. The AMD run in this thread (thepatrickworld) was reported before this head was pushed.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7159722709 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2077#issuecomment-7159722709). Originally posted by [Makto94](https://github.com/Makto94) on 2026-11-25T10:27:32Z. --- Hardware result for head `d9214336`, on an RTX 3070 Ti (`10de:2482`, driver 32.0.16.2101, Windows 11 build 26300.9974, fxc 10.0.26100.9457, dxc 1.9.2602.17, debug layer enabled, 0 capability skips (77)). It matches the WARP result in [my earlier comment](https://github.com/R0Y00/Xbox2Windows/pull/2077#issuecomment-7159516866). ```powershell .\tools\dev.ps1; ctest --preset dev --no-tests=error -j1 -R '^startup_gfx2hlsl_mul24_align_hardware$' -V ``` - FXC fails at the same op: `AssertionError: fxc v_mul_hi_u32_u24 ...` with `startup_flat_param mismatch expected=00003fff,00004000,0000ffff,00003fff actual=00000000,00000000,00000000,00000000`. The FXC ops before it (`v_mul_i32_i24`, `v_mad_i32_i24`, `v_mul_hi_i32_i24`) pass. - DXC alone (same script command without the `fxc` argument) printed 21 `dxc` result lines, 3 per op for all 7 ops, with no traceback, exit code 0. All 21 draws report `debug_errors=0 debug_warnings=0`. - Not measured on this head: AMD and Intel. The AMD run in this thread (thepatrickworld) was reported before this head was pushed.
thepatrickworld commented 2026-11-25 11:02:36 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-25T11:02:28Z.


Two corrections to the "Limits" paragraph of my comment above.

  1. I wrote "AMD RDNA2 only". The card is an RX 9070 XT, RDNA4 (gfx1201) — RDNA2 is the ISA I quote for the comparison rules, not the hardware I ran on. Sloppy, and wrong in the one paragraph where precision matters.

  2. "no NVIDIA card here, so I can't say whether the same fold appears elsewhere" no longer holds: Makto94 reproduced the same fold on an RTX 3070 Ti, same op, same four zeros, with the neighbouring ops passing. So this is not an AMD artefact, and the fxc optimiser is the common factor.

What still stands: one fxc build (10.0.26100.0), and I have not isolated which sub-expression makes the optimiser fold the expression to zero.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7160507276 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2077#issuecomment-7160507276). Originally posted by [thepatrickworld](https://github.com/thepatrickworld) on 2026-11-25T11:02:28Z. --- Two corrections to the "Limits" paragraph of my comment above. 1. I wrote "AMD RDNA2 only". The card is an **RX 9070 XT, RDNA4 (`gfx1201`)** — RDNA2 is the ISA I quote for the comparison rules, not the hardware I ran on. Sloppy, and wrong in the one paragraph where precision matters. 2. "no NVIDIA card here, so I can't say whether the same fold appears elsewhere" no longer holds: Makto94 reproduced the same fold on an RTX 3070 Ti, same op, same four zeros, with the neighbouring ops passing. So this is not an AMD artefact, and the fxc optimiser is the common factor. What still stands: one fxc build (10.0.26100.0), and I have not isolated which sub-expression makes the optimiser fold the expression to zero. _AI-assisted._
tedin7 commented 2026-11-25 12:01:31 +00:00 (Migrated from github.com)

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

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6056478674 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2077#pullrequestreview-6056478674). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T11:08:09Z. **Review:** COMMENTED --- _No description provided._
tedin7 commented 2026-11-25 12:01:52 +00:00 (Migrated from github.com)

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


@Makto94 thank you for the WARP and hardware runs and for the line-by-line CI analysis; the failure was real. Pushed ca819bf7.

  • v_mul_hi_u32_u24 is now refused (Unsupported, VOP2 and _e64) instead of being translated into the zeros FXC produced. Three unsigned variants all folded to zero under FXC ps_5_1; DXC kept them. A lowering FXC keeps can replace the refusal later. The reason is written next to the table in tools/startup/gfx2hlsl.py and in a new section of docs/experiments.md.
  • startup_gfx2hlsl_mul24_align_check.py now asserts both refusals; the draw check covers the six translated instructions and runs both compilers before it fails, as you suggested.

Verification (Windows Server 2025 build 26100, MSVC 14.44.35207, D3D12 WARP), commit ca819bf7:

  • python3 /root/.local/state/xbox2windows/pipeline/x2w_pipe.py win2025 2077 --force --targets offscreen_check --regex '^startup_gfx2hlsl_mul24_align'
  • Debug and Release: startup_gfx2hlsl_mul24_align, _warp and _hardware 3/3 passed in each. On that machine the _hardware test ran on the Microsoft Basic Render Driver, so it is not a physical GPU result.
  • Not re-run: a physical GPU (your RTX 3070 Ti and the RX 9070 XT), so a run there would still be welcome.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7160549878 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2077#issuecomment-7160549878). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T11:04:24Z. --- @Makto94 thank you for the WARP and hardware runs and for the line-by-line CI analysis; the failure was real. Pushed ca819bf7. - `v_mul_hi_u32_u24` is now refused (`Unsupported`, VOP2 and `_e64`) instead of being translated into the zeros FXC produced. Three unsigned variants all folded to zero under FXC `ps_5_1`; DXC kept them. A lowering FXC keeps can replace the refusal later. The reason is written next to the table in `tools/startup/gfx2hlsl.py` and in a new section of `docs/experiments.md`. - `startup_gfx2hlsl_mul24_align_check.py` now asserts both refusals; the draw check covers the six translated instructions and runs both compilers before it fails, as you suggested. Verification (Windows Server 2025 build 26100, MSVC 14.44.35207, D3D12 WARP), commit ca819bf7: - `python3 /root/.local/state/xbox2windows/pipeline/x2w_pipe.py win2025 2077 --force --targets offscreen_check --regex '^startup_gfx2hlsl_mul24_align'` - Debug and Release: `startup_gfx2hlsl_mul24_align`, `_warp` and `_hardware` 3/3 passed in each. On that machine the `_hardware` test ran on the Microsoft Basic Render Driver, so it is not a physical GPU result. - Not re-run: a physical GPU (your RTX 3070 Ti and the RX 9070 XT), so a run there would still be welcome. AI-assisted; commands listed were executed locally.
Makto94 commented 2026-11-25 12:01:52 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Makto94 on 2026-11-25T11:11:28Z.


I ran the hardware test on ca819bf7, as you asked.

  • Hardware: .\tools\dev.ps1; ctest --preset dev --no-tests=error -j1 -R '^startup_gfx2hlsl_mul24_align_hardware$' -V passes. The log has 18 fxc and 18 dxc result lines, 3 for each of the six ops (v_mul_i32_i24, v_mad_i32_i24, v_mul_hi_i32_i24, v_xnor_b32, v_alignbit_b32, v_alignbyte_b32). No debug_errors= line has a non-zero value in either log, and there are no skips (77). Serial run on an idle machine.
  • CPU and WARP: .\tools\dev.ps1; ctest --preset dev --no-tests=error -j1 -R '^startup_gfx2hlsl_mul24_align($|_warp$)' -V gives 100% tests passed, 0 tests failed out of 2. startup_gfx2hlsl_mul24_align prints v_mul_hi_u32_u24: refused ok and v_mul_hi_u32_u24_e64: refused ok.
  • Environment: RTX 3070 Ti (10de:2482), driver 32.0.16.2101; WARP (Microsoft Basic Render Driver, 1414:008c), driver 10.0.26100.9818; Windows 11 build 26300.9974, Debug build, D3D12 debug layer enabled, fxc 10.0.26100.9457, dxc 1.9.2602.17. The binaries were built at d9214336; between that commit and ca819bf7 only Python files and docs change.

Some FXC data, in case it helps a later lowering of v_mul_hi_u32_u24. The pixel shader comes from the check at 450326ef, where FXC still read zeros on WARP and on the RTX; at ca819bf7 the op is no longer generated. Command: fxc /nologo /T ps_5_1 /E main /Fc out.asm ps.hlsl. Each variant changes only the o.mrt0 line (and the output type for the uint4 rows).

Output expression Output type Maximum value Folded to mov o0.xyzw, l(0,0,0,0)
F(v12)..F(v15) (generated) float 0xffff yes
F(v0 >> 9) float 0x7fffff yes
F(v0 >> 8) float 0xffffff no
uint4(v0 >> 9, ...) uint4 0x7fffff no
uint4(v12, v13, v14, v15) uint4 0xffff no
generated shader with /Gis float 0xffff yes (mov [precise] o0.xyzw, l(0,0,0,0))

docs/experiments.md at ca819bf7 says: "Three variants (an unsigned shift pair, a shift and a mask, and the signed shift pair with a mask) all folded to zero under FXC". Measured here: F(v0 >> 9) folds with no product in it, and the same generated arithmetic with a uint4 output is kept.

My hypothesis, not tested further: below 0x00800000 the word read as a float is denormal, and FXC seems to zero a float output whose provable range lies entirely under that value. At runtime small words survive: on the RTX at ca819bf7, FXC v_mul_hi_i32_i24 reads back 00003fff,00004000,00000000,ffffc000 and passes.

Limits: one fxc version only, and the variants were compiled, not drawn.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7160715098 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2077#issuecomment-7160715098). Originally posted by [Makto94](https://github.com/Makto94) on 2026-11-25T11:11:28Z. --- I ran the hardware test on `ca819bf7`, as you asked. - Hardware: `.\tools\dev.ps1; ctest --preset dev --no-tests=error -j1 -R '^startup_gfx2hlsl_mul24_align_hardware$' -V` passes. The log has 18 `fxc` and 18 `dxc` result lines, 3 for each of the six ops (`v_mul_i32_i24`, `v_mad_i32_i24`, `v_mul_hi_i32_i24`, `v_xnor_b32`, `v_alignbit_b32`, `v_alignbyte_b32`). No `debug_errors=` line has a non-zero value in either log, and there are no skips (77). Serial run on an idle machine. - CPU and WARP: `.\tools\dev.ps1; ctest --preset dev --no-tests=error -j1 -R '^startup_gfx2hlsl_mul24_align($|_warp$)' -V` gives `100% tests passed, 0 tests failed out of 2`. `startup_gfx2hlsl_mul24_align` prints `v_mul_hi_u32_u24: refused ok` and `v_mul_hi_u32_u24_e64: refused ok`. - Environment: RTX 3070 Ti (`10de:2482`), driver 32.0.16.2101; WARP (Microsoft Basic Render Driver, `1414:008c`), driver 10.0.26100.9818; Windows 11 build 26300.9974, Debug build, D3D12 debug layer enabled, fxc 10.0.26100.9457, dxc 1.9.2602.17. The binaries were built at `d9214336`; between that commit and `ca819bf7` only Python files and docs change. Some FXC data, in case it helps a later lowering of `v_mul_hi_u32_u24`. The pixel shader comes from the check at `450326ef`, where FXC still read zeros on WARP and on the RTX; at `ca819bf7` the op is no longer generated. Command: `fxc /nologo /T ps_5_1 /E main /Fc out.asm ps.hlsl`. Each variant changes only the `o.mrt0` line (and the output type for the uint4 rows). | Output expression | Output type | Maximum value | Folded to `mov o0.xyzw, l(0,0,0,0)` | |---|---|---|---| | `F(v12)..F(v15)` (generated) | float | 0xffff | yes | | `F(v0 >> 9)` | float | 0x7fffff | yes | | `F(v0 >> 8)` | float | 0xffffff | no | | `uint4(v0 >> 9, ...)` | uint4 | 0x7fffff | no | | `uint4(v12, v13, v14, v15)` | uint4 | 0xffff | no | | generated shader with `/Gis` | float | 0xffff | yes (`mov [precise] o0.xyzw, l(0,0,0,0)`) | `docs/experiments.md` at `ca819bf7` says: "Three variants (an unsigned shift pair, a shift and a mask, and the signed shift pair with a mask) all folded to zero under FXC". Measured here: `F(v0 >> 9)` folds with no product in it, and the same generated arithmetic with a uint4 output is kept. My hypothesis, not tested further: below 0x00800000 the word read as a float is denormal, and FXC seems to zero a float output whose provable range lies entirely under that value. At runtime small words survive: on the RTX at `ca819bf7`, FXC `v_mul_hi_i32_i24` reads back `00003fff,00004000,00000000,ffffc000` and passes. Limits: one fxc version only, and the variants were compiled, not drawn.
tedin7 commented 2026-11-25 12:01:57 +00:00 (Migrated from github.com)

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

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

@@ -1864,6 +1864,49 @@ def declarations(self):
     'v_ffbh_i32': (1, '({0} == 0u || {0} == 0xffffffffu ? 0xffffffffu : 31u - firstbithigh(asint({0}) < 0 ? ~{0} : {0}))'),
     'v_bfrev_b32': (1, 'reversebits({0})'),
 }
+
+
+def _mul24_hi(signed):
+    """High 32 bits of the 48-bit product of two 24-bit fields, in 32-bit integer arithmetic.
+
+    With a = ah * 2^12 + al (al in 0..4095, ah the top 12 bits, sign-extended for the signed form) the product is
+    hh * 2^24 + mid * 2^12 + lo, so p >> 12 = hh * 2^12 + (mid + (lo >> 12)) exactly, and the result is that value
+    shifted right by 20 once hh * 2^12 is split into (hh >> 8) * 2^20 and (hh & 255) * 2^12 to stay inside 32 bits.
+    """
+    if signed:
+        def top(n):
+            return '(asint({%d} << 8) >> 20)' % n
+
+        def low(n):
+            return 'asint({%d} & 0xfffu)' % n
+        mask, wrap = '255', 'asuint(%s)'
+    else:
+        def top(n):
+            return '(({%d} >> 12) & 0xfffu)' % n
+
+        def low(n):
+            return '({%d} & 0xfffu)' % n
+        mask, wrap = '255u', '%s'
+    hh = '(%s * %s)' % (top(0), top(1))
+    mid = '(%s * %s + %s * %s)' % (top(0), low(1), low(0), top(1))
+    r = '(%s + ((%s * %s) >> 12))' % (mid, low(0), low(1))
+    return wrap % ('((%s >> 8) + (((((%s & %s) << 12) + %s)) >> 20))' % (hh, hh, mask, r))
+
+
+VEC_U.update({
+    # AMD RDNA 2 ISA reference: the 24-bit multiplies read the low 24 bits of each source, the signed forms as a
+    # two's complement field. The mul and mad forms keep the low 32 bits of the product; the hi forms keep bits 63..32
+    # of the 48-bit product. The 24-bit field is sign-extended with a left shift of 8 and an arithmetic right shift.
+    'v_mul_i32_i24': (2, 'asuint((asint({0} << 8) >> 8) * (asint({1} << 8) >> 8))'),
+    'v_mad_i32_i24': (3, 'asuint((asint({0} << 8) >> 8) * (asint({1} << 8) >> 8)) + {2}'),
+    'v_mul_hi_u32_u24': (2, _mul24_hi(False)),
+    'v_mul_hi_i32_i24': (2, _mul24_hi(True)),
+    'v_xnor_b32': (2, '~({0} ^ {1})'),
+    # v_alignbit_b32 takes bits [S2[4:0] + 31 : S2[4:0]] of the 64-bit value {S0, S1}; a zero shift returns S1 and
+    # the guard avoids a shift by 32. v_alignbyte_b32 does the same with S2[1:0] * 8 bits.
+    'v_alignbit_b32': (3, '(({2} & 31u) == 0u ? {1} : (({1} >> ({2} & 31u)) | ({0} << (32u - ({2} & 31u)))))'),

Addressed at ca819bf796: docs/experiments.md now has a "Startup 24-bit multiplies, v_xnor_b32 and the funnel shifts" section listing the translated forms, the refused v_mul_hi_u32_u24, and the reproduction commands (python3 -B tests/startup_gfx2hlsl_mul24_align_check.py, ctest --preset dev --no-tests=error -R '^startup_gfx2hlsl_mul24_align$' -V). The stale "not lowered" wording no longer matches the file.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4693992171 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2077#discussion_r4693992171). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T11:08:09Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 1907 ~~~~diff @@ -1864,6 +1864,49 @@ def declarations(self): 'v_ffbh_i32': (1, '({0} == 0u || {0} == 0xffffffffu ? 0xffffffffu : 31u - firstbithigh(asint({0}) < 0 ? ~{0} : {0}))'), 'v_bfrev_b32': (1, 'reversebits({0})'), } + + +def _mul24_hi(signed): + """High 32 bits of the 48-bit product of two 24-bit fields, in 32-bit integer arithmetic. + + With a = ah * 2^12 + al (al in 0..4095, ah the top 12 bits, sign-extended for the signed form) the product is + hh * 2^24 + mid * 2^12 + lo, so p >> 12 = hh * 2^12 + (mid + (lo >> 12)) exactly, and the result is that value + shifted right by 20 once hh * 2^12 is split into (hh >> 8) * 2^20 and (hh & 255) * 2^12 to stay inside 32 bits. + """ + if signed: + def top(n): + return '(asint({%d} << 8) >> 20)' % n + + def low(n): + return 'asint({%d} & 0xfffu)' % n + mask, wrap = '255', 'asuint(%s)' + else: + def top(n): + return '(({%d} >> 12) & 0xfffu)' % n + + def low(n): + return '({%d} & 0xfffu)' % n + mask, wrap = '255u', '%s' + hh = '(%s * %s)' % (top(0), top(1)) + mid = '(%s * %s + %s * %s)' % (top(0), low(1), low(0), top(1)) + r = '(%s + ((%s * %s) >> 12))' % (mid, low(0), low(1)) + return wrap % ('((%s >> 8) + (((((%s & %s) << 12) + %s)) >> 20))' % (hh, hh, mask, r)) + + +VEC_U.update({ + # AMD RDNA 2 ISA reference: the 24-bit multiplies read the low 24 bits of each source, the signed forms as a + # two's complement field. The mul and mad forms keep the low 32 bits of the product; the hi forms keep bits 63..32 + # of the 48-bit product. The 24-bit field is sign-extended with a left shift of 8 and an arithmetic right shift. + 'v_mul_i32_i24': (2, 'asuint((asint({0} << 8) >> 8) * (asint({1} << 8) >> 8))'), + 'v_mad_i32_i24': (3, 'asuint((asint({0} << 8) >> 8) * (asint({1} << 8) >> 8)) + {2}'), + 'v_mul_hi_u32_u24': (2, _mul24_hi(False)), + 'v_mul_hi_i32_i24': (2, _mul24_hi(True)), + 'v_xnor_b32': (2, '~({0} ^ {1})'), + # v_alignbit_b32 takes bits [S2[4:0] + 31 : S2[4:0]] of the 64-bit value {S0, S1}; a zero shift returns S1 and + # the guard avoids a shift by 32. v_alignbyte_b32 does the same with S2[1:0] * 8 bits. + 'v_alignbit_b32': (3, '(({2} & 31u) == 0u ? {1} : (({1} >> ({2} & 31u)) | ({0} << (32u - ({2} & 31u)))))'), ~~~~ --- Addressed at ca819bf796de6bdcbab6d1db0271b713d3d5f49d: docs/experiments.md now has a "Startup 24-bit multiplies, v_xnor_b32 and the funnel shifts" section listing the translated forms, the refused v_mul_hi_u32_u24, and the reproduction commands (`python3 -B tests/startup_gfx2hlsl_mul24_align_check.py`, `ctest --preset dev --no-tests=error -R '^startup_gfx2hlsl_mul24_align$' -V`). The stale "not lowered" wording no longer matches the file. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 13:00:58 +00:00 (Migrated from github.com)

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


@Makto94 thank you for the hardware run and the FXC table. Your denormal reading fits the data, and I took it.

  • The v_mul_hi_u32_u24 refusal stays. Its result is at most 0xffff, so as a float output word it is always a binary32 denormal. FXC folds a float output whose provable range is under 0x00800000, so any lowering of this op would read zeros on the float path.
  • I corrected the wrong claim. docs/experiments.md and the comment next to the table in tools/startup/gfx2hlsl.py no longer say "three unsigned variants folded". They now give the cause (denormal float output), your F(v0 >> 9) / F(v0 >> 8) / uint4 results, and say the variants were compiled, not drawn, on one FXC version.
  • No code change in the lowering, so no new test: startup_gfx2hlsl_mul24_align already asserts both refusals.

Committed as 438079bf (docs and a comment only).

Commands run locally:

  • python3 -B tests/startup_gfx2hlsl_mul24_align_check.py (both v_mul_hi_u32_u24 spellings print refused ok)

Not re-run: Win2025 WARP and hardware (no executable change since the last passing run).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7161911346 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2077#issuecomment-7161911346). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T12:05:42Z. --- @Makto94 thank you for the hardware run and the FXC table. Your denormal reading fits the data, and I took it. - The `v_mul_hi_u32_u24` refusal stays. Its result is at most `0xffff`, so as a float output word it is always a binary32 denormal. FXC folds a float output whose provable range is under `0x00800000`, so any lowering of this op would read zeros on the float path. - I corrected the wrong claim. `docs/experiments.md` and the comment next to the table in `tools/startup/gfx2hlsl.py` no longer say "three unsigned variants folded". They now give the cause (denormal float output), your `F(v0 >> 9)` / `F(v0 >> 8)` / `uint4` results, and say the variants were compiled, not drawn, on one FXC version. - No code change in the lowering, so no new test: `startup_gfx2hlsl_mul24_align` already asserts both refusals. Committed as `438079bf` (docs and a comment only). Commands run locally: - `python3 -B tests/startup_gfx2hlsl_mul24_align_check.py` (both `v_mul_hi_u32_u24` spellings print `refused ok`) Not re-run: Win2025 WARP and hardware (no executable change since the last passing run). AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-25 14:04:38 +00:00
tedin7 commented 2026-11-25 14:05:15 +00:00 (Migrated from github.com)

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


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:7164407818 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2077#issuecomment-7164407818). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T13:52:09Z. --- 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.
tedin7 commented 2026-11-26 00:01:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T23:08:55Z.


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

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target offscreen_check -- -j 2): 23.83s (configure 1.94s)
    • Test (ctest --preset dev -R 'startup_gfx2hlsl_(mul24_align|mul_mad_i24)' --parallel 4 --no-tests=error --output-on-failure): 6/6 passed (4.15s: startup_gfx2hlsl_mul_mad_i24_controls 0.25s, startup_gfx2hlsl_mul24_align 0.38s, startup_gfx2hlsl_mul_mad_i24_warp 1.59s, startup_gfx2hlsl_mul_mad_i24_hardware 1.49s, startup_gfx2hlsl_mul24_align_hardware 4.01s, startup_gfx2hlsl_mul24_align_warp 4.02s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target offscreen_check -- -j 2): 44.59s (configure 2.34s)
    • Test (ctest --preset release -R 'startup_gfx2hlsl_(mul24_align|mul_mad_i24)' --parallel 4 --no-tests=error --output-on-failure): 6/6 passed (4.35s: startup_gfx2hlsl_mul_mad_i24_controls 0.25s, startup_gfx2hlsl_mul24_align 0.34s, startup_gfx2hlsl_mul_mad_i24_warp 1.62s, startup_gfx2hlsl_mul_mad_i24_hardware 1.61s, startup_gfx2hlsl_mul24_align_warp 4.20s, startup_gfx2hlsl_mul24_align_hardware 4.21s)
  • 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_request_offline_check.py ok (0.4s), 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_bit_alu_check.py ok (0.6s), tests/startup_gfx2hlsl_capture_check.py ok (0.9s), tests/startup_gfx2hlsl_cmp16_check.py ok (0.3s), tests/startup_gfx2hlsl_compare_dst_check.py ok (0.1s), tests/startup_gfx2hlsl_compute_check.py ok (0.3s), 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.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_image_arity_check.py ok (0.1s), tests/startup_gfx2hlsl_image_get_lod_check.py ok (0.1s), 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_overwrite_check.py ok (0.1s), tests/startup_gfx2hlsl_operand_count_check.py ok (0.2s), tests/startup_gfx2hlsl_pack_absdiff_check.py ok (2.2s), 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.6s), tests/startup_gfx2hlsl_sad_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_table_arity_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 (5.0s), tests/startup_gfx2hlsl_sopk_accum_check.py ok (0.8s), tests/startup_gfx2hlsl_sopk_signext_check.py ok (0.1s), tests/startup_gfx2hlsl_swap_check.py ok (0.2s), tests/startup_gfx2hlsl_vopc_sdwa_check.py ok (3.9s), 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.2s), 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.9s), 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_skeleton_check.py ok (0.4s), tests/startup_run_ps1_check.py ok (8.7s), 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 (1.6s), 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.4s)
  • sccache: 2/10 hits; wall 131.3s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7177201595 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2077#issuecomment-7177201595). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T23:08:55Z. --- Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `8c3de91b5bd12a9ed4a6d908ea8e9ca903318a47`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target offscreen_check -- -j 2`): `23.83s` (configure `1.94s`) - Test (`ctest --preset dev -R 'startup_gfx2hlsl_(mul24_align|mul_mad_i24)' --parallel 4 --no-tests=error --output-on-failure`): **6/6 passed** (`4.15s`: `startup_gfx2hlsl_mul_mad_i24_controls` `0.25s`, `startup_gfx2hlsl_mul24_align` `0.38s`, `startup_gfx2hlsl_mul_mad_i24_warp` `1.59s`, `startup_gfx2hlsl_mul_mad_i24_hardware` `1.49s`, `startup_gfx2hlsl_mul24_align_hardware` `4.01s`, `startup_gfx2hlsl_mul24_align_warp` `4.02s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target offscreen_check -- -j 2`): `44.59s` (configure `2.34s`) - Test (`ctest --preset release -R 'startup_gfx2hlsl_(mul24_align|mul_mad_i24)' --parallel 4 --no-tests=error --output-on-failure`): **6/6 passed** (`4.35s`: `startup_gfx2hlsl_mul_mad_i24_controls` `0.25s`, `startup_gfx2hlsl_mul24_align` `0.34s`, `startup_gfx2hlsl_mul_mad_i24_warp` `1.62s`, `startup_gfx2hlsl_mul_mad_i24_hardware` `1.61s`, `startup_gfx2hlsl_mul24_align_warp` `4.20s`, `startup_gfx2hlsl_mul24_align_hardware` `4.21s`) - **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_request_offline_check.py` ok (`0.4s`), `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_bit_alu_check.py` ok (`0.6s`), `tests/startup_gfx2hlsl_capture_check.py` ok (`0.9s`), `tests/startup_gfx2hlsl_cmp16_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_compare_dst_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_compute_check.py` ok (`0.3s`), `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.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_image_arity_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_image_get_lod_check.py` ok (`0.1s`), `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_overwrite_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_operand_count_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_pack_absdiff_check.py` ok (`2.2s`), `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.6s`), `tests/startup_gfx2hlsl_sad_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_table_arity_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 (`5.0s`), `tests/startup_gfx2hlsl_sopk_accum_check.py` ok (`0.8s`), `tests/startup_gfx2hlsl_sopk_signext_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_swap_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_vopc_sdwa_check.py` ok (`3.9s`), `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.2s`), `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.9s`), `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_skeleton_check.py` ok (`0.4s`), `tests/startup_run_ps1_check.py` ok (`8.7s`), `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 (`1.6s`), `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.4s`) - `sccache`: 2/10 hits; wall `131.3s` AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 00:01:10 +00:00 (Migrated from github.com)

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


@MasterDomino #2077 is ready for review/merge.

  • What changed: merged origin/main (no force-push). The Linux check startup_gfx2hlsl_mul_mad_i24_check.py failed because this PR re-registered v_mul_i32_i24 / v_mad_i32_i24 with different text than main's, which broke that test's mutation control. I dropped the two duplicate entries so main's lowering stays; the new mul24/alignbit lowerings are unchanged.
  • Head: 8c3de91b5bd12a9ed4a6d908ea8e9ca903318a47. CI is green on this head.
  • Win2025 dev + release receipt (WARP readback vs CPU reference, startup_gfx2hlsl_mul24_align_warp and startup_gfx2hlsl_mul_mad_i24_warp) is in the comment above.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7177203117 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2077#issuecomment-7177203117). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T23:09:00Z. --- @MasterDomino #2077 is ready for review/merge. - What changed: merged `origin/main` (no force-push). The Linux check `startup_gfx2hlsl_mul_mad_i24_check.py` failed because this PR re-registered `v_mul_i32_i24` / `v_mad_i32_i24` with different text than main's, which broke that test's mutation control. I dropped the two duplicate entries so main's lowering stays; the new mul24/alignbit lowerings are unchanged. - Head: `8c3de91b5bd12a9ed4a6d908ea8e9ca903318a47`. CI is green on this head. - Win2025 dev + release receipt (WARP readback vs CPU reference, `startup_gfx2hlsl_mul24_align_warp` and `startup_gfx2hlsl_mul_mad_i24_warp`) is in the comment above. 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!2070
No description provided.