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 |
Claimed in the coordination issue as: #8344 (comment)
Depends on: #8101, #3293, #4577 (integration/rebase coordination for overlapping code; no functional dependency for this HANDLE-notification fix).
Review follow-up f2ee288
Fixed the test defect reported by tupacfan04 and rideinstead in f2ee288: the first WARP
CreateFence()is now an oracle operation after successful device setup, so failure returns 1 (FAIL) rather than 77 (SKIP). Only the test changes (2 additions / 2 deletions); the production implementation is unchanged by this follow-up. Fresh independent Luna and Claude Opus 5.5 reviews approve this limited correction.Fresh validation on Windows 11 / MSVC 19.51 / RX 9070 XT,
LEONIDA_VK_VALIDATION=1: all five requested targets rebuilt; 5/5 CTest Passed, no new warning lines in that build, zero Vulkan validation errors. Luna independently reran the final regression: exit 0. Isolated compiled branch-forcing probes give old fence-failure 77 / corrected fence-failure 1 / setup-failure 77; they simulate the branch, not an actual COM failure. The current corrected test linked in a separate executable against the original runtime from main867d922f09b86583859796a174df89555fb32da8still fails as expected: actual exit 1, WARP PASS, layer0/0and notification timeouts, validation errors 0. Its separately compiled original production object emitted the known pre-existing C4189; no new warning is attributed to this test edit. Hygiene checks remain clean.Remaining runtime compatibility issue, confirmed during review: after explicit removal, native WARP
Signal(1)returnsS_OK, the original layer returnsS_OK, and this PR's runtime returnsE_FAIL. This HRESULT divergence is introduced by the original context-propagation change and is not fixed by the test-only follow-up. WARPCreateFenceafter removal returnsDXGI_ERROR_DEVICE_REMOVED, while both layer versions succeed; that difference is pre-existing. These are open review/coordination items, not a claim of complete removal conformance or merge readiness.Null-event blocking waits also remain excluded. Open #4577 rewrites those paths, but its current draft returns
E_FAILon logical device loss whereas the native checks reportS_OK; it is not claimed as a complete resolution of that contract. No competing wait implementation is added here.The public ECHOZwei / lohant27-netizen / gut0to / h0useadv validations refer to original head
2a87ecd6383f639c6f58be92bebf9499a4c33220, not this follow-up. Local results above refer to the corrected test. No remote CI success is claimed.What and why
Explicit
ID3D12Device5::RemoveDevicechanges the removal reason while leaving the fence/dispatcher context healthy. With two unsignaled synthetic fences, native WARP reportsUINT64_MAXand completes single/ALL/ANY HANDLE notifications; the layer retained0/0and left the notifications pending. This differs from the documented removal contract.Propagate explicit removal through the existing context notification. The regression compares WARP and the layer: healthy initial state, single/ALL/ANY HANDLEs registered before and after removal, completed values, and idempotent repeated removal. Oracle failures are FAIL, not SKIP; only WARP setup unavailability skips.
Scope: #1440 introduced the reason-only stub. The inspected diffs of #8101/#3293 add diagnostics, without this propagation. #4577 rewrites blocking waits; this patch does not change or claim to fix null-event blocking waits. Those PRs may require integration/rebase work when merged.
Tested
Windows 11, MSVC 19.51, Vulkan SDK 1.4.363.0, RX 9070 XT / driver 32.0.32015.7029; native Microsoft WARP. Synthetic inputs only; no physical GPU failure or reset induced.
6dda0630bd6fc0514baadb94fb98e36bd7d64c0b: WARP PASS, layer FAIL (0/0, pending events), exit 1.a86d7f95081461f4dfd976a4e6d977d37671a151, rebuilt all five targets, then withLEONIDA_VK_VALIDATION=1:Result: 5/5 PASS, exit 0.
git diff --checkandpython -I scripts/check_no_game_data.py runtime/shims/d3d12_vulkan_device.cpp runtime/test/d3d12_fence_device_lost_counter_test.cpp: exit 0. Broader baseline results are not claimed as a full rerun for this patch.AI-assisted: yes — Codex (Sol orchestration/final review, Terra implementation, Luna independent validation) and Claude Opus 5.5 (independent discovery and cross-review). Luna approved the final diff; Claude's requested context guard is integrated.
Discord : kyaemma
Checklist