Skip to content

d3d12_xs: the device proxy table covers slot 133, so a console call names itself - #8442

Closed
dcastell1 wants to merge 1 commit into
ItsNotRexed:mainfrom
dcastell1:fix/device-table-192
Closed

dcastell1 wants to merge 1 commit into
ItsNotRexed:mainfrom
dcastell1:fix/device-table-192

Conversation

@dcastell1

Copy link
Copy Markdown
Contributor

What and why

The retail 1.0.2.1 title calls device slot 133 — CreatePlacedResourceX, three call sites in the image per tools/d3d12_device_calls.py (#7998). The device proxy's table held 128 slots, so that vtable read landed in the zeroed tail of the allocation: the call went to address 0, and the process died with an access violation at 0, with no stack and no slot name. That is why this stop read as a mystery for a day: everything before it passes and nothing logs.

With 192 slots the same run names the slot:

[rt] d3d12_xs: device slot 133 (forwarded) first call
[rt] d3d12_xs: device slot 133 (forwarded) is beyond the PC device vtable (80 slots); returning E_NOTIMPL

and the title's own int3 assert replaces the silent access violation. This is the table size alone; slot 133 stays refused (logged, E_NOTIMPL) until it is modelled, which is what docs/retail_boot_chain.md records as the local stand-in for stop 12.

Test

xs_proxy_mock now asserts that slot 133 answers E_NOTIMPL and is counted. Shrink kMaxSlots back under 133 and that check is the one that fails.

Verification

device_proxy, device_proxy_trace and the five xs_proxy_mock variants → 8/8 passed on Windows 11 26300, MSVC 19.44, RTX 5090, with the boot stack of #7154 (main + #4313 #4348 #6582 #6964 #6954 #2490) built from source.

Claimed in #7333. No game data: slot numbers, an import name and a count only.

…ames itself

The retail 1.0.2.1 title calls device slot 133 (CreatePlacedResourceX: three call
sites in the image, tools/d3d12_device_calls.py). The proxy table held 128 slots,
so that vtable read landed in the zeroed tail of the allocation: the call went to
address 0 and the process died with an access violation at 0, with no stack and no
slot name. It read as a mystery stop for a day.

With 192 slots the same run names the slot and returns E_NOTIMPL, and the title's
own assert replaces the silence. That is the state docs/retail_boot_chain.md
records as a local stand-in for stop 12; this is the table size alone, so the
refused tail (logged, E_NOTIMPL) is what the title gets until slot 133 is modelled.

Test: xs_proxy_mock asserts that slot 133 is answered with E_NOTIMPL and counted,
which is the check that fails if the table shrinks back under the slot.

Measured with the boot stack on Windows 11 26300, RTX 5090, MSVC 19.44.
@dcastell1

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate of #6953, which I had not seen when I opened this (it was claimed at 16:5x, mine at 18:4x). Same one-line table size, so #6953 is the one to keep.

What this PR adds that #6953 may want: a three-line check in xs_proxy_mock that calls slot 133 through the proxy and asserts E_NOTIMPL plus device_slot_hits(133) == 1. That is the assertion that fails if the table shrinks back under the slot, so it pins the regression instead of only fixing it. Happy to send it as a patch on top of #6953 if its author wants it.

Measured, since it is the reason the change matters: on main@dde82f27 + the boot stack, 128 slots make the slot-133 vtable read land in the zeroed tail, the call goes to address 0 and the process dies with an access violation at 0 with no stack; at 192 the same run names the slot and returns E_NOTIMPL, and the title's own assert replaces the silence.

@dcastell1 dcastell1 closed this Nov 23, 2026
@shdann

shdann commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 5d2c1cb on Windows 11 with MSVC 14.51: pass. I built device_proxy_test and xs_proxy_mock_test in RelWithDebInfo. All eight CTest cases selected by -R "^(device_proxy|xs_proxy_mock)" pass.

The mock records one call to slot 133. The trace names slot 133 and the call returns E_NOTIMPL. I also checked slots 128 and 191, the first and last new entries. Each returns E_NOTIMPL and records one hit. On parent dde82f2, a compile-time check that the table contains slot 133 fails (128 entries).

These tests use synthetic calls. They verify the proxy response and trace. I did not run the retail executable.

AI-assisted.

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.

2 participants