[PR #430] [MERGED] d3d12_xs: the title's queue slots 16 and 17 with a fence are Signal and Wait (RT-QUEUE-SIGNAL) #480

Closed
opened 2026-11-26 20:18:01 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/430
Author: @Mumogg
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142

Base: main ← Head: queue-slots16-17-signal


📝 Commits (7)

  • 8ba15dd d3d12_xs: the queue's console slot 32 is PresentX, wired to the presentation core
  • af8c42b PresentX: device-side WaitFrameEventX and the frame pacer share one token source
  • 77c801c queue_proxy_test: the PresentX slot is called and counted
  • adc4f31 d3d12_xs: the list proxy translates title-owned CPU descriptor handles (console list slots 50 to 54)
  • 89fdb83 d3d12_xs: a console depth-stencil texture with unordered access is sized and created without it (stand-in)
  • 028a414 d3d12_xs: the title's queue slots 16 and 17 with a fence are Signal and Wait
  • 6ed716a Merge main into RT-QUEUE-SIGNAL (#430)

📊 Changes

1 file changed (+21 additions, -1 deletions)

View changed files

📝 runtime/test/xs_proxy_mock_test.cpp (+21 -1)

📄 Description

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*) and GetClockCalibration(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 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.

main forwarded 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 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.

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

--run Ends with
without this a call through a null pointer from the title, on the fence it had just passed to queue slot 16
with this later: XboxID3D12Fence::Slot12 unsupported, then the title writes through a null pointer

Both runs create 50,450 pipeline states. The next stop is fence slot 12, a console method one past ID3D12Fence1 that 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_test passes 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_test passes 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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/430 **Author:** [@Mumogg](https://github.com/Mumogg) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `queue-slots16-17-signal` --- ### 📝 Commits (7) - [`8ba15dd`](https://github.com/ubiquitarianism/leonida/commit/8ba15dd44960a21167f975affb04370c721a103d) d3d12_xs: the queue's console slot 32 is PresentX, wired to the presentation core - [`af8c42b`](https://github.com/ubiquitarianism/leonida/commit/af8c42bb1aa19db773a3fee2607ec0f4218f864b) PresentX: device-side WaitFrameEventX and the frame pacer share one token source - [`77c801c`](https://github.com/ubiquitarianism/leonida/commit/77c801c82f5c0d7e222512ef7d1d0a927895f7a4) queue_proxy_test: the PresentX slot is called and counted - [`adc4f31`](https://github.com/ubiquitarianism/leonida/commit/adc4f314ba5b54579d91d5dbb7921901efe7a7f7) d3d12_xs: the list proxy translates title-owned CPU descriptor handles (console list slots 50 to 54) - [`89fdb83`](https://github.com/ubiquitarianism/leonida/commit/89fdb83e06965864fd57f98c18af716df39fe75c) d3d12_xs: a console depth-stencil texture with unordered access is sized and created without it (stand-in) - [`028a414`](https://github.com/ubiquitarianism/leonida/commit/028a414fade7058a96e5933d1325f374a0026588) d3d12_xs: the title's queue slots 16 and 17 with a fence are Signal and Wait - [`6ed716a`](https://github.com/ubiquitarianism/leonida/commit/6ed716a99a7416f1e8a60c2e38e128876ab752ec) Merge main into RT-QUEUE-SIGNAL (#430) ### 📊 Changes **1 file changed** (+21 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `runtime/test/xs_proxy_mock_test.cpp` (+21 -1) </details> ### 📄 Description 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*)` and `GetClockCalibration(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 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. `main` forwarded 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 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`. 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 `main` `ece4ba5b3`, with #142, #219, #328, #387 and #428 applied on top for the boot runs (they are not in this branch). | `--run` | Ends with | |---|---| | without this | a call through a null pointer from the title, on the fence it had just passed to queue slot 16 | | with this | later: `XboxID3D12Fence::Slot12 unsupported`, then the title writes through a null pointer | Both runs create 50,450 pipeline states. The next stop is fence slot 12, a console method one past `ID3D12Fence1` that 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_test` passes 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_test` passes 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.com/claude-code) https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:01 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#480
No description provided.