Repository navigation
d3d12: an ARRAY_OF_POINTERS entry below the arena is not an overflow (d3d12_indirect_rt on NVIDIA) - #6010
d3d12: an ARRAY_OF_POINTERS entry below the arena is not an overflow (d3d12_indirect_rt on NVIDIA)#6010lines9686-rgb wants to merge 1 commit into
Conversation
stage_khr_instances refused a pointer whose VA is above UINT64_MAX - heap_base. An UPLOAD buffer's VA is its
device address minus the heap base, so a buffer allocated below the arena has a VA that wraps, and heap_base + va
is its device address again, as addr() in vulkan_replay.h and the XDXR path compute it. The refusal failed the
whole ExecuteCommandLists ("invalid copy or resolve"), so d3d12_indirect_rt failed on NVIDIA (RTX 3060 Ti, and
RTX 2080 Ti per ProjectLeonida#166) since cc4b374.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested 2e86358 on Windows 11 with the NVIDIA GeForce RTX 4090 (driver 32.0.16.2101) and AMD Radeon integrated graphics (driver 32.0.21043.5001). The targeted ray-tracing test passes on each adapter with zero Vulkan validation errors. I built the PR and its parent Both TLAS layouts give hit=1 and miss=0 on both revisions. Both revisions also reject the null entry and the GPU-written placed pointer list before submission. The parent passes here, so these runs do not reproduce the below-arena allocation seen on the RTX 3060 Ti. This check covers the indirect RT target only. AI-assisted. |
|
Tested
No game files. |
|
Tested 2e86358 (merged on
|
|
Tested
So on a Blackwell card this one fixes the failure @zxcvqwerasdf couldn't reproduce on an RTX 2080 Ti. AI-assisted (Claude Code). |
|
Tested 2e86358 on Windows 11, AMD Radeon RX 9070 XT (RDNA4), driver 32.0.32029.2010: pass, but the run cannot tell fix from no fix
AI-assisted (Claude Code). |
|
Tested
|
|
Independent Windows check at Environment: Windows 11 26300, NVIDIA GeForce RTX 4050 Laptop GPU, NVIDIA On With this PR applied and The full unpatched run was 243/245; the other failure was the separate AI-assisted (Codex). |
|
Tested AMD Radeon RX 6700 XT (gfx1031), RADV Mesa 26.3.1, CachyOS, Linux 7.3.5; Windows build cross-compiled with clang-cl 23.1.5 + xwin (SDK 10.0.26100), run under Wine 11.22 (
So RDNA2 hardware ray queries through RADV hit the same ARRAY_OF_POINTERS problem as the NVIDIA runs, and this fixes it there too. AI-assisted (Claude Code). |
|
Tested
Same mechanism here without Resizable BAR: the pointer-list entry was AI-assisted (Claude Code). |
|
Independent Windows/MSVC 19.44, RTX 5060 driver 32.0.16.1088: #6010 diff applied to main 8575d36 audit checkout; a clean-first rebuild of d3d12_indirect_rt_test passes, exit 0. The initial incremental build still reproduced invalid copy / RayQueryKHR ARRAY hit=0, so a clean rebuild was needed for valid evidence here. Baseline before this patch failed at that ARRAY result. Audit tree also includes unrelated #7125/#7357/#7391 and #5792. Validation layer unavailable. Synthetic GPU fixture only, no game files. AI-assisted (Codex). |
|
Tested
On this card separate allocations land in two VA pools tens of TiB apart ( AI-assisted (Claude Code); run on my own machine, no game files involved. |
Item: new finding, claimed in #5934 (#5934 (comment)). Depends on: none. Regression from cc4b374 (#4060's merge, "translate ARRAY_OF_POINTERS instances on the KHR path"); @ttd0x reported the failure in #166 and bisected it to that commit.
What fails.
d3d12_indirect_rtonmain561b65a8, RTX 3060 Ti (NVIDIA 610.88, Windows 11, Resizable BAR: upload heaps live in VRAM) and RTX 2080 Ti (#166):It passed on
3faac557, before cc4b374.Why.
stage_khr_instances(runtime/src/vulkan_backend.h) refuses a pointer-list entry whenva > UINT64_MAX - vk.heap_base. The list's host read is fine (a debug print gaveva=0xfffffffffed40000 status=ok); the refusal is that overflow check. An UPLOAD buffer's VA is its device address minus the heap base (docs/d3d12_vulkan.md, section 3), so a buffer allocated below the arena has a VA that wraps, andheap_base + vais its device address again. Every other VA-to-address conversion is that wrapping sum (addr()invulkan_replay.h, the XDXR path). The refusal fails the wholeExecuteCommandLists, so the plain ARRAY TLAS in the same list misses too.Fix. Drop that one condition and say why in a comment. Null entries, entries outside any buffer and entries with less than 64 bytes of room are still refused by the same
if.Tested on the RTX 3060 Ti, MSVC RelWithDebInfo, on
main561b65a8:d3d12_indirect_rt_test: PASS (0 validation errors): BLAS + TLAS ARRAY and ARRAY_OF_POINTERS hit=1 miss=0, the null-entry and GPU-written-list refusals still refuse before submission.d3d12_indirect_dispatch_count, fails the same on main and is d3d12_indirect_dispatch_count_test: its compute fixture reads the root UAV at s4:s5 (D3D-448 layout) #5792's.xdxr_build_check,d3d12_xdxr_rt_checkand the other RT tests pass.No game files. AI-assisted (Claude Code).
🤖 Generated with Claude Code