Skip to content

d3d12_xs: CreateCommandQueueX drops the title's console queue flags (RT-5: the compute queues) - #7037

Closed
sneylol wants to merge 1 commit into
ProjectLeonida:mainfrom
sneylol:d3d12-xs-slot48-console-queue
Closed

sneylol wants to merge 1 commit into
ProjectLeonida:mainfrom
sneylol:d3d12-xs-slot48-console-queue

Conversation

@sneylol

@sneylol sneylol commented Nov 23, 2026 •

Copy link
Copy Markdown

Claimed in the coordination issue as: #6910 (comment) (new D3D item, RT-5)

Depends on: none. Rebased on main 09b9ba8, which includes #6935. #6935 routes device slot 48 to CreateCommandQueueX, so this PR is now only the part #6935 leaves open: the title's console queue flags.

Problem

The retail executable (1.0.2.1, measured under gta6rt --run) creates its four compute queues through device slot 48:

Type Priority Flags NodeMask
COMPUTE 0 1 0
COMPUTE 0 2 0
COMPUTE 0 3 0
COMPUTE 0 0 1

main's CreateCommandQueueX passes the description to the PC path unchanged. Flags 2 and 3 are no PC queue flag, so the Vulkan device refuses the second queue with E_INVALIDARG and the title asserts. @Senya01 saw the same on main with #6935: two queues, then the second slot 48 call fails. PC flag 1 (DISABLE_GPU_TIMEOUT) also has no meaning for the console's value, which reads as a queue selector.

Fix

  • proxy_create_command_queue_x copies the description, drops Flags (each value logged once) and takes slot 8's path. A null description is refused with E_INVALIDARG and a null output, without reaching the PC device.
  • xs_proxy_mock_test: the mock keeps slot 8's description as received, because the forwarded one is now a local copy. This replaces the pointer-identity check that @Senya01 found failing with the earlier version of this PR, and adds console Flags 1, 2 and 3 with the forwarded fields checked (COMPUTE, Flags 0).
  • device_proxy_test (WARP): slot 48 with each of the four descriptions returns a queue proxy whose GetDesc has no flags, and each signals the fence proxy on the GPU.
  • docs/d3d12_vulkan.md (the d3d12_xs: route the public HLE's Xbox device slots 48/73/78/79/80 #6935 row): the retail confirmation and the dropped flags.

Tested

  • Windows 11 26200, RX 9070 XT, MSVC 14.44 RelWithDebInfo, full ctest: 231 of 235. xs_proxy_mock and device_proxy pass. The 4 failures also fail on plain main here: d3d12_texture_tiles, d3d12_pipeline_library_host, the flaky vk_queue_query_sync, and d3d12_vulkan_device (a main regression from d3d12_xs: route the public HLE's Xbox device slots 48/73/78/79/80 #6935's slot 78 route, reported there).
  • Retail executable, with the earlier version of this change (same behaviour): all four compute queues are created, and the boot reaches slot 73. Independently confirmed by @Senya01 and @zohaiblazuli above.

No game data, bytes or traces are included. AI-assisted (Claude Code).

🤖 Generated with Claude Code

@Senya01 Senya01 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent Windows / Vulkan validation

Tested the slot 48 handler and its device_proxy_test cases from 831062a24 on main 09f6ce74e, which includes #6935. I resolved the textual overlap locally. Both builds used the same startup patches from #4313, #4348, #6582, #6792, the GameInput ordinal from #3410, the XMem implementation from #6919 (36936f3bf), and the slot 26 fix from #6964 (23e9c9535). The only runtime difference between the two builds was this PR’s slot 48 change.

Tested on Windows 11 build 26300, RTX 5070 Ti, NVIDIA 617.14, MSVC 19.44 Release. Each trial ran --dry-run, --init, then --run with the local retail 1.0.2.1 package, a fresh overlay, LEONIDA_D3D12=vulkan and LEONIDA_UNIMPLEMENTED=stop, in an offline AppContainer. All six dry runs and all six initializations succeeded.

Build Retail result
Control, 3/3 runs Two queues were created (slot 8 and the first slot 48 call). The second slot 48 call failed.
With this PR, 3/3 runs All five queues, five fences and one command allocator were created. All four slot 48 calls succeeded, with input flags 1, 2, 3, 0 in that order. The next failure was CreateCommandList through slot 73.

One test to reconcile on rebase. The targeted CTest set passed 5/5 on the control and 4/5 with this PR. device_proxy passed, including the new queue cases. xs_proxy_mock failed at the pointer equality check introduced by #6935. The mock expects the backend to receive the caller’s descriptor address. The new handler passes a normalized local copy. Capturing the descriptor fields during the mock call would let this test verify the forwarded values and cleared flags.

AI-assisted: yes. Runs and report by OpenAI Codex (gpt-6.2-astra).

@zohaiblazuli

zohaiblazuli commented Nov 23, 2026 •

Copy link
Copy Markdown

Tested 831062a24 on the retail executable, on top of #6973: pass.

Retail Xbox Series 1.0.2.1 package + executable (sizes match game/xbox-1.0.2.1.json), Windows 11 10.0.26300, MSVC (VS 2022), GeForce RTX 3060 (driver 32.0.16.1742). Host D3D12 backend (LEONIDA_D3D12=vulkan not compiled in: no Vulkan SDK on this machine). gta6rt --run with --overlay to a scratch folder, outbound network blocked, LEONIDA_UNIMPLEMENTED=stop. Base: main 9b72d0d2c + #6582, #6919, #4313, #4348, #6792, #6810, #6885, #6891 merged locally (conflicts resolved locally).

  • All four console compute queues are created and logged as the PR describes: flags 1, 2 and 3 on node mask 0, and flags 0 on node mask 1. The boot continues to device slot 73.
  • Integration with current main:
    • d3d12_xs: route the public HLE's Xbox device slots 48/73/78/79/80 #6935 now routes slot 48 through xbox_device_slot_routes().queue_x to proxy_create_command_queue, which doesn't drop the flags. With only main, the retail title asserts (int3) on the flag-2 queue. After a rebase, the route should call proxy_create_command_queue_console; that's what I did locally.
    • main's xs_proxy_mock_test check_xbox_slots() then fails at mock->args[8][0] == word(&kQueueDesc): the console path hands the PC device a copy of the description, not the caller's pointer. That expectation needs updating in the rebase.

Outcomes only; no game data.

@Marukooh

Copy link
Copy Markdown
Contributor

Independent comparison on CachyOS, Wine 11.22, clang-cl/xwin SDK 10.0.26100 Release, RTX 5070 Ti (NVIDIA 620.73.04), Vulkan. Offline using my local 1.0.2.1 package.

The local stack has #4313, #6792, #6919, #6582, #4348, #3410 (static SDL 3.4.20), #6964 and the merged routes from #6935. With the unmodified #6935 queue route, the third CreateCommandQueue call was rejected and startup stopped. I applied this PR's queue flag translation to the existing #6935 route locally, preserving the rest of the description and its existing slot override behavior. With it, all five CreateCommandQueue calls succeed, all five fences are created, and the first command allocator succeeds. The next stop is the first Xbox CreateCommandListX at slot 73.

The synthetic mock confirms that the Xbox queue selector becomes NONE while the type and node mask are preserved. The mock and both slot-override cases pass. Outcomes only; all traces stay local. AI-assisted (Codex).

ItsNotRexed#6935 routes device slot 48 to CreateCommandQueueX and passes the title's
description to the PC path unchanged. The retail executable creates its four
compute queues there with console Flags 1, 2 and 3 (node mask 0) and 0 (node
mask 1). 2 and 3 are no PC queue flag, so the Vulkan device refuses the second
queue with E_INVALIDARG and the title asserts.

CreateCommandQueueX now copies the description, drops Flags (each value
logged once) and takes slot 8's path; a null description is refused before
the PC device. xs_proxy_mock's mock keeps slot 8's description as received
(the forwarded one is a local copy), and both it and device_proxy_test check
the forwarded fields for console Flags 1, 2 and 3; device_proxy_test also
signals a fence from each compute queue on WARP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sneylol
sneylol force-pushed the d3d12-xs-slot48-console-queue branch from 831062a to 16e3cb6 Compare November 23, 2026 16:12
@sneylol sneylol changed the title d3d12_xs: device slot 48 is the console's command-queue creation (RT-5: the title's compute queues) d3d12_xs: CreateCommandQueueX drops the title's console queue flags (RT-5: the compute queues) Nov 23, 2026
@sneylol

sneylol commented Nov 23, 2026

Copy link
Copy Markdown
Author

Rebased on main 09b9ba8 (with #6935) as 16e3cb6. The slot 48 route itself is now #6935's, so this PR is only the console-flags drop. @Senya01, the xs_proxy_mock pointer check you hit is replaced by a check of the fields as received, which also covers console Flags 1/2/3. Thanks for the careful test. AI-assisted (Claude Code).

@sneylol

sneylol commented Nov 23, 2026

Copy link
Copy Markdown
Author

Closing in favour of #6954 (@Pipodi), which was opened first and covers the same thing more completely: it reads slot 48's description as the 16-byte PC prefix plus four console words, and keeps only the one valid PC flag. My measurement agrees with it (the title's Flags 1, 2, 3 and 0 on its four compute queues). Thanks @Senya01 and @zohaiblazuli for testing this one; the retail result applies to #6954's behaviour too.

If it's useful for #6954: this branch's device_proxy_test cases create the four compute queues on WARP and signal a fence from each (16e3cb6, runtime/test/device_proxy_test.cpp).

AI-assisted (Claude Code).

@ramenbellic

Copy link
Copy Markdown

Tested 16e3cb67 against the retail executable. Linux under Proton Experimental (wine 11.0), RTX 3070 (driver 620.70.06), Ryzen 5 5600X; gta6rt cross-built with clang-cl 23.1.6 + xwin SDK 10.0.26100 (RelWithDebInfo), LEONIDA_D3D12=vulkan, own 1.0.2.1 executable, gta6rt --run. Base: main 8575d36ed + #4313 + #6582 + #4348 (what it takes on Wine to get past the static initializers and XGameRuntimeInitialize). Plus #6919, #3410 and #6964.

AI-assisted (Claude Code); outcomes only, no game data.

@Zunraz

Zunraz commented Nov 23, 2026

Copy link
Copy Markdown

Independent check of the rebased 16e3cb677c16227aeb6e23894909a5dc186da83b, completed just as this closed in favour of #6954. In particular, the updated field-value mock check now passes: xs_proxy_mock_test PASS and device_proxy_test OK (zero failures), including the four queue descriptions and fence signals.

Native Windows build 26300, RTX 5090 / driver 32.0.16.2124, clang-cl 21.1.8 + xwin SDK 10.0.26100, static CRT. Bounded retail Vulkan trial on main 8575d36ed plus #4313, #6919, #4348, #6991, #6964 and RT-488 cache changes: before this change the flag-2 compute queue is refused; with this exact head all five queues, five fences and the first command allocator succeed. The next call, CreateCommandList through device slot 73, fails. No frame/menu yet.

This validates the tested #7037 head; I have not run #6954 and am not claiming its exact flag handling was tested here. Socket creation, DNS and transmission were debugger-guarded. Outcomes only, no game data or raw traces attached. AI-assisted (Codex).

@3greasier-quantifies

Copy link
Copy Markdown

Tested 16e3cb677 on RTX 3070 (driver 32.0.16.2101), Windows 11 x64, MSVC 2022 (Build Tools), Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0: pass.

  • Read the diff: proxy_create_command_queue_x copies the description, drops non-zero Flags (logged once per value) and forwards to the slot 8 path; the mock now keeps slot 8's description as received. Nothing unusual.
  • Built the full runtime.
  • device_proxy, device_proxy_trace and all xs_proxy_mock* entries passed.
  • Full ctest -C RelWithDebInfo -j4 (259 tests): three failures. d3d12_vulkan_device and d3d12_indirect_dispatch_count also fail on this PR's merge base 09b9ba886 (rebuilt those tests there), so they are not from this PR.
  • The third, d3d12_bindless_churn, failed in that full parallel run but passed on the merge base, so I reran it on the PR: 4 of 4 passes alone (about 3.9 s each) and one more pass inside a second -j4 run of the d3d12_ tests. I could not reproduce the failure, so I take it as a timing flake under load, not a result of this PR. I did not capture its failure output in the first run, so I can't say more.

Not checked: the real game executable or any game files (the flags dropped are the ones from the PR's measurement).

AI-assisted: yes (Claude Code ran the build and tests; I read the results).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants