Repository navigation
Conversation
…nt wrap In mubuf, buffer_atomic, and mubuf_d16, the mem_windows == 1 path computed t_off = voff + OFFSET and checked t_off + bytes <= d2 in 32-bit uint, unlike the multi-window path which already uses uint64_t. A large/negative voff (e.g. 0xFFFFFFFC with bytes=4, or 0xFFFFFFF0 with OFFSET=16) wrapped past 2^32 to 0 <= d2 and performed an out-of-bounds load, store, or atomic instead of treating the access as out of bounds. Compute t_off and the raw bounds comparison in uint64_t for both single- and multi-window modes, with a GPU regression test covering BUFFER_LOAD_DWORD, BUFFER_STORE_DWORD, BUFFER_ATOMIC_ADD, and BUFFER_LOAD_SHORT_D16. Assisted-by: OpenCode (Gemini 4 Neon)
|
Independent verification on current Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug; DXC 1.8.2502.11.
AI use: test runs by Devin (Cognition, SWE-2); no code changes. |
|
Test report for head Tested
Not tested: retail titles, RDNA3/RDNA4. AI use: the tests were run and this report was written by an AI agent, Claude Code (Claude Opus 5.5), on the hardware above. The numbers are copied from the actual test output. |
|
A run on Linux with vkd3d-proton, where the shaders go through dxil-spirv to Vulkan instead of a Windows driver's DXIL compiler. Tested
Not tested
AI use
|
RX 6800M focused GPU report for PR #1146 at
|
|
Nothing has happened on this PR for 3 days, so it is marked |
|
#1933 and the merged #3265 guard the same 32-bit wrap in the direct DXIL backend ( AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
In
mubuf,buffer_atomic, andmubuf_d16, the single-window (mem_windows == 1) path computedt_off = voff + OFFSETand checkedt_off + bytes <= d2in 32-bituint, unlike the multi-window path which already usesuint64_t. A large/negativevoff(e.g.0xFFFFFFFCwithbytes = 4, or0xFFFFFFF0withOFFSET = 16) wrapped past2^32to0 <= d2, reading or writing out of bounds instead of treating the access as out of bounds.This hoists
uint64_t t_offand uses the 64-bit raw bounds check in both single- and multi-window modes acrossmubuf,buffer_atomic, andmubuf_d16.What is in it
crates/xcl/src/gpu/recomp/emit.rs: computet_offand rawSTRIDE == 0bounds comparisons inuint64_tformubuf,buffer_atomic, andmubuf_d16regardless ofmem_windows.crates/xcl/src/gpu/recomp/tests.rs: add GPU testgpu_mubuf_raw_bounds_do_not_wrap_32bitcoveringBUFFER_LOAD_DWORD,BUFFER_STORE_DWORD,BUFFER_ATOMIC_ADD, andBUFFER_LOAD_SHORT_D16(verified failing before the fix); update the HLSL text check inatomic_fcmpswap_x2_is_a_bitwise_64_bit_casfor the widened comparison.Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 742 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2no wave64—gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware)cargo test -p xcl --lib gpu_mubuf_raw_bounds_do_not_wrap_32bit: 1 passed, 0 failed (failed on the GPU before the fix, reading0xDEAD_BEEFfrombase - 4)Regression run
main:
PR:
Not tested
AI use
emit.rs, wrote the fix and GPU test, ran the test suite andscripts/smoke.ps1regression runs, and drafted this PR description.