d3d12_xs: device slot 61 is CreateSamplerX for the title's calls, again (RT-SLOT61) #383

Manually merged
github merged 4 commits from gh-pr/383/head into gh-pr/383/base 2026-11-26 08:56:57 +00:00
Owner

@⁠Mumogg on GitHub · 2026-11-24 04:13 UTC · original
Mumogg:slot61-sampler-x → main · +99 −4 · 5 files · 4 commits · merged 2026-11-24 23:07 UTC

Claimed in #14 as RT-SLOT61. Depends on: #349, #350, #356, #362, #369, #375, #377 (their commits come first here; this pull request is the last two commits).

What and why

After #377 the title calls device slot 61 once per sampler, as (description, destination handle). On the PC that slot is CreateMetaCommand, and main forwards it by number: a host access violation, reading through one of the title's words.

Two commits by mrp1no, cherry-picked with -x (authorship kept; ancestors of main whose content is not in the tree):

  • e22994464: slot 61 is routed to the PC CreateSampler with the same two words.
  • c915e1da4: only for callers in an image the guest loader mapped. The proxy also serves host callers (d3d12_vulkan_device_test calls ID3D12Device5::CreateMetaCommand through it), and they get the PC slot 61 as before.

The first commit conflicted where neighbours have been added since (slot 41's handler and test case, the slot lists, a docs table row); both sides are kept. The second applied cleanly.

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 and #328 applied on top for the boot runs (they are not in this branch).

--run D3D12 calls Ends with
up to #377 1,655 host AV at device slot 61
+ this 1,657 the title's own int3; the last traced call is ID3D12Device9::ShaderCacheControl failed, reached through device slot 74 forwarded by number

So the next stop is device slot 74, another console slot at a PC method's position.

xs_proxy_mock_test under Wine passes with the three cases of the second commit: no classifier installed (PC slot 61), a guest caller (PC CreateSampler with the same words; a null description skipped) and a host caller under a classifier (PC slot 61).

Not built with MSVC and not run on Windows; I did not run d3d12_vulkan_device_test, which the second commit is about (it fails under Wine here on main as well).

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:13 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/383) `Mumogg:slot61-sampler-x` → `main` · +99 −4 · 5 files · 4 commits · merged 2026-11-24 23:07 UTC Claimed in #14 as `RT-SLOT61`. Depends on: #349, #350, #356, #362, #369, #375, #377 (their commits come first here; this pull request is the last two commits). ### What and why After #377 the title calls device slot 61 once per sampler, as `(description, destination handle)`. On the PC that slot is `CreateMetaCommand`, and `main` forwards it by number: a host access violation, reading through one of the title's words. Two commits by mrp1no, cherry-picked with `-x` (authorship kept; ancestors of `main` whose content is not in the tree): - `e22994464`: slot 61 is routed to the PC `CreateSampler` with the same two words. - `c915e1da4`: only for callers in an image the guest loader mapped. The proxy also serves host callers (`d3d12_vulkan_device_test` calls `ID3D12Device5::CreateMetaCommand` through it), and they get the PC slot 61 as before. The first commit conflicted where neighbours have been added since (slot 41's handler and test case, the slot lists, a docs table row); both sides are kept. The second applied cleanly. ### 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 and #328 applied on top for the boot runs (they are not in this branch). | `--run` | D3D12 calls | Ends with | |---|---|---| | up to #377 | 1,655 | host AV at device slot 61 | | + this | 1,657 | the title's own `int3`; the last traced call is `ID3D12Device9::ShaderCacheControl failed`, reached through device slot 74 forwarded by number | So the next stop is device slot 74, another console slot at a PC method's position. `xs_proxy_mock_test` under Wine passes with the three cases of the second commit: no classifier installed (PC slot 61), a guest caller (PC `CreateSampler` with the same words; a null description skipped) and a host caller under a classifier (PC slot 61). Not built with MSVC and not run on Windows; I did not run `d3d12_vulkan_device_test`, which the second commit is about (it fails under Wine here on `main` as well). 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
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
One conflict, in docs/d3d12_vulkan.md: both sides added a row to the same
table. Both are kept, in slot order: this branch's "Device slot 61" row,
then main's "Device slot 81, queue PresentX/SuspendX/ResumeX" row.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:56:57 +00:00
github manually merged commit 150b753449 into gh-pr/383/base 2026-11-26 08:56:57 +00:00
github-bot referenced this pull request from a commit 2026-11-26 08:56:57 +00:00
Author
Owner

@⁠slauko on GitHub · 2026-11-24 20:32 UTC · original

Backport check on current main: the routing commits apply and the suite passes, but the retail call is behind the pool gate

I backported the two routing commits (99ba1c085 + 49fd9a427) onto main 6293c1c4f without the dependency stack (#349/#350/#356/#362/#369/#375/#377) and without the descriptor-range translation (484962eb8, which needs translate_cpu_handle from those PRs), to test the slot-61 routing on the retail title under Wine (RTX 3080 Ti, NVIDIA 595.112.07, Wine 11.17, retail 1.0.2.1, 26,555-shader corpus).

  • Windows CI (run 45476785815): 303/304 runtime tests pass. The only failure is the known crt_timed_wait 1-ms flake ("an unnotified wait_for(200 ms) returned after 199 ms"), which also failed twice in three runs on unchanged heads. No slot-61 test failed; the mock cases (PC slot 61 with no classifier, guest caller -> PC CreateSampler, host caller -> PC slot 61) pass.
  • The retail boot reaches CreateRootSignature and CreateComputePipelineState (slot 62), the builder shader (bvh_29_f12431f3) is selected, and there is no root-signature/spill refusal. But slot 61 is never called: with the pool-fill assert skipped (LEONIDA_SKIP_INT3=1), the title's own hang watchdog (+0x2215c35, the 30 s frame-code marker) fires at t~32 s first. Without the skip, the same build stops at the pool-fill assert (used = 0, 64 MiB), which is a separate, currently open gate.
  • So the routing is not exercised by this run. The code is compile/test-clean, but a boot that passes the pool (or a Windows configuration that reaches the sampler path) is needed to confirm the retail call. Our measurement does not contradict the stop-20 report; it places the sampler call behind the pool on this main.

Branch for reference: slauko/leonida:wine-slot61 (base 6293c1c4f + the two commits; not a proposed rebase of the full stack). Counts and call shapes only, no game data.

**@⁠slauko** on GitHub · 2026-11-24 20:32 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/383#issuecomment-7143691506) **Backport check on current main: the routing commits apply and the suite passes, but the retail call is behind the pool gate** I backported the two routing commits (`99ba1c085` + `49fd9a427`) onto `main` `6293c1c4f` **without** the dependency stack (#349/#350/#356/#362/#369/#375/#377) and without the descriptor-range translation (`484962eb8`, which needs `translate_cpu_handle` from those PRs), to test the slot-61 routing on the retail title under Wine (RTX 3080 Ti, NVIDIA 595.112.07, Wine 11.17, retail 1.0.2.1, 26,555-shader corpus). - Windows CI (run `45476785815`): **303/304** runtime tests pass. The only failure is the known `crt_timed_wait` 1-ms flake ("an unnotified wait_for(200 ms) returned after 199 ms"), which also failed twice in three runs on unchanged heads. No slot-61 test failed; the mock cases (PC slot 61 with no classifier, guest caller -> PC CreateSampler, host caller -> PC slot 61) pass. - The retail boot reaches `CreateRootSignature` and `CreateComputePipelineState` (slot 62), the builder shader (`bvh_29_f12431f3`) is selected, and there is no root-signature/spill refusal. But **slot 61 is never called**: with the pool-fill assert skipped (`LEONIDA_SKIP_INT3=1`), the title's own hang watchdog (`+0x2215c35`, the 30 s frame-code marker) fires at t~32 s first. Without the skip, the same build stops at the pool-fill assert (`used = 0`, 64 MiB), which is a separate, currently open gate. - So the routing is not exercised by this run. The code is compile/test-clean, but a boot that passes the pool (or a Windows configuration that reaches the sampler path) is needed to confirm the retail call. Our measurement does not contradict the stop-20 report; it places the sampler call behind the pool on this main. Branch for reference: `slauko/leonida:wine-slot61` (base `6293c1c4f` + the two commits; not a proposed rebase of the full stack). Counts and call shapes only, no game data.
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-24 23:07 UTC · original

Merged. Mumogg is still away and this is the next rung on main's boot path (device slot 61, where the title stops once #377 is in), so I brought the branch up to date the same way as #375 and #377: one merge commit of main (28a32e190) on top of 484962eb8 (150b75344). Mumogg's three commits are untouched and nothing was force-pushed.

What it does: device slot 61 is CreateSamplerX(desc, dest) for the title. A caller in a guest-mapped image goes to the PC CreateSampler with the destination handle translated; a host caller, and every caller when no check is installed, still reaches the PC slot 61 as before. It puts back mrp1no's routing, which main had lost.

Conflict: one, in docs/d3d12_vulkan.md: both sides added a row to the same table. Both are kept in slot order (slot 61, then slot 81 / PresentX).

Holds and dependencies: there is no hold or maintainer request on this PR itself. The owner's hold on the stack was the ExecuteIndirect regression, resolved before #377 was merged. #349, #350, #356, #362, #369, #375 and #377 are all in main, so only this PR's own three commits come in (5 files, +99 −4 against main).

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

  • Full Windows suite under Wine, the branch against main 28a32e190: no test changed state on either device (258 pass and 15 fail on llvmpipe, 254 and 21 on the iGPU, on both sides).
  • xs_proxy_mock and its five variants and device_proxy pass.
  • The 12 test_docs_* files and check_no_game_data.py on the changed files are clean. The Linux portable subset does not build these files.
  • Not run here: MSVC, native Windows, and the game itself. Mumogg's run reports the title going from 1,655 to 1,657 traced calls, with the next stop at device slot 74.

Follow-ups, none blocking the boot path:

  • The description is still read as a PC D3D12_SAMPLER_DESC, which this PR marks as a hypothesis. Kokonotcu's finding in #14 (#14) gives the console's own 0x54-byte field table; decoding from it is the next fix on this slot, and it matters as soon as something is drawn.
  • The translated destination handle has no test yet.
  • The comment above proxy_create_sampler_x ("The handle is passed as given") is out of date since 484962eb8, and the comments and the docs row cite numbers from the original repository (#6910, #7021, #7115, #7490) that link nowhere now.

#385 (device slot 74) is the next rung.

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

**@⁠aslan2142** on GitHub · 2026-11-24 23:07 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/383#issuecomment-7147035489) Merged. Mumogg is still away and this is the next rung on `main`'s boot path (device slot 61, where the title stops once #377 is in), so I brought the branch up to date the same way as #375 and #377: one merge commit of `main` (`28a32e190`) on top of `484962eb8` (`150b75344`). Mumogg's three commits are untouched and nothing was force-pushed. **What it does:** device slot 61 is `CreateSamplerX(desc, dest)` for the title. A caller in a guest-mapped image goes to the PC `CreateSampler` with the destination handle translated; a host caller, and every caller when no check is installed, still reaches the PC slot 61 as before. It puts back mrp1no's routing, which `main` had lost. **Conflict:** one, in `docs/d3d12_vulkan.md`: both sides added a row to the same table. Both are kept in slot order (slot 61, then slot 81 / `PresentX`). **Holds and dependencies:** there is no hold or maintainer request on this PR itself. The owner's hold on the stack was the `ExecuteIndirect` regression, resolved before #377 was merged. #349, #350, #356, #362, #369, #375 and #377 are all in `main`, so only this PR's own three commits come in (5 files, +99 −4 against `main`). **Tests** (clang-cl with the xwin SDK; Wine, headless; llvmpipe and an RDNA2 iGPU): - Full Windows suite under Wine, the branch against `main` `28a32e190`: no test changed state on either device (258 pass and 15 fail on llvmpipe, 254 and 21 on the iGPU, on both sides). - `xs_proxy_mock` and its five variants and `device_proxy` pass. - The 12 `test_docs_*` files and `check_no_game_data.py` on the changed files are clean. The Linux portable subset does not build these files. - Not run here: MSVC, native Windows, and the game itself. Mumogg's run reports the title going from 1,655 to 1,657 traced calls, with the next stop at device slot 74. **Follow-ups, none blocking the boot path:** - The description is still read as a PC `D3D12_SAMPLER_DESC`, which this PR marks as a hypothesis. Kokonotcu's finding in #14 (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) gives the console's own 0x54-byte field table; decoding from it is the next fix on this slot, and it matters as soon as something is drawn. - The translated destination handle has no test yet. - The comment above `proxy_create_sampler_x` ("The handle is passed as given") is out of date since `484962eb8`, and the comments and the docs row cite numbers from the original repository (#6910, #7021, #7115, #7490) that link nowhere now. #385 (device slot 74) is the next rung. AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.