tests/semantic: wave32 s_cbranch_vccz/vccnz read vcc_lo only (TEST-W32-VCCZ-VCC-HI) #993

Manually merged
github merged 1 commit from gh-pr/993/head into gh-pr/993/base 2026-11-26 09:32:22 +00:00
Owner

@⁠qhukz13 on GitHub · 2026-11-24 16:36 UTC · original
qhukz13:cont/wave32-vccz-vcc-hi → main · +43 −0 · 1 files · 1 commits · merged 2026-11-24 22:18 UTC

Claimed in the coordination issue as: TEST-W32-VCCZ-VCC-HI

In wave32, VCC is vcc_lo alone and vcc_hi is an ordinary SGPR. branch_condition in tools/rdna2spirv.py reads %vcc_hi only under wave64 (if g.wave64 and "vcc" not in g.cur_masks), and the reference model in tests/semantic/test_control_flow_vcc.py (eval_vccz masks VCC to the wave size) assumes the same, but no test pinned it: with tools/semantic_mutants.py (#734), and -> or on that line survived all four test files that reach branch_condition, run together.

Wave32VccDataBranchTests in tests/semantic/test_wave64_vcc_data_branch.py, next to the wave64 class, runs the same programs without the 64-bit op that selects wave64, as two 32-lane subgroups, with SGPR-sourced and constant VCC writes: vcc_lo = 0 with vcc_hi != 0 takes s_cbranch_vccz and falls through s_cbranch_vccnz.

Test only. Tested: the file passes (5 tests); with the and -> or mutant it gives 4 failures. scripts/check_no_game_data.py: OK. Linux, CPU only; no GPU, no game files. No hardware measurement of the wave32 rule is in the repository; the test pins the translator's and the reference model's shared assumption.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

**@⁠qhukz13** on GitHub · 2026-11-24 16:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/993) `qhukz13:cont/wave32-vccz-vcc-hi` → `main` · +43 −0 · 1 files · 1 commits · merged 2026-11-24 22:18 UTC Claimed in the coordination issue as: TEST-W32-VCCZ-VCC-HI In wave32, VCC is `vcc_lo` alone and `vcc_hi` is an ordinary SGPR. `branch_condition` in `tools/rdna2spirv.py` reads `%vcc_hi` only under wave64 (`if g.wave64 and "vcc" not in g.cur_masks`), and the reference model in `tests/semantic/test_control_flow_vcc.py` (`eval_vccz` masks VCC to the wave size) assumes the same, but no test pinned it: with `tools/semantic_mutants.py` (#734), `and -> or` on that line survived all four test files that reach `branch_condition`, run together. `Wave32VccDataBranchTests` in `tests/semantic/test_wave64_vcc_data_branch.py`, next to the wave64 class, runs the same programs without the 64-bit op that selects wave64, as two 32-lane subgroups, with SGPR-sourced and constant VCC writes: `vcc_lo = 0` with `vcc_hi != 0` takes `s_cbranch_vccz` and falls through `s_cbranch_vccnz`. Test only. Tested: the file passes (5 tests); with the `and -> or` mutant it gives 4 failures. `scripts/check_no_game_data.py`: OK. Linux, CPU only; no GPU, no game files. No hardware measurement of the wave32 rule is in the repository; the test pins the translator's and the reference model's shared assumption. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
In wave32, VCC is vcc_lo alone and vcc_hi is an ordinary SGPR. branch_condition reads %vcc_hi only under wave64
(`if g.wave64 and "vcc" not in g.cur_masks`), as test_control_flow_vcc.py's reference model (eval_vccz masks VCC to
the wave size) assumes, but no test pinned it: with tools/semantic_mutants.py, `and -> or` on that line survived all
four test files that reach branch_condition, run together.

A wave32 class next to the wave64 one in test_wave64_vcc_data_branch.py runs the same programs without the 64-bit op
that selects wave64, as two 32-lane subgroups, with SGPR-sourced and constant VCC writes: vcc_lo = 0 and vcc_hi != 0
takes s_cbranch_vccz. The mutant now fails the file (4 failures).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:32:20 +00:00
github manually merged commit 7c59c185b0 into gh-pr/993/base 2026-11-26 09:32:22 +00:00
Author
Owner

@⁠morodirule on GitHub · 2026-11-24 16:38 UTC · original

Independent Linux check (stdlib only, no game/GPU): 5/5 pass on head 7c59c185b. With the claimed and->or mutant applied to the branch_condition line, the 2 new Wave32VccDataBranchTests fail with 4 failures (wave32 vccz/vccnz flip when vcc_hi is set) while the wave64 tests keep passing — so the new class pins exactly the reported gap. This matches my earlier #14 finding reproduction. Not claiming; review evidence.

**@⁠morodirule** on GitHub · 2026-11-24 16:38 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/993#issuecomment-7137969398) Independent Linux check (stdlib only, no game/GPU): 5/5 pass on head 7c59c185b. With the claimed and->or mutant applied to the branch_condition line, the 2 new Wave32VccDataBranchTests fail with 4 failures (wave32 vccz/vccnz flip when vcc_hi is set) while the wave64 tests keep passing — so the new class pins exactly the reported gap. This matches my earlier #14 finding reproduction. Not claiming; review evidence.
Author
Owner

@⁠KernelSmoker on GitHub · 2026-11-24 16:46 UTC · original · approved these changes

Reviewed exact head 7c59c185b0, applied cleanly on current main 82a2aabcc. test_wave64_vcc_data_branch.py passed 5/5 and test_control_flow_vcc.py passed 24/24 in Fedora 45. The mutation runner caught both targeted mutations at branch_condition (and -> or; not in -> in), each causing four failures. No-game-data and diff checks passed. Synthetic CPU tests only; no hardware validation of the wave32 rule is claimed. Hosted checks were queued.

**@⁠KernelSmoker** on GitHub · 2026-11-24 16:46 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/993#pullrequestreview-6043536165) · **approved these changes** Reviewed exact head 7c59c185b0a4e9be2d70b47fedb231f1fca03167, applied cleanly on current main 82a2aabcc. `test_wave64_vcc_data_branch.py` passed 5/5 and `test_control_flow_vcc.py` passed 24/24 in Fedora 45. The mutation runner caught both targeted mutations at `branch_condition` (and -> or; not in -> in), each causing four failures. No-game-data and diff checks passed. Synthetic CPU tests only; no hardware validation of the wave32 rule is claimed. Hosted checks were queued.
Author
Owner

@⁠QemmHD on GitHub · 2026-11-24 22:18 UTC · original

Merging.

Why merged: TEST-W32-VCCZ-VCC-HI, test-only: pins that wave32 s_cbranch_vccz/vccnz read vcc_lo only. morodirule did a mutation check and KernelSmoker checked it independently.

Why it's good: vcc_data_branch, control_flow_vcc, vcmp_dst_wave32_vcchi and vcc_half_write: 43 passed, 593 subtests.

Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 4a50cafc7. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests) gives 573 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls, new subprocesses, new env vars or CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-24 22:18 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/993#issuecomment-7146066824) Merging. **Why merged:** TEST-W32-VCCZ-VCC-HI, test-only: pins that wave32 s_cbranch_vccz/vccnz read vcc_lo only. morodirule did a mutation check and KernelSmoker checked it independently. **Why it's good:** vcc_data_branch, control_flow_vcc, vcmp_dst_wave32_vcchi and vcc_half_write: 43 passed, 593 subtests. Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 4a50cafc7. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests) gives 573 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls, new subprocesses, new env vars or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.