d3d12_xs: the list proxy translates title-owned CPU descriptor handles (RT-LIST-HANDLES) #416

Merged
Mumogg merged 28 commits from upstream-pr/416 into main 2026-11-25 03:46:20 +00:00
Mumogg commented 2026-11-24 04:52:05 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Mumogg on 2026-11-24T04:52:05Z.


Claimed in #14 as RT-LIST-HANDLES. Depends on: the stack up to #414 (their commits come first here; this pull request is the last commit). The code needs #375 (the title's descriptor range and translate_cpu_handle); the rest of the dependency is the measurement.

What and why

Since #375 the 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. Console list slots 50 (OMSetRenderTargets), 51 (ClearDepthStencilView), 52 (ClearRenderTargetView), 53 and 54 (the two ClearUnorderedAccessView) reached the real list with the title's address, which is no descriptor there.

On the retail boot that shows as soon as the title records its first frame: a ClearRenderTargetView with a title-owned handle, and then ID3D12GraphicsCommandList::Close failed.

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.

Written by me as a port: this is 0aba6c361 (LeonidaBringup), which sits on old PR 2490's list proxy and does not apply to main's. The commit message credits it.

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 Failed calls in the trace ExecuteCommandLists ok Close ok
up to #414 ID3D12GraphicsCommandList::Close: 1 3 585
+ this none 5 586

With it the trace of this path has no failed call at all, two more submissions go through, and in one of two runs the title's first PresentX succeeds (see #414 for the other run).

Every run now ends on the same thing: an int3 of the title on a worker thread, which tools/int3_cause.py reads as a check that a word of one of the title's objects is zero. That is the next stop and I do not know its cause yet.

xs_proxy_mock_test under Wine passes, with the new cases on a device whose heap has a title-owned range: slots 52, 53 and 54 with a handle inside the range and one outside it; slot 50 with two render-target handles (one inside, one outside) and a depth handle, checking what the real list receives and that the caller's arrays are unchanged; slot 51 through its typed thunk. The mock's integer prototype cannot see slot 51's float, so that the depth survives is not tested here.

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

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5466303069 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/416). Originally posted by [Mumogg](https://github.com/Mumogg) on 2026-11-24T04:52:05Z. --- Claimed in #14 as `RT-LIST-HANDLES`. Depends on: the stack up to #414 (their commits come first here; this pull request is the last commit). The code needs #375 (the title's descriptor range and `translate_cpu_handle`); the rest of the dependency is the measurement. ### What and why Since #375 the 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. Console list slots 50 (`OMSetRenderTargets`), 51 (`ClearDepthStencilView`), 52 (`ClearRenderTargetView`), 53 and 54 (the two `ClearUnorderedAccessView`) reached the real list with the title's address, which is no descriptor there. On the retail boot that shows as soon as the title records its first frame: a `ClearRenderTargetView` with a title-owned handle, and then `ID3D12GraphicsCommandList::Close failed`. 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. Written by me as a port: this is `0aba6c361` (LeonidaBringup), which sits on old PR 2490's list proxy and does not apply to `main`'s. The commit message credits it. ### 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` | Failed calls in the trace | `ExecuteCommandLists ok` | `Close ok` | |---|---|---|---| | up to #414 | `ID3D12GraphicsCommandList::Close`: 1 | 3 | 585 | | + this | none | 5 | 586 | With it the trace of this path has no failed call at all, two more submissions go through, and in one of two runs the title's first `PresentX` succeeds (see #414 for the other run). Every run now ends on the same thing: an `int3` of the title on a worker thread, which `tools/int3_cause.py` reads as a check that a word of one of the title's objects is zero. That is the next stop and I do not know its cause yet. `xs_proxy_mock_test` under Wine passes, with the new cases on a device whose heap has a title-owned range: slots 52, 53 and 54 with a handle inside the range and one outside it; slot 50 with two render-target handles (one inside, one outside) and a depth handle, checking what the real list receives and that the caller's arrays are unchanged; slot 51 through its typed thunk. The mock's integer prototype cannot see slot 51's float, so that the depth survives is not tested here. 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
3L1A5-1 commented 2026-11-25 01:48:30 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by 3L1A5-1 on 2026-11-25T01:48:30Z.


Native Windows + MSVC + NVIDIA result. I rebased this PR's own commit only, since #414's three commits conflict with main (#402's presentation handler in d3d12_xs_device.cpp, as noted on #414). adc4f314b applies to main cleanly without them: 3L1A5-1/leonida@rebase/416 (56e4d2587, author kept) on main b4b7756e8.

  • ctest: 318/318 passed, 0 failed (2 gameinput disabled, no SDL3). xs_proxy_mock, xs_proxy_mock_env_slots and queue_proxy pass.
  • scripts/run_gpu_tests.py: 207 passed, 0 failed, 49 skipped. With LEONIDA_W64_EMULATE=1: 239 passed, 0 failed, 17 skipped.
  • No result differs from main on this machine.

Hardware: RTX 2060 SUPER 8 GB (Turing), driver 617.14, Windows 11 26300, 16 GB RAM, MSVC 19.44, RelWithDebInfo. Synthetic tests only, no retail run.

AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7149980235 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/416#issuecomment-7149980235). Originally posted by [3L1A5-1](https://github.com/3L1A5-1) on 2026-11-25T01:48:30Z. --- Native Windows + MSVC + NVIDIA result. I rebased this PR's own commit only, since #414's three commits conflict with `main` (#402's presentation handler in `d3d12_xs_device.cpp`, as noted on #414). `adc4f314b` applies to `main` cleanly without them: [`3L1A5-1/leonida@rebase/416`](https://github.com/3L1A5-1/leonida/tree/rebase/416) (`56e4d2587`, author kept) on `main` `b4b7756e8`. - ctest: 318/318 passed, 0 failed (2 `gameinput` disabled, no SDL3). `xs_proxy_mock`, `xs_proxy_mock_env_slots` and `queue_proxy` pass. - `scripts/run_gpu_tests.py`: 207 passed, 0 failed, 49 skipped. With `LEONIDA_W64_EMULATE=1`: 239 passed, 0 failed, 17 skipped. - No result differs from `main` on this machine. Hardware: RTX 2060 SUPER 8 GB (Turing), driver 617.14, Windows 11 26300, 16 GB RAM, MSVC 19.44, RelWithDebInfo. Synthetic tests only, no retail run. AI-assisted: yes
aslan2142 commented 2026-11-25 03:47:03 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-25T03:47:03Z.


Marked merged through #430, whose branch contains this one. The content was already in main: console list slots 50–54 translate the title's CPU handles (the port of 0aba6c361), with the typed thunk for slot 51, and check_list_cpu_handles in xs_proxy_mock_test covers these cases and more, including that the float depth survives. Thanks.

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7152237780 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/416#issuecomment-7152237780). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-11-25T03:47:03Z. --- Marked merged through #430, whose branch contains this one. The content was already in `main`: console list slots 50–54 translate the title's CPU handles (the port of `0aba6c361`), with the typed thunk for slot 51, and `check_list_cpu_handles` in `xs_proxy_mock_test` covers these cases and more, including that the float depth survives. Thanks. AI-assisted (Claude Code, Claude Opus 5.5).
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!416
No description provided.