d3d12_xs: route device slots 86, 101 and 108 to PC Device2/Device5/Device8, rebased on main (RT-SLOT108-REBASE) #727
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!727
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/727/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@DesertGamer on GitHub · 2026-11-24 12:59 UTC · original
DesertGamer:fix/slot108-rebase→main· +368 −13 · 5 files · 3 commits · merged 2026-11-24 23:32 UTCClaimed in the coordination issue as: RT-SLOT108-REBASE (#14)
Depends on: none to merge. The retail boot reaches slot 108 only past the command-list IID stop at device slot 73, which #641, #359 and #142 each cover; I measured the slot-108 fault on a stack with #142, and #641 alone gave the same 1,639-call stop point on
mainbefore it. Supersedes #219, which conflicts withmain.What and why
#219 (old PR 9954 by
justr4mzi, carried over as a draft) rebased ontomain21625bca8. The commit is the original one, cherry-picked with-x, so the author credit is kept; the only changes are the resolution of its conflicts withmain: three hunks inruntime/shims/d3d12_xs_device.cpp(the new proxy functions go afterproxy_slot74, theSlot == 86 / 101 / 108branches after thekCreateCommittedResource3Xone, and86 || 101 || 108is added todevice_slot_overridden) and the comment ind3d12_xs_device.h. The tests anddocs/d3d12_vulkan.mdapply as they are.What it fixes, measured on a retail run: on the stack
main+ #142 + #427 (the slot-73 fix is #142 there; #641 is the equivalent open one) the title calls console device slot 108 with the device in RDX and RCX not an object (the slot-26 shape);proxy_slottakesselffrom RCX and faults in the host after 11,916 D3D12 calls. With slot 108 routed toGetResourceAllocationInfo2the run goes on, and with #602 (A8_UNORM) it reached the frame loop (888,983PresentX okin 420 s with #357 #387 #432 too; details in #14).Tested
ctest -R "xs_proxy_mock|device_proxy": 8 of 8 pass (MSVC, Windows 11, Vulkan SDK 1.4.363).scripts/check_no_game_data.pyon the five changed files, and alltests/test_docs_*.py: pass.GPUs tested: NVIDIA GeForce RTX 5070, driver 617.14, Windows 11
AI-assisted: yes (Claude Code, Sonnet 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (Not a translator change.)@abnalstlll-byte on GitHub · 2026-11-24 13:15 UTC · original · approved these changes
LGTM. Critical D3D12 XS slot routing for Xbox slots 86 (CreatePipelineState -> PC 47), 101 (CreateStateObject -> PC 62), and 108 (GetResourceAllocationInfo2 -> PC 68 with C-ABI struct return support and Xbox resource desc normalization). Unit tests in d3d12_xs_test.cpp verify all calling conventions.
@moffington on GitHub · 2026-11-24 14:29 UTC · original
Independently tested
3c8b583eunder Wine against merge base21625bca8and a trial merge ontomainatd0da7dade.The slot 86/101/108 changes pass all six
xs_proxy_mocktests on the PR head. A synthetic Wine ID3D12Device8 probe also confirms the slot routing, struct-return ABI and resource-description normalization. The two existingdevice_proxyfailures remain unchanged.However, the trial merge onto main introduces a regression in
xs_proxy_mock_env_slots(5/6 tests pass).The fixed slot 86/101/108 handlers in
proxy_slottake precedence overxbox_device_slot_routes(). This shadows the environment-configuredGetFrameStatisticsXroute to slot 101 introduced by #402:Could you rebase onto current main and preserve the configurable routing behavior? The new fixed-slot handlers otherwise look good.
@DesertGamer on GitHub · 2026-11-24 14:45 UTC · original
@moffington thanks, rebased and fixed; the head is now
ac73a8412(two commits onmainf3e26be7c: the carried-over one, with its author kept, and a fix of mine on top).Reproduced first. After the rebase,
xs_proxy_mock_env_slotsfailed here too (7 of 8 ofxs_proxy_mock*anddevice_proxypassed, native Windows 11, MSVC, no Wine). The cause is the one you named: inproxy_slottheSlot == 86 / 101 / 108branches came before the generic branch, wherexbox_device_slot_routes()is read, so aLEONIDA_XS_FRAME_STATISTICS_SLOTpointing at 101 never ran.Fix. The three handlers now sit after the route checks and before the refusal for slots past the PC device table (the remainder of that branch is an
elseof the sameif constexprchain, so there is no newC4702). Their ownnote_slotcalls are removed, since the generic branch already counts the slot once; the hit counters stay at 1. A configured route wins over the fixed handler on that slot; without the variable, 86, 101 and 108 behave as before.Result.
xs_proxy_mock, its four variants includingxs_proxy_mock_env_slotsandxs_proxy_mock_env_slots_invalid,device_proxyanddevice_proxy_trace: 8 of 8 pass. I did not run under Wine, so your twodevice_proxyfailures there are not reproduced or checked; I did not run the rest of the CTest suite or the game on this head.AI-assisted: yes (Claude Code, Sonnet 5.5)
@Mouad-Scriptz-0 on GitHub · 2026-11-24 21:59 UTC · original
This conflicts with
main, and it's on the path to the frame loop, so here's a rebase to save a step:rebased/pr727(a50472cfd). It has the same 2 commits and authors onmain4a50cafc7.git range-diffagainst this branch shows no commit's own change was altered.The one conflict: in
runtime/test/xs_proxy_mock_test.cpp,mainaddedcase 13(CheckFeatureSupport FEATURE_LEVELS) to the mock device switch where this PR addscase 68(GetResourceAllocationInfo2). I kept both, each with its own block.Not compiled or run here: I have no Windows SDK on this machine, so CI is the first build.
To take it (maintainer edits are on):
AI-assisted.
@aslan2142 on GitHub · 2026-11-24 23:32 UTC · original
Merged. This is the next rung on
main's boot path: with #375, #377, #383 and #385 in, the title's next reported stop is the first call of device slot 108. The branch conflicted withmain, so I brought it up to date the way the Mumogg rungs were: one merge commit ofmain(2376e7d56) on top ofac73a8412(7234bcd7a). justr4mzi's and DesertGamer's commits are untouched and nothing was force-pushed. Thanks to both, and to @Mouad-Scriptz-0 for the earlier rebase, whosecase 13/case 68resolution this one matches.What it does:
ID3D12Device8::GetResourceAllocationInfo2(slot 68). It takes the console's C-ABI struct return (return buffer inRCX, device inRDX) as well as the PC order, and cleans the title's 56-byte descriptions on a copy. This removes the measured fault inproxy_slot<108>.CreatePipelineState(47) andCreateStateObject(62).LEONIDA_XS_*_SLOTvariable still wins over the three fixed handlers.Conflicts: three files; in each, both sides had added something and both are kept.
runtime/shims/d3d12_xs_device.cpp: this branch still had the six Xbox device slot routes inline, followed by its handlers for 86, 101 and 108;mainhas since moved those routes intoroute_xbox_device_slot()(#385). The generic path now calls the helper and then the three handlers. The six inline routes were compared with the helper line by line and are identical, so nothing is lost.device_slot_overridden()hasmain's list plus 86, 101 and 108.runtime/shims/d3d12_xs_device.h: the comment lists both sides' slots.runtime/test/xs_proxy_mock_test.cpp: the mock device keepsmain'scase 13and this branch'scase 68;check_xbox_slotskeepsmain's slot 41 and 61 cases, one combined list of handled slots, and this branch's slot 86, 101 and 108 cases. The two groups use different mock counters.Holds and requests: none from a maintainer. moffington's request (rebase and keep the configurable routing) is answered by
ac73a8412and by this merge.Tests (clang-cl with the xwin SDK; Wine, headless; llvmpipe and an RDNA2 iGPU):
main: 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_mockwith its six variants,device_proxyanddevice_proxy_tracepass on both.main2376e7d56. #1055 went intomainafterwards; it changes the command list and the replay, not these files, and the branch still merges cleanly.test_docs_*files andcheck_no_game_data.pyon the changed files are clean.Follow-ups, none blocking the boot path:
main's helpers (pc_resource_desc,d3d12_xs_desc_clean.h), and the results differ: its flag mask is0x5FFwheremainuses0x1FF(the comment calling it slot 133's mask is out of date); it maps every layout above 3, where slot 25 maps only0x101; and it skips the console render-target placement, so for a listed render-target shape it returns the PC size where slot 25 and the lease return the console tile size. Worth making the two agree before resources are created from these sizes. The depth-stencil unordered-access strip is claimed asRT-DS-UAV-SLOT108.printfofcheck_xbox_slotsdoes not mention 86, 101 and 108.#391 is the next rung.
AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5).