gpu: test overlapping placements in one existing heap (Part of #3676) #3723
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3723"
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 timbot103 on 2026-12-01T10:53:11Z.
Refs #3676 (item (e), standalone D3D12 fixture only — no runtime integration).
Summary
Adds a standalone D3D12 fixture (
tests/existing_heap_shared_buffer_check.cpp,tests/cmake/existing_heap_shared_buffer.cmake,CMakePresets.json,docs/experiments/existing-heap-shared-buffer.md) that verifies overlapping unaligned logical buffer views over one desktop placed buffer in a singleOpenExistingHeapFromAddressheap:MEM_PRIVATEVirtualAllocregion, opens it viaID3D12Device3::OpenExistingHeapFromAddress, and places one cross-adapter UAV-capable buffer over the whole allocation.0x100(A) and0x180(B), overlapping on[0x180, 0x200)(32 dwords) with guard patterns filling the rest of the 128 KiB allocation:VirtualAllocpointer directly at both A's overlap offset and B's base and verifies all guards across the 128 KiB allocation.--offset-control/--corrupt-offsetbinds B's UAV at byte 0 instead of0x180, verifying that the overlap checks fail and that the write landed only in[0x000, 0x080)(direct--corrupt-offsetexits with code3).existing_heap_shared_buffer_{warp,hardware}andexisting_heap_shared_buffer_offset_control_{warp,hardware}in CTest (SKIP_RETURN_CODE 77whenD3D12_FEATURE_EXISTING_HEAPSis unsupported) and includes both WARP cases in theprsmoke preset.Verification
Windows 11 (26200), MSVC 19.44, Ninja, Windows SDK 10.0.26100. D3D12 debug layer unavailable on this host (
D3D12GetDebugInterface=0x887a002d, reported honestly by the fixture; info-queue error checking is wired in when installed).devpreset):ctest --preset dev --no-tests=error -R '^existing_heap_shared_buffer_' -V-> 4/4 passed:Microsoft Basic Render Driver, driver10.0.26100.9818,D3D12_FEATURE_EXISTING_HEAPS=1): positive + offset control passedNVIDIA GeForce RTX 5080,10de:2c02, driver32.0.16.2140,D3D12_FEATURE_EXISTING_HEAPS=1): positive + offset control passedreleasepreset):ctest --preset release --no-tests=error -R '^existing_heap_shared_buffer_' -V-> 4/4 passed on both WARP and RTX 5080.--corrupt-offsetverified exit code3on both WARP and RTX 5080.git diff --check HEAD^ HEADclean.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-12-01T14:16:41Z.
Review: COMMENTED
In
main,--offset-controlexits successfully for bothoffset_mismatchand0. If a regression sends the control down the positive path, CTest will still report a pass. Could the wrapper requireresult == offset_mismatchin control mode and returnresultdirectly in the other modes?Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-12-01T22:43:43Z.
@Leyukaka Good catch — fixed in
4257a909:--offset-controlnow requiresresult == offset_mismatch(returning1with a failure message if it ever falls through with0or another code), while positive and--corrupt-offsetmodes returnresultdirectly. Re-verified 4/4 in Debug and Release on WARP (10.0.26100.9818) and RTX 5080 (32.0.16.2140), plus direct--corrupt-offsetexit code 3 on both.