Verify the D3D12 mapping fence before publishing new memory #200
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 TaynanGT/Vice-Tay. Originally posted by NotADonky43 on 2026-11-27T09:05:29Z.
Mapping residency can report success without a completed fence
In
host::mapped, the reusable copy queue marks a newly resident allocation ready for use. In4ee1a47b,GetCompletedValue() == UINT64_MAXpasses the completion check even though it means the D3D12 device was removed. The event branch also ignores the Win32 wait status and does not confirm the fence after waking. The old branch can therefore reach its success return without evidence of a usable mapping. This is separate from #196, which leaves residency ordering unchanged, and from normal frame or relay retirement.The patch only changes the existing mapping queue: return the removal reason (or
DXGI_ERROR_DEVICE_REMOVED), propagate the wait error, and confirm the expected fence value after each wake. If a submission was already issued when confirmation failed, keep the existing queue/list/resources alive, confirm or re-signal the old marker before reuse, then issue a fresh marker for the new call. All signals are on the same serialized queue. It does not batch allocations or disable the mapping wait.Validation
4ee1a47b: five focused Windows tests and optimized build passed. Tests cover realWAIT_FAILEDon an invalid handle, injected event registration failure and removal sentinel, stale wake, and recovery ordering. Ordinary native mappings also pass on an RTX 5070 Ti with the debug and GPU-validation options enabled. Removal and recovery failure paths are fault-injected; this was not a reproduced device-loss crash in the title.Standalone source diff (checked by replay onto
4ee1a47b):Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T09:12:47Z.
@NotADonky43 I’ve put the mapping fix and your tests in #203, separate from the lock-scope change. The mapping path now checks the fence after each wake and confirms any outstanding marker before reusing the command list. I kept the native allocation test conditional on an available D3D12 adapter so CI can still run the injected failure cases.
Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T09:40:26Z.
@NotADonky43 #203 is in main at
99a7f9b. All five focused tests passed here with the RTX 4090 required, including native D3D12 mappings and the injected cases for device removal, wait failure, stale wakes and recovery ordering.