Pin compute_store's PSV, group, literal, offset, clause and wait bounds #958
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/965"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-23T19:06:36Z.
Change
This closes eight gaps in the test coverage of
tools/compute_store_aot.py. Each was a one-line mutation that passedcontrols()intests/compute_store_check.pyonmain. Only that test file changes; the translator does not.(1, 1, 0)is rejecteds_clause 0x3flowers likes_clause 0x1s_clauselimit tightened to< 0x3f-2147483649is rejected (Invalid scalar immediate)-(1 << 31)0x100000000is rejected (Invalid literal move)0xffffffffoffset:4096is rejected (Unverified raw UAV store)s_waitcnt lgkmcnt(0) vmcnt(1)in place of the read'svmcnt(0)is rejected (Unsupported compute instruction: s_waitcnt lgkmcnt(0) vmcnt(1))The bounds follow the encodings:
s_clauseholds a 6-bit length minus one, the MUBUF offset is 12-bit unsigned, literals are 32-bit, and PSV runtime info 2 is 48 bytes, with the stage byte at byte 28 of the PSV0 part, after its 4-byte size (5 is compute, 4 is domain). The new cases are pure Python. Each names the diagnostic it expects, except the thread-group case, which joins the existingmust_rejectlist, and thes_clausecase, which compares HLSL. The two PSV cases share one message.Verification
On
672ac62(branch on185ffbe), Windows 11 build 26300, MSVC 14.44.35207, Python 3.14:All 16 tests pass. The eight
_hardwaretests ran on an NVIDIA GeForce RTX 5080 (driver 32.0.16.2101) and none was skipped.Each mutation was applied to
tools/compute_store_aot.pyone at a time andcontrols()was run with themainand the branch versions ofcompute_store_check.py. With the unmutated translator both pass. Onmain,controls()passed under all eight mutations; on this branch it fails under each of them.The eight edits to
tools/compute_store_aot.py:48 <= size <= len(psv) - 4->47 <= size <= len(psv) - 4or psv[28] != 5->or psv[28] not in (4, 5)1 <= z <= 64->0 <= z <= 64if int(m[1], 0) > 0x3f:->if int(m[1], 0) >= 0x3f:-(1 << 31) <= value->-(1 << 31) - 1 <= valuevalue <= 0xffffffff->value <= 0x100000000offset > 4095->offset > 4096in the raw UAV store check"s_waitcnt vmcnt(0)"):->"s_waitcnt vmcnt(0)", "s_waitcnt lgkmcnt(0) vmcnt(1)"):Checklist
AI-assisted.