startup: lower s_bitset0_b64 and s_bitset1_b64 in gfx2hlsl #2897

Manually merged
github merged 1 commit from github-bot/gh-2897 into gh-pr/2897/base 2026-11-27 06:52:11 +00:00 AGit
Owner

@⁠R0D4X on GitHub · 2026-11-26 16:55 UTC · original
R0D4X:feat/gfx2hlsl-s-bitset64 → main · +469 −0 · 4 files · 1 commits · merged 2026-11-27 06:50 UTC

What this changes

Adds lowering for the 64-bit scalar bit-clear/set SOP1 instructions s_bitset0_b64 and s_bitset1_b64 in tools/startup/gfx2hlsl.py (already decoded by tools/disasm_rdna2.py, alongside the existing 32-bit s_bitset0/1_b32 handlers).

  • Semantics: Clears or sets bit S0[5:0] in the destination SGPR pair s[D:D+1] in place without modifying SCC.
  • Constant folding & aliasing: Known bit indices (null, immediate, or constant-tracked SGPR) update only the targeted 32-bit half and fold when that half is constant. For dynamic SGPR indices that alias the low half (s[D:D+1], sD), the high half is updated first so the index is read before being overwritten.
  • Safety checks: Refuses bad operand counts, modifiers, lane masks (including masks / mask_high on either half of D or on S0), descriptor-bearing SGPRs, VGPRs, odd or out-of-range SGPR pairs, floats, m0, and src_scc.

Tests added

  • tests/startup_gfx2hlsl_s_bitset64_check.py: SOP1 binary decode via G.decode(), 416 pair/index cases, s[4:5], s4 and s[4:5], s5 aliasing checks, constant folding, uniformity tracking, refusal cases, unlowered control, and FXC ps_5_1 + DXC ps_6_0 GPU readback draws (including a negative-control draw).
  • Registered via tests/cmake/startup_gfx2hlsl_s_bitset64.cmake and tests/checks/python-linux/startup_gfx2hlsl_s_bitset64.txt.

Verification

  • Commit: b011dbfa (on upstream/main b505c32b)
  • Host: Windows 11 x64 (10.0.26300.9974), MSVC 19.44.35230, Windows SDK 10.0.26100.0, FXC + DXC 1.9.2602.17, D3D12 debug layer enabled
  • Adapters: WARP (1414:008c, driver 10.0.26100.9818) and NVIDIA GeForce RTX 5080 (10de:2c02, driver 32.0.16.2124)

Results:

  • ctest --preset dev --no-tests=error -R '^startup_gfx2hlsl_s_bitset64|^startup_tools_lint$' -V -> 4/4 passed, 0 skipped (debug_errors=0 debug_warnings=0 on all draws)
  • ctest --preset release --no-tests=error -R '^startup_gfx2hlsl_s_bitset64' -> 3/3 passed, 0 skipped
  • Repo & neighbor checks (docs_links_check.py, bidi_controls_check.py, startup_gfx2hlsl_s_bitset_check.py, scalar/arity/null/refusal checks, git diff --check) -> all passed
  • 5 live mutations on gfx2hlsl.py (breaking s[D:D+1], sD alias order, dropping bit-5 selection, swapping clear/set, dropping mask_high and odd-pair guards) -> 5/5 caught (rc=1)

Scope: Covers synthetic gfx1013 SOP1 fixtures translated by gfx2hlsl.py and run on WARP and RTX 5080; does not establish full-title startup or frame rate.

**@⁠R0D4X** on GitHub · 2026-11-26 16:55 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2897) `R0D4X:feat/gfx2hlsl-s-bitset64` → `main` · +469 −0 · 4 files · 1 commits · merged 2026-11-27 06:50 UTC ## What this changes Adds lowering for the 64-bit scalar bit-clear/set SOP1 instructions `s_bitset0_b64` and `s_bitset1_b64` in `tools/startup/gfx2hlsl.py` (already decoded by `tools/disasm_rdna2.py`, alongside the existing 32-bit `s_bitset0/1_b32` handlers). - **Semantics:** Clears or sets bit `S0[5:0]` in the destination SGPR pair `s[D:D+1]` in place without modifying `SCC`. - **Constant folding & aliasing:** Known bit indices (`null`, immediate, or constant-tracked SGPR) update only the targeted 32-bit half and fold when that half is constant. For dynamic SGPR indices that alias the low half (`s[D:D+1], sD`), the high half is updated first so the index is read before being overwritten. - **Safety checks:** Refuses bad operand counts, modifiers, lane masks (including `masks` / `mask_high` on either half of `D` or on `S0`), descriptor-bearing SGPRs, VGPRs, odd or out-of-range SGPR pairs, floats, `m0`, and `src_scc`. ## Tests added - `tests/startup_gfx2hlsl_s_bitset64_check.py`: SOP1 binary decode via `G.decode()`, 416 pair/index cases, `s[4:5], s4` and `s[4:5], s5` aliasing checks, constant folding, uniformity tracking, refusal cases, unlowered control, and FXC `ps_5_1` + DXC `ps_6_0` GPU readback draws (including a negative-control draw). - Registered via `tests/cmake/startup_gfx2hlsl_s_bitset64.cmake` and `tests/checks/python-linux/startup_gfx2hlsl_s_bitset64.txt`. ## Verification - **Commit:** `b011dbfa` (on `upstream/main` `b505c32b`) - **Host:** Windows 11 x64 (`10.0.26300.9974`), MSVC `19.44.35230`, Windows SDK `10.0.26100.0`, FXC + DXC `1.9.2602.17`, D3D12 debug layer enabled - **Adapters:** WARP (`1414:008c`, driver `10.0.26100.9818`) and NVIDIA GeForce RTX 5080 (`10de:2c02`, driver `32.0.16.2124`) Results: - `ctest --preset dev --no-tests=error -R '^startup_gfx2hlsl_s_bitset64|^startup_tools_lint$' -V` -> **4/4 passed, 0 skipped** (`debug_errors=0 debug_warnings=0` on all draws) - `ctest --preset release --no-tests=error -R '^startup_gfx2hlsl_s_bitset64'` -> **3/3 passed, 0 skipped** - Repo & neighbor checks (`docs_links_check.py`, `bidi_controls_check.py`, `startup_gfx2hlsl_s_bitset_check.py`, scalar/arity/null/refusal checks, `git diff --check`) -> **all passed** - 5 live mutations on `gfx2hlsl.py` (breaking `s[D:D+1], sD` alias order, dropping bit-5 selection, swapping clear/set, dropping `mask_high` and odd-pair guards) -> **5/5 caught (`rc=1`)** *Scope:* Covers synthetic gfx1013 SOP1 fixtures translated by `gfx2hlsl.py` and run on WARP and RTX 5080; does not establish full-title startup or frame rate.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:28:12 +00:00
Author
Owner

@⁠thepatrickworld on GitHub · 2026-11-26 19:16 UTC · original

Review note on b011dbfa: the aliasing section's vectors all miss the aliasing class

Pure-Python path only (python3 -B tests/startup_gfx2hlsl_s_bitset64_check.py, CPython 3.11.16, Linux); no GPU run is involved in anything below.

The ordering branch, and two mutants it does not see

scalar_bitset64 (tools/startup/gfx2hlsl.py:5846) emits the two HLSL assignments in a chosen order when the bit index lives in the low word of the destination pair (tools/startup/gfx2hlsl.py:5904), and the docstring says why: "when S0 aliases the low word of D, the high word is updated first so S0 is read intact". Section 3 of the fixture (tests/startup_gfx2hlsl_s_bitset64_check.py:206-216) is labelled "aliasing s[4:5], s4 and s[4:5], s5 preserve original index".

Two one-line mutants, both of which leave the whole fixture green (77 checks, exit 0):

M-a  `if src_reg == d:` -> `if False:`   (always emit the low word first)
M-b  `if src_reg == d:` -> `if True:`    (always emit the high word first)

s_bitset1_b64 s[4:5], s4   s4=0x05 s5=0x00   head (0x25,0x00)   M-a (0x25,0x20)
s_bitset0_b64 s[4:5], s5   s4=0x20 s5=0x25   head (0x20,0x05)   M-b (0x00,0x05)

Both values come from evaluating the emitted statements through the fixture's own run_lines(), and all 28 alias comparisons of section 3 agree with the reference under each mutant.

Why the 28 vectors miss it

For M-a the separating class is narrow: the low write only happens when index bit 5 is clear, and it can only take bit 5 of the low word from 0 to 1 when index & 31 == 5, with bit 5 still clear in the high word - so only the set form with the source aliasing the low word separates (s4 = 5, s5 = 0). For M-b the mirror holds: only the clear form with the source aliasing the high word separates (s4 = 0x20, s5 = 0x25). In the current list (5, 0x12345678) has bit 5 set in hi (0x78 & 0x20), and the remaining pairs have index bit 5 set or index & 31 != 5; none is in either class.

Minimal addition

One pair per direction, in the section 3 loop: (5, 0) for the low-word alias and (0x20, 0x25) for the high-word alias. Measured on a temporary copy of the fixture: with (5, 0) added, M-a fails with aliasing s[4:5], s4 and s[4:5], s5 preserve original index: MISMATCH (exit 1) while the unmutated head still exits 0; with (0x20, 0x25) added, M-b does the same. Asserting the emitted order directly (stage.lines[0].startswith('s5 =') for the s4 form) would pin the mechanism rather than two values, if you prefer that.

Worth noting: the pixel_aot fixture already pins this pattern for the other lowering - tests/pixel_aot_check.py:6367-6380 builds s_bitset1_b64 s[44:45], s44 with lo=5, hi=0x11111111 and encodes the read-after-write result (5, 0x11111131) as the expected mismatch. The startup handler added here has no equivalent.

Section 9's two lines (tests/startup_gfx2hlsl_s_bitset64_check.py:314 and :316) compare ref_bitset64 to itself and never call Stage, so the "mutation" labels announce a control that does not run; the grid does the real work - of ten mutants I applied to scalar_bitset64, eight are killed (5-bit index masking in both index paths, dropped bit-5 word selection, unmasked fold shift, inverted word selection, 63-bit dynamic mask, clear/set swap, removed pair-alignment guard), and the aliasing order plus the post-write lane-mask discard survive.

What this does not say

Not a claim that the lowering is wrong: on b011dbfa the 416-case grid, the 28 alias comparisons and four further alias probes all match the reference, and the mutants are mine. The draw entries cannot see the ordering either - the synthetic pixel program passes s6 as the index for both instructions - and I did not run the draw mode here (no DXC, no GPU on this host).

AI-assisted.

**@⁠thepatrickworld** on GitHub · 2026-11-26 19:16 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2897#issuecomment-7201397192) **Review note on `b011dbfa`: the aliasing section's vectors all miss the aliasing class** Pure-Python path only (`python3 -B tests/startup_gfx2hlsl_s_bitset64_check.py`, CPython 3.11.16, Linux); no GPU run is involved in anything below. ### The ordering branch, and two mutants it does not see `scalar_bitset64` (`tools/startup/gfx2hlsl.py:5846`) emits the two HLSL assignments in a chosen order when the bit index lives in the low word of the destination pair (`tools/startup/gfx2hlsl.py:5904`), and the docstring says why: "when S0 aliases the low word of D, the high word is updated first so S0 is read intact". Section 3 of the fixture (`tests/startup_gfx2hlsl_s_bitset64_check.py:206-216`) is labelled "aliasing s[4:5], s4 and s[4:5], s5 preserve original index". Two one-line mutants, both of which leave the whole fixture green (77 checks, exit 0): ``` M-a `if src_reg == d:` -> `if False:` (always emit the low word first) M-b `if src_reg == d:` -> `if True:` (always emit the high word first) s_bitset1_b64 s[4:5], s4 s4=0x05 s5=0x00 head (0x25,0x00) M-a (0x25,0x20) s_bitset0_b64 s[4:5], s5 s4=0x20 s5=0x25 head (0x20,0x05) M-b (0x00,0x05) ``` Both values come from evaluating the emitted statements through the fixture's own `run_lines()`, and all 28 alias comparisons of section 3 agree with the reference under each mutant. ### Why the 28 vectors miss it For M-a the separating class is narrow: the low write only happens when index bit 5 is clear, and it can only take bit 5 of the low word from 0 to 1 when `index & 31 == 5`, with bit 5 still clear in the high word - so only the set form with the source aliasing the low word separates (`s4 = 5, s5 = 0`). For M-b the mirror holds: only the clear form with the source aliasing the high word separates (`s4 = 0x20, s5 = 0x25`). In the current list `(5, 0x12345678)` has bit 5 set in `hi` (`0x78 & 0x20`), and the remaining pairs have index bit 5 set or `index & 31 != 5`; none is in either class. ### Minimal addition One pair per direction, in the section 3 loop: `(5, 0)` for the low-word alias and `(0x20, 0x25)` for the high-word alias. Measured on a temporary copy of the fixture: with `(5, 0)` added, M-a fails with `aliasing s[4:5], s4 and s[4:5], s5 preserve original index: MISMATCH` (exit 1) while the unmutated head still exits 0; with `(0x20, 0x25)` added, M-b does the same. Asserting the emitted order directly (`stage.lines[0].startswith('s5 =')` for the `s4` form) would pin the mechanism rather than two values, if you prefer that. Worth noting: the pixel_aot fixture already pins this pattern for the other lowering - `tests/pixel_aot_check.py:6367-6380` builds `s_bitset1_b64 s[44:45], s44` with `lo=5, hi=0x11111111` and encodes the read-after-write result `(5, 0x11111131)` as the expected *mismatch*. The startup handler added here has no equivalent. Section 9's two lines (`tests/startup_gfx2hlsl_s_bitset64_check.py:314` and `:316`) compare `ref_bitset64` to itself and never call `Stage`, so the "mutation" labels announce a control that does not run; the grid does the real work - of ten mutants I applied to `scalar_bitset64`, eight are killed (5-bit index masking in both index paths, dropped bit-5 word selection, unmasked fold shift, inverted word selection, 63-bit dynamic mask, clear/set swap, removed pair-alignment guard), and the aliasing order plus the post-write lane-mask discard survive. ### What this does not say Not a claim that the lowering is wrong: on `b011dbfa` the 416-case grid, the 28 alias comparisons and four further alias probes all match the reference, and the mutants are mine. The draw entries cannot see the ordering either - the synthetic pixel program passes `s6` as the index for both instructions - and I did not run the draw mode here (no DXC, no GPU on this host). _AI-assisted._
Author
Owner

@⁠thepatrickworld on GitHub · 2026-11-26 19:46 UTC · original

Independent AMD (RDNA 4) result on b011dbfa — Not a code change; measurements only.

Environment

  • Windows 11 build 26200 UBR 9974, MSVC 19.44.35230, BuildTools 14.44.35207, DXC 1.9.2602.17, FXC from Windows SDK 10.0.26100.0. The PR body reports its own run as build 26300 with the debug layer enabled.
  • AMD Radeon RX 9070 XT, vendor 1002 device 7550, driver 32.0.32029.2010 (RDNA 4). debug_layer=unavailable on this machine.
  • b011dbfa7e640c4b26af80bc1b44a0b2950b016e, as recorded by git rev-parse HEAD in the run's environment block. ctest -N → Total Tests: 2445, including #2420 controls, #2421 warp, #2422 hardware. The test command takes its interpreter from this machine's x2w-pr641/out/pe-env; the fixture imports the translator from its own tree, so the lowering under test is the one at b011dbfa.

Commands

set "XBOX2WINDOWS_ADAPTER=AMD Radeon RX 9070 XT"
ctest --preset dev --no-tests=error -R startup_gfx2hlsl_s_bitset64 -V

Observed

100% tests passed out of 3 — controls 0.57 s, warp 4.34 s, hardware 6.20 s — and no SKIP line anywhere.

On the card, 16 startup_flat_param words= readback lines: 7 vectors × 2 compilers (fxc ps_5_1, dxc ps_6_0) plus 2 negative controls, which re-draw lo_bit0 with a deliberately wrong expected list. The 14 positive readbacks equal the list the fixture printed for that vector; the renderer compares by memcmp (tests/offscreen_check.cpp:1557) and the fixture raises on any non-zero exit, so a mismatch would have printed expected=… actual=… — the log has none. Both negative controls draw, print their readback, then exit 1 (fail maps to 1, skip to 77 — tests/offscreen_check.cpp:1968), and the readback line is printed before the comparison (tests/startup_flat_param.cpp:126), so the compare is the only step after it.

The two vectors above a 63 index, identical from both compilers:

2422: startup_flat_param words=3f800000,3f800000,3f800001,3f800000   (wrap_64)
2422: startup_flat_param words=3f800000,3f800000,3f800000,3f800020   (wrap_101)

What this draw measures, and what it does not

Every operand of these draws is a literal in the emitted HLSL — s6 = 0x00000040u; s6 = 0x00000040u ^ 0x00000000u; — and each half is a literal ternary: s4 = ((s6 & 32u) == 0u ? (0x00000001u & ~(1u << (s6 & 31u))) : 0x00000001u);. The translator folds that XOR itself, so clearing its const symbol never produced a runtime operand.

Recompiling the same emitted HLSL through the fixture's own compile_hlsl() (identical flags by construction; a fresh .cso, not the one the draw consumed):

; fxc ps_5_1 default, wrap_101
dcl_output o0.xyzw
mov o0.xyzw, l(1.000000,1.000000,1.000000,1.000004)
ret
; fxc ps_5_1 /Od, wrap_64
dcl_globalFlags refactoringAllowed | skipOptimization
mov r0.x, l(1)
not r0.x, r0.x
and r0.x, r0.x, l(1)
...
; dxc ps_6_0, wrap_101, four immediates, unchanged at -Od
call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 3, float 0x3FF0000400000000)

dxc folds even at -Od, which points at constant evaluation rather than the optimising passes. fxc folds only when optimising — the same shader at /Od keeps not/and/or/xor on literals. Either way, no runtime operand reaches the adapter. (fxc prints six decimals in a listing, so 1.000004 is not a bit-exact quote — the words themselves are the readback lines above.)

So the draw pins the emitted expression — a wrong half select (s6 >= 32u for s6 & 32u) folds to a different word for wrap_64, the only one of the seven that separates it, since wrap_101 satisfies both predicates — and that the four words survive transport. It never exercises the ternary at runtime, so _warp vs _hardware says nothing about the lowering here; what it can still separate is a broken export or readback.

If a runtime measurement is wanted, the renderer side already exists: run_startup_flat_param takes the four entry constants as an optional extra argument (tests/offscreen_check.cpp:1552, entry_constants in tests/startup_flat_param.cpp:22), and the translator already emits cbuffer entry : register(b0) when a pipeline declares them (tools/startup/gfx2hlsl.py:10503). The sibling fixture uses exactly that path for its two operands (tests/startup_gfx2hlsl_bfm_b64_check.py:565-569, checked at :584). The missing half is on the fixture side: the index would have to arrive through a scalar load from that buffer instead of a literal sop1_mov_lit, and a root constant is opaque to both compilers, so the (s6 & 32u) ternary would then really execute on the GPU.

Regression

The controls entry prints 77 : ok lines, the last being the fixture's own summary — 76 individual checks. Each draw entry prints 79 = 76 + the 2 negative controls + summary; the 76 are the pure-Python controls, re-executed in all three entries. 0 fail, 0 skip.

Limits

  • One machine, one AMD adapter, one driver, one run.
  • No debug layer: the pixel path is exercised, API validation is not.
  • The fold was dumped for 3 of 7 vectors at default settings (lo_bit0, wrap_64, wrap_101) and 2 of 7 at /Od, where the two compilers behave differently.
  • The draw writes s[4:5] indexed by s6, so s[D:D+1], sD aliasing is not exercised; the aliasing … ok line in this log is the pure-Python control from my earlier note.
  • wrap_64's readback is byte-identical to lo_bit0's: its value is against the half-select mutant, not as a new word.
  • Synthetic gfx1013 bytes only; nothing about startup throughput.

AI-assisted.

**@⁠thepatrickworld** on GitHub · 2026-11-26 19:46 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2897#issuecomment-7201938699) **Independent AMD (RDNA 4) result on `b011dbfa`** — Not a code change; measurements only. ### Environment - Windows 11 build **26200 UBR 9974**, MSVC **19.44.35230**, BuildTools **14.44.35207**, DXC **1.9.2602.17**, FXC from Windows SDK 10.0.26100.0. The PR body reports its own run as build 26300 with the debug layer enabled. - **AMD Radeon RX 9070 XT, vendor 1002 device 7550, driver 32.0.32029.2010** (RDNA 4). `debug_layer=unavailable` on this machine. - `b011dbfa7e640c4b26af80bc1b44a0b2950b016e`, as recorded by `git rev-parse HEAD` in the run's environment block. `ctest -N` → `Total Tests: 2445`, including `#2420` controls, `#2421` warp, `#2422` hardware. The test command takes its interpreter from this machine's `x2w-pr641/out/pe-env`; the fixture imports the translator from its own tree, so the lowering under test is the one at `b011dbfa`. ### Commands ``` set "XBOX2WINDOWS_ADAPTER=AMD Radeon RX 9070 XT" ctest --preset dev --no-tests=error -R startup_gfx2hlsl_s_bitset64 -V ``` ### Observed `100% tests passed out of 3` — controls 0.57 s, warp 4.34 s, hardware 6.20 s — and no `SKIP` line anywhere. On the card, 16 `startup_flat_param words=` readback lines: 7 vectors × 2 compilers (fxc `ps_5_1`, dxc `ps_6_0`) plus 2 negative controls, which re-draw `lo_bit0` with a deliberately wrong expected list. The 14 positive readbacks equal the list the fixture printed for that vector; the renderer compares by `memcmp` (`tests/offscreen_check.cpp:1557`) and the fixture raises on any non-zero exit, so a mismatch would have printed `expected=… actual=…` — the log has none. Both negative controls draw, print their readback, then exit 1 (`fail` maps to 1, `skip` to 77 — `tests/offscreen_check.cpp:1968`), and the readback line is printed before the comparison (`tests/startup_flat_param.cpp:126`), so the compare is the only step after it. The two vectors above a 63 index, identical from both compilers: ``` 2422: startup_flat_param words=3f800000,3f800000,3f800001,3f800000 (wrap_64) 2422: startup_flat_param words=3f800000,3f800000,3f800000,3f800020 (wrap_101) ``` ### What this draw measures, and what it does not Every operand of these draws is a literal in the emitted HLSL — `s6 = 0x00000040u; s6 = 0x00000040u ^ 0x00000000u;` — and each half is a literal ternary: `s4 = ((s6 & 32u) == 0u ? (0x00000001u & ~(1u << (s6 & 31u))) : 0x00000001u);`. The translator folds that XOR itself, so clearing its const symbol never produced a runtime operand. Recompiling the same emitted HLSL through the fixture's own `compile_hlsl()` (identical flags by construction; a fresh `.cso`, not the one the draw consumed): ``` ; fxc ps_5_1 default, wrap_101 dcl_output o0.xyzw mov o0.xyzw, l(1.000000,1.000000,1.000000,1.000004) ret ; fxc ps_5_1 /Od, wrap_64 dcl_globalFlags refactoringAllowed | skipOptimization mov r0.x, l(1) not r0.x, r0.x and r0.x, r0.x, l(1) ... ; dxc ps_6_0, wrap_101, four immediates, unchanged at -Od call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 3, float 0x3FF0000400000000) ``` dxc folds even at `-Od`, which points at constant evaluation rather than the optimising passes. fxc folds only when optimising — the same shader at `/Od` keeps `not`/`and`/`or`/`xor` on literals. Either way, no runtime operand reaches the adapter. (fxc prints six decimals in a listing, so `1.000004` is not a bit-exact quote — the words themselves are the readback lines above.) So the draw pins the **emitted expression** — a wrong half select (`s6 >= 32u` for `s6 & 32u`) folds to a different word for `wrap_64`, the only one of the seven that separates it, since `wrap_101` satisfies both predicates — and that the four words survive transport. It never exercises the ternary at runtime, so `_warp` vs `_hardware` says nothing about the lowering here; what it can still separate is a broken export or readback. If a runtime measurement is wanted, the renderer side already exists: `run_startup_flat_param` takes the four entry constants as an optional extra argument (`tests/offscreen_check.cpp:1552`, `entry_constants` in `tests/startup_flat_param.cpp:22`), and the translator already emits `cbuffer entry : register(b0)` when a pipeline declares them (`tools/startup/gfx2hlsl.py:10503`). The sibling fixture uses exactly that path for its two operands (`tests/startup_gfx2hlsl_bfm_b64_check.py:565-569`, checked at `:584`). The missing half is on the fixture side: the index would have to arrive through a scalar load from that buffer instead of a literal `sop1_mov_lit`, and a root constant is opaque to both compilers, so the `(s6 & 32u)` ternary would then really execute on the GPU. ### Regression The controls entry prints 77 `: ok` lines, the last being the fixture's own summary — 76 individual checks. Each draw entry prints 79 = 76 + the 2 negative controls + summary; the 76 are the pure-Python controls, re-executed in all three entries. 0 fail, 0 skip. ### Limits - One machine, one AMD adapter, one driver, one run. - No debug layer: the pixel path is exercised, API validation is not. - The fold was dumped for 3 of 7 vectors at default settings (`lo_bit0`, `wrap_64`, `wrap_101`) and 2 of 7 at `/Od`, where the two compilers behave differently. - The draw writes `s[4:5]` indexed by `s6`, so `s[D:D+1], sD` aliasing is not exercised; the `aliasing … ok` line in this log is the pure-Python control from my earlier note. - `wrap_64`'s readback is byte-identical to `lo_bit0`'s: its value is against the half-select mutant, not as a new word. - Synthetic `gfx1013` bytes only; nothing about startup throughput. _AI-assisted._
github-bot changed target branch from main to gh-pr/2897/base 2026-11-27 06:52:10 +00:00
github manually merged commit b011dbfa7e into gh-pr/2897/base 2026-11-27 06:52:11 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-27 06:49 UTC · original · approved these changes

Independent review of b011dbfa integrated with main 2917babc (cb5f6a10 locally). The six-bit index selects a single half and both operations preserve SCC, consistent with AMD RDNA 2 ISA, Table 14. The dynamic alias order keeps the scalar index live until the opposite half has been processed.

I rebuilt offscreen_check and ran ctest --preset <dev|release> --no-tests=error -R '^startup_gfx2hlsl_s_bitset64_(controls|warp|hardware)$'. Debug and Release /O2 each passed 3/3 without skips. The draw suite exercised FXC and DXC, including wrong-expectation controls on both adapters. The neighboring python -B tests/startup_gfx2hlsl_s_bitset_check.py also passed. Windows 11 build 26200.9974, RTX 4060 Laptop driver 32.0.16.1656 and WARP 10.0.26100.9818, with the debug layer enabled. Hosted Windows, Linux Python and gfx1013 checks passed. The hosted /O2 job skipped and the local /O2 retest passed.

**@⁠R0Y00** on GitHub · 2026-11-27 06:49 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2897#pullrequestreview-6084518506) · **approved these changes** Independent review of `b011dbfa` integrated with `main` `2917babc` (`cb5f6a10` locally). The six-bit index selects a single half and both operations preserve SCC, consistent with [AMD RDNA 2 ISA, Table 14](https://www.amd.com/content/dam/amd/en/documents/radeon-tech-docs/instruction-set-architectures/rdna2-shader-instruction-set-architecture.pdf). The dynamic alias order keeps the scalar index live until the opposite half has been processed. I rebuilt `offscreen_check` and ran `ctest --preset <dev|release> --no-tests=error -R '^startup_gfx2hlsl_s_bitset64_(controls|warp|hardware)$'`. Debug and Release `/O2` each passed 3/3 without skips. The draw suite exercised FXC and DXC, including wrong-expectation controls on both adapters. The neighboring `python -B tests/startup_gfx2hlsl_s_bitset_check.py` also passed. Windows 11 build 26200.9974, RTX 4060 Laptop driver 32.0.16.1656 and WARP 10.0.26100.9818, with the debug layer enabled. Hosted Windows, Linux Python and gfx1013 checks passed. The hosted `/O2` job skipped and the local `/O2` retest passed.
This discussion has been locked. Commenting is limited to contributors.
No description provided.