Repository navigation
Description
Summary
On an NVIDIA GTX 1060, all four startup_resource_retire_views_*_hardware tests crash with an access violation inside the driver's CopyDescriptorsSimple. The same tests pass on WARP.
The crash happens on the first descriptor copy in case 2 of tests/startup_resource_retire_views.cpp, a guest copy from the shader-visible heap into a CPU-only staging heap. copy_descriptor_run in src/startup_stubs/d3d12_xs_device.cpp forwards it unchanged to the desktop device, so the source handle is in a shader-visible desktop heap.
Desktop D3D12 requires the source descriptors of CopyDescriptors/CopyDescriptorsSimple to be in a non-shader-visible heap, because shader-visible heaps may live in memory the CPU cannot read reliably. WARP tolerates the copy, but this driver faults on it. A console title can legally copy out of a visible heap, so this is a runtime gap and not only a test issue.
Evidence
- Windows 10 19045, NVIDIA GTX 1060 6GB driver 32.0.15.6094, in-box WARP 10.0.19041. Clean dev build of
mainat2ff74a6a. - Retire families on this card: 24 tests, 17 passed, 7 failed. Four are the views crashes, with the debug layer both off and on, including the keep and no-retire variants. All four pass on WARP.
- A local instrumented build showed the last call before the fault is the desktop
CopyDescriptorsSimplefor one descriptor, with the source in the shader-visible heap and the destination in the CPU-only heap. The shim's own bookkeeping after it never ran. - The other three failures,
retire_reasons_hardwareandretire_title_hardware_debug0/1, are separate. They fail an expectation instead of crashing. The title cases are the heap2 retention result reported on startup: release retired slot-133 title-memory textures and track slot-18 SRV reuse (slice 2) #2468.
$env:XBOX2WINDOWS_ADAPTER = '1060'
ctest --preset dev --no-tests=error -j 1 -R '^startup_resource_retire_views_'Possible fix
Keep a CPU-only desktop mirror for each shader-visible heap. Write every view, sampler and copy destination to both the mirror and the visible heap, and use the mirror as the source whenever a copy reads from a visible range. This also gives the capture and retire code a readable copy. I'm happy to prepare a PR if this direction is acceptable.
Ready for more review
Activity
Jess-Doit commentedon Nov 30, 2026
A note on fix options, after reading
view_slot,copy_descriptor_run,note_copyand the heap creation path onmain44a3ad5a. Each option changes a different amount, so I'd like a direction before opening a PR.copy_descriptor_run, when a source run lies in a shader-visible desktop range, rebuild each source descriptor at the destination from its view record (slot, resource, description), the same wayview_slotwould. Visible-heap writes stay as they are, so this is the smallest change. It depends on the record's resource still being alive when the copy happens, which holds with retire on but needs a check with it off. It also cannot rebuild a descriptor that has no record.view_slotneeds a second write, including refused and default views and the console sampler, and the heap uses twice the descriptor memory.ExecuteCommandLists. Copies become trivially valid. It is the largest change:shadow_slot,note_heapand the internal heap users assume the desktop CPU handle is the visible heap.My preference is 2, because it matches desktop semantics exactly and keeps the shadow tracking keyed as it is today. Option 1 is the quickest if you'd rather start small. The fixture already exists: the four retire-views cases crash on the GTX 1060 and should pass with any of these options.
Ready for more review
mumba17 commentedon Nov 30, 2026
Independent NVIDIA data point. On main
077bff3a, Release, Windows 11 build 26300, RTX 3090 (Ampere, driver 32.0.16.1664):All 8 passed:
hardware_debug0,hardware_debug1,keep_hardwareandnoretire_hardware, plus the four WARP variants. None of them crashed inCopyDescriptorsSimple.So the fault does not reproduce on every NVIDIA driver. It appears on the GTX 1060 (Pascal, 32.0.15.6094, Windows 10) and not on Ampere with a current driver. The copy is still outside the D3D12 rules, so a passing NVIDIA run cannot serve as the regression check here.
The debug layer does catch it deterministically. In
startup_resource_retire_views_hardware_debug1, the RTX 3090 logs message ID 654 for the first copy:The test still passes, because nothing fails on that message. Whichever fix option is chosen, the fixture could assert that message 654 no longer appears, which checks the contract on any adapter. A copy-source assertion in the shim would work too.
(Edited: the first version of this comment said the debug layer did not flag the copy. It does, as shown above.)
Jess-Doit commentedon Nov 30, 2026
Thanks @mumba17. Message 654 turned out to be the check this needed. #3627 implements option 2, a CPU-only mirror of each shader-visible title heap, and uses your suggestion as its regression check:
retire_views_{warp,hardware}_debug1tests now fail if message 654 appears. That runs on WARP in CI, so it no longer depends on a driver that faults.check_device, so the test's ownGetNumStoredMessagescount is always 0. The new check reads the shim's log instead.X2W_D3D12_NO_VISIBLE_HEAP_MIRROR=1) passes only if message 654 appears.Results on the GTX 1060:
If option 1 or 3 is preferred instead, the message check and the new case 6 carry over unchanged.
Ready for more review
startup: read descriptor copies out of shader-visible heaps from a CP…