Repository navigation
Conversation
…int of the lanes that are off (SHADER-819) Three tier tests and one interpreter test from the finding: a lane id, a v_readlane and an s_bcnt1 of EXEC are written to a VGPR, then an s_and_saveexec region overwrites the register for one lane and the register is exported after the join. The analysis must say tier C; on the interpreter the lane-id listing gives lane 32 a 32 in the 64-lane wave and a 0 in its half. A masked write of a clean value stays tier A. The three tier tests and the execution test fail on main. AI-assisted (Claude Code, Claude Fable 5.1). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GDgoLQVYG7p8mvxkwBroVz
… of the lanes that are off (SHADER-819) put() replaced a register's taint on every write, so a VGPR written while EXEC was narrowed lost the partition dependence of the lanes the write skipped: a lane id, a readlane or a lane count written before a saveexec region and overwritten there for one lane was exported as tier A. When EXEC is not the launch mask, a VGPR destination now keeps its old taint (old | new), is not uniform and takes no lane-id tag. Writes carrying an idiom tag (elect, cnt, rank, waterfall, mask, vote) are unchanged: they describe a value read from one lane or inside the region, and the aggregated-atomic and waterfall idioms keep their tier B. test_wave64_halves: 78 OK; the whole semantic suite has the same 38 failures as main (unrelated modules). The corpus census is not run here (no game files). AI-assisted (Claude Code, Claude Fable 5.1). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GDgoLQVYG7p8mvxkwBroVz
Kam471
left a comment
There was a problem hiding this comment.
Ran this at 3417222d9 on Windows 11: tests/semantic/test_wave64_halves.py -> 78 tests, OK; test_wave64_halves_soundness.py -> 30 tests, OK; git diff --check clean.
The change keeps a VGPR's old taint when a write happens under a narrowed EXEC, and clears the uniform/lane-id tags for that write; the added cases cover the masked write and the unchanged idiom tags.
Overlap/duplicate: #4619 (fearkov, opened 03:16, before this at 05:06) fixes the same SHADER-819 false tier A with a st["p"] pre-narrowing taint re-applied on widening (a stricter reconstruction of the off-lane value) plus the rewritten-vote-mask fix. The two branches conflict in tools/wave64_halves.py (git merge-tree refs/remotes/pr/4778 refs/remotes/pr/4619 -> exit 1). #4619 was verified at 38 tests; one of the two should close or drop the overlapping hunk.
|
I reproduced the fourth case from the finding. The low-half count needs to execute at the launch mask. Narrow EXEC only for the high-half count, then restore it before building the byte address. This hand-written body drops directly into v_mbcnt_lo_u32_b32 v10, -1, 0
v_cmp_gt_u32_e32 vcc, 32, v0
s_and_saveexec_b64 s[12:13], vcc
v_mbcnt_hi_u32_b32 v10, -1, v10
s_or_b64 exec, exec, s[12:13]
v_lshlrev_b32_e32 v11, 2, v10
ds_bpermute_b32 v6, v11, v0
s_waitcnt lgkmcnt(0)For export component 0, exactly lanes 33–63 differ. Lane 33 returns 32 in the full wave and 33 in the paired halves. The classifier at |
…ER-819) Kev-Ball's rebuild of the fourth listing: v_mbcnt_lo at the launch mask, v_mbcnt_hi for lanes 0..31 only, the count as a ds_bpermute address. Classifier: tier C. Interpreter: lanes 33..63 read lane 32's v0 in the wave and their own in the halves (lane 33: 32 against 33). Tier A on main. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GDgoLQVYG7p8mvxkwBroVz
|
@Kev-Ball thanks, your listing is in at 0aef525 as a classifier test (tier C) and an interpreter test (lanes 33..63 differ, lane 33 = 32 against 33); tier A on main. @Kam471 agreed: #4619 was claimed and opened first, and its rule passes all 6 cases here (the 3 listings, the clean-value control and the |
|
Tested
|
Claimed as SHADER-819 in the coordination issue (shdann's finding).
put()replaced a register's taint on every write, so a VGPR written while EXEC is narrowed lost the partition dependence of the lanes the write skipped, and the four listings of the finding were tier A: a lane id, av_readlaneand ans_bcnt1of EXEC written before as_and_saveexecregion that overwrites the register for one lane, exported after the join. The wave interpreter gives lane 32 a 32 in the wave and a 0 in its half.The rule now: when EXEC is not the launch mask, a VGPR destination keeps its old taint (
old | new), is not uniform and takes no lane-id tag. Writes carrying an idiom tag (elect, cnt, rank, waterfall, mask, vote) are unchanged: those describe a value read from one lane or inside the narrowed region, and the aggregated-atomic and waterfall tests still pass as tier B.Tests (
tests/semantic/test_wave64_halves.py): the lane-id,v_readlaneands_bcnt1listings are tier C withlane-id/lane-countreasons; an execution test runs the lane-id listing as 64 lanes and as two halves on the interpreter and checks lane 32 differs (32 against 0); a masked write of a clean value stays tier A. The three tier tests and the execution test fail onmain.Not done: the corpus census (
python tools/wave64_halves.py --census <spirv>/index.jsonbefore and after), which needs a copy of the game; this can move shaders from tier A to tier C, so a census from someone with a work folder is welcome. The fourth listing of the finding (ads_bpermuteaddress rewritten under EXEC = lanes 0..31) is covered by the same rule but I could not reproduce its 31-lane difference with a listing of my own, so it has no test here. Conflicts with #4373 (partial-write taint, same function); whichever lands first, the other rebases.Tested:
tests/semantic/test_wave64_halves.py78 OK at 3417222 and 4 failures at 00841e0 (the tests without the fix), on macOS and on Windows 11 (Python 3.12.10); the rest of the semantic suite fails exactly as onmain. No game files.AI-assisted (Claude Code, Claude Fable 5.1).
🤖 Generated with Claude Code
https://claude.ai/code/session_01GDgoLQVYG7p8mvxkwBroVz