Repository navigation
Conversation
…dxen through a literal V# with ADD_TID_ENABLE (SHADER-833)
…s_pack, s_bfm, ...), pin offen/tbuffer/store_format (SHADER-833)
|
Tested The 8 AI-assisted verification with synthetic inputs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: SHADER-833 (#4571 (comment))
What and why
Finding by @shdann (#4571):
tools/wave64_halves.pygave tier A to abuffer_loadwithoutidxenthrough a V# with ADD_TID_ENABLE. Withoutidxenthat bit adds the wave lane to the index (idxenignores it, docs/design.md "Swizzled buffer addressing"), so the loaded value depends on how the wave is cut: lane 40 reads index 40 in a wave64 and index 8 in a half.tools/wave64_halves.py: a MUBUF/MTBUF access with noidxenwhose V# word3 is a literal (written earlier in the block by the same scalar foldsrdna2spirvrecords insgpr_imm:s_mov_b32/s_mov_b64(word3 as the high half of a pair),s_movk_i32,s_pack_*,s_bfm_b32,s_not_b32,s_and/lshl/lshr_b32,s_mul_i32; mirrored inAnalysis.literal_sgprbecause the analysis runs before the translator emits a block, so itssgpr_immcannot be imported or read) with bit 23 set gets the raw lane-id taint: the load result, a store's address and an atomic's address. Reason is the existinglane-id, so no new reason code. A literal with the bit clear, and every access withidxen, are unchanged.idxenthrough a run-time V#), credit to @shdann, and the follow-up (count bound V#s with bit 23 at run time, needs the game).Tested with numbers
RunPod pod only.
test_wave64_halves.py,test_wave64_halves_soundness.py,test_wave64_halves_fixtures.py,test_wave64_graphics_scan.pytogether:New class
AddTidBuffer(8 tests, incl. s_mov_b64 / s_pack / s_bfm word3 and offen, tbuffer load, buffer_store_format with bit set -> C, clear -> A): literal with bit set is tier Clane-id(buffer_load_dword,buffer_load_format_x); bit clear is tier A; idxen with the bit set is tier A; literal copied through another SGPR; store and atomic with bit set are C, with bit clear A; a run-time V# stays A (the documented assumption).Not covered
Classification only: the wave interpreter on main cannot load from a physical-storage-buffer pointer (
OpLoadof a "psb" access chain is unhandled), so there is no 64 against 2x32 run of a buffer load. wave64_halves: a buffer_load with idxen at a wave-uniform address gives a wave-uniform VGPR (new SHADER item) #4630 (read-only memory inspirv_wave_interp.py) would allow that test as a follow-up.Run-time V# with the bit set: undecidable from the code, documented as an assumption.
Folds rdna2spirv has that are not mirrored (s_abs, s_sext, s_min/max, s_add/sub, s_xor/andn2 family, s_bfe, s_absdiff, s_lshlN_add): such a word3 counts as run-time. The bit counts even with SWIZZLE_ENABLE clear (conservative).
Corpus census not re-measured with this rule (needs the game); the census numbers in design.md predate it and may change.
Reviewed by an independent model (DeepSeek) before opening: it found that word3 literals built with
s_mov_b64,s_pack_*ors_bfm_*were missed; fixed and pinned.AI-assisted (Claude Code). No game files.