Skip to content

wave64_halves: fix readfirstlane-uniform soundness on widened/narrowed EXEC and unsigned v_dot*c - #8157

Open
ds1s1s1 wants to merge 1 commit into
ItsNotRexed:mainfrom
ds1s1s1:fix/wave64-halves-readfirstlane-uniform
Open

ds1s1s1 wants to merge 1 commit into
ItsNotRexed:mainfrom
ds1s1s1:fix/wave64-halves-readfirstlane-uniform

Conversation

@ds1s1s1

@ds1s1s1 ds1s1s1 commented Nov 23, 2026

Copy link
Copy Markdown

What & Why:
Addresses @emirduran707's Tier B readfirstlane-uniform soundness finding in #7599 and unsigned v_dot*c_* RMW accumulation bugs in tools/wave64_halves.py. Specifically: (1) adds v_dot2c_u32_u16, v_dot4c_u32_u8, and v_dot8c_u32_u4 to RMW_DEST so prior divergence/taint is preserved; (2) clears st["ua"] on non-subset/unknown EXEC writes (s_wqm_b64 exec, exec, s_or_saveexec_b64, s_xor_saveexec_b64) and requires self.ancestor(("e",), ...) in join() and EXEC restore; (3) requires st["f"] for full-wave v_readfirstlane_b32 uniformity so narrowed-EXEC reads emit ACT_RFL; (4) requires launch-EXEC ancestry for v_readlane_b32 uniform rewrites; and (5) clears uniform/uniform_active whenever tj != 0 so non-X tainted scalars (CNT, FF1, etc.) never make a VGPR uniform.

Files changed:

  • tools/wave64_halves.py (modified)
  • tests/semantic/test_wave64_halves_uniform_soundness.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_uniform_soundness.py -v -> Ran 10 tests in 0.422s OK (failed 10 subtests before fix)
  • py -3 -B -I -m unittest discover -s tests/semantic -p "test_wave64*.py" -> Ran 245 tests in 41.951s OK
  • py -3 -B -I tests/test_ci_registration.py -> Ran 14 tests in 5.713s 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 2c4155384 on Arch Linux, Python 3.14.10, CPU only: pass — new tests/semantic/test_wave64_halves_uniform_soundness.py 10/10 OK. Negative control: merge-base tool → all 10 fail; 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