Repository navigation
d3d12_xs: the title's XMem hooks, console render-target sizes and resource leases, again (RT-XMEM-LEASE) - #375
Conversation
ae574b3 to
35e687f
Compare
|
Holding this. #362 and #369 are merged. With this PR on top of them, a Windows MSVC build (AMD RX 6800, WARP for the proxy test) fails three checks that pass without it: The console tile sizes for slots 25 and 56 change what GetResourceAllocationInfo returns, so it no longer matches the PC device these tests compare against. Either scope the console sizes to the title's resources, or update the tests to state the new contract, with a reason. Follow-ups from review, not blocking on their own:
#377 and the PRs stacked on it wait on this and on the ExecuteIndirect fix noted there. |
|
Tested your change against the retail title on today's Good news first: the five commits are now clean on top of What you fix is now behind a wall this pull request does not cross. On With the IID answered, your change clears the budget check you describe. I added #445's mapping on top (nothing else) and re-ran: the assert your body describes is gone. That check is visible in the executable — And here is what it hands over, which I could not fix and am reporting rather than claiming. The run ends with a C++ exception, The title got there through the call at Limits, so you know what this evidence does and does not cover: one machine (integrated Radeon 780M, gfx1036), no Vulkan NVIDIA comparison for this part. I did not run |
…stack Contains ProjectLeonida#375 ProjectLeonida#377 ProjectLeonida#383 ProjectLeonida#385 ProjectLeonida#391 ProjectLeonida#395 ProjectLeonida#396 ProjectLeonida#403 ProjectLeonida#414 ProjectLeonida#416 ProjectLeonida#427 ProjectLeonida#430 ProjectLeonida#432. # Conflicts: # runtime/shims/d3d12_com.cpp # runtime/shims/d3d12_vulkan_device.cpp # runtime/src/command_list.h
|
Same three failures on NVIDIA (RTX 3070, driver 610.88, Windows 11, MSVC), with #432's stack merged onto |
…nslate CPU handles (cherry picked from commit 355201c)
…(RT-5 stop 17) The retail title asserts when its first full-screen render targets leave more than 2 MiB of a fixed budget unused (docs/retail_boot_chain.md, #6982). The PC size is about width x height x element bytes; the console takes whole RDNA2 SW_64KB tiles. Slot 25 adds the difference per render target description and never lowers a size. Depends on #6973. (cherry picked from commit 8897855)
…ons (RT-5 stop 16) The title's descriptions carry the Xbox layout word and flag bits above the PC ones. Slot 25 now passes a copy with PC flags and a PC layout; the title's array is not written. Depends on #7078. (cherry picked from commit c7ca0f2)
…t, slot 56 offsets, full mip chains, rounded-up mip extents, B5G5R5A1, saturating sums (cherry picked from commit 3593908)
…em hooks (RT-5 stop 17) On the console a committed resource's memory is allocated with XMemAlloc, so it goes through the title's __XMemAllocationHooks__. The retail title budgets its first full-screen render targets with a per-thread hook that bump-allocates out of a range it reserved and asserts that less than 2 MiB is left; PC resources never allocated through the hooks, so the assert always fired. Slots 76 and 127 now allocate the slot-25 size of each resource through the hooks, held by the resource with SetPrivateDataInterface and freed when it is destroyed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit ae322da) Adapted to main by Mumogg: the lease size is the later form of this series (d61755d, a render target's console tile size, else the PC size), since console_render_target_extra is gone after 3593908.
(cherry picked from commit b4d1ba1)
…g-cl rejects 0x101 for the unfixed enum) Reported by YaBulochka and sovljanskii on #7154; #7110's current head has the same form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit bee4718)
…console-form calls only With the console tile sizes applied to every caller, a PC-form call through the proxy no longer answered what the PC device answers, and the code that compares the two failed on Windows: device_proxy_test's two slot 25 checks and d3d12_vulkan_device_test's allocation_mismatches (reported on ProjectLeonida#375 from MSVC builds on AMD and NVIDIA, the first bad commit being the one that cleans the descriptions). Together with b4d1ba1, which scopes the cleaning the same way, a PC-form caller now gets the PC device's own answer for its own description; the title's call, which comes in the console form, gets the cleaned description and the console sizes as before. xs_proxy_mock_test: the PC-form slot 25 case expects the mock device's size (it expected the console size), and the mixed slot 56 case is asked in the console form. device_proxy_test includes d3d12_xs_desc_clean.h for the cleaned description b4d1ba1's check compares with. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
…ole-extended heap A heap that main's console-extended handler created already sits at the address the title named, so proxy_create_descriptor_heap asks the title's XMem hooks for a backing address only when the heap came from a plain PC description (follow-up asked for in review on ProjectLeonida#375). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
35e687f to
0c5a146
Compare
|
Updated: rebased on The three failing checks. I took the first option, scoping the console behaviour to the title's calls:
What I could and could not verify here. Follow-ups.
The title's retail run with the whole stack is in #602. To fiestorra: thank you for the Windows run; the AI-assisted. |
|
Check on a second NVIDIA machine (Windows 11, RTX 5070, driver 617.14, AI-assisted: yes (Claude Code, Sonnet 5.5) |
One conflict, runtime/test/xs_proxy_mock_test.cpp, neighbours added on both sides, both kept: the mock's `held` (this branch, slot 5 private data for the committed-resource leases) next to main's `max_level` (FEATURE_LEVELS answer), and this branch's five checks in main()'s list before main's check_presentation_wiring(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@Mumogg this PR is the gate for
AI-assisted (Claude Code, Claude Fable 5.2). |
One conflict, runtime/shims/d3d12_xs.cpp: functions added after create_root_signature_deserializer on both sides, both kept: main's create_versioned_root_signature_deserializer, then this branch's xmem_descriptor_heap_alloc/free (the bridge to the title's XMem hooks that D3D12XboxCreateDevice installs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This conflicts with Every conflict was an add/add. I kept both sides:
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): git fetch https://github.com/Mouad-Scriptz-0/leonida rebased/pr375
git push --force-with-lease=xmem-hooks-sizes-lease:0c5a14659 https://github.com/Mumogg/leonida-continued FETCH_HEAD:xmem-hooks-sizes-leaseAI-assisted. |
|
Merged. Mumogg has been away since this morning and this PR is the gate for Conflicts: three, each from additions on both sides, both kept.
Thanks @Mouad-Scriptz-0 for the independent rebase: it resolves the same three places the same way, and differs from this branch only in the order of two lines in the test. The three checks behind the hold:
Tests, the merged branch against
Next: #546 reads the same export with its own struct and conflicts with this in AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5). |
|
The check left open above, measured on Windows with a Vulkan GPU, plus the retail boot after this merge. Setup:
Retail boot (own 1.0.2.1 copy,
AI-assisted. |
Claimed in #14 as
RT-XMEM-LEASE. Depends on: #349, #350, #356, #362, #369 (their commits come first here; this pull request is the last five commits).What and why
After #369 the title stops on a budget check: it bump-allocates its first full-screen render targets out of a range it reserved, through its own
__XMemAllocationHooks__, and asserts that less than 2 MiB of that range is left. Onmainnothing goes through those hooks, so the whole range is left.tools/int3_cause.pyon the stop shows the comparison against0x1fffff.Clearing it takes three pieces that build on each other. All five commits are cherry-picked with
-xand keep their authors; all are ancestors ofmainwhose content is not in the tree.355201c51__XMemAllocationHooks__honoured for descriptor heaps; device slots 17 to 24 translate CPU handles in the title's own range (old PR 7021)889785539c7ca0f2d1359390833ae322dafcWhat I changed while resolving conflicts, so a reviewer knows where to look:
proxy_get_resource_allocation_info:c7ca0f2d1and359390833come from two branches of the original series; I resolved them as the original merge commit (aeb253754) did, including the mock's helper block.359390833removes. I used the later form from the same author's follow-up (d61755d4d): a render target's console tile size, else the PC size. The commit message says so.Left out on purpose, to keep this to what the stop needs:
b4d1ba179(PC descriptor validation in slot 25),4a8603436(a depth-stencil texture with unordered access) andbee47186f.One thing a maintainer should decide:
355201c51is the title-backed descriptor heap model.mainalso has the slot 14 console-heap handler in the Vulkan layer. They did not conflict textually and the boot below runs with both present, but they are two answers to the same question and I have not worked out how they should share slot 14.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
mainece4ba5b3, with #142 and #328 applied on top for the boot runs (they are not in this branch).--runint3on the 2 MiB budget checkint3after its device set-up returns false; the last new slot called is 41With this the log shows the first calls of device slot 16 (
CreateRootSignature) and slot 62 (the console's compute pipeline creation), and the shader library loads (28,215 translated shaders here). The next stop looks like device slot 41,CreateCommandSignature, forwarded as it is.xs_proxy_mock_testunder Wine passes with every case of the five commits: descriptor heap hooks, render-target sizes, cleaned descriptions, render-target layout and committed-resource leases.Not built with MSVC and not run on Windows.
device_proxy_testalso gets cases from355201c51; I cannot run it here (it stops atD3D12XboxCreateDevice returns a deviceunder Wine, onmaintoo).AI-assisted (Claude Code); built and run on the machine above.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt