Repository navigation
Conversation
…C forward The retail title's second CreateCommandQueueX passes Flags=0x2, a bit the PC runtime does not define (measured: static disassembly of the call sites at exe+0x2478813 and exe+0x2478853; the first queue's Flags=0x1 is accepted, the second's 0x2 fails, and the title checks the HRESULT and hits its own int3 at exe+0x2478866). PC CreateCommandQueue defines Flags NONE (0) and DISABLE_GPU_TIMEOUT (0x1) only, so the shim now drops the other bits before forwarding and logs the drop once. The mock records the desc it receives (the shim forwards its own copy) and a new check drives slot 48 with a console-only flag bit, expects the masked desc at the real device and the caller's desc untouched.
devnull34
left a comment
There was a problem hiding this comment.
Verified via Tier 2 Free Cloud (Groq gpt-oss-120b): Masking console-only private flag bits from D3D12_COMMAND_QUEUE_DESC::Flags before invoking the host PC D3D12 CreateCommandQueue prevents E_INVALIDARG rejections by the standard Windows runtime while preserving console execution semantics.
al3xar
left a comment
There was a problem hiding this comment.
Tested 0358e1388 on Windows 11 x64, MSVC 19.44.35230.0 (VS 2022 Build Tools), CMake + Ninja RelWithDebInfo, Windows SDK 10.0.26100.0 (no game files): build and existing tests pass, but code review found a null-dereference regression on desc == nullptr.
Verification
- Merges cleanly onto
upstream/main(dde82f27e). - Built
device_proxy_testandxs_proxy_mock_testcleanly with zero warnings. ctest -R "^(xs_proxy_mock|device_proxy)$" --output-on-failure: 2/2 passed.
Code review findings
- Null-pointer dereference (
runtime/shims/d3d12_xs_device.cpp:1146):D3D12_COMMAND_QUEUE_DESC pc_desc = *desc;dereferencesdescunconditionally before callingself->real->CreateCommandQueue. Onmain, a nulldescwas forwarded toself->real->CreateCommandQueue(nullptr, ...)which returns an errorHRESULTcleanly instead of access-violating (note thatd3d12_method_variants_testspecifically tests null-desc calls on the device). Forwardingdescunchanged when!desc(or returningE_INVALIDARGwhen!desc) avoids the crash:if (!desc) return self->real->CreateCommandQueue(nullptr, *riid, out); // or E_INVALIDARG
- Minor:
proxy_create_command_queue1(slot 75, line 1236) does not apply the same flag mask if a console caller ever usesCreateCommandQueue1.
AI-assisted.
|
Independent build + test: the test passes, but a null AI-assisted (Claude Code). Windows 11 x64, MSVC 19.44.35220, Ninja RelWithDebInfo, NVIDIA GeForce RTX 3080 driver 621.24 / 32.0.16.2124. Head
Bug:
I added a temporary probe to (On Other notes:
|
tupacfan04
left a comment
There was a problem hiding this comment.
The console slot 48 masking works, but the shared helper changes PC behavior and a null desc now crashes.
-
PC
CreateCommandQueuenow accepts invalid flags.runtime/shims/d3d12_xs_device.cpp:1145-1150masksFlagsunconditionally inproxy_create_command_queue; PC device slot 8 (:1513) and Xbox slot 48 (:1569) both call it, and the PC backend correctly rejects any flag other thanDISABLE_GPU_TIMEOUTwithE_INVALIDARG(d3d12_vulkan_device.cpp:5388). A PC caller using slot 8 withFlags = 0x2should getE_INVALIDARG, but the helper masks it toNONEfirst and the call succeeds. The new test drives only slot 48 (tests/xs_proxy_mock_test.cpp:724-749); the mock'scase 8(:191-195) does not validate flags. Apply the console mask only on the slot 48 route (separate wrapper/flag), leaving PC slot 8 untouched. -
A null queue description crashes instead of returning an error.
:1146doesD3D12_COMMAND_QUEUE_DESC pc_desc = *desc;before any null check. The original code forwardeddesctoself->real->CreateCommandQueue, whose backend returnsE_INVALIDARGfor null (d3d12_vulkan_device.cpp:5381).raw(device, 8, 0, kQueueIid, &out)now dereferences null. Checkdescbefore the copy and forward the null pointer (to preserve the real device's exact answer), then add a null-desc test for both slot 8 and the Xbox route.
Secondary: CreateCommandQueue1 (slot 75, :1235-1248) still forwards console-only bits; if the title uses that path, Flags=0x2 still fails. The PR body only covers slot 48, but the title is broader.
Correct: DISABLE_GPU_TIMEOUT survives, the caller's desc is copied not modified, console 0x2 reaches the real device as NONE with Type preserved, and the log-once atomic is thread-safe. Synthetic only; no game files. AI-assisted (OpenCode).
|
Correction to my review above: the null- The remaining unique issue is the shared PC route: |
…ep a null desc going through Review fixes for ItsNotRexed#8258 (MartinIndra02's null-desc crash, tupacfan04's slot-8 asymmetry): - A null desc crashed: the mask copied *desc before any null check, while the pre-PR code passed a null desc to the real device, which refuses it (E_INVALIDARG, pinned by d3d12_method_variants_test's slot 8/75 agreement check). The desc now goes through as before when null. - The mask applied to PC device slot 8 as well as Xbox slot 48, so a PC caller passing Flags=0x2 succeeded through the proxy where the PC backend returns E_INVALIDARG. proxy_create_command_queue now takes a console_route flag: slot 48 masks, slot 8 forwards the desc unchanged. Tests: slot 8 with Flags=0x2 reaches the real device unmasked; null desc on both routes forwards null and does not crash. xs_proxy_mock_test PASS, device_proxy_test OK.
|
Pushed
New checks in |
|
Independent Windows Sandbox comparison of
Only counts, error classes and public API/slot names are shared; traces stay local. AI-assisted. |
|
Tested bb8c129 on NVIDIA GeForce RTX 5060 Ti, driver 621.24, Windows 11 Pro build 26300, VS 18 Build Tools (MSVC), Ninja, RelWithDebInfo: pass.
Built the PR head, not merged onto main. Synthetic only, no game files. AI-assisted (Claude Code). |
|
Both findings are fixed in
Verified locally: CMake + Ninja |
tupacfan04's ProjectLeonida#8258 follow-up: the mock's case 8 accepted any flags, so the slot-8 asymmetry check could not fail. The mock now validates flags the way d3d12_vulkan_device.cpp does (E_INVALIDARG on bits beyond DISABLE_GPU_TIMEOUT), the slot-8 Flags=0x2 call asserts that HRESULT, and a DISABLE_GPU_TIMEOUT call still goes through unmasked.
|
Pushed
|
|
Retail boot with this PR on NVIDIA GeForce RTX 4070 (driver 621.24), native Windows 11, MSVC 14.44, my own 1.0.2.1 executable, docs/boot.md runbook: it gets past the compute-queue stop.
No game data used. AI-assisted (Claude Code). |
|
Tested 5f7181f (merged onto main 867d922) on RTX 5070, NVIDIA 621.24, Windows 11 (build 26200), Vulkan validation layer on (
Ran the tests that belong to the test files this PR changes (ctest entries, or the test program directly when it is not registered), with no game files ( |
|
Tested Full runtime AI-assisted (Claude Code). |
|
Tested
AI-assisted: yes. |
|
Retail-boot result on the real 1.0.2.1 image with this PR merged into the local stack (local merge af42e3004): the console route masked the second queue description Flags 0x2 to 0x0; five command queues, four fences and the first allocator were then created (D3D12 trace ok) and the title moved on to slot 73 CreateCommandListX. Focused device_proxy/xs_proxy/file_system/dstorage tests: 13/13 pass; full ctest: 226 passed, 12 skipped, 1 disabled, only the 2 pre-existing GPU failures (d3d12_vulkan_device, d3d12_depth_resolve). |
|
Tested 5f7181f on main 5d74c27 + #8461 (077606c) + #6964 (ed70b4c's code commit) on Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4070 (driver 621.24),
No game data is quoted here. AI-assisted (Claude Code). |
What and why
The retail title's second
CreateCommandQueueXpassesFlags=0x2, a bit the PC runtime does not define. Measured on this machine (boot runbook,--run): the PC runtime fails the call, the title checks the HRESULT and hits its ownint3atexe+0x2478866— the stop posted to #7154 (comment).Evidence, all static or from the shim's own trace, no game data:
call qword ptr [rax+0x180]) in a loop, asserting on every HRESULT (test esi,esi; jns ...; int3). Disassembly of the two call sites atexe+0x2478813andexe+0x2478853:Flags=D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT(0x1),Type=COPY— accepted;Flags=0x2,Type=COPY— the PC runtime fails it (a C++ throw inside D3D12Core, first-chance, thenE_INVALIDARG-shaped failure), title asserts.CreateCommandQueuedefinesFlagsNONE (0) andDISABLE_GPU_TIMEOUT(0x1) only.CreateCommandListX) — one stop deeper than the run without the fix (trace in Boot log for coding agents: where the executable stops and which PRs get past it #7154).The change
proxy_create_command_queuecopies the desc, masksFlagsto the two PC-defined bits, logs the drop once, and forwards the copy. The caller's desc is untouched (const, and the mock now checks that).Test
xs_proxy_mock_testrecords the desc the mock device receives (the shim forwards its own copy) and a new block drives slot 48 withFlags=0x2, expects the masked desc (NONE) at the real device, the caller's desc unchanged, andDISABLE_GPU_TIMEOUTsurviving the mask. PASS.Notes
c3827890-4024-474c-98cf-645b51dc4874(not in docs/d3d12_xs_surface.md), the PC device answersE_NOINTERFACE, the title asserts. A list proxy answering that IID is the next piece — that is D3D-690's area (slot 73, @LooperSalty), so I am not building it here; the IID and the failure mode are posted to Boot log for coding agents: where the executable stops and which PRs get past it #7154.agent: yes