Repository navigation
Runtime: allow D3D12 fence signal retry after transient Vulkan failure - #3789
pmilewsskiedu-gif wants to merge 1 commit into
Conversation
|
Tested a78a5a4 (based on main f847748) on Windows 11 build 26300, MSVC 19.44, Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, with two GPUs picked by
The multi-queue case passes on the UHD 770 too, although its Vulkan driver has a single queue. That is expected: the test builds its device with AI-assisted (Claude Code). No game files. |
Kam471
left a comment
There was a problem hiding this comment.
Tested a78a5a4b89f1e32687468aae5ce2ac6bc45ea6db on Windows 11, MSVC 19.44.35228, RTX 5070 Ti, Vulkan SDK 1.4.363.0.
- Built
d3d12_fence_signal_retry_test(11/11 steps); pinnedLEONIDA_VK_DEVICE=RTX 5070 Ti. d3d12_fence_signal_retry_test.exe-> exit 0, 44/44 EXPECT checks, realvkSignalSemaphore/vkQueueSubmit/timeline waits with synthetic OOM above the driver.- ctest
^d3d12_fence_signal_retry$-> 1/1 passed, 0.14 s. WithLEONIDA_VK_VALIDATION=1: PASS, 0 VUIDs; 50/50 repeat runs; related fence/queue ctest set 7/7. - Negative control: the same test on the unmodified base shim exits 1 at line 103 (the retry never reaches
vkSignalSemaphore); this head exits 0.
Logic: a failed value is never committed, so highest_ stays at the last accepted value and the identical retry passes the ascending gate; one signal per value is admitted, and retries only happen after submit() returned false (d3d12_com.cpp:1106-1113). VK_ERROR_DEVICE_LOST is special-cased as lost and fails E_FAIL rather than spinning.
Two non-blocking notes: only VK_ERROR_OUT_OF_HOST_MEMORY is injected (no permanent/device-lost case), and the CPU vkSignalSemaphore device loss is not recorded (vulkan_backend.h:1374), unlike the GPU path, so a permanent CPU failure can look retryable and GetCompletedValue stays healthy. Classifying transient vs permanent results would make the intent explicit; neither is a regression here.
|
Tested Built |
Claimed: #3574 (comment)
What and why
Fix a transient D3D12 fence-signal failure: Fence::claim(value) advanced its high-water mark before vkSignalSemaphore (CPU) or vkQueueSubmit (GPU) succeeded. On synthetic VK_ERROR_OUT_OF_HOST_MEMORY, the original call returned E_FAIL, but retrying the same value was discarded as S_OK, leaving the Vulkan timeline unsignaled.
Use a per-fence mutex transaction to check an ascending value, submit the backend signal, and commit the high-water mark only after success. This prevents unsafe CAS rollback if another queue's higher value is accepted. Existing duplicate/backward signal behavior stays unchanged. Three files +198/-12; no game data.
Base f847748. Commit a78a5a4.
Tested
Integration / limitations
#1161 owns CPU-behind-GPU queue signal ordering; #2951 owns held Wait-before-Signal execution. Both are open and edit adjacent/identical methods. This PR does not fix either. When integrating, avoid invoking held-queue releases or deferred callbacks under the per-fence mutex (Q1→Fence→Q2 / Q2→Fence deadlock). Retain only accepted queued values, dispatch callbacks outside queue/fence locks. Coordinate before combining; don't blindly merge.
Checklist
No upstream merge performed.