Skip to content

d3d12_xs: console list slot 139 is Reset (RT-LIST139) - #396

Merged
aslan2142 merged 7 commits into
ProjectLeonida:mainfrom
Mumogg:list-slot139-reset
Nov 25, 2026
Merged

aslan2142 merged 7 commits into
ProjectLeonida:mainfrom
Mumogg:list-slot139-reset

Conversation

@Mumogg

@Mumogg Mumogg commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Claimed in #14 as RT-LIST139. Depends on: #349 to #395 in order (their commits come first here; this pull request is the last commit). The change itself is three places in the list proxy and its test.

What and why

The retail title resets its command lists through list slot 139, with (allocator proxy, pipeline state). main's console_to_pc_list_slot has no entry for 139, so the call is recorded and dropped.

  • d3d12_xs_device.h: the map sends 139 to the PC slot 10.
  • d3d12_xs_device.cpp: the list proxy's unwrap keys on the PC slot instead of the console slot, so console slot 10 and console slot 139 both give the real list its real allocator (and a wrapped pipeline state the same way) and re-pin the inline cursor.
  • xs_proxy_mock_test.cpp: the map entry, and a slot 139 call that reaches the real list's slot 10 with the real allocator and never its slot 139.

This one is written by me, not cherry-picked: the mapping and the unwrap rule are those of ef9d0759d (Nolan Cotter; the call shape was measured by Pipodi), which does not apply to main's list proxy. 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 Traced calls ok among them
up to #395 11,949 1,644
+ this 11,950 1,645

The extra call is the list's Reset, now reached.

This does not move the stop either. The run still ends right after the first ExecuteCommandLists ok, with the title writing through a null pointer of its own: it loads a pointer from one of its globals and stores a byte far into the object it expects there. So something the title sets up earlier is missing on this path, and it is not the list's Reset. I do not know yet what it is; the run of the integration branch (#321) at the same point goes on, and next I will narrow down which difference between the two matters (the memory shim is my first candidate, since #321 uses another one).

xs_proxy_mock_test under Wine passes.

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

@Mumogg

Mumogg commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up on my own guess above: it is not the memory shim. I swapped the integration branch's xmem.cpp into the measurement build and the run ends at the same call (11,950 traced, last ExecuteCommandLists ok) with the same fault. So that candidate is ruled out, and the difference is somewhere else in what the two trees do before the first submission.

One thing visible in the logs that I have not explained: at this point the integration branch's run shows a first call of list slot 74 between list slot 72 and WaitFrameEventX, and the run on main never calls it.

AI-assisted.

DevilNine and others added 4 commits November 24, 2026 03:52
(cherry picked from commit e925b63)

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.
…ow in the Xbox-only table

Asked for in review on ProjectLeonida#377.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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 ef9d075 (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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
@Mumogg
Mumogg force-pushed the list-slot139-reset branch from 7d58fa5 to 54ed404 Compare November 24, 2026 09:54
@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 24, 2026
Two files conflicted; in each, both sides had added something at the same
place and both are kept.

runtime/shims/d3d12_xs_device.cpp: this branch's
queue_execute_command_lists() next to main's XboxQueueSlotRoutes and
xbox_queue_slot_routes() (the PresentX, SuspendX and ResumeX routes).

runtime/test/xs_proxy_mock_test.cpp: main() runs check_xbox_queue_slots()
and then check_presentation_wiring().

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@3L1A5-1

3L1A5-1 commented Nov 24, 2026

Copy link
Copy Markdown

An independent confirmation of the slot-139 part, from another project's measurement (facts only, no code):

  • xcl (GPL-2.0-only, so nothing copied) measured the same console list layout on the retail 1.0.2.1 title: its slot numbers line up with main's map here (61 = ExecuteIndirect, 85 = CopyTextureRegionX).
  • There the title calls slot 139 as Reset(allocator, NULL, 0) on each list it takes from its pool, before recording. While the slot was a stub, the list stayed closed: every later call on it was refused and Close failed. So it matches this PR's mapping to PC slot 10, with the allocator unwrapped.

On current main (507029d1e) console_to_pc_list_slot(139) is still kListNotForwarded, so the call returns 0 and does nothing. Since this PR is needs rebase and touches 18 files, would you split the one-line slot-139 mapping (with the pc == 10 unwrap) into its own small PR? It would be easy to review and merge on its own.

AI-assisted: yes.

aslan2142 and others added 2 commits November 24, 2026 18:47
Merged on top of the merge made for ProjectLeonida#391 (main 507029d plus RT-QUEUE35).

One conflict, in docs/d3d12_vulkan.md: both sides added a row at the same
place of the Xbox-only table. Both are kept: this branch's
"Command-allocator slot 9" row, then main's "Device slot 81, queue
PresentX/SuspendX/ResumeX" row. The code and the tests merged without
conflicts.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merged on top of the merge made for ProjectLeonida#395 (main 507029d plus RT-QUEUE35
and RT-ALLOC9). No conflicts.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@aslan2142
aslan2142 merged commit 436dc80 into ProjectLeonida:main Nov 25, 2026
4 of 5 checks passed
@aslan2142

Copy link
Copy Markdown
Collaborator

Merged. Mumogg is still away and this is the next rung on main's boot path, so I brought the branch up to date as with the rungs before it: one merge commit on top of 54ed404de (864337351), merging main with #391 and #395 in it. Mumogg's commit is untouched and nothing was force-pushed. There were no conflicts.

What it does: console list slot 139 now goes to the PC Reset (slot 10). The allocator proxy is unwrapped, a wrapped pipeline state would be too, and the inline cursor is re-pinned as for console slot 10. Before, the call was dropped with S_OK and the real list stayed closed.

How it is known: the slot is measured on the retail title, in ef9d0759d (in main's history, not in its tree): the title creates a list, closes it at slot 9, then calls 139 with (allocator proxy, 0). This PR rewrites that for main's list proxy.

Holds and requests: none on this PR.

Tests (clang-cl with the xwin SDK; Wine, headless; llvmpipe and an RDNA2 iGPU):

  • Full Windows suite under Wine, the branch against main with d3d12_xs: command-allocator slot 9 (SetAllocatorCallbackX) is recorded, again (RT-ALLOC9) #395: no test changed state on either device (259 pass and 15 fail on llvmpipe, 255 and 21 on the iGPU, on both sides).
  • xs_proxy_mock with its six variants and device_proxy pass on both devices.
  • check_no_game_data.py on the three changed files is clean. The Linux portable subset does not build these files.
  • Not run here: MSVC, native Windows, and the game itself. By Mumogg's run the boot gets one more ok call (11,949 to 11,950) and the stop does not move.

For later:

  • docs/d3d12_vulkan.md has no row for list slot 139; the row in ef9d0759d is ready to be brought over.
  • The new test passes pipeline state 0, so unwrapping a pipeline state is not exercised.
  • Still open from the RT-LIST139 finding in Coordinating who works on what #14: list slot 74 is never called on main, and nothing is recorded after the first submission (slots 146 and 52).

#403 (queue slot 18) is the next rung.

AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5).

aslan2142 added a commit that referenced this pull request Nov 25, 2026
Merged on top of the merge made for #396 (main 507029d plus RT-QUEUE35,
RT-ALLOC9 and RT-LIST139). No conflicts.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@3L1A5-1

3L1A5-1 commented Nov 25, 2026

Copy link
Copy Markdown

Native Windows + MSVC result for the part not run above: Mumogg's 54ed404de on main 1154976d4 (no conflicts; same change as the merge), MSVC 14.44, Windows SDK 10.0.26100, Windows 11 26300, RTX 2060 SUPER (Turing, 8 GB, driver 617.14).

  • Full ctest: 318 / 318 passed (only the two SDL3 gameinput tests are disabled here), including xs_proxy_mock and its six variants.
  • Same suite on main before it: 316 / 316. scripts/run_gpu_tests.py on main: 207 pass / 49 skip / 0 fail, and with LEONIDA_W64_EMULATE=1 239 / 17 / 0.

AI-assisted: yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with the base branch: rebase it on main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants