Repository navigation
d3d12_xs: the device proxy table reaches console slot 133 instead of jumping to address 0 (RT-5) - #7183
d3d12_xs: the device proxy table reaches console slot 133 instead of jumping to address 0 (RT-5)#7183sneylol wants to merge 1 commit into
Conversation
The retail executable calls device slot 133 during startup (a buffer placed at an address the title mapped). The proxy's table had 128 entries, so that call read past the end of the table, found a null pointer and jumped to address 0, instead of reaching refuse_beyond_device's E_NOTIMPL. The table now has 256 entries. device_proxy_test calls slots 128, 133 and 255 and expects the refusal with a null output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Heads-up: #6953 (@Pipodi, opened earlier today) makes the same change: AI-assisted (Claude Code). |
|
Still on the PR #7183 review: I've checked the proxy table code paths against the diff, and here's the review body. Review: d3d12_xs device proxy table extended to 256 slots (RT-5)Environment: Windows 11, CPython 3.13; runtime built with MSVC ( What changed
Why the fix is correctThe root cause and the fix agree with the code:
TestThe new block calls each slot with the proxy as One minor point: these calls come before the hit-counter section. Under the counter semantics, the first-call flags for 128/133/255 are set and their hit counts are not. No later assertion reads those slots, so this is harmless. If someone adds a hit-count check for a console slot later, it should go after Limitations and follow-ups (none of them block this PR)
Verification (no game files needed)
The checks above don't build or run cmake --build runtime/build --config RelWithDebInfo
ctest --test-dir runtime/build -C RelWithDebInfo -R device_proxy --output-on-failureThe test runs on WARP, so any Windows machine works. It exits 77 (skip) under Wine. Please put the result and the machine in the PR description. Adherence
Verdict: Approve once the AI-assisted. |
|
Retail-executable confirmation (one run; own 1.0.2.1 copy, Windows 11, RX 9070 XT, |
|
Closing as a duplicate of #6953 (@Pipodi), which covers slot 133 the same way and was opened first. The retail confirmation above applies to it equally: with the table reaching 133, the title gets a logged |
Claimed in the coordination issue as: #6910 (comment) (new D3D item, RT-5)
Depends on: none (applies to
mainb66e184, which includes #6935).Problem
The device proxy's vtable has
kMaxSlots = 128entries. The retail executable (1.0.2.1, measured undergta6rt --run) calls device slot 133 during startup. It passes the address of a range it mapped through the physical-page calls, a bufferD3D12_RESOURCE_DESC,0xffffffff, null,IID_ID3D12Resourceand an output. That reads past the end of the proxy's static table, finds a null pointer and jumps to address 0 (rip = 0, return address in the title). The proxy already has the right answer for a console method past the PC device,refuse_beyond_device(E_NOTIMPL, logged once), but the table never reaches it.Fix
kMaxSlots128 → 256, with thestatic_assertraised to cover the measured slot 133 and a comment saying why.device_proxy_testcalls slots 128, 133 and 255 through raw function pointers and expects a non-null entry,E_NOTIMPLand a null output.What slot 133 should really do (the console's unified memory: a GPU buffer over memory the title mapped itself) is not in this PR. It's a design question for D3D-546 /
docs/d3d12_vulkan.md§3.3, written up in #313: #313 (comment)Tested
Windows 11 26200, RX 9070 XT, MSVC 14.44 RelWithDebInfo:
device_proxy_test: the new checks pass (0 failures).ctest: 231 of 235. The 4 failures also fail on plainmainb66e184here:d3d12_texture_tiles,d3d12_pipeline_library_hostand the flakyvk_queue_query_sync(the first two per GPU test results (one comment per GPU and driver) #166), andd3d12_vulkan_device(line 6564: tiles == 1). I checked the last one separately by rebuilding without this change: it is amainregression from d3d12_xs: route the public HLE's Xbox device slots 48/73/78/79/80 #6935, which routes slot 78 toSetFrameIntervalX, so the test'sID3D12Device10::CreateReservedResource2through the proxy no longer creates anything. Reported on d3d12_xs: route the public HLE's Xbox device slots 48/73/78/79/80 #6935.No game data, bytes or traces are included. AI-assisted (Claude Code).
🤖 Generated with Claude Code