rdna2spirv: keep plain-data VCC sources on the 64-bit data path in is_mask_op and src64_data (SHADER-SALU64-VCC-DATA-SRC) #1990

Closed
ShotTechOp wants to merge 1 commit from upstream-pr/1990 into main
ShotTechOp commented 2026-11-25 17:34:05 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ShotTechOp on 2026-11-25T17:34:05Z.


Claimed in #1608 as SHADER-SALU64-VCC-DATA-SRC.

What and why

  • Gen.is_mask_op in tools/rdna2spirv.py previously returned True unconditionally whenever an operand was vcc, vcc_lo, or vcc_hi, even when lane_masks.py proved vcc holds plain scalar data (for example after s_mov_b32 vcc_lo, ... / s_mov_b32 vcc_hi, ...).
    • Gen.holds_lane_mask already returns True unconditionally for exec/exec_lo/exec_hi and returns True for vcc/vcc_lo/vcc_hi only when vcc actually holds a lane mask ("vcc" in self.cur_masks).
    • Because of the unconditional vcc branch in is_mask_op:
      1. s_not_b64, s_{and,or,xor,andn2,orn2,nand,nor,xnor}_b64, and s_cselect_b64 with a plain-data vcc source took the per-lane mask path, dropping %vcc_hi and the high dword of the paired SGPR, duplicating the low 32-bit word into both destination dwords, and voting SCC across the wave instead of testing (D.lo | D.hi) != 0.
      2. s_cmov_b64, s_quadmask_b32/s_quadmask_b64, and s_bitreplicate_b64_b32 falsely rejected plain-data vcc/vcc_lo operands as lane masks.
  • Gen.src64_data also rejected plain-data vcc operands with Unsupported("<op> source"). Adding a not self.holds_lane_mask(s) branch to load (%vcc, %vcc_hi) fixes all src64_data consumers while keeping lane-mask vcc sources rejected as Unsupported.
  • Updated the 64-bit scalar bitwise ops contract row in docs/design.md.

Testing

  • AI-assisted: yes.
  • Environment: Windows 11, Python 3.12 (no GPU / LLVM / SPIRV-Tools installed locally).
  • New regression suite: tests/semantic/test_salu64_vcc_data_src.py — covers all 9 64-bit bitwise ops in both operand orders (s_and_b64..s_xnor_b64, s_not_b64) with high-word-only non-zero SCC checks, s_cselect_b64, s_cmov_b64, s_quadmask_b64, s_bitreplicate_b64_b32, mask-to-data VCC overwrite, and lane-mask VCC preservation/rejection controls.
  • RED control on origin/main (fe15534): tests/semantic/test_salu64_vcc_data_src.py fails on origin/main (proving both silent miscompilation of the high dword / SCC in the bitwise + s_cselect_b64 ops and false Unsupported errors in s_cmov_b64 / s_quadmask_b64 / s_bitreplicate_b64_b32).
  • GREEN checks on branch:
    • python -I tests/semantic/test_salu64_vcc_data_src.py -v
    • python -m unittest discover -s tests/semantic -p test_salu64_bitwise_data.py
    • python -m unittest discover -s tests/semantic -p test_scselect_b64_data.py
    • python -m unittest discover -s tests/semantic -p test_salu_cmov_b64.py
    • python -m unittest discover -s tests/semantic -p test_salu_quadmask_bitreplicate.py
    • python -m unittest discover -s tests/semantic -p test_lane_mask_bitreplicate_flbit.py
    • python -m unittest discover -s tests -p "test_docs_*.py"
    • python -I tests/test_text_write_line_endings.py
    • python -m compileall -q tools/rdna2spirv.py tests/semantic/test_salu64_vcc_data_src.py
    • python -I scripts/check_no_game_data.py tools/rdna2spirv.py docs/design.md tests/semantic/test_salu64_vcc_data_src.py
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5496108971 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1990). Originally posted by [ShotTechOp](https://github.com/ShotTechOp) on 2026-11-25T17:34:05Z. --- Claimed in #1608 as `SHADER-SALU64-VCC-DATA-SRC`. ## What and why - `Gen.is_mask_op` in `tools/rdna2spirv.py` previously returned `True` unconditionally whenever an operand was `vcc`, `vcc_lo`, or `vcc_hi`, even when `lane_masks.py` proved `vcc` holds plain scalar data (for example after `s_mov_b32 vcc_lo, ...` / `s_mov_b32 vcc_hi, ...`). - `Gen.holds_lane_mask` already returns `True` unconditionally for `exec`/`exec_lo`/`exec_hi` and returns `True` for `vcc`/`vcc_lo`/`vcc_hi` only when `vcc` actually holds a lane mask (`"vcc" in self.cur_masks`). - Because of the unconditional `vcc` branch in `is_mask_op`: 1. `s_not_b64`, `s_{and,or,xor,andn2,orn2,nand,nor,xnor}_b64`, and `s_cselect_b64` with a plain-data `vcc` source took the per-lane mask path, dropping `%vcc_hi` and the high dword of the paired SGPR, duplicating the low 32-bit word into both destination dwords, and voting `SCC` across the wave instead of testing `(D.lo | D.hi) != 0`. 2. `s_cmov_b64`, `s_quadmask_b32`/`s_quadmask_b64`, and `s_bitreplicate_b64_b32` falsely rejected plain-data `vcc`/`vcc_lo` operands as lane masks. - `Gen.src64_data` also rejected plain-data `vcc` operands with `Unsupported("<op> source")`. Adding a `not self.holds_lane_mask(s)` branch to load `(%vcc, %vcc_hi)` fixes all `src64_data` consumers while keeping lane-mask `vcc` sources rejected as `Unsupported`. - Updated the `64-bit scalar bitwise ops` contract row in `docs/design.md`. ## Testing - **AI-assisted**: yes. - **Environment**: Windows 11, Python 3.12 (no GPU / LLVM / SPIRV-Tools installed locally). - **New regression suite**: `tests/semantic/test_salu64_vcc_data_src.py` — covers all 9 64-bit bitwise ops in both operand orders (`s_and_b64`..`s_xnor_b64`, `s_not_b64`) with high-word-only non-zero SCC checks, `s_cselect_b64`, `s_cmov_b64`, `s_quadmask_b64`, `s_bitreplicate_b64_b32`, mask-to-data VCC overwrite, and lane-mask VCC preservation/rejection controls. - **RED control on `origin/main` (`fe15534`)**: `tests/semantic/test_salu64_vcc_data_src.py` fails on `origin/main` (proving both silent miscompilation of the high dword / SCC in the bitwise + `s_cselect_b64` ops and false `Unsupported` errors in `s_cmov_b64` / `s_quadmask_b64` / `s_bitreplicate_b64_b32`). - **GREEN checks on branch**: - `python -I tests/semantic/test_salu64_vcc_data_src.py -v` - `python -m unittest discover -s tests/semantic -p test_salu64_bitwise_data.py` - `python -m unittest discover -s tests/semantic -p test_scselect_b64_data.py` - `python -m unittest discover -s tests/semantic -p test_salu_cmov_b64.py` - `python -m unittest discover -s tests/semantic -p test_salu_quadmask_bitreplicate.py` - `python -m unittest discover -s tests/semantic -p test_lane_mask_bitreplicate_flbit.py` - `python -m unittest discover -s tests -p "test_docs_*.py"` - `python -I tests/test_text_write_line_endings.py` - `python -m compileall -q tools/rdna2spirv.py tests/semantic/test_salu64_vcc_data_src.py` - `python -I scripts/check_no_game_data.py tools/rdna2spirv.py docs/design.md tests/semantic/test_salu64_vcc_data_src.py`
kirigayakazima commented 2026-11-28 06:17:11 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-28T06:17:11Z.


#1990 | head 74031f03cfa39a3755a3f6b9eff731be685dbeee | python -I -m unittest discover -s tests/semantic -p test_salu64_vcc_data_src.py | red: FAILED (failures=48, errors=3; AssertionError + rdna2spirv.Unsupported) | green: 4/4 OK (8.034s) | full suite: FAILED — semantic 506 files / 6401 tests / 1 failed (test_wave64_emulate_opt) vs main 8994000b08 | Windows 11, Python 3.14.7, no game files | AI-assisted: yes, Antigravity (Gemini)

Details:

  • Red (PR test tests/semantic/test_salu64_vcc_data_src.py on upstream/main 8994000b08): Ran 4 tests in 8.400s — FAILED (failures=48, errors=3) (rdna2spirv.Unsupported: s_cmov_b64 lane-mask source x2, rdna2spirv.Unsupported: s_quadmask_b64 on a lane mask x1, plus 48 AssertionError subtests where plain-data vcc took the lane-mask path).
  • Green (PR test merged with upstream/main 8994000b08): Ran 4 tests in 8.034s — OK.
  • Full semantic suite FAILURE (rc=1): 506 files, 6401 tests, 1 files failed in 419 s with 16 jobs: test_wave64_emulate_opt.
    • Reproduced standalone on the merged PR (6.988s, rc=1) vs clean upstream/main 8994000b08 (34/34 OK in 7.311s, rc=0): LocalExecFoldTests.test_negative_live_in_pair_and_unmasked_vcc_scc_not_folded fails at tests/semantic/test_wave64_emulate_opt.py:1158 (self.assertGreaterEqual(vote_calls, 2) # branch vote + scc_from_mask vote -> AssertionError: 1 not greater than or equal to 2).
    • Cause: test_wave64_emulate_opt.py:1139-1158 builds s_mov_b64 vcc, s[12:13] + s_and_b64 s[10:11], vcc, s[12:13] assuming the previous Gen.is_mask_op(vcc) -> scc_from_mask subgroup vote, whereas this PR changes Gen.is_mask_op to return self.holds_lane_mask(x) so plain-data vcc stays on the scalar 64-bit data path (no scc_from_mask vote, vote_calls == 1). Needs reconciliation with test_wave64_emulate_opt.py before merge.
  • Other repo checks: scripts/check_no_game_data.py -> 0; python -m compileall -q tools scripts tests -> 0; node --test tests/test_viewer_streaming.cjs -> 0; standalone stdlib tests/test_*.py initially hit 2 parallel 90s worker timeouts (tests/test_build_runtime_cmake.py, tests/test_merge_check.py), both passed standalone on the merged PR tree (1/1 OK in 19.251s and 24/24 OK in 40.342s), yielding 513/521 passed (33 skipped pytest/helper files; 0 new stdlib failures vs 8994000b08, same 8 pre-existing failures).
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7235198048 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1990#issuecomment-7235198048). Originally posted by [kirigayakazima](https://github.com/kirigayakazima) on 2026-11-28T06:17:11Z. --- `#1990 | head 74031f03cfa39a3755a3f6b9eff731be685dbeee | python -I -m unittest discover -s tests/semantic -p test_salu64_vcc_data_src.py | red: FAILED (failures=48, errors=3; AssertionError + rdna2spirv.Unsupported) | green: 4/4 OK (8.034s) | full suite: FAILED — semantic 506 files / 6401 tests / 1 failed (test_wave64_emulate_opt) vs main 8994000b08 | Windows 11, Python 3.14.7, no game files | AI-assisted: yes, Antigravity (Gemini)` Details: - **Red** (PR test `tests/semantic/test_salu64_vcc_data_src.py` on `upstream/main` `8994000b08`): `Ran 4 tests in 8.400s — FAILED (failures=48, errors=3)` (`rdna2spirv.Unsupported: s_cmov_b64 lane-mask source` x2, `rdna2spirv.Unsupported: s_quadmask_b64 on a lane mask` x1, plus 48 `AssertionError` subtests where plain-data `vcc` took the lane-mask path). - **Green** (PR test merged with `upstream/main` `8994000b08`): `Ran 4 tests in 8.034s — OK`. - **Full semantic suite FAILURE** (`rc=1`): `506 files, 6401 tests, 1 files failed in 419 s with 16 jobs: test_wave64_emulate_opt`. - Reproduced standalone on the merged PR (`6.988s`, `rc=1`) vs clean `upstream/main` `8994000b08` (`34/34 OK` in `7.311s`, `rc=0`): `LocalExecFoldTests.test_negative_live_in_pair_and_unmasked_vcc_scc_not_folded` fails at `tests/semantic/test_wave64_emulate_opt.py:1158` (`self.assertGreaterEqual(vote_calls, 2) # branch vote + scc_from_mask vote` -> `AssertionError: 1 not greater than or equal to 2`). - Cause: `test_wave64_emulate_opt.py:1139-1158` builds `s_mov_b64 vcc, s[12:13]` + `s_and_b64 s[10:11], vcc, s[12:13]` assuming the previous `Gen.is_mask_op(vcc) -> scc_from_mask` subgroup vote, whereas this PR changes `Gen.is_mask_op` to `return self.holds_lane_mask(x)` so plain-data `vcc` stays on the scalar 64-bit data path (no `scc_from_mask` vote, `vote_calls == 1`). Needs reconciliation with `test_wave64_emulate_opt.py` before merge. - **Other repo checks**: `scripts/check_no_game_data.py` -> `0`; `python -m compileall -q tools scripts tests` -> `0`; `node --test tests/test_viewer_streaming.cjs` -> `0`; standalone stdlib `tests/test_*.py` initially hit 2 parallel 90s worker timeouts (`tests/test_build_runtime_cmake.py`, `tests/test_merge_check.py`), both passed standalone on the merged PR tree (`1/1 OK` in `19.251s` and `24/24 OK` in `40.342s`), yielding `513/521 passed` (`33` skipped pytest/helper files; `0` new stdlib failures vs `8994000b08`, same 8 pre-existing failures).
zmasi commented 2026-11-28 12:32:22 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T12:32:22Z.


#1990 | head 74031f03cfa39a3755a3f6b9eff731be685dbeee (merged cleanly onto main d48a957bb9988afce424552a3c0c8d01ef12320f, and cleanly alongside #1983) | Windows 11 (10.0.26200), CPython 3.12.10, llvm-mc (gfx1013), spirv-val (1.4.363.1), NVIDIA GeForce RTX 3090 (Vulkan 1.4.341, driver 610.88, subgroup 32..32, LEONIDA_VK_VALIDATION=1)

  • Red on main (d48a957bb9988afce424552a3c0c8d01ef12320f):
    • tests/semantic/test_salu64_vcc_data_src.py: FAILED (failures=48, errors=3) (64-bit bitwise/select ops route plain-data vcc onto the per-lane mask path and s_cmov_b64 / s_quadmask_b64 / src64_data reject plain-data vcc).
    • Live RTX 3090 vk_compute_test (--wave64-emulate, LEONIDA_VK_VALIDATION=1) on s_and_b64 s[8:9], s[6:7], vcc with s[6:7] = 0x0F0F0F0F_00000000 and vcc = 0x55667788_11223344: dumps 0x11223344 0x11223344 1 instead of 0x00000000 0x05060708 1.
  • Green on PR + main:
    • python -I tests/semantic/test_salu64_vcc_data_src.py -v and python -I tests/semantic/test_salu64_bitwise_data.py -v: pass (OK).
    • Live RTX 3090 vk_compute_test (--wave64-emulate, LEONIDA_VK_VALIDATION=1, spirv-val clean) exercising s_and_b64, s_quadmask_b64, and s_cmov_b64 on plain-data vcc = 0x55667788_11223344 and s[6:7] = 0x0F0F0F0F_00000000: 1 groups x 64: 0 mismatches, out[0..5] = 0x00000000 0x05060708 1 0x0000FFFF 0x11223344 0x55667788 (0 Khronos validation errors).
    • scripts/check_no_game_data.py, test_docs_encoding.py, and test_text_write_line_endings.py: pass (0 CRLF).
  • Non-blocking note: Same s_mov_b64 vcc, null interaction noted on #1983 (lane_masks.py classifies vcc as non-mask after s_mov_b64 vcc, null while %vcc_hi is not cleared), and in wave32 Gen.holds_lane_mask({"k": "special", "t": "vcc"}) checks "vcc" without "vcc_hi".

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7239296447 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1990#issuecomment-7239296447). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T12:32:22Z. --- #1990 | head `74031f03cfa39a3755a3f6b9eff731be685dbeee` (merged cleanly onto `main` `d48a957bb9988afce424552a3c0c8d01ef12320f`, and cleanly alongside `#1983`) | Windows 11 (`10.0.26200`), CPython `3.12.10`, `llvm-mc` (`gfx1013`), `spirv-val` (`1.4.363.1`), NVIDIA GeForce RTX 3090 (Vulkan `1.4.341`, driver `610.88`, `subgroup 32..32`, `LEONIDA_VK_VALIDATION=1`) - **Red on `main` (`d48a957bb9988afce424552a3c0c8d01ef12320f`)**: - `tests/semantic/test_salu64_vcc_data_src.py`: `FAILED (failures=48, errors=3)` (64-bit bitwise/select ops route plain-data `vcc` onto the per-lane mask path and `s_cmov_b64` / `s_quadmask_b64` / `src64_data` reject plain-data `vcc`). - Live RTX 3090 `vk_compute_test` (`--wave64-emulate`, `LEONIDA_VK_VALIDATION=1`) on `s_and_b64 s[8:9], s[6:7], vcc` with `s[6:7] = 0x0F0F0F0F_00000000` and `vcc = 0x55667788_11223344`: dumps `0x11223344 0x11223344 1` instead of `0x00000000 0x05060708 1`. - **Green on `PR + main`**: - `python -I tests/semantic/test_salu64_vcc_data_src.py -v` and `python -I tests/semantic/test_salu64_bitwise_data.py -v`: pass (`OK`). - Live RTX 3090 `vk_compute_test` (`--wave64-emulate`, `LEONIDA_VK_VALIDATION=1`, `spirv-val` clean) exercising `s_and_b64`, `s_quadmask_b64`, and `s_cmov_b64` on plain-data `vcc = 0x55667788_11223344` and `s[6:7] = 0x0F0F0F0F_00000000`: `1 groups x 64: 0 mismatches`, `out[0..5] = 0x00000000 0x05060708 1 0x0000FFFF 0x11223344 0x55667788` (`0` Khronos validation errors). - `scripts/check_no_game_data.py`, `test_docs_encoding.py`, and `test_text_write_line_endings.py`: pass (`0` CRLF). - **Non-blocking note**: Same `s_mov_b64 vcc, null` interaction noted on `#1983` (`lane_masks.py` classifies `vcc` as non-mask after `s_mov_b64 vcc, null` while `%vcc_hi` is not cleared), and in wave32 `Gen.holds_lane_mask({"k": "special", "t": "vcc"})` checks `"vcc"` without `"vcc_hi"`. AI-assisted.
zmasi commented 2026-11-28 13:18:06 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T13:18:06Z.


The previously reported vote-count test failure is also a wrong GPU result on native wave64, not just a brittle OpAtomicOr count. On physical gfx906 (RADV Mesa 26.0.8), start with s[4:5] = (1, 0) and run:

s_mov_b64 vcc, s[4:5]
s_and_b64 s[10:11], vcc, s[4:5]
s_cselect_b32 s14, 7, 3
v_mov_b32_e32 v4, s14

This scalar AND is nonzero. Main d48a957bb stored 7 on all 64 lanes. With 74031f03c merged, only lane 0 stored 7; the other 63 stored 3. Splitting the first instruction into separate low/high VCC writes restored 64 sevens; zero input returned 64 threes on both builds. On a second physical device, the upper-half branch from LocalExecFoldTests.test_negative_live_in_pair_and_unmasked_vcc_scc_not_folded likewise changed from 32 sevens to 32 threes. I would assert the stored values before changing the vote-count expectation.

The broader matrix improved from 15/72 to 75/90 matching readbacks. The merge fixes the tested split-write bitwise cases; it also ran the conditional-move and quadmask modules main refused. The minimal straight-line control above is separate from those counts. All guards held; no shader-run validation errors or synchronization hazards.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7239838431 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1990#issuecomment-7239838431). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T13:18:06Z. --- The previously reported vote-count test failure is **also a wrong GPU result** on native wave64, not just a brittle `OpAtomicOr` count. On physical gfx906 (RADV Mesa 26.0.8), start with `s[4:5] = (1, 0)` and run: ```asm s_mov_b64 vcc, s[4:5] s_and_b64 s[10:11], vcc, s[4:5] s_cselect_b32 s14, 7, 3 v_mov_b32_e32 v4, s14 ``` This scalar AND is nonzero. Main `d48a957bb` stored 7 on all 64 lanes. With `74031f03c` merged, only lane 0 stored 7; the other 63 stored 3. Splitting the first instruction into separate low/high VCC writes restored 64 sevens; zero input returned 64 threes on both builds. On a second physical device, the upper-half branch from `LocalExecFoldTests.test_negative_live_in_pair_and_unmasked_vcc_scc_not_folded` likewise changed from 32 sevens to 32 threes. I would assert the stored values before changing the vote-count expectation. The broader matrix improved from 15/72 to 75/90 matching readbacks. The merge fixes the tested split-write bitwise cases; it also ran the conditional-move and quadmask modules main refused. The minimal straight-line control above is separate from those counts. All guards held; no shader-run validation errors or synchronization hazards. AI-assisted.
TheGeogeo commented 2026-11-29 00:00:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T00:00:31Z.


Tested 74031f03c merged (no commit) with main aa918e5d9. Python 3.12.4, Windows 11 10.0.26300, CPU only, with LLVM_MC (conda-forge llvm-tools) and SPIRV-Tools from the Vulkan SDK 1.4.363.1. check_no_game_data.py is clean.

  • Green: tests/semantic/test_salu64_vcc_data_src.py, 4 tests pass.
  • Red: with tools/rdna2spirv.py back to main, 48 failures and 3 errors (lane 32 diverged).

Blocker: it breaks an existing test. With this PR merged on main, tests/semantic/test_wave64_emulate_opt.py fails LocalExecFoldTests.test_negative_live_in_pair_and_unmasked_vcc_scc_not_folded (line 1180, vote_calls: 1 not greater than or equal to 2). That test passes on plain main and with each of the other six PRs. The likely cause is that is_mask_op no longer treats every vcc/exec special as a mask, so the wave64-emulate fold sees one vote fewer. Either the fold test needs updating with a reason, or is_mask_op needs to keep that case.

Overlap check across #1973, #1977, #1990, #1943, #1994, #1996 and #1803 (same translator area):

  • None is a stack or a duplicate. They are independent single commits, and each covers a different reader:
    • plain 64-bit VCC data: #1973 for the b64 bit ops, #1977 for s_wqm, #1990 for src64_data/is_mask_op;
    • per-lane bits from non-mask sources: #1943 for VCC data, #1994 for s_mov into exec_hi, #1996 for m0/scc;
    • #1803: wave32 lane slots.
  • The only textual conflict is docs/design.md, between #1990, #1943 and #1994.
  • With all 7 merged together on main (docs/design.md taken from main), each PR's own test file passes. The full semantic suite (scripts/run_semantic_tests.py tests/semantic -j 4, 528 files, 6513 tests) fails in 2 files:
    • test_valu_cvt_f16_int16_mods, which fails on plain main too;
    • test_wave64_emulate_opt, which comes from #1990 alone (see #1990).

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7247808281 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1990#issuecomment-7247808281). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T00:00:31Z. --- Tested `74031f03c` merged (no commit) with `main` `aa918e5d9`. Python 3.12.4, Windows 11 10.0.26300, CPU only, with `LLVM_MC` (conda-forge llvm-tools) and SPIRV-Tools from the Vulkan SDK 1.4.363.1. `check_no_game_data.py` is clean. - Green: `tests/semantic/test_salu64_vcc_data_src.py`, 4 tests pass. - Red: with `tools/rdna2spirv.py` back to `main`, 48 failures and 3 errors (`lane 32 diverged`). **Blocker: it breaks an existing test.** With this PR merged on `main`, `tests/semantic/test_wave64_emulate_opt.py` fails `LocalExecFoldTests.test_negative_live_in_pair_and_unmasked_vcc_scc_not_folded` (line 1180, `vote_calls`: `1 not greater than or equal to 2`). That test passes on plain `main` and with each of the other six PRs. The likely cause is that `is_mask_op` no longer treats every `vcc`/`exec` special as a mask, so the wave64-emulate fold sees one vote fewer. Either the fold test needs updating with a reason, or `is_mask_op` needs to keep that case. Overlap check across #1973, #1977, #1990, #1943, #1994, #1996 and #1803 (same translator area): - None is a stack or a duplicate. They are independent single commits, and each covers a different reader: - plain 64-bit VCC data: #1973 for the b64 bit ops, #1977 for `s_wqm`, #1990 for `src64_data`/`is_mask_op`; - per-lane bits from non-mask sources: #1943 for VCC data, #1994 for `s_mov` into `exec_hi`, #1996 for `m0`/`scc`; - #1803: wave32 lane slots. - The only textual conflict is `docs/design.md`, between #1990, #1943 and #1994. - With all 7 merged together on `main` (`docs/design.md` taken from `main`), each PR's own test file passes. The full semantic suite (`scripts/run_semantic_tests.py tests/semantic -j 4`, 528 files, 6513 tests) fails in 2 files: - `test_valu_cvt_f16_int16_mods`, which fails on plain `main` too; - `test_wave64_emulate_opt`, which comes from #1990 alone (see #1990). AI-assisted (Claude Code).
ecox982745 commented 2026-11-29 01:07:43 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-11-29T01:07:43Z.


The scalar-pair write patch for #2598 fixes the wrong GPU output in the earlier SCC reproduction. I applied only this PR's translator diff at 74031f03c to main aa52446f7d, then compared it with the same code plus the #2598 patch. Physical RTX 4090, Windows 11, driver 616.64, wave64 emulation over 32-lane subgroups.

For s[4:5] = (1, 0), the shader moves the pair to VCC, ANDs the same pair with VCC, then selects 7 on nonzero SCC. When all lanes executed, 1/64 lanes selected 7 with this PR alone and 64/64 with both changes. When only lanes 32–63 executed the AND, the result went from 0/32 to 32/32. All 32 lower output words stayed zero in the guarded shader.

Across four input pairs, both single-move shaders went from 1/4 correct dispatches to 4/4. Both split-write controls stayed at 4/4. All 32 dispatches preserved the guard words and completed with Vulkan validation enabled and zero validation errors.

The existing CPU assertion in LocalExecFoldTests.test_negative_live_in_pair_and_unmasked_vcc_scc_not_folded still counts one vote and expects at least two with both changes applied. The upper-half readback above gives an output assertion for this specific case while leaving the other case in that test intact. The comparison trees were b102395b783d5354883ef69ec200f0fa97691603 and fa2a62e42cc9dc41a754c3e0ed525143ffa1032c. AI-assisted with OpenAI Codex (GPT-6).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248578172 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1990#issuecomment-7248578172). Originally posted by [ecox982745](https://github.com/ecox982745) on 2026-11-29T01:07:43Z. --- The [scalar-pair write patch for #2598](https://github.com/ProjectLeonida/mandy/issues/2598#issuecomment-7248572945) fixes the wrong GPU output in the [earlier SCC reproduction](https://github.com/ProjectLeonida/mandy/pull/1990#issuecomment-7239838431). I applied only this PR's translator diff at `74031f03c` to main `aa52446f7d`, then compared it with the same code plus the #2598 patch. Physical RTX 4090, Windows 11, driver 616.64, wave64 emulation over 32-lane subgroups. For `s[4:5] = (1, 0)`, the shader moves the pair to VCC, ANDs the same pair with VCC, then selects 7 on nonzero SCC. When all lanes executed, **1/64** lanes selected 7 with this PR alone and **64/64** with both changes. When only lanes 32–63 executed the AND, the result went from **0/32** to **32/32**. All 32 lower output words stayed zero in the guarded shader. Across four input pairs, both single-move shaders went from 1/4 correct dispatches to 4/4. Both split-write controls stayed at 4/4. All 32 dispatches preserved the guard words and completed with Vulkan validation enabled and zero validation errors. The existing CPU assertion in `LocalExecFoldTests.test_negative_live_in_pair_and_unmasked_vcc_scc_not_folded` still counts one vote and expects at least two with both changes applied. The upper-half readback above gives an output assertion for this specific case while leaving the other case in that test intact. The comparison trees were `b102395b783d5354883ef69ec200f0fa97691603` and `fa2a62e42cc9dc41a754c3e0ed525143ffa1032c`. AI-assisted with OpenAI Codex (GPT-6).
aslan2142 commented 2026-12-01 11:55:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:55:49Z.

Review: CHANGES_REQUESTED


Reviewed against current main: this branch conflicts with main (docs/design.md / tools/rdna2spirv.py), has failing CI, and independent native-wave64 GPU testing reported a wrong GPU result on the vote-count case. Please address that regression, rebase onto current main, and re-run CI.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130762445 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1990#pullrequestreview-6130762445). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:55:49Z. **Review:** CHANGES_REQUESTED --- Reviewed against current `main`: this branch conflicts with `main` (`docs/design.md` / `tools/rdna2spirv.py`), has failing CI, and independent native-wave64 GPU testing reported a wrong GPU result on the vote-count case. Please address that regression, rebase onto current `main`, and re-run CI. *(AI-assisted review.)*
aslan2142 commented 2026-12-01 16:40:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:40:51Z.


Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7318022753 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1990#issuecomment-7318022753). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:40:51Z. --- Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.

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
ProjectLeonida/mandy!1990
No description provided.