Repository navigation
Conversation
…#1358) A title's allocator Reset while the GPU still runs what was recorded on it puts that PC allocator aside (alloc_pool, xcl-dev#897) and returns S_OK. real::alloc_reset took the S_OK as "the GPU is done" and freed every unified-memory block that ended recordings on the title's allocator had used: root argument tables, io and AllocateUploadMemory blocks. Coherent blocks go back on the pool's LIFO stack, so the next translated draw can take one and write its arguments over those a submitted draw has not read yet; sparse ones are decommitted. xcl-dev#897 counted 240 such swaps in 60 s of a retail title's world. The blocks were also held under the title's allocator, which since xcl-dev#897 stands for PC allocators that change, so no one Reset could tell whether the GPU was done with all of them. A recording's blocks are now held for the PC allocator it is on (the one alloc_pool's reset_list hands to the PC Reset), and alloc_pool gives a PC allocator's blocks back at the title's Reset once the GPU has passed every submit on it, whether it is in use, was reset or was put aside. A PC allocator made here that is released gives its blocks back with it. The device test through the Reset hook finds the blocks freed at the swap on the old code (run on Wine's D3D12 over MoltenVK; no Windows machine here). Fixes xcl-dev#1358. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Test report on head Tested
Not tested
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Regression run of Against the limits in CONTRIBUTING.md: 101 % of AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, AI use: Claude Code (Claude Opus 5.5) built both trees and ran |
|
NVIDIA test report for
Added 16:35Z: whole workspace on this head, after
AI-assisted (Claude Code, Claude Opus 5.5). Synthetic tests only; no title run. |
Fixes #1358.
When the title resets a command allocator while the GPU still runs what was recorded on it,
alloc_pool(#897) puts that PC allocator aside and returnsS_OK.real::alloc_resettook theS_OKas "the GPU is done" and freed every unified-memory block that ended recordings had filed under the title's allocator: root argument tables, io andAllocateUploadMemoryblocks. Coherent blocks go back on the pool's LIFO stack, so the next translated draw can take one and write over arguments a submitted draw has not read yet; sparse ones are decommitted. #897 counted 240 such swaps in 60 s of a retail title's world. Filing the blocks under the title's allocator could not work either: since #897 it stands for PC allocators that change, so no one Reset could tell whether the GPU was done with all of them.Now a recording's blocks are filed under the PC allocator it is on, and
alloc_poolgives a PC allocator's blocks back at the title's Reset once the GPU has passed every submit on it (whether it is in use, was reset or was put aside).What is in it
One commit:
alloc_pool.rs:title_resetgives back the blocks of the title allocator's PC allocators whose submits the GPU has passed (done_with,Backing::idle); a PC allocator made here gives its blocks back when it is released. Testsended_recordings_keep_their_memory_until_the_gpu_passes_their_allocator(CPU) anda_reset_that_puts_the_allocator_aside_keeps_what_the_gpu_still_reads(D3D12 device, through theResethook, with the queue held on a fence).real.rs:alloc_resetfrees the blocks itself only when it reset the title's allocator itself.list_x.rs:reset_x, the Wait64 mid-list split and KickoffX's split givebindthe PC allocator the new recording is on. Testa_recordings_memory_is_held_for_the_pc_allocator_it_is_on(CPU).bind.rs,console_list.rs: doc comments only.Tested
No Windows machine here: Apple M1 Pro, macOS 27.2, Wine 11.21 (Gcenx build) with Wine's D3D12 on MoltenVK 1.4.0, under Rosetta 2. Rust 1.100.0,
x86_64-pc-windows-gnu(mingw-w64 14.0.0), debug. Every test binary ofcargo test --workspace --no-runrun under Wine with--test-threads=1(with 4 threads the lib test binary exits with status 5 a few seconds in, onmaintoo).7901856: 745 passed, 9 failed, 41 ignored; SKIPPED: 89no GPU, 5no DXCmain,930e8b4: 742 passed, 9 failed, 41 ignored; the same skipsdisk_free_space_ex_reports_pls_quota,test_title_runs_and_game_folder_is_untouched,readable_answers_from_the_working_set_without_touching_pages,timestamps_outside_unified_memory_land_after_the_queue,write_buffer_immediate_on_open_existing_heap_visible_to_cpu,a_tile_decommitted_and_committed_again_keeps_its_video_memory,ensure_mapped_with_query_holes_skips_uncommitted_pages_on_readback,d32s8_targets_take_their_own_size_of_video_memory,reset_dxgi_device_manager_with_d3d12_device_and_token_validationreal.rsandlist_x.rsput back as onmain: the device test finds the blocks freed at the swap (left: []) and thelist_xtest finds the recording filed under the title's allocator. The CPU test inalloc_pool.rscallstitle_reset_withdirectly, so it fails only iftitle_resetalso frees the title allocator's blocks on success, asalloc_resetdid.main06c9f55(no conflicts; Retail game (retail title, Series X build): GPU device removal after Wait64BitValueX waits with no producer; also watchdog stalls on slow compute pipeline builds #1452's stand-in list for a Reset while the last submit runs goes throughreset_pc, which files the recording under the PC allocator it is on here as well): 1162 passed, 106 failed, 46 ignored;main06c9f55: 1159 passed, 106 failed, 46 ignored; the same 106 fail on both (Wine / MoltenVK; 86 of them aregpu::dxiltests, the rest include the 9 listed above). SKIPPED on both: 124no GPU, 23no GPU with 32-lane waves, 12no DXC, 6no wave32 GPU, 5Invalid parameter. (0x80070057), 2no GPU UMA, 1no GPU / DXC / mesh shaders, 1no d3d12SDKLayers.dll, 1no D3D12 debug layer, 1validator 0.0 < 1.87901856: 754 passed, 0 failed, 41 ignored, and the device test fails without thereal.rs/list_x.rschanges (report); RTX 3070, merged ontomain568e7db: 1156 passed, 1 failed (the end-to-end test: its title was not built), 46 ignored, the same asmain(report)Regression run
Run by Toons29 on a Radeon RX 9070 (RDNA4), release, 60 s of the retail title with
XCL_NETWORK=0; the blocks are copied from their comment as posted. 101 % ofmain's frames, 100 % of its peak commit, no crash, no device removal. It does not show whether the title reached the put-aside path.Not tested
XCL_CONSOLE_LISTS=1: its lists are not tracked byalloc_pool, so its allocators are never put aside; unchanged.alloc_pool, as before (D3D12.X: track split and created lists on alloc_pool's active backing #1071 registers them).AI use
🤖 Generated with Claude Code