Repository navigation
Conversation
|
A regression run under Wine on Linux on the retail title: no device removal, no crash, frames level with Tested
Regression run main (first run): this PR: The second Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
Reclaim idle put-aside PC command allocators proactively via reset_list_with_retire and reclaim_idle, cap excess clean spares at 2 per allocator, hold orphaned busy spares and pending UMA blocks behind GPU fences until idle, and order bind::forget and list_x cleanup strictly before alloc_pool::forget_list and release.
When coherent unified memory is exhausted, small per-draw root/CBV copies and AllocateUploadMemory requests first rate-limit idle allocator-pool reclamation (50 ms cooldown), then seed one 256 KiB sparse VA block into the list's Arena instead of claiming a 64 KiB sparse block per small copy, sharing it across subsequent bump allocations on both command lists and console command lists.
583fe45 to
3f3d762
Compare
|
Rebased cleanly onto the updated Re-tested on
|
|
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current |
Stacked on #2138; only the top commit belongs here.
When coherent unified memory fills up during heavy scene recording, every draw still needs small chunks of unified memory for its per-draw shader tables and constant-buffer copies, and console middleware calls
AllocateUploadMemory. Previously, when coherent unified memory ran out on a small request, recording either failed (unified memory is full) or risked allocating a separate 64 KiB sparse block for each tiny copy (burning sparse reservation blocks and virtual-address tiles on every small draw).This change handles small upload and binding requests cleanly when coherent unified memory is full: first it asks the swap pool to reclaim idle put-aside PC command allocators (rate-limited to once every 50 ms across concurrent threads so threads do not thrash a contended pool) and retries coherent memory; if coherent memory is still full and sparse unified memory windows are enabled, it allocates one 256 KiB sparse block, seeds the command list's bump arena with it, and serves subsequent small draws out of that same 256 KiB block until the allocator resets (doing the same for console command lists on
cl_allocate_upload_memoryanduma_copy). Larger requests continue taking dedicated sparse blocks before falling back to coherent memory + reclaim.What is in it
crates/xcl/src/gpu/uma.rs: splitArena::take_bumpout ofArena::take, addArena::seed_block(with overflow-safe bounds checks) so callers can attach a 256 KiB backing block to an active arena, and add unit testarena_seed_block_bump_allocates_and_tracks_block_oncecrates/xcl/src/hle/d3d12x/bind.rs: add a 50 ms cooldownmaybe_reclaim_alloc_poolretry, extract sharedalloc_recording_uma/alloc_recording_uma_withfallback helper used by bothallocate_upload_memoryandbind_abi's copy closure (dropping redundant sparse blocks outsideSTATESif another thread seeds concurrently), plus unit testalloc_recording_uma_falls_back_to_sparse_arena_block_without_per_copy_churnand GPU testgpu_sparse_arena_fallback_maps_va_uploads_to_gpu_and_frees_on_resetcrates/xcl/src/hle/d3d12x/console_list.rs: share the 256 KiB sparseArenablock seeding fallback incl_allocate_upload_memoryanduma_copywhen coherent unified memory is fullTested
rustc 1.100.0 (0ef1bc386 2026-11-09)cargo test -p xcl --lib ... -- --test-threads=1):gpu::uma::tests13 passed / 0 failed / 0 ignored;hle::d3d12x::bind::tests9 passed / 0 failed / 0 ignored;hle::d3d12x::console_list::tests5 passed / 0 failed / 0 ignored;XCL_HEAP_WINDOWS=1standalonehle::d3d12x::bind::tests::gpu_sparse_arena_fallback1 passed / 0 failed / 0 ignoredcargo test --workspace --no-fail-fast -- --test-threads=4: 1269 passed, 2 failed (only pre-existinggpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1seed 722 andfuzz_validate_and_gpu_3seed 1599 reproduced on unmodifiedorigin/main06c9f550, tracked in DXIL fuzz tests: fuzz_validate_and_gpu_1 fails on AMD (seed 722 and others, RDNA2-4), so the default suite is red there #2115 / Direct DXIL: geometry mode, MSAA loads and directed f32 rounding #1679), 46 ignored across 23 test result summaries (debug build)SKIPPEDtests: gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's)); gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's)); gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's)); gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's)); gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's)); gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's)); shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D); test_title_draws_with_a_root_signature_under_the_debug_layer: no d3d12SDKLayers.dll; heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows; uploads_start_from_each_subresources_state: no D3D12 debug layer (The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D))cargo build --release -p xcl) and 60 s retail title run (5ec87c56) completed cleanly with 0 device removals and 0 crashes; peak commit was 16108 MB vs 19392 MB onmainRegression run
Not tested
mainalone (verified locally across a 240 s retail world-load soak with 0unified memory is fullerrors alongside the rest of the local patch set), NVIDIA GPUs, Intel Arc GPUs, wave32-only GPUs, and Linux/WineAI use
Arena::seed_blockand the throttled reclaim/sparse fallback path, porting/rebasing onto the updated#2138base, adding the unit and GPU tests, running the test suite and smoke runs, and drafting this description. All builds, tests, and regression runs were executed locally on the hardware above.