Repository navigation
Conversation
Grimkaaah
left a comment
There was a problem hiding this comment.
Independent review (Linux CPU) — PASS (code-only; dual-device Vulkan not run)
Checked
- Cross-device ownership checks on ExecuteBundle, ExecuteCommandLists, Signal/Wait, and
SetEventOnMultipleFenceCompletion(device pointer threaded through); device-lost →DXGI_ERROR_DEVICE_REMOVEDon the blocking multi-fence path. - New
d3d12_cross_device_validation_test.cppcovers foreign/mixed lists and fences; CMake entry present. - No Linux case-path issues.
Overlap: runtime/CMakeLists.txt + d3d12_vulkan_device.cpp with #9719.
Not executed here: dual Vulkan devices / live Windows D3D12 parity (host skipped under Wine per test comments).
No game files. Reviewer: Grimkeh (AI-assisted Cursor / Composer).
|
Tested d175e11ae merged onto main 5d74c27 on Windows 11 Pro 24H2 (build 26100), AMD Radeon RX 9070 (RDNA4 / GFX1201), AMD Software 26.10.1 (driver 32.0.21045.29003, Vulkan 1.4.359), MSVC 14.44 (VS 2022 Community 17.14.40), RelWithDebInfo: pass.
|
|
AI-assisted code review and native Windows 11 / RTX 3090 verification (synthetic inputs only, no game data). Depends on: none Verification Summary — PASS
Checks Run
Code Review Notes
|
|
Tested
AI-assisted (Claude Code); no game files. |
|
checked: #9715 at head Windows 10 22H2 (19045.6466), RTX 5070 (NVIDIA 610.88, Vulkan subgroup 32), MSVC 19.51.36256, Windows SDK 10.0.26100.0, Ninja Release with static CRT.
AI-assisted: yes. |
Claim: #9522 (comment)
Summary
Enforce cross-device ownership checks before passing D3D12 COM objects into Vulkan on five queue, fence, and command-list paths, and guard the blocking path of
set_event_on_multiple_fence_completionagainst an already-lost device:CommandQueue::Signal&CommandQueue::Wait(runtime/shims/d3d12_com.cpp): verify the fence belongs to the sameVulkanContextandattached_device(); returnE_INVALIDARGbefore claiming or submitting to Vulkan.ID3D12Device1::SetEventOnMultipleFenceCompletion(runtime/shims/d3d12_com.h,runtime/shims/d3d12_com.cpp,runtime/shims/d3d12_vulkan_device.cpp): validate every fence in the array againstcontextanddevice(E_INVALIDARGon any foreign fence, including mixed arrays); on the blocking (event == nullptr) path, returnDXGI_ERROR_DEVICE_REMOVEDimmediately ifcontext.is_device_lost()(and whenvkWaitSemaphoresreturnsVK_ERROR_DEVICE_LOST).CommandQueue::ExecuteCommandLists(runtime/shims/d3d12_com.cpp): refuse the entire batch (ReplayResult::unsupported) if any list has a mismatchedattached_device(), never submitting foreign handles toVulkanContext.GraphicsCommandList::ExecuteBundle(runtime/shims/d3d12_com.cpp): invalidate the recording list viacheck(false)ifbundle->attached_device() != attached_device(), soClose()returnsE_INVALIDARGand no foreign bundle commands are replayed.Standalone tests (
attached_device() == nullptron both objects) continue to pass cleanly.Live Windows 11 D3D12 Verification
Empirically probed against two distinct host adapters (NVIDIA GeForce RTX 5090 + Microsoft Basic Render Driver / WARP):
queue_A->Signal(fence_B, 1)->0x80070057(E_INVALIDARG),fence_Bunchangedqueue_A->Wait(fence_B, 1)->0x80070057(E_INVALIDARG)dev_A->SetEventOnMultipleFenceCompletion({fence_B} / {fence_A, fence_B}, ALL/ANY, event/null)->0x80070057(E_INVALIDARG)ExecuteBundle/ExecuteCommandListswith foreign objects fault without the debug layer; the layer safely refuses both.Testing
Added
runtime/test/d3d12_cross_device_validation_test.cpp(registered asd3d12_cross_device_validationinruntime/CMakeLists.txtwithSKIP_RETURN_CODE 77andFAIL_REGULAR_EXPRESSION "Validation Error;VUID-").Verified on NVIDIA GeForce RTX 5090 with
LEONIDA_VK_VALIDATION=1(0 VUIDs):d3d12_cross_device_validation: PASS (40/40 checks, including live RTX 5090 + WARP host parity & device-lost blocking check)d3d12_com: PASSd3d12_fence_timing: PASSd3d12_bundle: PASSAI-assisted (Gemini 4 Neon).