shader: lower 64-bit scalar compares, quadmask and wqm in gfx2hlsl (Part of #1723) #2069

Closed
tedin7 wants to merge 4 commits from upstream-pr/2076 into main
tedin7 commented 2026-11-25 00:03:11 +00:00 (Migrated from github.com)

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


Part of #1723

What this unblocks: gfx2hlsl can translate shaders that compare 64-bit scalar pairs, test a bit of a 64-bit pair, or build quad masks (s_quadmask, s_wqm) on ordinary scalar registers, instead of refusing them or silently skipping s_wqm.

Lowers s_cmp_eq_u64, s_cmp_lg_u64, s_bitcmp0_b64, s_bitcmp1_b64, s_quadmask_b32/b64 and s_wqm_b32/b64 in tools/startup/gfx2hlsl.py. 64-bit operands are even-aligned SGPR pairs or immediates (inline constants sign-extended, 32-bit literals zero-extended). Lane-mask operands (exec, vcc, projected masks) and misaligned pairs are refused; s_wqm of a lane mask keeps its previous no-op behaviour.

Verification:

  • python3 -B tests/startup_gfx2hlsl_s_cmp64_wqm_check.py on this branch: s_cmp64_wqm: ok. The same test against origin/main's gfx2hlsl.py: 631 failures.
  • python3 -B on every tests/*gfx2hlsl*_check.py, plus tests/pixel_aot_check.py: all pass.
  • Test registered as startup_gfx2hlsl_s_cmp64_wqm in CMakeLists.txt.
  • Not run: tests/form_coverage_check.py (needs the iced_x86 module, not installed here). Win2025 run not executed; checks ran locally on Linux.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6593980600 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2076). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T00:03:11Z. --- Part of #1723 What this unblocks: gfx2hlsl can translate shaders that compare 64-bit scalar pairs, test a bit of a 64-bit pair, or build quad masks (`s_quadmask`, `s_wqm`) on ordinary scalar registers, instead of refusing them or silently skipping `s_wqm`. Lowers `s_cmp_eq_u64`, `s_cmp_lg_u64`, `s_bitcmp0_b64`, `s_bitcmp1_b64`, `s_quadmask_b32/b64` and `s_wqm_b32/b64` in `tools/startup/gfx2hlsl.py`. 64-bit operands are even-aligned SGPR pairs or immediates (inline constants sign-extended, 32-bit literals zero-extended). Lane-mask operands (exec, vcc, projected masks) and misaligned pairs are refused; `s_wqm` of a lane mask keeps its previous no-op behaviour. Verification: - `python3 -B tests/startup_gfx2hlsl_s_cmp64_wqm_check.py` on this branch: `s_cmp64_wqm: ok`. The same test against `origin/main`'s `gfx2hlsl.py`: 631 failures. - `python3 -B` on every `tests/*gfx2hlsl*_check.py`, plus `tests/pixel_aot_check.py`: all pass. - Test registered as `startup_gfx2hlsl_s_cmp64_wqm` in `CMakeLists.txt`. - Not run: `tests/form_coverage_check.py` (needs the `iced_x86` module, not installed here). Win2025 run not executed; checks ran locally on Linux. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-25 01:01:30 +00:00 (Migrated from github.com)

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

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7af0c09a65

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

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


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:08:59.064086Z 7af0c09 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:7148088136 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2076#issuecomment-7148088136). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T00:03:22Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"7af0c09a65beb1000dd3b317284093d2dbf76f4d","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:08:59.064086Z">2026-11-25T00:08:59.064086Z</relative-time> | `7af0c09` | 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:08:57Z.

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

@@ -1916,6 +1916,112 @@ def handler(self, ops, mods):
     setattr(Stage, 'op_s_bitcmp%d_b32' % _bit, _make_bitcmp())
 
 
+def _word_pair(self, tok, base):
+    """(low, high) uint expressions of a 64-bit scalar source: an even-aligned SGPR pair or an immediate."""
+    if self.is_lane_mask(tok) or tok == 'm0':
+        raise Unsupported('%s on a lane mask or m0' % base)
+    reg = reg_range(tok)
+    if reg:
+        if reg[0] != 's' or reg[2] != reg[1] + 1 or reg[1] % 2 or reg[2] > 105:
+            raise Unsupported('%s operand %s' % (base, tok))
+        return self.S(reg[1]), self.S(reg[2])

P2 Badge Reject projected masks in either word of a scalar pair

When the high SGPR contains a projected lane mask, is_lane_mask(tok) checks only the pair's low register, so this return exposes the high register as an ordinary numeric word. For example, after s_mov_b32 s4, 0; s_mov_b32 s5, exec_lo, the newly supported s_bitcmp1_b64 s[4:5], 33 is accepted. With guest EXEC equal to 0xf, SCC should be true, but evaluating the emitted code produces false because s5 contains the current-lane projection 1, not the full mask. The parent commit refused this instruction instead of silently miscompiling it. Check both member registers for projected masks before returning their numeric expressions.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4688368052 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2076#discussion_r4688368052). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T00:08:57Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 1927 ~~~~diff @@ -1916,6 +1916,112 @@ def handler(self, ops, mods): setattr(Stage, 'op_s_bitcmp%d_b32' % _bit, _make_bitcmp()) +def _word_pair(self, tok, base): + """(low, high) uint expressions of a 64-bit scalar source: an even-aligned SGPR pair or an immediate.""" + if self.is_lane_mask(tok) or tok == 'm0': + raise Unsupported('%s on a lane mask or m0' % base) + reg = reg_range(tok) + if reg: + if reg[0] != 's' or reg[2] != reg[1] + 1 or reg[1] % 2 or reg[2] > 105: + raise Unsupported('%s operand %s' % (base, tok)) + return self.S(reg[1]), self.S(reg[2]) ~~~~ --- **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Reject projected masks in either word of a scalar pair** When the high SGPR contains a projected lane mask, `is_lane_mask(tok)` checks only the pair's low register, so this return exposes the high register as an ordinary numeric word. For example, after `s_mov_b32 s4, 0; s_mov_b32 s5, exec_lo`, the newly supported `s_bitcmp1_b64 s[4:5], 33` is accepted. With guest EXEC equal to `0xf`, SCC should be true, but evaluating the emitted code produces false because `s5` contains the current-lane projection `1`, not the full mask. The parent commit refused this instruction instead of silently miscompiling it. Check both member registers for projected masks before returning their numeric expressions. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
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:08:57Z.

Code review location: CMakeLists.txt; line 2188

@@ -2183,6 +2183,9 @@ if(EXISTS "${INTAKE_PYTHON}")
     # gfx2hlsl lowers s_bitcmp1_b32 and s_bitcmp0_b32 (SOPC): CPU evaluation of the translated SCC test.
     add_test(NAME startup_gfx2hlsl_s_bitcmp COMMAND "${INTAKE_PYTHON}" -B
         "${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_s_bitcmp_check.py")
+    # gfx2hlsl lowers s_cmp_eq_u64, s_cmp_lg_u64, s_bitcmp0/1_b64, s_quadmask_b32/b64 and s_wqm_b32/b64 on scalar registers.
+    add_test(NAME startup_gfx2hlsl_s_cmp64_wqm COMMAND "${INTAKE_PYTHON}" -B
+        "${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_s_cmp64_wqm_check.py")

P1 Badge Document the new scalar translation capability

This commit adds publicly usable instruction support and registers a new reproduction check, but changes neither the README nor docs/experiments.md. AGENTS.md explicitly requires updating one of those documents when a public capability or reproduction command changes. Add the supported scalar forms, lane-mask limitations, and exact verification command/result so contributors can reproduce this capability and distinguish it from the existing pixel-AOT implementation.

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

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4688368058 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2076#discussion_r4688368058). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T00:08:57Z. **Code review location:** `CMakeLists.txt`; line 2188 ~~~~diff @@ -2183,6 +2183,9 @@ if(EXISTS "${INTAKE_PYTHON}") # gfx2hlsl lowers s_bitcmp1_b32 and s_bitcmp0_b32 (SOPC): CPU evaluation of the translated SCC test. add_test(NAME startup_gfx2hlsl_s_bitcmp COMMAND "${INTAKE_PYTHON}" -B "${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_s_bitcmp_check.py") + # gfx2hlsl lowers s_cmp_eq_u64, s_cmp_lg_u64, s_bitcmp0/1_b64, s_quadmask_b32/b64 and s_wqm_b32/b64 on scalar registers. + add_test(NAME startup_gfx2hlsl_s_cmp64_wqm COMMAND "${INTAKE_PYTHON}" -B + "${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_s_cmp64_wqm_check.py") ~~~~ --- **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Document the new scalar translation capability** This commit adds publicly usable instruction support and registers a new reproduction check, but changes neither the README nor `docs/experiments.md`. `AGENTS.md` explicitly requires updating one of those documents when a public capability or reproduction command changes. Add the supported scalar forms, lane-mask limitations, and exact verification command/result so contributors can reproduce this capability and distinguish it from the existing pixel-AOT implementation. AGENTS.md reference: [AGENTS.md:L211-L212](https://github.com/R0Y00/Xbox2Windows/blob/7af0c09a65beb1000dd3b317284093d2dbf76f4d/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:30:23Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6050187492 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2076#pullrequestreview-6050187492). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T01:30:23Z. **Review:** COMMENTED --- _No description provided._
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:30:25Z.

Review: COMMENTED


No description provided.

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

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


Fixed and pushed in ff79222a (pair-word mask check + docs, tests pass).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7149336742 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2076#issuecomment-7149336742). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T01:13:49Z. --- Fixed and pushed in ff79222a (pair-word mask check + docs, tests pass).
tedin7 commented 2026-11-25 02:02:14 +00:00 (Migrated from github.com)

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

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

@@ -1916,6 +1916,112 @@ def handler(self, ops, mods):
     setattr(Stage, 'op_s_bitcmp%d_b32' % _bit, _make_bitcmp())
 
 
+def _word_pair(self, tok, base):
+    """(low, high) uint expressions of a 64-bit scalar source: an even-aligned SGPR pair or an immediate."""
+    if self.is_lane_mask(tok) or tok == 'm0':
+        raise Unsupported('%s on a lane mask or m0' % base)
+    reg = reg_range(tok)
+    if reg:
+        if reg[0] != 's' or reg[2] != reg[1] + 1 or reg[1] % 2 or reg[2] > 105:
+            raise Unsupported('%s operand %s' % (base, tok))
+        return self.S(reg[1]), self.S(reg[2])

Fixed in b8833999: _word_pair now refuses a projected lane mask in either member register, so s_mov_b32 s5, exec_lo; s_bitcmp1_b64 s[4:5], 33 is refused again. tests/startup_gfx2hlsl_s_cmp64_wqm_check.py plants a mask in the low and the high word for five forms.

Verification: python -B tools/run_checks_parallel.py <the 83 Linux checks from ci.yml> -> all 83 checks passed; python -B tests/startup_gfx2hlsl_s_cmp64_wqm_check.py -> s_cmp64_wqm: ok.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4688963317 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2076#discussion_r4688963317). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T01:30:23Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 1927 ~~~~diff @@ -1916,6 +1916,112 @@ def handler(self, ops, mods): setattr(Stage, 'op_s_bitcmp%d_b32' % _bit, _make_bitcmp()) +def _word_pair(self, tok, base): + """(low, high) uint expressions of a 64-bit scalar source: an even-aligned SGPR pair or an immediate.""" + if self.is_lane_mask(tok) or tok == 'm0': + raise Unsupported('%s on a lane mask or m0' % base) + reg = reg_range(tok) + if reg: + if reg[0] != 's' or reg[2] != reg[1] + 1 or reg[1] % 2 or reg[2] > 105: + raise Unsupported('%s operand %s' % (base, tok)) + return self.S(reg[1]), self.S(reg[2]) ~~~~ --- Fixed in b8833999: `_word_pair` now refuses a projected lane mask in either member register, so `s_mov_b32 s5, exec_lo; s_bitcmp1_b64 s[4:5], 33` is refused again. `tests/startup_gfx2hlsl_s_cmp64_wqm_check.py` plants a mask in the low and the high word for five forms. Verification: `python -B tools/run_checks_parallel.py <the 83 Linux checks from ci.yml>` -> all 83 checks passed; `python -B tests/startup_gfx2hlsl_s_cmp64_wqm_check.py` -> `s_cmp64_wqm: ok`. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 02:02:15 +00:00 (Migrated from github.com)

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

Code review location: CMakeLists.txt; line 2188

@@ -2183,6 +2183,9 @@ if(EXISTS "${INTAKE_PYTHON}")
     # gfx2hlsl lowers s_bitcmp1_b32 and s_bitcmp0_b32 (SOPC): CPU evaluation of the translated SCC test.
     add_test(NAME startup_gfx2hlsl_s_bitcmp COMMAND "${INTAKE_PYTHON}" -B
         "${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_s_bitcmp_check.py")
+    # gfx2hlsl lowers s_cmp_eq_u64, s_cmp_lg_u64, s_bitcmp0/1_b64, s_quadmask_b32/b64 and s_wqm_b32/b64 on scalar registers.
+    add_test(NAME startup_gfx2hlsl_s_cmp64_wqm COMMAND "${INTAKE_PYTHON}" -B
+        "${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_s_cmp64_wqm_check.py")

Fixed in ff79222a: docs/experiments.md now has a "Scalar 64-bit compares, quad masks and WQM" section with the supported forms, the lane-mask and EXEC/VCC/M0 refusals, and the exact ctest --preset dev --no-tests=error -R '^startup_gfx2hlsl_s_cmp64_wqm$' -V command.

Verification: Linux Python checks (83) all passed locally; targeted test prints s_cmp64_wqm: ok.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4688963604 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2076#discussion_r4688963604). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T01:30:25Z. **Code review location:** `CMakeLists.txt`; line 2188 ~~~~diff @@ -2183,6 +2183,9 @@ if(EXISTS "${INTAKE_PYTHON}") # gfx2hlsl lowers s_bitcmp1_b32 and s_bitcmp0_b32 (SOPC): CPU evaluation of the translated SCC test. add_test(NAME startup_gfx2hlsl_s_bitcmp COMMAND "${INTAKE_PYTHON}" -B "${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_s_bitcmp_check.py") + # gfx2hlsl lowers s_cmp_eq_u64, s_cmp_lg_u64, s_bitcmp0/1_b64, s_quadmask_b32/b64 and s_wqm_b32/b64 on scalar registers. + add_test(NAME startup_gfx2hlsl_s_cmp64_wqm COMMAND "${INTAKE_PYTHON}" -B + "${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_s_cmp64_wqm_check.py") ~~~~ --- Fixed in ff79222a: `docs/experiments.md` now has a "Scalar 64-bit compares, quad masks and WQM" section with the supported forms, the lane-mask and EXEC/VCC/M0 refusals, and the exact `ctest --preset dev --no-tests=error -R '^startup_gfx2hlsl_s_cmp64_wqm$' -V` command. Verification: Linux Python checks (83) all passed locally; targeted test prints `s_cmp64_wqm: ok`. AI-assisted; commands listed were executed locally.
thepatrickworld commented 2026-11-25 03:01:21 +00:00 (Migrated from github.com)

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


Differential sweep of the emitted expressions against the guide's loops

This PR has no draw stage, and the property worth keeping is that its check does not reimplement the intent: it translates a line and evaluates the assignments the translator emitted. So I ran that same evaluation against the guide's own loops, on far more inputs than the ten hand-picked qwords.

  • S_QUADMASK (D[i] = (S0[i*4+3:i*4] != 0)) and S_WQM (every bit of a quad takes the quad's OR, SCC = (D != 0)), both widths: 4008 32-bit patterns and 4006 qwords, edge patterns included. No divergence.
  • S_BITCMP0/1_B64 on 6000 index cases, including 63, 64, 65, 0x7f, 0xff and 0xffffffff. The guide masks with S1.u[5:0], and the emitted (index >> 5) & 1 with index & 31 reproduces that, including the wrap at 64. No divergence.
  • S_CMP_EQ_U64 and S_CMP_LG_U64 on 600 random pairs plus the inline-constant cases: the sign extension of -16..-1 to 64 bits and the zero extension of a 32-bit literal are what the guide describes, and the emitted comparisons agree.

No defect found, and I would rather say that than invent one. What is missing is not correctness but reach: the scalar-to-SCC path has no adapter stage anywhere, so evaluating the emitted text in Python is the only channel available for these operations, and this check is doing it properly. One line saying so would keep a reader from assuming the draw coverage of the neighbouring PRs applies here too.

Limit. The loops above are written from the guide text by me, not taken from this PR, so agreement means the emitted expressions match the architecture as I read it.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7150315717 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2076#issuecomment-7150315717). Originally posted by [thepatrickworld](https://github.com/thepatrickworld) on 2026-11-25T02:05:59Z. --- **Differential sweep of the emitted expressions against the guide's loops** This PR has no draw stage, and the property worth keeping is that its check does not reimplement the intent: it translates a line and evaluates the assignments the translator emitted. So I ran that same evaluation against the guide's own loops, on far more inputs than the ten hand-picked qwords. - `S_QUADMASK` (`D[i] = (S0[i*4+3:i*4] != 0)`) and `S_WQM` (every bit of a quad takes the quad's OR, `SCC = (D != 0)`), both widths: 4008 32-bit patterns and 4006 qwords, edge patterns included. **No divergence.** - `S_BITCMP0/1_B64` on 6000 index cases, including 63, 64, 65, 0x7f, 0xff and 0xffffffff. The guide masks with `S1.u[5:0]`, and the emitted `(index >> 5) & 1` with `index & 31` reproduces that, including the wrap at 64. **No divergence.** - `S_CMP_EQ_U64` and `S_CMP_LG_U64` on 600 random pairs plus the inline-constant cases: the sign extension of `-16..-1` to 64 bits and the zero extension of a 32-bit literal are what the guide describes, and the emitted comparisons agree. **No defect found**, and I would rather say that than invent one. What is missing is not correctness but reach: the scalar-to-SCC path has no adapter stage anywhere, so evaluating the emitted text in Python is the only channel available for these operations, and this check is doing it properly. One line saying so would keep a reader from assuming the draw coverage of the neighbouring PRs applies here too. **Limit.** The loops above are written from the guide text by me, not taken from this PR, so agreement means the emitted expressions match the architecture as I read it. _AI-assisted._
tedin7 commented 2026-11-25 11:02:33 +00:00 (Migrated from github.com)

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


Thank you @thepatrickworld for the differential sweep against the guide's loops. Agreed that this PR has no adapter stage, so the evaluation of the emitted text is its only channel; the neighbouring PRs' draw coverage does not apply here.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7160291917 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2076#issuecomment-7160291917). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T10:52:39Z. --- Thank you @thepatrickworld for the differential sweep against the guide's loops. Agreed that this PR has no adapter stage, so the evaluation of the emitted text is its only channel; the neighbouring PRs' draw coverage does not apply here. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-25 14:04:37 +00:00
tedin7 commented 2026-11-25 14:05:14 +00:00 (Migrated from github.com)

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


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:7164406671 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2076#issuecomment-7164406671). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T13:52:06Z. --- 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.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!2069
No description provided.