Repository navigation
Conversation
tupacfan04
left a comment
There was a problem hiding this comment.
The implementation change looks correct: mark_device_lost() sets the context lost and wakes the dispatcher, GetCompletedValue returns UINT64_MAX, and single/multiple SetEventOnCompletion complete immediately after removal; the test otherwise covers pre/post-removal single/ALL/ANY notifications, fence values, repeated removal and the native WARP oracle. One test defect:
runtime/test/d3d12_fence_device_lost_counter_test.cpp:127-131 groups device->CreateFence with the WARP setup checks:
if (FAILED(CreateDXGIFactory1(...)) ||
FAILED(factory->EnumWarpAdapter(...)) ||
FAILED(D3D12CreateDevice(...)) ||
FAILED(device->CreateFence(...)))
return 77;main treats 77 as SKIP (CTest property SKIP_RETURN_CODE 77). If WARP and D3D12CreateDevice succeed but CreateFence fails, that is a fence-control failure, not WARP unavailability; the test skips before either remove_device_notifies call, so the explicit-removal/fence-notification behavior is never exercised. This contradicts the PR description's “Oracle failures are FAIL, not SKIP; only WARP setup unavailability skips.” The rest of the new control (event, signal, query, multiple-fence waits) correctly returns 1.
Fix: move CreateFence out of the return 77 block into the return 1 oracle-control block, or run the layer removal check independently when the oracle fails. Synthetic only; no game files. AI-assisted (OpenCode).
|
Tested
AI-assisted. |
TEST validation — Needs changesReviewer-flagged test defect (significant): In if (FAILED(CreateDXGIFactory1(...)) ||
FAILED(factory->EnumWarpAdapter(...)) ||
FAILED(D3D12CreateDevice(...)) ||
FAILED(device->CreateFence(...)))
return 77;If WARP and Fix needed: Move Other notes:
Recommendation: Needs changes — fix the SKIP/FAIL contract defect before merge. |
|
Tested
|
gut0to
left a comment
There was a problem hiding this comment.
Reviewed the removal and notification ordering, including repeated removal and notifications registered after removal. Built d3d12_fence_device_lost_counter_test with native MSVC and ran the WARP/Vulkan regression through CTest: d3d12_fence_device_lost_counter passed (1/1). The new test separately checks native WARP as the behavior oracle and the shim against the same expectations.
|
The event-based paths look right:
Native result (RTX and WARP, Suggestion: bound the blocking waits in slices and re-check AI-assisted (Claude Code). |
|
Tested
AI-assisted (Claude Code). |
|
@tupacfan04 Thanks for catching this. You were right: the first Rebuilt all five fence targets and reran them on RX 9070 XT with Vulkan validation: 5/5 passed, no new warning lines or validation errors. Compiled branch-forcing probes also verify old fence-failure → 77, corrected fence-failure → 1, and setup-failure → 77. The follow-up changes only the test; Luna and a fresh Claude review approved it. |
|
@rideinstead Thanks for independently identifying the same skip/fail defect. Addressed in f2ee288: The five rebuilt targeted tests pass with validation on RX 9070 XT; an independent Luna run also passes with zero validation errors. The current corrected test, linked in an isolated executable against the original runtime, still fails as expected (actual exit 1, WARP PASS, layer counters |
|
@ECHOZwei Thanks for the independent negative control and the RTX 4080 SUPER / AMD iGPU validation, including the clean five-target runs. I have retained those results against the exact commit you tested, Follow-up f2ee288 addresses the reviewers' test classification feedback: initial WARP fence creation failure now fails instead of skipping. It preserves the production implementation. Our local RX 9070 XT validation of the follow-up is 5/5 targeted tests passed, with zero validation errors. |
|
@Envyre Thanks for the native checks. I reproduced the two post-removal HRESULT differences with synthetic WARP/original-layer/PR-layer probes:
So the The null-event cases were already explicitly excluded here because #4577 rewrites those same waits. Its current draft still maps logical loss to |
|
@Envyre The The same final WARP/layer test calls Eight fence/queue-wait checks pass with Vulkan validation; Luna independently ran the final regression and Claude reviewed the exact diff. Additional handover/compute checks pass; a separate unchanged standalone Only the |
|
Tested on AMD Radeon RX 7700 XT (RDNA3), AMD Windows driver 32.0.32029.2010, Windows 11, MSVC 14.51 Release, at f2ee288. Full No regression. The only failures are the same 5 as on AI-assisted (Claude Code). |
Claimed in the coordination issue as: #8344 (comment)
Depends on: #8101, #3293, #4577 (integration/rebase coordination for overlapping code; no functional dependency for this fix).
What and why
Explicit
ID3D12Device5::RemoveDeviceoriginally updated the removal reason without reaching the fence/dispatcher context. Propagate removal through the existing context so completed values becomeUINT64_MAXand single/ALL/ANY HANDLE notifications fire, including registrations after removal. This follows the documented removal contract and the native WARP oracle.Review follow-ups:
f2ee288a0: a first WARPCreateFence()failure is FAIL (1), rather than SKIP (77), after successful factory/adapter/device setup.89893c0a9bbdb7dccd69071874d122e72955252f: fixes the introduced CPUFence::Signalregression after removal. Under the existing claim mutex, an already-lost context returnsS_OKbefore bookkeeping or backend work.Signal(1/0/42)afterRemoveDevicereturns successfully and leaves the value atUINT64_MAX, matching WARP. The Vulkan backend is unchanged: an operation starting healthy still reports its first OOM/device-loss error asE_FAIL; no after-the-fact error-to-success mapping was added.Three files are changed overall:
d3d12_vulkan_device.cpp(removal propagation),d3d12_com.cpp(one-line Signal guard), andd3d12_fence_device_lost_counter_test.cpp(oracle/regressions).Tested
Windows 11, MSVC 19.51, Vulkan SDK 1.4.363.0, RX 9070 XT / driver 32.0.32015.7029,
LEONIDA_VK_VALIDATION=1; native Microsoft WARP. Synthetic inputs only; no physical GPU failure/reset induced.f2ee288a0S_OK×3; layerE_FAIL/S_OK/E_FAILfor 1/0/42; validation errors 0E_FAIL; respectively healthy/value0 and removed/valueMAX, exactly one interceptionS_OK, MAX, no additional foreground Vulkan signal; this pins layer policy, not a native physical-loss measurementvk_queueFAILS with 10 WRITE_AFTER_WRITE hazards under validation, reproduced once. Its test/backend inputs are unchanged from f2ee and it does not link the modified COM code; this separate validation failure is not hidden or attributed to the guardThe final test checks MAX after each post-removal Signal and no
vkSignalSemaphorecall on the calling thread. It retains pre/post HANDLE notifications, repeated removal, and the prior wait/counter error controls. Luna independently ran the final regression with validation: exit 0. Claude Opus 5.5 and Luna approve the exact final diff. No new warnings observed in the Signal builds.git diff --checkandcheck_no_game_data.pyon both newly modified files pass.The five fence targets are
vk_fence_dispatcher_sync_test,d3d12_fence_timing_test,d3d12_fence_events_test,d3d12_fence_device_lost_counter_test,d3d12_fence_waiter_test. The queue cases ared3d12_queue_wait,d3d12_queue_wait_timeout,d3d12_queue_wait_one_queue.Earlier public validations by ECHOZwei, lohant27-netizen, gut0to and h0useadv apply to original head
2a87ecd63, not this Signal follow-up. No remote CI success or full-suite rerun is claimed.Remaining scope / integration
Null-event blocking waits and the pre-existing
CreateFence-after-removal HRESULT mismatch remain open. #4577 rewrites the waits but its current draft returnsE_FAILon logical loss, so it is not claimed as complete nativeS_OKconformance. Preserve this early Signal guard when integrating its rewrittenFence::Signal.This regression proves ordered calls after
RemoveDevicehas returned. ASignalracing removal can still encounter the pre-existing check/use window; no concurrency guarantee for overlapping calls is added. The foreground counter does not cover older held callbacks on the dispatcher thread.AI-assisted: yes — Codex (Sol orchestration/final review, Terra implementation, Luna independent validation) and Claude Opus 5.5 (independent root-cause analysis and final diff review).
Discord : kyaemma
Checklist