With it, d3d12_xs reads list slot 48 as the console's IASetVertexBuffers, so the PC-shaped fixture list's
ClearRenderTargetView never runs and Close fails. The branch also changes runtime/src/pe_loader.cpp and carried
committed conflict markers in docs/fssm_crosscheck.md. Its docs rows go with it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
D3-445, contributed by shdann (tested on Windows 11, MSVC 14.51, RTX
4090; xs_proxy_mock passes, negative control fails as designed).
From CopyTextureRegionX on, the newer console layout sits two slots
later than the older one (docs/d3d12_xs_console_abi.md 5.3). A table
keyed by the older-layout slot gives every measured pair one name, so
list slot 85 under the newer layout and 83 under the older both log
"CopyTextureRegionX"; the seven unmeasured pairs print "tail method,
older slot N". A slot gets no name while the layout is unknown or when
it is not a measured slot of that layout, so a number never wears the
other layout's name. Naming only - console_to_pc_list_slot and the
forwarding are untouched.
Co-Authored-By: shdann <28006689+shdann@users.noreply.github.com>
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
shdann's second case on #2490: a title reads the timestamp frequency at
start-up, before any fence call has detected the layout. Slot 18 then
went to the PC GetDesc - a struct-return write of a whole desc through
a caller that passed an 8-byte out pointer - so the frequency came
back unset (and the write overran).
While the layout is still unknown the call is served as the newer
layout's GetTimestampFrequency instead: an 8-byte write stays inside
either interpretation's buffer. A queue or device already proven
older keeps the generic GetDesc forward; slots 19 and 20 stay no-ops
because their newer interpretations write through caller pointers an
unmodelled older method might not supply.
The mock queue's slot 16 now writes a fixed frequency (unless the
argument is a mock object - then it is a newer Signal's fence), and
check_signalx_detection covers the undetected query and the post-
detection shifted path.
shdann's report on #2490: on a device whose queue layout is still
undetected, the first SignalX at slot 25 answered S_OK without
signalling — the fence never completes and a title waiting on that
value hangs. The Signal/Wait detection at slots 16/17 only helps a
title that calls them; one that signals exclusively through SignalX
(the console-native path) would lose every signal, not just the first.
Per the measured table (docs/d3d12_xs_console_abi.md §4) the
fence-first queue methods are Signal/Wait/SignalX only, so a proxy
fence arriving at slot 25 while the layout is fully unknown is the
newer layout's SignalX: mark the shared detection newer and forward it
as Signal. A proven-older device still leaves slot 25 to the
console-only no-op, and a fence at slot 23 forwards without pinning so
a newer title's own SignalX detection stays open.
The mock's new check_signalx_detection covers the lost-signal repro
(hr=0 calls=0 on the first SignalX), detection inheritance on a second
queue, the proven-older no-op at 25 and the non-pinning forward at 23.
Written with AI assistance (Devin). Verified with the clang-cl/xwin
cross-build under Wine: xs_proxy_mock_test PASS, loader_test 87/0.
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
SOSetTargets (console 49) carries BufferLocation and
BufferFilledSizeLocation, both GPU VAs; both now translate through the
upload arena in the proxy's scratch copy.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
IASetIndexBuffer (console 47) and IASetVertexBuffers (console 48) carry
GPU VAs inside their view structs rather than in an argument word. The
list proxy now rewrites BufferLocation through upload_translate on a
copy — a stack copy for the index view, a scratch array on the proxy
for the vertex views — so a pointer AllocateUploadMemory handed out is
usable for index and vertex data the same way a root descriptor is.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Console list slot 148 carves from a bump arena of persistently-mapped
UPLOAD-heap buffers, so the pointer a title writes is the same memory
the GPU samples. The six root descriptor setters (console 41-46)
translate an arena address to the chunk's buffer device address before
forwarding; other VAs pass through. A device that cannot hand out a
mapped buffer falls back to private memory so the call still returns
something writable.
The mock test now models command lists end to end: creation unwraps
the allocator proxy, the console body exposes the pinned cursor,
console-only slots are recorded without forwarding, slot 148 hands out
aligned arena pointers and slot 43/146 reach the real list.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Queue slots 30 (older layout) and 32 (newer) are the measured PresentX
entry points, with SignalX at 23/25. The queue proxy now detects which
of the two documented console layouts a title uses — a fence reaching
slot 16/17 marks the newer layout — forwards SignalX as PC Signal, and
lazily builds the windowed presentation core for PresentX under
LEONIDA_VULKAN_DEVICE.
Unmodelled console-only queue methods answer S_OK instead of E_NOTIMPL
because frame pacing flows through them; they are still never forwarded.
The mock test now asserts that contract.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Device slot 9 (CreateCommandAllocator) now returns an allocator proxy,
the fourth command object after the queue and fence (BUILD-231) and the
list (D3D-136): the public chain (9 slots, Reset at 8) is forwarded, a
slot past it up to the end of a 64-slot table is logged and refused with
E_NOTIMPL, and a read past the table faults in its own guard region. The
console allocator's extra methods are not measured and not guessed.
A list takes the title's allocator in CreateCommandList and Reset, so a
proxy is only safe where the list side resolves it. Slot 9 therefore
wraps an allocator only when it answers kLeonidaCommandAllocatorTag (the
Vulkan layer's CommandAllocator, whose from() resolves the proxy for both
calls); a PC runtime allocator is handed out unchanged, logged once,
until a command-list proxy unwraps it at Reset. Allocator proxies are
unwrapped in the residency calls like heap, queue and fence proxies.
Device slot 12 is not touched.
Tests: allocator_proxy_test (WARP, a hardware adapter, the Vulkan device:
forwarding, refused tail, guard region, identity, D3D12's allocator rules,
a list created and Reset on the proxy with GPU copies through the queue
and fence proxies read back), mock cases for allocators with and without
the tag and their failure paths, and device_proxy_test's slot-9
expectations. No game files.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Device slots 8 (CreateCommandQueue), 75 (CreateCommandQueue1), 36
(CreateFence) and 32 (OpenSharedHandle of a fence) now return queue and
fence proxies. They forward the public chain in PC order (19 queue slots,
11 or 12 fence slots), refuse and log a slot past it up to the end of the
proxy's table, and name a read past the table through a guard region and
a vectored handler.
Heap, queue and fence proxies are unwrapped wherever a device or queue
method hands them to the real runtime: queue Signal/Wait, device slots
31/34/35/45/46/50. Arrays are copied without exceptions. QueryInterface
answers only the modelled interfaces, and logs one the real object has
but the proxy does not model. Outputs are cleared on failure as for
slots 14/62/76. --trace-d3d12 records proxy calls in the README grammar.
Every function a thunk hands its words to keeps them in the same
positions, because a title passes only as many as the method takes.
Tests: queue_proxy_test (host WARP, host hardware, Vulkan device;
differential per-process error cases, guard faults, identity, threads,
raw-slot client, child-runner self-test), xs_proxy_mock_test (older
devices, fences without Fence1, OpenSharedHandle branches, allocation
failures; three guard-setup fault modes), and device_proxy_test through
the D3D12XboxCreateDevice shim. No game files.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>