Repository navigation
d3d12_xs: the title's queue slots 16 and 17 with a fence are Signal and Wait (RT-QUEUE-SIGNAL) - #430
Merged
Conversation
This was referenced Nov 24, 2026
demoz53
added a commit
to demoz53/leonida
that referenced
this pull request
Nov 24, 2026
…stack Contains ProjectLeonida#375 ProjectLeonida#377 ProjectLeonida#383 ProjectLeonida#385 ProjectLeonida#391 ProjectLeonida#395 ProjectLeonida#396 ProjectLeonida#403 ProjectLeonida#414 ProjectLeonida#416 ProjectLeonida#427 ProjectLeonida#430 ProjectLeonida#432. # Conflicts: # runtime/shims/d3d12_com.cpp # runtime/shims/d3d12_vulkan_device.cpp # runtime/src/command_list.h
…ntation core The retail title presents through command-queue slot 32, past the PC queue's 19 slots, so main refused it with E_NOTIMPL and nothing could be shown. The slot now calls XboxPresentation::PresentX (xbox_present.h) with the title's plane count, planes and parameters. The first call on a device builds a window and the Vulkan layer's presenter for it, once; a device that cannot present answers S_OK and shows nothing, so the title's frame loop runs either way. The mock and COM builds of this file have no presenter and answer S_OK. The wiring follows old PR 2490's (Nolan Cotter, 2be25ce), written again for main's queue proxy, where that commit does not apply. Not carried over: the queue layout detection (the older layout has PresentX at slot 30) and presenting into the title's own window (old PR 8591); the window here is one this layer creates. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
…oken source Device slot 80 (WaitFrameEventX, from #6935) numbered its tokens with a counter of its own, while XboxPresentation's pacer refuses any token above the ones it issued itself. A title that waits through the device and presents through the device's XboxPresentation therefore had every PresentX refused with E_INVALIDARG once its tokens ran ahead of the pacer's. leonida::FrameTokenSource is now the counter both use: a pacer takes an optional shared source (a standalone pacer still owns its own and numbers as before), the device proxy owns one and exposes it through rt::d3d12_xs::device_frame_tokens, and XboxPresentation passes a given source to its pacer. A token that was never issued is still refused. Reported by rafaelpssz in #7496. (cherry picked from commit afb14d5) Adapted to main by Mumogg: main's uncapped pacer path issues its token from the shared source too, the device proxy keeps the PresentX state next to the token source, and the queue's PresentX hands the device's source to its XboxPresentation, which is what makes the title's tokens valid there.
The coverage gate asks for every queue slot to have been called, and skips the overridden ones in its sweep of
the refused tail. Slot 32 is overridden since the PresentX wiring, so nothing called it and the gate failed
("queue slot 32 never called"). The test now calls it where it calls the console ExecuteCommandLists slot: this
build of the proxy has no presenter, so the answer is S_OK.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
…s (console list slots 50 to 54) Device slots 17 to 24 translate a CPU descriptor handle in the title's own range (__XMemAllocationHooks__) to the real heap's. The five command-list methods that take such handles did not: OMSetRenderTargets (console slot 50), ClearDepthStencilView (51), ClearRenderTargetView (52) and the two ClearUnorderedAccessView (53, 54) went to the real list with the title's address, which is no descriptor there. On the retail boot the first ClearRenderTargetView made the list's Close fail. They translate now, in copies: the caller's arrays are not written, and a handle outside the range is passed as it is. Slot 51 gets a typed thunk, because its depth is a FLOAT in XMM3, which the all-integer list thunk loses. This is 0aba6c3 (LeonidaBringup) written again for main's list proxy, where that commit does not apply (it sits on old PR 2490's list proxy). xs_proxy_mock_test: the five slots with a handle inside the range, one outside it, and the caller's arrays unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
…zed and created without it (stand-in) The console allows ALLOW_DEPTH_STENCIL | ALLOW_UNORDERED_ACCESS on a texture; the PC runtime refuses the pair and slot 25 answered UINT64_MAX for it. pc_resource_flags drops the UAV bit from depth-stencil textures (slot 25 through pc_resource_desc, and slot 76). Their UAV views then write no descriptor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 4a86034) Adapted to main by Mumogg: the conflict is with b4d1ba1, which is applied before it here: slot 25 keeps that commit's scoped cleaning, and this one adds the flag rule and its log line.
…nd Wait Queue slots 16 and 17 are GetTimestampFrequency(UINT64*) and GetClockCalibration(UINT64*, UINT64*) on the PC: both write through their first argument. The retail title calls slot 16 with one of its fences and a value, the shape of Signal(fence, value). On the console queue Signal and Wait sit two later than on the PC, at 16 and 17, as the frequency getter does at 18. Forwarded by number, the call wrote the frequency over the first word of the fence proxy, its vtable pointer; the title's next call on that fence went through a null pointer. The title's call (set_console_caller) whose first argument is a fence proxy now goes to the PC Signal or Wait with the real fence. A host caller keeps the PC getters, and so does a title call whose first argument is no object of this proxy, which cannot be a Signal. Same family as the slot 18 change: the console queue order of old PR 2490 (Nolan Cotter), as one rule for main's queue proxy. xs_proxy_mock_test: both slots with a fence reach the mock queue's slots 14 and 15 with the real fence, the fence proxy's first word is unchanged, and the non-fence and host calls reach slot 16. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
Mumogg
force-pushed
the
queue-slots16-17-signal
branch
from
November 24, 2026 09:54
feabc36 to
028a414
Compare
Contributor
|
Independent native Windows check of RT-QUEUE-SIGNAL. Windows 10 22H2 (19045), MSVC 19.51.36256, Windows SDK 10.0.26100, Ninja Release, RTX 5070 / NVIDIA 610.88.
Synthetic data only; no game files or retail boot. AI-assisted (Codex). |
This was referenced Nov 24, 2026
Everything below this rung (ProjectLeonida#414, ProjectLeonida#416, ProjectLeonida#427) and the rung's own routing are in main already, through ProjectLeonida#984 and ProjectLeonida#939, in main's form; what is left of ProjectLeonida#430 is its test of queue slot 17, ported onto main's layout detection. Conflicts, all resolved to main's form: - runtime/shims/d3d12_xs_device.cpp: main's queue slot 16/17 rule (a fence there is the newer layout's Signal/Wait, for any caller) replaces the rung's caller-gated rule; main's PresentX routing (slot 30, or 32 once the newer layout is detected, LEONIDA_XS_PRESENT_X_SLOT) and lazily built presenter replace the fixed slot 32 of ProjectLeonida#414; main's list proxy already translates the CPU handles of console list slots 50 to 54 (ProjectLeonida#416) and drops unordered access from a depth-stencil texture at slot 76 (ProjectLeonida#427). - runtime/shims/d3d12_xs_device.h, runtime/shims/xbox_present.cpp, runtime/shims/xbox_present.h, runtime/src/frame_pacer.h: main's shared FrameTokenSource (Logan's piece of ProjectLeonida#414, as ProjectLeonida#984 carried it). - runtime/shims/d3d12_xs_desc_clean.h, runtime/test/device_proxy_test.cpp: main's without_depth_stencil_uav and its slot 25/76 test (ProjectLeonida#427). - runtime/test/xs_proxy_mock_test.cpp: main's file, which already has check_list_cpu_handles (ProjectLeonida#416's cases and more); the rung's slot 16/17 case is ported to main's form at the end of check_xbox_queue_slots: slot 16 and 17 with a fence reach PC Signal and Wait with the real fence, not the PC getters, and the fence proxy's vtable pointer is unchanged. The rung's host-caller and no-fence expectations are dropped: under main's rule a fence at 16 proves the newer layout, after which those calls answer S_OK. Auto-merged, then set to main's content: - runtime/test/queue_proxy_test.cpp: ProjectLeonida#414's call of queue slot 32 as an overridden slot; on main slot 32 is routed only on the newer layout and the sweep of the console tail already calls it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
Merged, after merging
AI-assisted (Claude Code, Claude Opus 5.5). |
This was referenced Nov 25, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in #14 as
RT-QUEUE-SIGNAL. Depends on: the stack up to #427 (their commits come first here; this pull request is the last commit). The change is in the queue proxy and its test, next to #403's.What and why
The same kind of bug as #403, one slot over.
Queue slots 16 and 17 are
GetTimestampFrequency(UINT64*)andGetClockCalibration(UINT64*, UINT64*)on the PC; both write through their first argument. The retail title calls queue slot 16 with one of its fences and a value: the shape ofSignal(fence, value). On the console queueSignalandWaitsit two later than on the PC, at 16 and 17, as the frequency getter does at 18.mainforwarded the call by number, so the PC frequency getter wrote the frequency over the first 8 bytes of the fence proxy: its vtable pointer. The title's next call on that fence then went through a null pointer.How I found it: at the fault the register that should hold the fence's vtable held 1,000,000,000, the frequency the layer answers; and the object the title was calling was a queue/fence/allocator proxy at an address I had logged.
The change: the title's call (
set_console_caller) whose first argument is a fence proxy goes to the PCSignalorWaitwith the real fence. A host caller keeps the PC getters, and so does a title call whose first argument is no object of this proxy, which cannot be aSignal.Written by me. The slot order is the console queue's of old PR 2490 (Nolan Cotter), which detects the layout at run time; this is one rule for
main's queue proxy.Measured
Linux (Nobara 44, kernel 7.3), Wine 11.21 staging, RTX 5070 Ti (driver 615.78.08), clang-cl 22.1.8 + xwin SDK 10.0.26100, own 1.0.2.1 copy, network off, on
mainece4ba5b3, with #142, #219, #328, #387 and #428 applied on top for the boot runs (they are not in this branch).--runXboxID3D12Fence::Slot12 unsupported, then the title writes through a null pointerBoth runs create 50,450 pipeline states. The next stop is fence slot 12, a console method one past
ID3D12Fence1that returns a pointer the title reads; refused, the title dereferences the error code.5ac4deaa2(TreXito) is the piece for it and I will try it next.Tests under Wine:
xs_proxy_mock_testpasses with the new case (both slots with a fence reach the mock queue's slots 14 and 15 with the real fence; the fence proxy's first word is unchanged; the non-fence call and the host call reach slot 16).queue_proxy_testpasses on the Vulkan backend.Not built with MSVC and not run on Windows.
AI-assisted (Claude Code); built and run on the machine above.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt