d3d12_xs: the queue's slot 32 is PresentX, wired to the presentation core with a shared token source (RT-PRESENTX) #414

Manually merged
github merged 27 commits from gh-pr/414/head into gh-pr/414/base 2026-11-26 08:58:50 +00:00
Owner

@⁠Mumogg on GitHub · 2026-11-24 04:51 UTC · original
Mumogg:presentx-queue-slot32 → main · +2257 −123 · 23 files · 27 commits · merged 2026-11-25 03:46 UTC

Claimed in #14 as RT-PRESENTX. Depends on: the stack up to #403 (their commits come first here; this pull request is the last two commits).

What and why

After #403 the retail title reaches its first present: command-queue slot 32, PresentX(plane count, planes, parameters). It is past the PC queue's 19 slots, so main refuses it and nothing can be shown, although main already has the call's implementation (XboxPresentation, xbox_present.h).

Two commits:

  1. Mine: queue slot 32 calls XboxPresentation::PresentX. The first call on a device builds a window and the Vulkan layer's presenter for it, once, and the state dies with the device proxy. A device that cannot present answers S_OK and shows nothing, so the frame loop runs either way; the mock and COM builds of the file have no presenter and answer S_OK. It follows old PR 2490's wiring (Nolan Cotter, 2be25cee2), written again for main's queue proxy, where that commit does not apply.
  2. afb14d56c by Logan (-x, authorship kept; an ancestor of main whose content is not in the tree): device slot 80 (WaitFrameEventX) and the presentation's pacer share one FrameTokenSource. Without it the title waits through the device, gets tokens from the device's own counter and presents them to a pacer that never issued them. Adapted to main: the uncapped pacer path issues from the shared source too, and the queue's PresentX hands the device's source to its XboxPresentation.

Left out on purpose:

  • The older console queue layout, which has PresentX at slot 30. Only slot 32 is measured on this title.
  • Presenting into the title's own window (old PR 8591). The window here is one this layer creates; that is an assumption marked in the code.

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 main ece4ba5b3, with #142, #219, #328 and #387 applied on top for the boot runs (they are not in this branch).

--run The present call in the trace
up to #403 XboxID3D12CommandQueue::Slot32 unsupported
+ commit 1 only PresentX ready (window ...), then XboxPresentation::PresentX failed
+ commit 2, and the list fix of the next pull request XboxPresentation::PresentX ok

The last row is the first successful present on this path. Two honest limits on it:

  • I have it in one of two runs. In the other, an int3 of the title on a worker thread came first; that stop is there in every run now and is a race with the present, not caused by it. I have not looked at it yet.
  • I did not get a run with commit 2 and without the next pull request's list fix that reached the present, for the same reason, so the table's last row has both.

I have not looked at what is on screen. At this point of the boot the integration branch (#321) shows a black frame.

Tests under Wine: xs_proxy_mock_test passes; frame_pacer_test exits 0; xbox_present_test: all cases pass (both have the cases that came with afb14d56c).

Not built with MSVC and not run on Windows. device_proxy_test gets a case from afb14d56c that I cannot run here.

AI-assisted (Claude Code); built and run on the machine above.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt

**@⁠Mumogg** on GitHub · 2026-11-24 04:51 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/414) `Mumogg:presentx-queue-slot32` → `main` · +2257 −123 · 23 files · 27 commits · merged 2026-11-25 03:46 UTC Claimed in #14 as `RT-PRESENTX`. Depends on: the stack up to #403 (their commits come first here; this pull request is the last two commits). ### What and why After #403 the retail title reaches its first present: command-queue slot 32, `PresentX(plane count, planes, parameters)`. It is past the PC queue's 19 slots, so `main` refuses it and nothing can be shown, although `main` already has the call's implementation (`XboxPresentation`, `xbox_present.h`). Two commits: 1. **Mine**: queue slot 32 calls `XboxPresentation::PresentX`. The first call on a device builds a window and the Vulkan layer's presenter for it, once, and the state dies with the device proxy. A device that cannot present answers `S_OK` and shows nothing, so the frame loop runs either way; the mock and COM builds of the file have no presenter and answer `S_OK`. It follows old PR 2490's wiring (Nolan Cotter, `2be25cee2`), written again for `main`'s queue proxy, where that commit does not apply. 2. **`afb14d56c` by Logan** (`-x`, authorship kept; an ancestor of `main` whose content is not in the tree): device slot 80 (`WaitFrameEventX`) and the presentation's pacer share one `FrameTokenSource`. Without it the title waits through the device, gets tokens from the device's own counter and presents them to a pacer that never issued them. Adapted to `main`: the uncapped pacer path issues from the shared source too, and the queue's PresentX hands the device's source to its `XboxPresentation`. Left out on purpose: - The older console queue layout, which has PresentX at slot 30. Only slot 32 is measured on this title. - Presenting into the title's own window (old PR 8591). The window here is one this layer creates; that is an **assumption** marked in the code. ### 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 `main` `ece4ba5b3`, with #142, #219, #328 and #387 applied on top for the boot runs (they are not in this branch). | `--run` | The present call in the trace | |---|---| | up to #403 | `XboxID3D12CommandQueue::Slot32 unsupported` | | + commit 1 only | `PresentX ready (window ...)`, then `XboxPresentation::PresentX failed` | | + commit 2, and the list fix of the next pull request | `XboxPresentation::PresentX ok` | The last row is the first successful present on this path. Two honest limits on it: - I have it in one of two runs. In the other, an `int3` of the title on a worker thread came first; that stop is there in every run now and is a race with the present, not caused by it. I have not looked at it yet. - I did not get a run with commit 2 and without the next pull request's list fix that reached the present, for the same reason, so the table's last row has both. I have not looked at what is on screen. At this point of the boot the integration branch (#321) shows a black frame. Tests under Wine: `xs_proxy_mock_test` passes; `frame_pacer_test` exits 0; `xbox_present_test`: all cases pass (both have the cases that came with `afb14d56c`). Not built with MSVC and not run on Windows. `device_proxy_test` gets a case from `afb14d56c` that I cannot run here. AI-assisted (Claude Code); built and run on the machine above. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
(cherry picked from commit 355201c51e)
The retail title asserts when its first full-screen render targets leave more than 2 MiB of a fixed budget unused (docs/retail_boot_chain.md, #6982). The PC size is about width x height x element bytes; the console takes whole RDNA2 SW_64KB tiles. Slot 25 adds the difference per render target description and never lowers a size. Depends on #6973.

(cherry picked from commit 8897855399)
The title's descriptions carry the Xbox layout word and flag bits above the PC ones. Slot 25 now passes a copy with PC flags and a PC layout; the title's array is not written. Depends on #7078.

(cherry picked from commit c7ca0f2d1c)
(cherry picked from commit 359390833f)
On the console a committed resource's memory is allocated with XMemAlloc, so it goes
through the title's __XMemAllocationHooks__. The retail title budgets its first
full-screen render targets with a per-thread hook that bump-allocates out of a range it
reserved and asserts that less than 2 MiB is left; PC resources never allocated through
the hooks, so the assert always fired. Slots 76 and 127 now allocate the slot-25 size of
each resource through the hooks, held by the resource with SetPrivateDataInterface and
freed when it is destroyed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit ae322dafc5)

Adapted to main by Mumogg: the lease size is the later form of this series (d61755d4d, a render target's console
tile size, else the PC size), since console_render_target_extra is gone after 359390833.
(cherry picked from commit b4d1ba1794)
Reported by YaBulochka and sovljanskii on #7154; #7110's current head has the same form.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit bee47186f6)
With the console tile sizes applied to every caller, a PC-form call through the proxy no longer answered what the
PC device answers, and the code that compares the two failed on Windows: device_proxy_test's two slot 25 checks
and d3d12_vulkan_device_test's allocation_mismatches (reported on #375 from MSVC builds on AMD and NVIDIA, the
first bad commit being the one that cleans the descriptions). Together with b4d1ba179, which scopes the cleaning
the same way, a PC-form caller now gets the PC device's own answer for its own description; the title's call,
which comes in the console form, gets the cleaned description and the console sizes as before.

xs_proxy_mock_test: the PC-form slot 25 case expects the mock device's size (it expected the console size), and
the mixed slot 56 case is asked in the console form. device_proxy_test includes d3d12_xs_desc_clean.h for the
cleaned description b4d1ba179's check compares with.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
A heap that main's console-extended handler created already sits at the address the title named, so
proxy_create_descriptor_heap asks the title's XMem hooks for a backing address only when the heap came from a
plain PC description (follow-up asked for in review on #375).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
The retail title creates five one-argument command signatures with no root
signature at startup (device slot 41, CreateCommandSignature at its PC
position). One has the console argument type 105 and a 12-byte stride, next
to a DISPATCH and a DISPATCH_MESH of 12 bytes. The PC layer refuses the
unknown type, which is stop 19 of the RT-5 boot measurements.

Read statically from the title's call sites (shapes only): the two
ExecuteIndirect sites of that signature pass MaxCommandCount 1 and an offset
into the same argument buffer as the DISPATCH sites. Right before, they set
the same compute state as the DISPATCH path (pipeline, compute root signature,
tables, constants, SRV and UAV); they record on a second command list of the
title's context. So the argument is taken as a D3D12_DISPATCH_ARGUMENTS.

Slot 41 now has its own handler. A description that holds type 105 is copied
with that type replaced by DISPATCH (logged once). Any other description is
forwarded as the same pointer. What the console does differently for type 105
is left open in docs/d3d12_vulkan.md (section 4.9).

xs_proxy_mock_test: a two-argument description (a root constant, then type
105) reaches the PC slot 41 as a copy with DISPATCH, the same stride, count,
root signature, IID and output, and the caller's description is untouched; a
PC description is passed through unchanged. With main's d3d12_xs_device.cpp
the new check fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 4c04c0f4e3)
105 is outside D3D12_INDIRECT_ARGUMENT_TYPE's range [0, 15], so clang-cl
rejects a constant expression that casts it to the enum (reported by
umnitus on #7163). The handler now reads each argument's Type field as a
uint32_t through memcpy and compares it with 105; the test writes and reads
the raw value the same way, and the mock records it the same way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 084c8c60e7)
The Vulkan layer created signatures for draw, draw-indexed and dispatch only and answered E_NOTIMPL
for DISPATCH_MESH, which the PC runtime creates on any mesh-shader tier 1 device. A title that
creates such a signature at startup and asserts on the result stopped there.

The signature is created when the device has VK_EXT_mesh_shader (MeshShaderTier 1), as a new
IndirectKind::dispatch_mesh (the name and value #3777 uses, so the two merge). ExecuteIndirect with
it records nothing yet and says so once; #3777 replays it as vkCmdDrawMeshTasksIndirectEXT.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit efc347830b)
Resolving the cherry-pick of efc347830 I dropped main's record-size, stride and span checks (e1ec785b2), which
d3d12_execute_indirect_validation_test depends on and which matter to every D3D12 user (found in review on
#377). They are back as on main, the record-size chain knows D3D12_DISPATCH_MESH_ARGUMENTS, and the early
return for a DISPATCH_MESH signature comes after the checks.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
The retail title calls device slot 61 as CreateSamplerX(desc, dest handle), once
per sampler, after its descriptor heaps exist (stop 20 of the RT-5 boot
measurements in the coordination issue). The generic thunk forwarded it to the
PC slot 61, which is CreateMetaCommand, so the sampler was never written.

Slot 61 now has its own handler, like 62 and 67. It passes the description's
PC D3D12_SAMPLER_DESC prefix and the handle to the PC CreateSampler (slot 22).
That was enough to get the title past this call under Wine. Whatever follows
the prefix in the console description is not known and is not read. A null
description is skipped and logged once. A handle in the title's own heap range
is #7021's translation.

xs_proxy_mock_test: slot 61 reaches the mock's slot 22 with the same two words
and never its slot 61; a null description reaches nothing. With main's
d3d12_xs_device.cpp the new check fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit e22994464b)
The proxy also serves host callers: d3d12_vulkan_device_test drives the Vulkan device through it,
and its ID3D12Device5::CreateMetaCommand call (PC slot 61) landed in proxy_create_sampler_x
(found by nullmarsh on #7115: the test stopped at line 5763 instead of main's known line 6574).

Slot 61 now checks the caller's return address with a classifier the runtime installs
(set_console_caller, the name #7490 uses): D3D12XboxCreateDevice installs
rt::shims::mapped_image_base, so only a caller in an image the guest loader mapped gets
CreateSamplerX. Any other caller, and every caller when no classifier is installed, is forwarded
to the PC slot 61.

xs_proxy_mock_test checks all three cases: no classifier (PC slot 61), a guest caller (PC
CreateSampler with the same words; a null description skipped) and a host caller under an
installed classifier (PC slot 61). d3d12_vulkan_device_test again stops at line 6574, as on main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 8f756ebe048af042638ce51a61490f35f4f44ee3)
(cherry picked from commit c915e1da45)
Slot 61 passed the destination handle to the PC CreateSampler as given. With the title's descriptor range
honoured (__XMemAllocationHooks__), a handle in that range has to be translated to the real heap's, as device
slots 17 to 24 do (asked for in review on #377).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
The retail title calls slot 74 once; the PC slot 74 reads the first pointer as kinds and returns E_INVALIDARG, so the title hits an int3. The proxy handler does not call the PC device, writes nothing, logs the three words once, and yields to an env slot override that moves a route onto 74.

(cherry picked from commit cdeee35aa8)

Adapted to main by Mumogg: the queue route inside route_xbox_device_slot calls proxy_create_command_queue_xbox
(the 32-byte description of 0cde63d61), as the inline route did before this commit moved the routes into a
function.
The stand-in also took a host's ID3D12Device9::ShaderCacheControl call through the proxy and answered S_OK
without reaching the device (found on native Windows by BadgersMC in the review of this change). Slot 74 now
asks the caller classifier slot 61 uses (set_console_caller): a caller in an image the guest loader mapped gets
the stand-in, any other caller, and every caller when no classifier is installed, is forwarded to the PC slot 74
or refused past the PC device's table.

xs_proxy_mock_test: the guest case under a classifier, and the host case with a classifier and with none, on a
device that has ShaderCacheControl and on one that does not.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
Asked for in review on #377.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
(cherry picked from commit e925b63455)

Adapted to main by Mumogg: main has command-list proxies, so the shared execute function replaces them by their
real lists in a copy of the array (UnwrappedArray), for the console slot 35 as for the PC slot 10, whose test
failed otherwise. The slot 35 mock case passes two mock lists instead of two numbers and checks that they arrive
and that the caller's array is not written.
(cherry picked from commit e29e989980)
Asked for in review on #377.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
The retail title resets its command lists through list slot 139, with (allocator proxy, pipeline state). main's
slot map had no entry for it, so the call was recorded and dropped and the list stayed closed. The map sends it
to the PC slot 10, and the unwrap keys on the PC slot, so console slot 10 and console slot 139 both hand the real
list its real allocator (and a wrapped pipeline state the same way) and re-pin the inline cursor.

The mapping and the unwrap rule are those of ef9d0759d (Nolan Cotter; measured by Pipodi), written again for
main's list proxy, where that commit does not apply. xs_proxy_mock_test checks the map entry and a slot 139 call.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
Queue slot 18 is ID3D12CommandQueue::GetDesc on the PC: a struct return that writes a 16-byte description through
the hidden pointer. The retail title calls slot 18 with one pointer to 8 bytes, the shape of
GetTimestampFrequency(UINT64*), which the console queue has there (two methods are inserted at 14/15, so the PC
slots 16 to 18 sit two later). Forwarded as GetDesc, the call wrote a description over the title's 8 bytes and
what follows them; the title then went wrong a little later, after its first submission.

The title's call (set_console_caller, as device slots 61 and 74) now goes to the PC slot 16. A host caller, and
every caller when no classifier is installed, keeps the PC GetDesc.

The reading of slot 18 is that of the console queue work in old PR 2490 (Nolan Cotter), which answers an
undetected slot 18 as the frequency getter because it is the only reading that cannot overrun its argument. That
work's layout detection does not apply to main's queue proxy; this is the one rule the boot needs, written for
it. xs_proxy_mock_test: the guest call reaches the mock queue's slot 16 with its pointer and leaves the words
around it; a host call, with a classifier and with none, reaches slot 18.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
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, 2be25cee2), 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 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
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 afb14d56c6)

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 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:58:49 +00:00
github manually merged commit 77c801c82f into gh-pr/414/base 2026-11-26 08:58:50 +00:00
Author
Owner

@⁠Mumogg on GitHub · 2026-11-24 05:04 UTC · original

A correction to my own pull request: the PresentX wiring broke queue_proxy_test, which I had not run on it. Its 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 now, so nothing called it and the gate failed with queue slot 32 never called.

Fixed with one more commit on this branch: the test calls slot 32 where it calls the console ExecuteCommandLists slot (that build of the proxy has no presenter, so the answer is S_OK). queue_proxy_test passes under Wine again on the Vulkan backend. #416 is rebased onto it.

AI-assisted.

**@⁠Mumogg** on GitHub · 2026-11-24 05:04 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/414#issuecomment-7122597227) A correction to my own pull request: the PresentX wiring broke `queue_proxy_test`, which I had not run on it. Its 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 now, so nothing called it and the gate failed with `queue slot 32 never called`. Fixed with one more commit on this branch: the test calls slot 32 where it calls the console `ExecuteCommandLists` slot (that build of the proxy has no presenter, so the answer is `S_OK`). `queue_proxy_test` passes under Wine again on the Vulkan backend. #416 is rebased onto it. AI-assisted.
Author
Owner

@⁠sodove on GitHub · 2026-11-24 06:02 UTC · original

checked: independent native Windows verification of the exact #414 head 11d44eee9f. Windows 11 x64 build 26100, MSVC 19.44.35220, SDK 10.0.26100, Release, RTX 5070 Ti / NVIDIA 610.74, Vulkan loader 1.4.341.

  • Stock frame_pacer, xbox_present, queue_proxy and xs_proxy_mock passed. The new slot-80 token checks also passed in device_proxy and device_proxy_trace. Both modes failed the same two slot-25 allocation-info assertions (C ABI and PC form) on this head and on e7044cb9b immediately before the PresentX changes. The HDR10 swapchain subcase skipped on this display.
  • An extension of xbox_present_test exercised the queue slot with the runtime Vulkan path compiled in and counted successful vkQueuePresentKHR calls. In 3/3 runs a token issued via device slot 80 before the first PresentX reached Vulkan exactly once. The lazy window was visible and owned by the test process. The next, still unissued token returned E_INVALIDARG with zero additional presents. Slot 80 then issued that token and the second present reached Vulkan on the same window.
  • A control build gave the lazy presenter a separate token source. The first issued token then returned E_INVALIDARG, with zero Vulkan presents.

Synthetic fixtures only. AI-assisted verification.

**@⁠sodove** on GitHub · 2026-11-24 06:02 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/414#issuecomment-7123517467) checked: independent native Windows verification of the exact #414 head 11d44eee9f00c2c1273240ad2220ddf14c5a8a1d. Windows 11 x64 build 26100, MSVC 19.44.35220, SDK 10.0.26100, Release, RTX 5070 Ti / NVIDIA 610.74, Vulkan loader 1.4.341. - Stock frame_pacer, xbox_present, queue_proxy and xs_proxy_mock passed. The new slot-80 token checks also passed in device_proxy and device_proxy_trace. Both modes failed the same two slot-25 allocation-info assertions (C ABI and PC form) on this head and on e7044cb9b immediately before the PresentX changes. The HDR10 swapchain subcase skipped on this display. - An extension of xbox_present_test exercised the queue slot with the runtime Vulkan path compiled in and counted successful vkQueuePresentKHR calls. In 3/3 runs a token issued via device slot 80 before the first PresentX reached Vulkan exactly once. The lazy window was visible and owned by the test process. The next, still unissued token returned E_INVALIDARG with zero additional presents. Slot 80 then issued that token and the second present reached Vulkan on the same window. - A control build gave the lazy presenter a separate token source. The first issued token then returned E_INVALIDARG, with zero Vulkan presents. Synthetic fixtures only. AI-assisted verification.
Author
Owner

@⁠towade on GitHub · 2026-11-24 15:25 UTC · original

@⁠Mumogg, a retail data point and two integration notes for this PR on current main (d0da7dade, which now has #402). RX 9070 XT, own 1.0.2.1 copy, with #511 and the other open boot pull requests below it (ladder on #14). Counts only.

  • Without this PR, the run ends right after queue slot 32 answers unsupported: main has #402's routing, but nothing calls attach_xbox_presentation outside the tests. With 8ba15dd44 and 77c801c82 on top, PresentX ready is logged, and the title's 8 PresentX calls reach XboxPresentation::PresentX.
  • All 8 fail without your token commit af8c42bb1. The title passes tokens from the device-side WaitFrameEventX, which the presentation's pacer never issued, so check_present_token refuses them. af8c42bb1 does not apply to main, because #402 rewrote frame_pacer.h (per-event ticks, issue_token_locked), so it needs adapting rather than a rebase. With a local-only change that lets such tokens through, all PresentX calls return ok and no ExecuteCommandLists fails.
  • On the combination, xs_proxy_mock and xs_proxy_mock_env_slots fail (lines 2776 and 1582 of the combined tree). Both are #402's tests: they expect raw(queue, 32) to be E_NOTIMPL while PresentX is routed to slot 30 or an env slot. Here slot 32 is fixed. Going through #402's handler, with its PresentX default at 32, might settle both.

Not run: your branch as is (it conflicts with main in d3d12_xs_device.cpp, .h and frame_pacer.h), and anything past the next stop: the title's own int3, which this PR doesn't change.

AI-assisted (Claude Code).

**@⁠towade** on GitHub · 2026-11-24 15:25 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/414#issuecomment-7136007615) @⁠Mumogg, a retail data point and two integration notes for this PR on current `main` (`d0da7dade`, which now has #402). RX 9070 XT, own 1.0.2.1 copy, with #511 and the other open boot pull requests below it (ladder on #14). Counts only. - Without this PR, the run ends right after queue slot 32 answers unsupported: `main` has #402's routing, but nothing calls `attach_xbox_presentation` outside the tests. With `8ba15dd44` and `77c801c82` on top, `PresentX ready` is logged, and the title's 8 `PresentX` calls reach `XboxPresentation::PresentX`. - **All 8 fail without your token commit `af8c42bb1`.** The title passes tokens from the device-side `WaitFrameEventX`, which the presentation's pacer never issued, so `check_present_token` refuses them. `af8c42bb1` does not apply to `main`, because #402 rewrote `frame_pacer.h` (per-event ticks, `issue_token_locked`), so it needs adapting rather than a rebase. With a local-only change that lets such tokens through, all `PresentX` calls return `ok` and no `ExecuteCommandLists` fails. - On the combination, `xs_proxy_mock` and `xs_proxy_mock_env_slots` fail (lines 2776 and 1582 of the combined tree). Both are #402's tests: they expect `raw(queue, 32)` to be `E_NOTIMPL` while `PresentX` is routed to slot 30 or an env slot. Here slot 32 is fixed. Going through #402's handler, with its `PresentX` default at 32, might settle both. Not run: your branch as is (it conflicts with `main` in `d3d12_xs_device.cpp`, `.h` and `frame_pacer.h`), and anything past the next stop: the title's own `int3`, which this PR doesn't change. AI-assisted (Claude Code).
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 01:01 UTC · original

@⁠aslan2142 @⁠Mumogg: #414 is the next rung after #403, and it needs more than a merge now that #402 is in. PresentX has to go through #402's handler at slot 32, a presenter has to be created, and the token source has to be shared. Mumogg has been away since ~10:24Z.

If it helps, I can carry the adaptation onto current main as a separate PR. I'd keep Mumogg's commits 8ba15dd44 and 77c801c82 with their authorship, re-implement Logan's frame-pacer piece over #402's rewritten frame_pacer.h with a Co-authored-by, and update the two #402 tests that expect slot 32 to be E_NOTIMPL. It would be tested on Windows 11 / MSVC / RTX 4070 SUPER with xs_proxy_mock, queue_proxy, frame_pacer and xbox_present (no game files). It's about 200 lines.

I'll only do it if you want it, since #984's merge may make it redundant. Just say so here.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 01:01 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/414#issuecomment-7149135870) @⁠aslan2142 @⁠Mumogg: #414 is the next rung after #403, and it needs more than a merge now that #402 is in. PresentX has to go through #402's handler at slot 32, a presenter has to be created, and the token source has to be shared. Mumogg has been away since ~10:24Z. If it helps, I can carry the adaptation onto current main as a separate PR. I'd keep Mumogg's commits `8ba15dd44` and `77c801c82` with their authorship, re-implement Logan's frame-pacer piece over #402's rewritten `frame_pacer.h` with a `Co-authored-by`, and update the two #402 tests that expect slot 32 to be `E_NOTIMPL`. It would be tested on Windows 11 / MSVC / RTX 4070 SUPER with `xs_proxy_mock`, `queue_proxy`, `frame_pacer` and `xbox_present` (no game files). It's about 200 lines. I'll only do it if you want it, since #984's merge may make it redundant. Just say so here. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-25 01:28 UTC · original

@⁠QemmHD thanks for the offer, and for keeping an eye on the ladder. Please don't start it: we'll settle #414 after #984 and #939 are in, because between them they cover most of it.

  • #984 merged with main is tested and goes in shortly. It brings the presenter that is created on the first PresentX, the FrameTokenSource shared between device slot 80 and the pacer, and PresentX routed through #402's XboxQueueSlotRoutes. That's what towade found missing.
  • The slot: in that merge PresentX is queue slot 30, or 32 once a queue is detected as the newer layout (#984's measured rule), and LEONIDA_XS_PRESENT_X_SLOT pins it. The two #402 tests that expected E_NOTIMPL at 32 are adapted there.
  • Two things a local rework of #414 turned up, both handled in that merge:
    • the lazily built presenter held a reference on the device proxy that owns it, so the proxy, the window and the swapchain were never released;
    • handing device slots 78 to 81 to the presentation, as a plain attach_xbox_presentation does, makes the next WaitFrameEventX fail, because that pacer never saw the title's SetFrameIntervalX. The merge keeps them on the device.
  • #939 goes on top of that next; its presentation path is being merged into the same code.
  • After #939: we'll compare what's left of #414 against main and either merge the remainder, keeping Mumogg's commits and Logan's credit, or close it as carried. If something is left that you'd like to take, it'll be much smaller by then; I'll say here.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-25 01:28 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/414#issuecomment-7149579843) @⁠QemmHD thanks for the offer, and for keeping an eye on the ladder. Please don't start it: we'll settle #414 after #984 and #939 are in, because between them they cover most of it. - **#984 merged with `main`** is tested and goes in shortly. It brings the presenter that is created on the first `PresentX`, the `FrameTokenSource` shared between device slot 80 and the pacer, and `PresentX` routed through #402's `XboxQueueSlotRoutes`. That's what towade found missing. - **The slot:** in that merge `PresentX` is queue slot 30, or 32 once a queue is detected as the newer layout (#984's measured rule), and `LEONIDA_XS_PRESENT_X_SLOT` pins it. The two #402 tests that expected `E_NOTIMPL` at 32 are adapted there. - **Two things a local rework of #414 turned up, both handled in that merge:** - the lazily built presenter held a reference on the device proxy that owns it, so the proxy, the window and the swapchain were never released; - handing device slots 78 to 81 to the presentation, as a plain `attach_xbox_presentation` does, makes the next `WaitFrameEventX` fail, because that pacer never saw the title's `SetFrameIntervalX`. The merge keeps them on the device. - **#939** goes on top of that next; its presentation path is being merged into the same code. - **After #939:** we'll compare what's left of #414 against `main` and either merge the remainder, keeping Mumogg's commits and Logan's credit, or close it as carried. If something is left that you'd like to take, it'll be much smaller by then; I'll say here. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 01:37 UTC · original

@⁠aslan2142 understood, I won't start it, and thanks for the detail on the two defects. Since you can't build with MSVC here: the merged #984 head (71a783e56) is building now on native Windows 11 with MSVC (VS 2022) and an RTX 4070 SUPER. I'll post the build result, full ctest and the validation run on #984 as soon as they're in.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 01:37 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/414#issuecomment-7149767903) @⁠aslan2142 understood, I won't start it, and thanks for the detail on the two defects. Since you can't build with MSVC here: the merged #984 head (71a783e56) is building now on native Windows 11 with MSVC (VS 2022) and an RTX 4070 SUPER. I'll post the build result, full ctest and the validation run on #984 as soon as they're in. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-25 03:47 UTC · original

Marked merged through #430, whose branch contains this one. The content was already in main since #984 and #939, in this form:

  • PresentX goes through XboxQueueSlotRoutes to queue_present_x, which builds the presenter on the first call.
  • The slot is 30, or 32 once the queue is detected as the newer layout (a fence at 16/17, or SignalX at 25); LEONIDA_XS_PRESENT_X_SLOT pins it.
  • Logan's piece: device slot 80 and the pacer share the device's FrameTokenSource.
  • Both defects of the earlier rework are fixed there: the presenter holds no reference on the device proxy, and slots 78–81 stay on the device.
  • The queue_proxy_test change isn't needed: slot 32 is not an overridden slot on main, and the console-tail sweep calls it.

As promised in the thread, this was settled after #939. Thanks to Mumogg and Logan, and to QemmHD and towade for the analysis.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-25 03:47 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/414#issuecomment-7152237526) Marked merged through #430, whose branch contains this one. The content was already in `main` since #984 and #939, in this form: - PresentX goes through `XboxQueueSlotRoutes` to `queue_present_x`, which builds the presenter on the first call. - The slot is 30, or 32 once the queue is detected as the newer layout (a fence at 16/17, or SignalX at 25); `LEONIDA_XS_PRESENT_X_SLOT` pins it. - Logan's piece: device slot 80 and the pacer share the device's `FrameTokenSource`. - Both defects of the earlier rework are fixed there: the presenter holds no reference on the device proxy, and slots 78–81 stay on the device. - The `queue_proxy_test` change isn't needed: slot 32 is not an overridden slot on `main`, and the console-tail sweep calls it. As promised in the thread, this was settled after #939. Thanks to Mumogg and Logan, and to QemmHD and towade for the analysis. AI-assisted (Claude Code, Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.