Repository navigation
d3d12_xs: device slot 26 takes the return buffer in RCX and the device in RDX, as the retail executable calls it (RT-5) - #6964
Conversation
The retail executable calls GetCustomHeapProperties with the return buffer in RCX and the device in RDX. The forwarder took RCX for the proxy and faulted. AI-assisted.
|
Tested on the retail executable: pass. Own 1.0.2.1 copy (exe sha256
#6973 gives the same result on the same base. Slot 25 isn't called before slot 48 in this run, so only the slot 26 half can be compared on the retail boot so far. AI-assisted (Claude Code). |
…two comments AI-assisted.
AI-assisted.
devnull34
left a comment
There was a problem hiding this comment.
Hardware & Environment
- Host: Windows 11 Build 26300 x64
- GPU: AMD Radeon RX 7900 GRE (16 GB VRAM)
- Toolchain: MSVC 19.44 (Visual Studio 2022), CMake 4.4
Verification Summary
Targets compiled with MSVC 19.44 and executed natively:
-
xs_proxy_mock_test.exe:- Passed with 0 failures (
xs_proxy_mock_test: PASS (9 allocations refused on purpose)). - Validated that
check_custom_heap_propertiesexercises slot 26 (GetCustomHeapProperties) with console C-ABI struct-return calling convention (padded.valuebuffer in RCX, device in RDX), writing exactD3D12_HEAP_PROPERTIESoutput without buffer overrun or corruption of surrounding guard bytes, while also verifying PC C++ ABI caller forwarding.
- Passed with 0 failures (
-
device_proxy_test.exe:- Passed with 0 failures across live WARP adapter testing.
-
CTest Suite:
device_proxy: Passed (0.03s)device_proxy_trace: Passed (0.03s)xs_proxy_mock: Passed (0.01s)xs_proxy_mock_no_reserve: Passed (0.01s)xs_proxy_mock_no_protect: Passed (0.01s)xs_proxy_mock_no_handler: Passed (0.01s)- Total: 6/6 passed (100%).
-
Overlap Note:
- Note for maintainers: PR #6973 covers both slot 25 and slot 26. Whichever PR merges first, the other can be rebased or consolidated accordingly.
-
Hygiene & Compliance:
- Clean-room compliant: pure synthetic unit tests; zero game assets or proprietary code.
git diff origin/main..HEAD --check: Clean (0 whitespace/formatting defects).
LGTM!
|
Note for the rebase: the #6935 conflict you listed is now on |
|
Independent before/after test of Local stack: #4313 + #6792 + #6919 + #6582 + #4348 + #3410 with static SDL 3.4.20. The GameInput ordinal is bound to the shim, and the game opens its first DirectStorage file, calls the physical-page allocator and creates a Vulkan device on the 5070 Ti. Without this slot 26 patch the first forwarded call produced a read access violation. With this patch it reaches the device's Xbox queue creation at slot 48, where this build still forwards the call. The synthetic Only call outcomes are reported. AI-assisted (Codex). |
|
Tested Retail Xbox Series 1.0.2.1 package + executable (sizes match
Outcomes only; no game data. |
|
Closing my #6973 as a duplicate of this one: same measurement, same fix for slot 26, and yours came first. One point from #6973 for a possible follow-up, not a blocker here: slot 25 ( AI-assisted (Claude Code). |
|
Tested
|
# Conflicts: # runtime/shims/d3d12_xs_device.cpp # runtime/shims/d3d12_xs_device.h # runtime/test/xs_proxy_mock_test.cpp
|
Native Windows check of Base: main
Both PRs were added together; this is not a separate #6954-only comparison. The actual executable ran with a bounded, read-only input boundary, and all input metadata and PE hashes remained unchanged. No game data or trace excerpts are included. |
|
Tested Merged onto Conflicts: the forwarded-slot list in Traces stay local; no addresses or game data here. AI-assisted (Claude Code). |
|
Verified on the retail 1.0.2.1 executable, Windows 11, RX 7900 XTX, Vulkan backend, from a stack of the open RT-5 PRs. Measured at the title's call site ( The PC |
…ffer order) for the RT-5 boot
|
@tupacfan04 thanks for looking twice. For the record, since the two comments disagree: the case in your review does exist, and the retraction is right only for the console form.
Nothing here can produce that: the title only uses the console form (@bobcatchris measured the registers at the call site), and the PC-form calls in the tree pass fresh temporaries. Checking both registers would only move the ambiguity to the other form, so I am leaving this head as tested; comparing against the live proxy's address instead of its vtable word would close it properly, and I can do that as a follow-up if a maintainer wants it. AI-assisted. |
|
Retail boot test (RT-5): own 1.0.2.1 copy, Windows 11, i9-12900KF, RTX 3070 (NVIDIA 617.42), MSVC 2022 RelWithDebInfo, Result: clears stop 7 (device slot 26). Merges cleanly; AI-assisted test run. |
Claimed in the coordination issue as: D3D-669 (claim)
Depends on: none. Text conflicts with #6954 (
d3d12_xs_device.cpp,xs_proxy_mock_test.cpp); the second to land rebases. The branch contains main with #6935. Duplicates #6973 and #7702 were closed by their authors in favour of this one; #7078 builds on it.What and why
gta6rt --runon the retail executable crashes in the loader right after device creation:0xC0000005inproxy_slot<26>.The title calls device slot 26 (
GetCustomHeapProperties) with the return buffer in RCX and the device in RDX. The proxy assumed the PC C++ order and took the buffer for the device.Fix: slot 26 takes that form when RDX holds the device proxy. A PC-style call is forwarded as before. Slots 25 and 43 are not changed.
Tested
Windows 11, MSVC 14.44, RX 9070 XT (driver 32.0.32029.2010).
xs_proxy_mock_testanddevice_proxy_testpass. Againstmain's proxy,device_proxy_testends with the same0xC0000005.ctest: 235 pass, 11 skip, 4 fail. The 4 also fail onmainhere:vk_queue_query_sync,d3d12_texture_tiles,d3d12_indirect_dispatch_count,d3d12_pipeline_library_host.AI-assisted: yes
Checklist
docs/design.md, with how it was confirmed. (not a translator change)