test: refuse a gather destination that runs past v255 #1953
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!1953
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1953/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ChazY11 on GitHub · 2026-11-24 22:05 UTC · original
ChazY11:test/gather-dest-refusal→main· +6 −2 · 1 files · 1 commits · merged 2026-11-24 22:10 UTCWhat
op_image_gather4_lzrequires four contiguous destination registers:The fixture in #1927 covers the address-register and
nsacases but not this one, so the guard is unpinned. Two bases thatdecode to a destination running past the file make it observable:
Change
tests/startup_image_gather_lz_check.pyonly:shader()gains adst=4parameter (the base sits in bits 8–15 of the seconddword, which the existing
highmasking already leaves clear), and two refusal cases next to thensaone:No production change, no new file, no CMake change.
Tested
Fail-first, with the guard reduced to
if not dst or dst[0] != 'v':and reverted afterwards:and with the guard restored,
exit 0. The accepted form emitsv256/v257under the mutation, which is what the case prevents.Scope note
This is the second half of the follow-up I posted on #1927 (
pull/1927#issuecomment-7145688618). The first half — thecheck_gather_sampler(words, 1, …)argument — I retracted there:(mips - 1) << 8is vacuous for both1and0becausew1 >> 12is non-negative, so that mutation is equivalent and there is nothing to test.Notes
@tedin7 on GitHub · 2026-11-24 22:09 UTC · original · reviewed
Review of head
fd9999528c442187519f9396a0da9e92be6ad2f4.The change touches only
tests/startup_image_gather_lz_check.py. It adds adstparameter to theshader()helper and two refusal controls: destination bases0xfeand0xffmust be refused with "four destination registers". The defaultdst=4encodes the same bytes as before (0x00c40400). No CMake change and no new files. Clean-room: no external code.Commands executed locally:
git merge-tree --write-tree --name-only origin/main HEAD: clean, no conflictspython3 -B tests/startup_image_gather_lz_check.py: PASSpython3 tests/docs_links_check.py: PASS (18 files, 386 links)python3 tests/bidi_controls_check.py: PASSgit diff --check origin/main...HEAD: cleanpython3 x2w_pipe.py win2025 1953 --wait 900: Debug and Release /O2,startup_image_gather_lzandstartup_image_gather_lz_warp2/2 passed in eachgh pr checks 1953: Windows, Linux and gfx1013 fixtures passMutation killed: in
tools/startup/gfx2hlsl.pyI removed theor dst[2] > 255bound from the gather destination check. The test now fails withGather accepted an unsupported form: four destination registers. The file was restored withgit checkout -- ..P1: 0. P2: 0.
AI-assisted; commands listed were executed locally.