Repository navigation
Conversation
…cl-dev#1732) sparse::readback_after_execute previously stalled sparse::State::queue behind the title queue (s.queue.Wait) and synchronously blocked the submitter thread inside STATE.lock() for up to 5000 ms (s.wait_for). When an async compute queue carried both a sparse write and a wait-before-signal Wait64BitValueX whose producer direct queue had not yet been submitted on the same thread, this deadlocked both the submitter thread (blocking submission of the producer queue) and sparse::State::queue for 5000 ms per submit, triggering xcl-sync-watchdog timeouts and the title's stall watchdog after 5-6 consecutive submits. Dispatch sparse readbacks to per-queue background workers that wait on a raw per-queue fence outside STATE.lock() before invoking readback_ranges, never stalling sparse::State::queue or blocking ExecuteCommandLists.
|
Independent Windows release GPU check on NVIDIA RTX 3060 Ti ( Setup
Workspace tests (
Regression run (
Base ( PR head ( Not tested: Linux / Wine, repeating AI use: Antigravity ( |
…pub(crate) Fixes compilation errors on MSVC Windows target: - D3D12.X: restores pub(crate) unsafe fn create_raw_fence in real.rs required by sparse::readback_after_execute (xcl-dev#1732). Creates an unproxied raw ID3D12Fence bypassing title vtable hooks so internal queue worker threads under Wine/vkd3d-proton signal native fences without hitting proxy mismatches. - KernelX: restores pub(crate) visibility for commit_sparse in kernelx.rs (xcl-dev#549, xcl-dev#1298), required by DirectStorage's lazy MEM_RESERVE sparse window allocation in dstorage.rs and placeholder mappings. - Recompiler: adds #[cfg(test)] gate above mod tests in emit.rs to silence unused PRELUDE_MEM import warnings in non-test release builds (xcl-dev#1524). Assisted-by: Antigravity
…driver gave up callback Eliminates compiler warnings for unused items: - D3D12.X: removes rb_fence and rb_value from sparse::State and test fixtures (xcl-dev#1732). Readback fences are now managed per-queue in RB_QUEUES by async readback workers, making the fields on State obsolete. - D3D12.X: hooks note_driver_gave_up in real::translated_compute_pso_once when driver_compile_identified returns E_OUTOFMEMORY after DRIVER_GAVE_UP_AFTER (xcl-dev#1665, xcl-dev#1524), ensuring failed massive compute pipelines are persisted in used-pipelines.txt (!<key>) and eliminating dead code warnings. Assisted-by: Antigravity
00eec16 to
64cb447
Compare
|
Thanks @LocranKing for catching that on Windows! Your diagnosis was spot on: when an unstalled queue (like Updated
(The two earlier commits |
|
Verification on RTX 3060 Ti (Windows 11): merge conflict with current |
64cb447 to
e4d8229
Compare
|
Thanks @DavidM1911! Rebased the stack (#867 -> #871 -> #877 -> #1732) onto |
XCL PR #1732 verification on Intel Arc A770Head Tested
Workspace failures and skips 24 DXIL/recompiler tests failed (20 compute PSO rejections with 0x80070057 and four output mismatches). The title e2e failed its dynamic depth-bias check (blue pixel, expected green). The log contains 25 exact Not tested Matched main run, retail-title smoke, sample-data coverage, Wine or other GPUs. AI use T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against |
e4d8229 to
2fb4601
Compare
|
Thanks @JJAutoCompare for verifying all three focused Rebased onto |
|
Independent native Windows release test for #1732 on NVIDIA RTX 3070. The synthetic title's D3D12 debug-layer run read Tested
Commands used for the build, isolated tests, grouped E2E, and full suite: cargo build --release --offline --locked --workspace
cargo test --release --offline --locked -p xcl --test e2e test_title_runs_and_game_folder_is_untouched -- --exact --test-threads=1 --show-output
cargo test --release --offline --locked -p xcl --lib hle::d3d12x::sparse::tests::readback_after_execute_does_not_block_on_stalled_queue -- --exact --test-threads=1 --show-output
cargo test --release --offline --locked -p xcl --test e2e test_title_draws_with_a_root_signature_under_the_debug_layer -- --exact --test-threads=1 --show-output
cargo test --release --offline --locked -p xcl --test e2e -- --test-threads=4 --show-output
cargo test --release --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-outputNot tested
AI use
|
2fb4601 to
6fa3a01
Compare
…1946, xcl-dev#1803, xcl-dev#2297, xcl-dev#2320, xcl-dev#2333 Carries forward still-open high-value upstream PRs onto upstream/main (2898511) + our updated Wine PR stack (xcl-dev#867, xcl-dev#1395-successor, xcl-dev#871, xcl-dev#877, xcl-dev#1732). Preserves UnadoptGuard in xcl-dev#2320 KickoffX reset_one. Assisted-by: Antigravity (Gemini 4 Neon)
|
Thanks @razormontana for catching and isolating the 5/5 Root cause: Rebased onto
|
…er Wine (xcl-dev#175) vkd3d-proton validates iface->lpVtbl on adopted D3D12 objects passed back into d3d12core.dll (command allocators, lists, heaps, resources, PSOs, and fences). On unmodified assertion-free vkd3d-proton (such as GE-Proton or -Db_ndebug=true builds), XCL's in-place vtable adoption causes CreateCommandList/Reset to fail with E_INVALIDARG and fence waits to reject adopted fences. Under Wine (gated behind util::under_wine(), native Windows unchanged): - UnadoptGuard temporarily restores the native vtable on adopted command allocators (including alloc_pool backings and reset_pc_allocator), command lists, heaps (CreatePlacedResource/CreatePlacedResource1), RTV resources, and PSOs around calls into d3d12core.dll. - FenceProxy wraps title ID3D12Fence1 objects so the underlying PC fence keeps its native lpVtbl, unwrapping in queue Signal/Wait while preserving Fence::xcl-dev#12 completed_value_address and freeing on final Release. - real::create_raw_fence creates un-proxied native ID3D12Fence objects for XCL's own internal queue tracking (late_release, alloc_pool, list_x, cpu_writes, present, vram, drain_gpu) so un-adopted internal queues like sparse::queue() never receive a FenceProxy. Note: assert-enabled vkd3d-proton builds (such as stock Proton Experimental) still validate iface->lpVtbl inside an adopted object's own methods, so an assertion-free build (-Db_ndebug=true / GE-Proton) remains required for in-place adoption. Assisted-by: Antigravity (Google DeepMind)
On Linux with amdgpu, a multi-GiB coherent UMA window imported via OpenExistingHeapFromAddress (VK_EXT_external_memory_host userptr) causes two severe stalls: 1. GetWriteWatch(WRITE_WATCH_FLAG_RESET) on the userptr range triggers amdgpu MMU-notifier evictions (~100-200 ms/submit). 2. A multi-GiB userptr BO stalls every Vulkan GPU submission (~150 ms/frame, dropping PresentX frames). Under Wine (native Windows unchanged): - Key the default 512 MiB coherent_hint() cap on AMD GPUs (DXGI VendorId 0x1002) under Wine so NVIDIA Linux keeps a full-size coherent window (unless XCL_COHERENT_MB is set). - Allocate the coherent window without MEM_WRITE_WATCH and exclude it from watch_regions(), notifying title_textures on DirectStorage writes into it and hashing small/dynamic coherent textures with a 1/16 round-robin sweep for large ones. - Route overflow PAGE_GRAPHICS_* title GPU heaps into the sparse VRAM windows so shaders still read them directly. Assisted-by: Antigravity (Google DeepMind)
…#175) Under Wine, overflow PAGE_GRAPHICS_* title heaps are routed to sparse VRAM windows (xcl-dev#871). Eagerly mapping 64 KiB VRAM tiles for the full reserved heap up front consumes ~3.2 GiB of local VRAM for zero-filled or never- written pages before the title even leaves the menus. Add sparse::alloc_lazy (used under util::under_wine() only; native Windows unchanged): - Commits CPU pages up front so host accesses never fault, while deferring 64 KiB VRAM tile allocation until the first non-zero CPU write or GPU write target registration (placed buffers, buffer UAVs, and command-list memory writes via sparse::ensure_lazy_mapped). - Unit tests cover lazy-range overlap, hole masks, non-zero page detection, and coalesced lazy tile allocation. Assisted-by: Antigravity (Google DeepMind)
…g STATE or sparse::State::queue sparse::readback_after_execute previously stalled sparse::State::queue behind the title queue (s.queue.Wait) and synchronously blocked the submitter thread inside STATE.lock() for up to 5000 ms (s.wait_for). When an async compute queue carried both a sparse write and a wait-before-signal Wait64BitValueX whose producer direct queue had not yet been submitted on the same thread, this deadlocked both the submitter thread (blocking submission of the producer queue) and sparse::State::queue for 5000 ms per submit, triggering xcl-sync-watchdog timeouts and the title's stall watchdog after 5-6 consecutive submits. Dispatch sparse readbacks through per-queue FIFO background workers that wait on a raw per-queue fence outside STATE.lock() before invoking readback_ranges, never stalling sparse::State::queue. Track active unsatisfied queue.Wait calls via note_queue_wait (in q_wait_pc and the Wait64BitValueX GPU bridge, cleaned up in q_release via forget_queue): when the queue has an unsatisfied Wait, readback_after_execute returns immediately while the worker finishes asynchronously; when no unsatisfied Wait is active, readback_after_execute waits on the worker's completion condvar outside STATE.lock() so CPU reads immediately after a GPU fence wait (such as Write32BitValueBottomOfPipeX in testtitle) always observe the updated bytes.
6fa3a01 to
1be3831
Compare
…1946, xcl-dev#1803, xcl-dev#2297, xcl-dev#2320, xcl-dev#2333 Carries forward still-open high-value upstream PRs onto upstream/main (2898511) + our updated Wine PR stack (xcl-dev#867, xcl-dev#1395-successor, xcl-dev#871, xcl-dev#877, xcl-dev#1732). Preserves UnadoptGuard in xcl-dev#2320 KickoffX reset_one. Assisted-by: Antigravity (Gemini 4 Neon)
|
Rebased onto |
Move
sparse::readback_after_executeoffsparse::State::queueand out from underSTATE.lock()into per-queue FIFO background workers, completing asynchronously when the queue has an unsatisfied title/wait-before-signal GPUqueue.Wait(avoiding CPU/GPU deadlocks on wait-before-signalWait64BitValueX) and synchronously otherwise (preserving immediate CPU visibility after a GPU fence wait). Part of #1452.Stacked on #877; only the top commit (
1be3831a) belongs here.Previously,
sparse::readback_after_executelockedSTATE, calleds.queue.Wait(&s.rb_fence, v), and synchronously executeds.readback_ranges(&merged)(s.wait_for(s.value)with a 5,000 ms timeout) insideExecuteCommandLists. When an async compute queue carried both a sparse memory write and a wait-before-signalWait64BitValueXwhose producer direct queue had not yet been submitted on the same thread, this deadlocked both the submitter thread (preventing submission of the producer queue) andsparse::State::queuefor 5,000 ms per submit, triggering repeatedxcl-sync-watchdogtimeouts and causing a retail title's stall watchdog to abort after 5–6 consecutive submits.With per-queue FIFO workers waiting on a raw per-queue fence outside
STATE.lock()before invokingreadback_ranges,sparse::State::queueis never stalled behind a blocked title queue. Active unsatisfied titlequeue.Waitcalls and unsubmitted wait-before-signalWait64BitValueXbridges are tracked viasparse::note_queue_wait(ignoring XCL's own internal fences such assparse::before_execute'ss.fenceso an in-flight internal upload underXCL_D3D12_DEBUG=1never causesreadback_after_executeto return beforeCopyBufferRegioncompletes, fixing theWrite32BitValueBottomOfPipeXzero-read reported by @razormontana).What is in it
crates/xcl/src/hle/d3d12x/sparse.rs:RB_QUEUESmap (RbQueueStateholding a rawID3D12Fenceviasuper::real::create_raw_fence, monotonic fence value, and channel sender to a dedicatedxcl-sparse-rb-<queue>FIFO worker thread) andQUEUE_WAITStracking (note_queue_wait,queue_has_unsatisfied_wait,forget_queue).readback_after_executefilter/merge sparse ranges usinguma::get(), signal the queue's fence, register new queues withs.note_queue(queue)(preserving D3D12.X: quarantine unmapped parked sparse tiles behind GPU fences #2345's parked-tile quarantine tracking outside the hot path), and enqueue anRbJobwithout holdingSTATEacross GPU waits — returning immediately ifqueue_has_unsatisfied_waitis true, or waiting on the job's completion condvar outsideSTATE.lock()otherwise.STATE.lock()(5,000 ms timeout with power-of-two warning logging on late queues) before lockingSTATEand runnings.readback_ranges(&job.ranges).readback_after_execute_does_not_block_on_stalled_queueandinternal_fence_wait_keeps_readback_synchronous(verifying that an in-flight internal raw-fencequeue.Waitdoes not mark the queue stalled and keepsreadback_after_executesynchronous).crates/xcl/src/hle/d3d12x/real.rs&crates/xcl/src/hle/d3d12x/list_x.rs:queue.Waitcalls (is_fenceinq_wait_pcandqueue_dispatch) and unsubmittedWait64BitValueXGPU bridges (unsubmittedintry_gpu_wait) viasparse::note_queue_wait, and clean up per-queue state inq_releaseviasparse::forget_queue.Tested
GE-Proton11-14-x86_64,vkd3d-proton(-Db_ndebug=true), DXC 1.9.2609.5, cross-compiledx86_64-pc-windows-msvc(clang-cl+lld-link).maine0d93c84+ D3D12.X: preserve native vtables and wrap fences for vkd3d-proton under Wine (#175) #867 (f98da36d) + Memory: avoid amdgpu userptr stalls under Wine (#175) #871 (153730d7) + Memory: lazily map sparse VRAM tiles for Wine graphics heaps (#175) #877 (08abaa07) at1be3831aand verified under Proton (XCL_DXC_DIRset for GPU tests):hle::d3d12x::sparse:: --test-threads=1: 20 passed, 0 failed, 1 ignored (including bothreadback_after_execute_does_not_block_on_stalled_queueandinternal_fence_wait_keeps_readback_synchronous, plus D3D12.X: quarantine unmapped parked sparse tiles behind GPU fences #2345's quarantine tests)hle::d3d12x::vram:: --test-threads=1: 19 passed, 0 failed, 1 ignoredhle::d3d12x::title_textures:: --test-threads=1: 19 passed, 0 failed, 0 ignoredgpu::uma:: --test-threads=1: 12 passed, 0 failed, 0 ignoredhle::d3d12x::list_x:: --test-threads=1: 40 passed, 0 failed, 0 ignoredhle::d3d12x::real:: --test-threads=1: 61 passed, 0 failed, 0 ignoredhle::d3d12x::alloc_pool:: --test-threads=4(× 3): 4 passed, 0 failed, 0 ignored each--exact gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem gpu::recomp::tests::gpu_valu_float_and_int --test-threads=1: 2 passed, 0 failed, 0 ignored, 0 skippedpwsh ./scripts/smoke.ps1(withGE-Proton11-14wrapper):985frames shown (PresentX 985,54 56 55/2 s),exit: 0x0,0crashes,0device removals.Regression run
Produced under Wine (
GE-Proton11-14, AMD Radeon RX 9060 XT,XCL_NETWORK=0 XCL_PSO_PRELOAD=0 XCL_RUN_SECONDS=60 XCL_ACTIVITY=1,VKD3D_CONFIG=""). The PR run used unmodifiedpwsh ./scripts/smoke.ps1via a thin Wine wrapper;main(e0d93c84) crashed before writingreport.json, so its block was extracted from the samexcl.log(peak commit: 0 MBis what Wine reports inxcl.log).main(e0d93c84):This PR (
1be3831a, stacked on #877):Not tested
test_title_draws_with_a_root_signature_under_the_debug_layerneeds re-verification on Windows after theis_fence/unsubmittedfix).AI use
main+ updated Memory: lazily map sparse VRAM tiles for Wine graphics heaps (#175) #877, and running the Proton test/smoke verification.