tests: evaluate the emitted run-time block of the 64-bit scalar shifts and s_bfe #2392

Merged
Makto94 merged 1 commit from upstream-pr/2400 into main 2026-11-25 17:14:25 +00:00
Makto94 commented 2026-11-25 15:15:17 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Makto94 on 2026-11-25T15:15:17Z.


Refs #1723

Problem: startup_gfx2hlsl_scalar_shift64_bfe_check.py (from #2088) checks the run-time block that scalar_wide_op emits only by substring (runtime_blocks) and evaluates the helper functions on their own. Nothing executes the emitted block itself, so the order of the two destination words, the SCC expression and the signed flag of bfe32/bfe64 are unchecked. Operands that are only partly known at translation time (one constant word, or a constant source with an unknown amount), and uniformity of the result and SCC for each unknown operand, are not covered either.

What this adds (tests only, one file, no change to tools/):

  • runtime_semantics(): parses the emitted { uint2? t = helper(...); sN = t.x; ... scc = ...; } block for unknown operands, evaluates it with the helpers translated to Python, and compares both destination registers and SCC with reference(). The s_bfe_i32 rows include x=1, amount=2<<16 (result 1, so a t > 1u SCC is caught).
  • partly_known(): with one known word, one unknown word, or a known source and unknown amount, the translator must emit the helper call and must not fold. It then runs the emitted block with concrete values for the unknown registers and compares result and SCC with reference(). It also checks that a destination register that held a constant no longer has a symbol after the block is emitted.
  • varying_operand(): a varying low word, high word or amount makes the destination register(s) varying and SCC non-uniform.

Mutants (applied to tools/startup/gfx2hlsl.py, one at a time):

# Mutant in scalar_wide_op Minimal input Reference Killed by (message)
1 swap t.x / t.y stores s_lshl_b64, x=1, amount=32 0x100000000 runtime_semantics: block gave 0x1, reference 0x100000000
2 wide SCC (t.x | t.y) == 0u s_lshl_b64, x=1, amount=32 SCC true runtime_semantics: SCC False for result 0x100000000
3 bfe32 SCC t == 0u s_bfe_i32, x=0xf0, amount=4|4<<16 0xffffffff, SCC true runtime_semantics: SCC False for result 0xffffffff
4 bfe32 SCC t > 1u s_bfe_i32, x=1, amount=2<<16 1, SCC true runtime_semantics: SCC False for result 0x1
5 signed flag inverted (0 if signed else 1) s_bfe_i32, x=0xf0, amount=4|4<<16 0xffffffff runtime_semantics: block gave 0xf, reference 0xffffffff
6 uniformity ignores the amount s_lshl_b64, amount register varying s20 varying varying_operand: ('s_lshl_b64', 9, {9})
7 uniformity ignores the high word s_lshl_b64, s7 varying s20/s21 varying varying_operand: ('s_lshl_b64', 7, {7})
8 None not in known[:1] (fold with an unknown high word) s_lshl_b64, s6 known, s7 unknown no fold partly_known: TypeError: unsupported operand type(s) for <<: 'NoneType' and 'int' (the mutant translator raises instead of emitting the helper call)
9 low and high swapped in the helper call when one word is a literal s_lshl_b64, s6=1 (known), s7=2, s9=1 0x400000002 partly_known: block gave 0x200000004, reference 0x400000002
10 constant shift amount altered in the emitted block (3 -> 1) s_lshl_b64, s9=3 (known), x=0x200000001 0x1000000008 partly_known: block gave 0x400000002, reference 0x1000000008
11 self.sym.pop(r, None) removed after emission s_lshl_b64 with s20/s21 previously constant no symbol for s20/s21 partly_known: AssertionError: ('s_lshl_b64', {6: ('const', 1)}, ...) on the destination symbols left in stage.sym

On origin/main (7092683a, whose only gfx2hlsl.py change since a4f7a95c adds s_ff1_i32_b32) the unchanged check passes for all eleven mutants. With this change all eleven fail.

Command and result (Linux-compatible, Python only; the check is in the python-linux job list in .github/workflows/windows.yml):

python -I -B tests/startup_gfx2hlsl_scalar_shift64_bfe_check.py
startup scalar 64-bit shift and bitfield extract controls passed (3498 helper cases)

Run on Windows 11 build 26300 with Python 3.12. No GPU, dxc or fxc involved. The registered CTest startup_gfx2hlsl_scalar_shift64_bfe_controls runs the same script.

Scope and limits:

  • run_block depends on the text format of the emitted block: one line { uint2 t = f(args); sN = ...; scc = ...; } (or uint t). A change of that format makes run_block fail its format assertion and the check must be updated with it.
  • The block is evaluated with Python re-implementations of the HLSL helpers (make_helpers), not compiled HLSL. This checks the emitted block's register and SCC wiring, not HLSL compilation.
  • Mutation runs: mutants 1-8 come from a first pass. A second, separate pass repeated them and ran 14 more against the earlier version of this change; all were killed. It found two gaps (partly known operands were only checked for the call and for absence of folding, not executed; stale constant symbols on the destination), closed here by mutants 9-11 and the extended partly_known().
  • Mutants of the helper text itself are covered by the existing helper grid.
  • No change to tools/, CMakeLists.txt or docs.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6607701231 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2400). Originally posted by [Makto94](https://github.com/Makto94) on 2026-11-25T15:15:17Z. --- Refs #1723 Problem: `startup_gfx2hlsl_scalar_shift64_bfe_check.py` (from #2088) checks the run-time block that `scalar_wide_op` emits only by substring (`runtime_blocks`) and evaluates the helper functions on their own. Nothing executes the emitted block itself, so the order of the two destination words, the SCC expression and the signed flag of `bfe32`/`bfe64` are unchecked. Operands that are only partly known at translation time (one constant word, or a constant source with an unknown amount), and uniformity of the result and SCC for each unknown operand, are not covered either. What this adds (tests only, one file, no change to `tools/`): - `runtime_semantics()`: parses the emitted `{ uint2? t = helper(...); sN = t.x; ... scc = ...; }` block for unknown operands, evaluates it with the helpers translated to Python, and compares both destination registers and SCC with `reference()`. The `s_bfe_i32` rows include x=1, amount=2<<16 (result 1, so a `t > 1u` SCC is caught). - `partly_known()`: with one known word, one unknown word, or a known source and unknown amount, the translator must emit the helper call and must not fold. It then runs the emitted block with concrete values for the unknown registers and compares result and SCC with `reference()`. It also checks that a destination register that held a constant no longer has a symbol after the block is emitted. - `varying_operand()`: a varying low word, high word or amount makes the destination register(s) varying and SCC non-uniform. Mutants (applied to `tools/startup/gfx2hlsl.py`, one at a time): | # | Mutant in `scalar_wide_op` | Minimal input | Reference | Killed by (message) | |---|---|---|---|---| | 1 | swap `t.x` / `t.y` stores | `s_lshl_b64`, x=1, amount=32 | `0x100000000` | `runtime_semantics`: block gave 0x1, reference 0x100000000 | | 2 | wide SCC `(t.x \| t.y) == 0u` | `s_lshl_b64`, x=1, amount=32 | SCC true | `runtime_semantics`: SCC False for result 0x100000000 | | 3 | `bfe32` SCC `t == 0u` | `s_bfe_i32`, x=0xf0, amount=4\|4<<16 | `0xffffffff`, SCC true | `runtime_semantics`: SCC False for result 0xffffffff | | 4 | `bfe32` SCC `t > 1u` | `s_bfe_i32`, x=1, amount=2<<16 | `1`, SCC true | `runtime_semantics`: SCC False for result 0x1 | | 5 | signed flag inverted (`0 if signed else 1`) | `s_bfe_i32`, x=0xf0, amount=4\|4<<16 | `0xffffffff` | `runtime_semantics`: block gave 0xf, reference 0xffffffff | | 6 | uniformity ignores the amount | `s_lshl_b64`, amount register varying | `s20` varying | `varying_operand`: `('s_lshl_b64', 9, {9})` | | 7 | uniformity ignores the high word | `s_lshl_b64`, `s7` varying | `s20`/`s21` varying | `varying_operand`: `('s_lshl_b64', 7, {7})` | | 8 | `None not in known[:1]` (fold with an unknown high word) | `s_lshl_b64`, `s6` known, `s7` unknown | no fold | `partly_known`: `TypeError: unsupported operand type(s) for <<: 'NoneType' and 'int'` (the mutant translator raises instead of emitting the helper call) | | 9 | low and high swapped in the helper call when one word is a literal | `s_lshl_b64`, `s6`=1 (known), `s7`=2, `s9`=1 | `0x400000002` | `partly_known`: block gave 0x200000004, reference 0x400000002 | | 10 | constant shift amount altered in the emitted block (3 -> 1) | `s_lshl_b64`, `s9`=3 (known), x=`0x200000001` | `0x1000000008` | `partly_known`: block gave 0x400000002, reference 0x1000000008 | | 11 | `self.sym.pop(r, None)` removed after emission | `s_lshl_b64` with `s20`/`s21` previously constant | no symbol for `s20`/`s21` | `partly_known`: `AssertionError: ('s_lshl_b64', {6: ('const', 1)}, ...)` on the destination symbols left in `stage.sym` | On `origin/main` (`7092683a`, whose only `gfx2hlsl.py` change since `a4f7a95c` adds `s_ff1_i32_b32`) the unchanged check passes for all eleven mutants. With this change all eleven fail. Command and result (Linux-compatible, Python only; the check is in the `python-linux` job list in `.github/workflows/windows.yml`): ``` python -I -B tests/startup_gfx2hlsl_scalar_shift64_bfe_check.py startup scalar 64-bit shift and bitfield extract controls passed (3498 helper cases) ``` Run on Windows 11 build 26300 with Python 3.12. No GPU, dxc or fxc involved. The registered CTest `startup_gfx2hlsl_scalar_shift64_bfe_controls` runs the same script. Scope and limits: - `run_block` depends on the text format of the emitted block: one line `{ uint2 t = f(args); sN = ...; scc = ...; }` (or `uint t`). A change of that format makes `run_block` fail its format assertion and the check must be updated with it. - The block is evaluated with Python re-implementations of the HLSL helpers (`make_helpers`), not compiled HLSL. This checks the emitted block's register and SCC wiring, not HLSL compilation. - Mutation runs: mutants 1-8 come from a first pass. A second, separate pass repeated them and ran 14 more against the earlier version of this change; all were killed. It found two gaps (partly known operands were only checked for the call and for absence of folding, not executed; stale constant symbols on the destination), closed here by mutants 9-11 and the extended `partly_known()`. - Mutants of the helper text itself are covered by the existing helper grid. - No change to `tools/`, `CMakeLists.txt` or docs.
ChazY11 commented 2026-11-25 16:05:24 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T15:39:03Z.


Six mutations against the helpers, all caught — this is the strongest test-only PR I have reviewed here

Baseline on this branch:

startup scalar 64-bit shift and bitfield extract controls passed (3498 helper cases)   exit 0
mutation of the emitted helper text in gfx2hlsl.py result
shl64: drop sh &= 63u (shifts ≥ 64) caught
shl64: drop the cross-word carry (hi << sb) | cy → (hi << sb) caught
shl64/shr64u: sc = (32u - sb) & 31u → sc = sb (direction) caught
shr64i: asuint(asint(hi) >> sb) → asuint(hi >> sb) (sign extension) caught
shr64i: the sign fill asuint(asint(hi) >> 31u) → 0u caught
bfe64: drop min(..., 64u - (s1 & 63u)) (width clamp) caught

What makes run_block() worth the 106 lines is that it evaluates the emitted text, not a Python reimplementation of it: the mutation has to survive both the translator and the evaluator to pass, so a helper that is wrong in a way the reference model shares still gets caught. The t.x/t.y → t[0]/t[1] rewriting in run_block is the part that makes that possible for the uint2 returns, and it is the sort of glue that usually rots — worth a comment saying which helper shapes the regex accepts (uint2 t = f(...) and uint t = f(...), one trailing statement list, no loops or branches).

Two things I would tighten

1. The six cases per helper are chosen, not enumerated over a boundary set. I can see (1, 32), (0x8000000000000000, 63), (1, 1) and similar in rows, which is the right instinct — but the interesting shifts are exactly 0, 1, 31, 32, 33, 63 and the interesting values are 0, 1, 0x80000000 in the low word, 0x80000000 in the high word. If those are all present, ignore me; if they are sampled, the six mutations above passing does not tell you the boundary is covered, because each of my mutations breaks a whole class rather than one case.

2. eval(rhs, {'t': ...}) on generated text is fine here and worth keeping safe. The text comes from our own translator, so the # noqa: S307 is honest. The risk is the opposite direction: eval accepts more than the emitter produces, so a future emitter change that produces something the reference cannot parse fails as a NameError/SyntaxError inside the check rather than as a clear message. A one-line assert naming the unrecognised right-hand side would save the next person the traceback.

What I would not change

The docstring states the reference values come from the ISA rather than from the helper, which is the distinction that matters for a test of this shape; and printing the case count (3498 helper cases) makes the CI log tell you whether the table shrank.

AI-assisted; the six mutations and the baseline run were executed locally on Windows 11 build 26300.9974.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7167169896 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2400#issuecomment-7167169896). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-25T15:39:03Z. --- ## Six mutations against the helpers, all caught — this is the strongest test-only PR I have reviewed here Baseline on this branch: ```text startup scalar 64-bit shift and bitfield extract controls passed (3498 helper cases) exit 0 ``` | mutation of the emitted helper text in `gfx2hlsl.py` | result | |---|---| | `shl64`: drop `sh &= 63u` (shifts ≥ 64) | **caught** | | `shl64`: drop the cross-word carry `(hi << sb) \| cy` → `(hi << sb)` | **caught** | | `shl64`/`shr64u`: `sc = (32u - sb) & 31u` → `sc = sb` (direction) | **caught** | | `shr64i`: `asuint(asint(hi) >> sb)` → `asuint(hi >> sb)` (sign extension) | **caught** | | `shr64i`: the sign fill `asuint(asint(hi) >> 31u)` → `0u` | **caught** | | `bfe64`: drop `min(..., 64u - (s1 & 63u))` (width clamp) | **caught** | What makes `run_block()` worth the 106 lines is that it evaluates the **emitted text**, not a Python reimplementation of it: the mutation has to survive both the translator and the evaluator to pass, so a helper that is wrong in a way the reference model shares still gets caught. The `t.x`/`t.y` → `t[0]`/`t[1]` rewriting in `run_block` is the part that makes that possible for the `uint2` returns, and it is the sort of glue that usually rots — worth a comment saying which helper shapes the regex accepts (`uint2 t = f(...)` and `uint t = f(...)`, one trailing statement list, no loops or branches). ## Two things I would tighten **1. The six cases per helper are chosen, not enumerated over a boundary set.** I can see `(1, 32)`, `(0x8000000000000000, 63)`, `(1, 1)` and similar in `rows`, which is the right instinct — but the interesting shifts are exactly `0, 1, 31, 32, 33, 63` and the interesting values are `0`, `1`, `0x80000000` in the low word, `0x80000000` in the high word. If those are all present, ignore me; if they are sampled, the six mutations above passing does not tell you the boundary is covered, because each of my mutations breaks a whole class rather than one case. **2. `eval(rhs, {'t': ...})` on generated text is fine here and worth keeping safe.** The text comes from our own translator, so the `# noqa: S307` is honest. The risk is the opposite direction: `eval` accepts more than the emitter produces, so a future emitter change that produces something the reference cannot parse fails as a `NameError`/`SyntaxError` inside the check rather than as a clear message. A one-line `assert` naming the unrecognised right-hand side would save the next person the traceback. ## What I would not change The docstring states the reference values come from the ISA rather than from the helper, which is the distinction that matters for a test of this shape; and printing the case count (`3498 helper cases`) makes the CI log tell you whether the table shrank. AI-assisted; the six mutations and the baseline run were executed locally on Windows 11 build 26300.9974.
tedin7 commented 2026-11-25 17:01:24 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Review of head 95c31d22 (tests only: +106 lines in tests/startup_gfx2hlsl_scalar_shift64_bfe_check.py).

Checked:

  • The branch is up to date with main. The diff touches only this one existing test, which is already registered in CMakeLists.txt as startup_gfx2hlsl_scalar_shift64_bfe_controls. No production code changes.
  • runtime_semantics() runs the emitted run-time block (helper call, result registers, SCC) for s_lshl_b64, s_lshr_b64, s_ashr_i64, s_bfe_i32, s_bfe_u64 and s_bfe_i64 and compares it with reference(). It also checks that the high register is not written for 32-bit results.
  • partly_known() covers one known word, one unknown word, and a known source with an unknown amount. It checks that nothing is folded, that the block gives the reference result, and that a stale constant in the destination is dropped.
  • varying_operand() checks that a varying low word, high word or amount makes the result and SCC varying.
  • No sibling tables are missed. The other 64-bit scalar ops belong to the lowering merged in #2088. No other open PR covers this test.
  • This adds a CPU-side evaluation of the generated text, not a D3D12 WARP readback. That is acceptable here because the PR adds no new lowering. The eval only sees the generator's own output.

Ran: python3 -I tests/startup_gfx2hlsl_scalar_shift64_bfe_check.py gives startup scalar 64-bit shift and bitfield extract controls passed (3498 helper cases).

No problems found. Small, additive.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6060981333 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2400#pullrequestreview-6060981333). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T16:12:58Z. **Review:** COMMENTED --- Review of head 95c31d22 (tests only: +106 lines in tests/startup_gfx2hlsl_scalar_shift64_bfe_check.py). Checked: - The branch is up to date with main. The diff touches only this one existing test, which is already registered in CMakeLists.txt as `startup_gfx2hlsl_scalar_shift64_bfe_controls`. No production code changes. - `runtime_semantics()` runs the emitted run-time block (helper call, result registers, SCC) for s_lshl_b64, s_lshr_b64, s_ashr_i64, s_bfe_i32, s_bfe_u64 and s_bfe_i64 and compares it with `reference()`. It also checks that the high register is not written for 32-bit results. - `partly_known()` covers one known word, one unknown word, and a known source with an unknown amount. It checks that nothing is folded, that the block gives the reference result, and that a stale constant in the destination is dropped. - `varying_operand()` checks that a varying low word, high word or amount makes the result and SCC varying. - No sibling tables are missed. The other 64-bit scalar ops belong to the lowering merged in #2088. No other open PR covers this test. - This adds a CPU-side evaluation of the generated text, not a D3D12 WARP readback. That is acceptable here because the PR adds no new lowering. The `eval` only sees the generator's own output. Ran: `python3 -I tests/startup_gfx2hlsl_scalar_shift64_bfe_check.py` gives `startup scalar 64-bit shift and bitfield extract controls passed (3498 helper cases)`. No problems found. Small, additive. AI-assisted; commands listed were executed locally.
KelboLive commented 2026-11-25 17:01:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-25T16:07:54Z.


APPROVED. Tests run-time block for 64-bit scalar shifts and s_bfe.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7167620134 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2400#issuecomment-7167620134). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-25T16:07:54Z. --- APPROVED. Tests run-time block for 64-bit scalar shifts and s_bfe.
tedin7 commented 2026-11-25 17:01:57 +00:00 (Migrated from github.com)

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


Win2025 WARP receipt for head 95c31d22 after updating with main.

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

  • Debug (--preset dev):
    • Build (cmake --build --preset dev -- -j 2): 0.00s (configure 0.00s)
    • Test (ctest --preset dev -R 'startup_gfx2hlsl_scalar_shift64_bfe_controls' --parallel 4 --no-tests=error --output-on-failure): 1/1 passed (0.31s: startup_gfx2hlsl_scalar_shift64_bfe_controls 0.19s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release -- -j 2): 0.00s (configure 0.00s)
    • Test (ctest --preset release -R 'startup_gfx2hlsl_scalar_shift64_bfe_controls' --parallel 4 --no-tests=error --output-on-failure): 1/1 passed (0.31s: startup_gfx2hlsl_scalar_shift64_bfe_controls 0.19s)
  • Wall: 5.3s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7167720639 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2400#issuecomment-7167720639). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T16:14:50Z. --- Win2025 WARP receipt for head 95c31d22 after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `95c31d22b77550a5c2c0c73a25aad136d1e0a37a`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev -- -j 2`): `0.00s` (configure `0.00s`) - Test (`ctest --preset dev -R 'startup_gfx2hlsl_scalar_shift64_bfe_controls' --parallel 4 --no-tests=error --output-on-failure`): **1/1 passed** (`0.31s`: `startup_gfx2hlsl_scalar_shift64_bfe_controls` `0.19s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release -- -j 2`): `0.00s` (configure `0.00s`) - Test (`ctest --preset release -R 'startup_gfx2hlsl_scalar_shift64_bfe_controls' --parallel 4 --no-tests=error --output-on-failure`): **1/1 passed** (`0.31s`: `startup_gfx2hlsl_scalar_shift64_bfe_controls` `0.19s`) - Wall: `5.3s` AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-25 18:00:58 +00:00
MasterDomino commented 2026-11-25 18:00:59 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T17:14:21Z.

Review: APPROVED


Approved at head 95c31d22. The change is test-only: +106 lines in tests/startup_gfx2hlsl_scalar_shift64_bfe_check.py. This adds a local mutation run to @tedin7's and @ChazY11's reviews.

Commands executed (Windows 11 build 26300, Python 3.13; no GPU needed)

python -I -B tests/startup_gfx2hlsl_scalar_shift64_bfe_check.py
  • At 95c31d22: startup scalar 64-bit shift and bitfield extract controls passed (3498 helper cases), exit 0.
  • Merged with current main (f59f7761 plus this PR): same result, and the merge is clean.

Negative control

I applied five of the description's mutants to scalar_wide_op in tools/startup/gfx2hlsl.py, one at a time, then reverted each. Each ran against main's copy of the check and against this PR's:

Mutant main check This PR's check
1: t.x/t.y stores swapped exit 0 exit 1: s_lshl_b64 0x1,0x20: block gave 0x1, reference 0x100000000
2: wide SCC == 0u exit 0 exit 1: SCC False for result 0x100000000
5: bfe signed flag inverted exit 0 exit 1: s_bfe_i32 0xf0,0x40004: block gave 0xf, reference 0xffffffff
8: fold with an unknown high word (known[:1]) exit 0 exit 1: the TypeError from the mutated fold
11: self.sym.pop(r, None) removed exit 0 exit 1: stale destination symbol assertion

The results match the table in the description.

Merge checks: CI passed at this head ("Build and test on Windows" and both Linux jobs). The /O2 and coverage skips come from explicit workflow conditions. There are no unresolved review threads.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6061867811 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2400#pullrequestreview-6061867811). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-25T17:14:21Z. **Review:** APPROVED --- Approved at head `95c31d22`. The change is test-only: +106 lines in `tests/startup_gfx2hlsl_scalar_shift64_bfe_check.py`. This adds a local mutation run to @tedin7's and @ChazY11's reviews. ### Commands executed (Windows 11 build 26300, Python 3.13; no GPU needed) ```powershell python -I -B tests/startup_gfx2hlsl_scalar_shift64_bfe_check.py ``` - At `95c31d22`: `startup scalar 64-bit shift and bitfield extract controls passed (3498 helper cases)`, exit 0. - Merged with current `main` (`f59f7761` plus this PR): same result, and the merge is clean. ### Negative control I applied five of the description's mutants to `scalar_wide_op` in `tools/startup/gfx2hlsl.py`, one at a time, then reverted each. Each ran against `main`'s copy of the check and against this PR's: | Mutant | `main` check | This PR's check | |---|---|---| | 1: `t.x`/`t.y` stores swapped | exit 0 | exit 1: `s_lshl_b64 0x1,0x20: block gave 0x1, reference 0x100000000` | | 2: wide SCC `== 0u` | exit 0 | exit 1: `SCC False for result 0x100000000` | | 5: `bfe` signed flag inverted | exit 0 | exit 1: `s_bfe_i32 0xf0,0x40004: block gave 0xf, reference 0xffffffff` | | 8: fold with an unknown high word (`known[:1]`) | exit 0 | exit 1: the `TypeError` from the mutated fold | | 11: `self.sym.pop(r, None)` removed | exit 0 | exit 1: stale destination symbol assertion | The results match the table in the description. Merge checks: CI passed at this head ("Build and test on Windows" and both Linux jobs). The `/O2` and coverage skips come from explicit workflow conditions. There are no unresolved review threads. 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!2392
No description provided.