Skip to content

wave64_halves: taint non-uniform bitmask operands on v_cndmask and carry-in VALU ops - #8164

Open
ds1s1s1 wants to merge 1 commit into
ItsNotRexed:mainfrom
ds1s1s1:fix/wave64-halves-valu-bitmask-src
Open

ds1s1s1 wants to merge 1 commit into
ItsNotRexed:mainfrom
ds1s1s1:fix/wave64-halves-valu-bitmask-src

Conversation

@ds1s1s1

@ds1s1s1 ds1s1s1 commented Nov 23, 2026

Copy link
Copy Markdown

What & Why:
In tools/rdna2spirv.py (Gen.mask_src), non-tracked 64-bit mask/carry-in operands on VALU select and carry-in ops (VALU_MASK_OPS: v_cndmask_b32/b16, v_*_co_ci_u32, v_addc*, v_subb*) read bit wave_lane (0..63 vs 0..31), so non-uniform constants like 1, 0xFFFFFFFF, or plain-data SGPR pairs diverge between one 64-lane wave and two 32-lane halves. This adds _uniform_mask_const (0, -1, 0xFFFFFFFFFFFFFFFF, null), taints tj |= LANE when srcs[2] is neither a tracked mask nor a wave-uniform constant, excludes VALU_MASK_OPS from setting uniform/uniform_active, and exempts only srcs[2] (not data operands srcs[0..1]) of VALU_MASK_OPS from MASKD|X so valid tracked carry-in masks like s[8:9] remain Tier A.

Note: also introduces helper _uniform_mask_const (like open PR #7611 for SALU masks/exec writes); will rebase cleanly once #7611 or fix/wave64-halves-readfirstlane-uniform lands.

Files changed:

  • tools/wave64_halves.py (modified)
  • tests/semantic/test_wave64_halves_valu_mask_src.py (added)

Coordination:

Tested:
CPU-only on Windows 11 (Python 3.15, no Vulkan SDK / no GPU run, synthetic RDNA2 listings via spirv_asm Vulkan 1.2 + spirv_wave_interp 1x64 vs 2x32):

  • py -3 -m compileall -q make_game.py tools tests -> exit 0
  • py -3 -B -I scripts/check_no_game_data.py -> exit 0
  • py -3 -B -I tests/semantic/test_wave64_halves_valu_mask_src.py -v -> Ran 4 tests in 0.988s OK (failed 14 subtests before fix)
  • py -3 -B -I -m unittest discover -s tests/semantic -p "test_wave64*.py" -> Ran 239 tests in 50.566s OK
  • py -3 -B -I tests/test_ci_registration.py -> Ran 14 tests in 6.671s OK
  • py -3 -B -I scripts/run_semantic_tests.py tests/semantic (run on identical tools/wave64_halves.py at dde82f27e) -> 445/447 existing semantic files OK (same 2 pre-existing upstream/main image failures test_image_store_d16 and test_image_atomics_guard)

AI-assisted. No game files, extracted assets, or generated shaders are included.

@morodirule

Copy link
Copy Markdown

Tested 4ae5cc5 on Arch Linux, Python 3.14.10, CPU only: pass — new tests/semantic/test_wave64_halves_valu_mask_src.py 4/4 OK (related halves suites also green). Negative control: merge-base tool → 14 failures on the new file; restored, green again. No game files, no GPU. AI-assisted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants