Repository navigation
Conversation
… Linux PRs ivall#867/ivall#871/ivall#877 Update fork README for upstream/main 1ec4c98 (fenced late_release and queue-wait diagnostics), newly integrated PRs (ivall#838-ivall#841, ivall#849, ivall#851, ivall#864, ivall#875, ivall#876), live gameplay audio progress, and our three open upstream Linux PRs (ivall#867, ivall#871, ivall#877). Assisted-by: Antigravity (Google DeepMind)
|
Linux / AMD RDNA3 lane report, head This PR hard-crashes the test harness on my Wine/RDNA3 lane. Not a test failure: the lib test binary dies with exit status 5, no panic message, no failure list. Everything after it (e2e, gpu_compute_e2e, pls_quota, predication_e2e targets) then fails to run, which is why the lane totals look collapsed (36 passed / 2 suites). Crash point, pinned with sequential runs ( Reproduced 3/3: full-suite lane run, isolated lib rerun, and a Counts only, no game data. Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting. |
|
Written by an AI agent (Claude Code, Claude Opus 5.5) on this account, from runs on this machine. A second RDNA3 data point for this PR and #867: RX 7900 XTX, Mesa 26.3.1 RADV, CachyOS (kernel 7.3.5), Wine 11.22 (Arch build, kernel write watches), vkd3d-proton v3.1 (
Not run: Windows, NVIDIA, stock vkd3d-proton, |
|
Rerun on the new head Rerun on the new head Native Windows / NVIDIA run, since Not tested lists native Windows. Tested
Not tested
AI use
|
|
An NVIDIA data point for the 512 MB default. RTX 5060 8 GB (NVIDIA 595.112.07), Wine 11.22 Staging, vkd3d-proton master + relaxed lookups + dxil-spirv
So on this card the small window costs about a quarter of the frames during the intro and loading, where on RADV it is the other way round. Keying the default on the driver (amdgpu) rather than on Wine might be worth it. Not tested: AMD, Windows, a GPU with more than 8 GB. AI use: Claude Code with Claude Opus 5.5 ran the builds and runs and wrote this; I checked it. |
Under Wine, overflow PAGE_GRAPHICS_* title heaps are routed to sparse VRAM windows (ivall#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)
de6d71c to
45b805c
Compare
|
Rebased onto
|
Under Wine, overflow PAGE_GRAPHICS_* title heaps are routed to sparse VRAM windows (ivall#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)
…ll#1221, and updated Linux PRs Update fork README for upstream/main 930e8b4 (BCPack BC1-BC7, XCL_PSO_WAIT_MS, low-VA ASLR < 2^40, alloc_pool, sparse tile parking/pool reuse, direct page moves, write-watch merge), newly integrated PRs (ivall#1078, ivall#1097, ivall#1139, ivall#1142, ivall#1150, ivall#1156, ivall#1182, ivall#1191, ivall#1195, ivall#1221), and updated Linux PRs (ivall#867, ivall#871, ivall#877). Assisted-by: Antigravity (Google DeepMind)
crastinator
left a comment
There was a problem hiding this comment.
Tested on RDNA2 under Proton with a patched vkd3d-proton: no new failures. That includes #867's commits, since this PR stacks on them.
Tested (head 45b805c, merged onto main 930e8b4: no conflicts)
- AMD Radeon RX 6700 XT (RDNA2, gfx1031, RADV NAVI22, Mesa 26.3.1), Ryzen 7 5700X, Linux 7.3.5 (CachyOS)
- Proton Experimental 11.0-20261112's Wine, vkd3d-proton v3.1 + #257's patch (
-Db_ndebug=true, dxil-spirv53aac418from #775), DXVK v3.1.1-209dxgi, DXC 1.9.2609.5, libopus 1.5.2,XCL_REQUIRE_GPU=wave64,mesh(0 SKIPPED) - cross-built for
x86_64-pc-windows-msvc(clang-cl / lld-link, xwin SDK 10.0.26100), Rust 1.99.1, debug cargo test -p xcl --lib -- --test-threads=1plus every integration test (--test '*' -- --test-threads=1), compared per test with the same runs onmain930e8b4.mainhere: 8 stable Wine-lane failures (#530 ×2, #676, #890 ×2, e2e,pls_quota#810,predication_e2e#1272). Separately,title_textures::{placed_title_textures_share_vram_and_preserve_pixels, transitions_apply_when_their_list_is_submitted}andvram::d32s8_targets…fail together in 2 of 5mainruns (the #718 family), so I do not count a pass of those as a fix either way.- PR: 745 passed, 8 failed, 41 ignored.
main: 740 / 11 / 41 in the same run, with the 3 #718 flakes failing that time. No test fails here that passes onmain; the 8 failures are the stable set above.gpu::uma::tests7 passed,hle::d3d12x::sparse::tests13 passed and 1 ignored.
Not tested
- Anything that needs game files: no
XCL_SAMPLE_*was set, so the tests that read them (about 66) pass without running. - The stalls this PR is about (a retail title): no game here yet. Proton's unpatched vkd3d-proton (see my note on #867). NVIDIA.
AI use
- Claude Code (Claude Opus 5.5) merged, built and ran this and wrote the report; I checked the results.
Under Wine, overflow PAGE_GRAPHICS_* title heaps are routed to sparse VRAM windows (ivall#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)
45b805c to
b66a150
Compare
|
Rebased onto
|
|
Thanks @Tymon3310 for the RX 6800 XT / second-title verification (0.3 fps → steady 30.0 fps over 240 s with 0 crashes/removals)! Great to have RDNA2 confirmation beyond the first title as well. |
b66a150 to
b3f2f7c
Compare
|
Verification on RTX 3060 Ti (Windows 11): merge conflict with current |
|
On RDNA4 under Wine, Setup: RX 9070 XT 16 GB (RDNA4), Mesa RADV 26.3.1, Ryzen 9 5950X, 128 GB, CachyOS kernel
The merge (
Not tested: the merge on native Windows, the whole suite on it, a regression pair ( AI use: Claude Code (Claude Opus 5.5) ran the start tests, resolved the merge and wrote this comment. |
b3f2f7c to
34cd677
Compare
|
Thanks @DavidM1911 and @St5sz2Jk (especially for sharing your clean conflict notes)! 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)
|
A race in What happened: How we read it: What we run locally (not a fix of the design, just the crash): in pub unsafe fn orig_fn(this: *mut c_void, slot: usize) -> usize {
let ext = vt(this);
let orig = *ext.sub(1) as *const usize;
if orig.is_null() {
// another thread's UnadoptGuard put the native table back: it is the original itself
return *ext.add(slot);
}
*orig.add(slot)
}It relies on the word before vkd3d-proton's vtables being 0, which held here but is not guaranteed. A sturdier way would be to not write the shared object's vtable at all for objects other threads can reach (pipeline states), e.g. only unadopt the list and allocator, or pass vkd3d-proton an unadopted alias. Counts, for what they are worth: 1 crash in 6 runs of this stack with #2404 on top (180–600 s each), 0 in 2 runs (330 s) with the Setup: RX 7900 XT, Mesa 26.2.5 RADV, Linux 7.2, Proton-CachyOS Wine 11, a local vkd3d-proton build; AI use: Claude Code (Claude Opus 5.5) read the crash, the code and the logs, ran the runs and wrote this. |
34cd677 to
cfcdca7
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 |
Avoid
amdgpuuserptrsubmission stalls under Wine/vkd3d-proton on Linux by capping the coherent UMA window to 512 MiB on AMD GPUs (withoutMEM_WRITE_WATCH) and routing overflowPAGE_GRAPHICS_*heaps into the sparse VRAM windows. Part of #175 and #1701.Stacked on #867; only the top commit (
cfcdca7) belongs here.On Linux with
amdgpu, importing a multi-GiB coherent UMA window viaOpenExistingHeapFromAddress(VK_EXT_external_memory_hostuserptr) causes two severe stalls:GetWriteWatch(WRITE_WATCH_FLAG_RESET)on theuserptrrange triggersamdgpuMMU-notifier evictions (~100–200 ms per submit).userptrBO stalls every Vulkan GPU submission (~150 ms/frame, droppingPresentXframes).All new paths are gated behind
util::under_wine(); native Windows behavior is unchanged.What is in it
crates/xcl/src/gpu/uma.rs:coherent_hint()cap under Wine on AMD GPUs (wine_amd_gpu()via DXGIVendorId == 0x1002), so NVIDIA Linux keeps a full-size coherent window unlessXCL_COHERENT_MBis explicitly set (per @notdxbi's RTX 5060 benchmark).MEM_WRITE_WATCHunder Wine and omit it fromwatch_regions().crates/xcl/src/hle/d3d12x/title_textures.rs&crates/xcl/src/hle/dstorage.rs:title_textures::mark_dirty_rangeand call it on DirectStorage copies into coherent memory under Wine.copy_committed_region(ReadProcessMemory) inread_committed/title_bytes/refreshunder Wine instead of rawcopy_nonoverlapping/from_raw_parts, fixing the0xc0000005ucrtbase.dllmemcpyfault on unreadable coherent-window pages reported by @TobiasFornell.crates/xcl/src/hle/kernelx.rs:PAGE_GRAPHICS_*VirtualAlloccalls under Wine into the sparse VRAM windows when the coherent window is full.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).main2898511+ D3D12.X: preserve native vtables and wrap fences for vkd3d-proton under Wine (#175) #867 (c79e3b3) atcfcdca7and verified across the rebased stack under Proton (--test-threads=1,XCL_DXC_DIRset for GPU tests):gpu::uma::: 12 passed, 0 failed, 0 ignoredhle::d3d12x::title_textures::: 19 passed, 0 failed, 0 ignoredhle::d3d12x::vram::: 19 passed, 0 failed, 1 ignoredhle::d3d12x::sparse::: 20 passed, 0 failed, 1 ignoredhle::d3d12x::real::: 60 passed, 0 failed, 0 ignored--exact gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem gpu::recomp::tests::gpu_valu_float_and_int: 2 passed, 0 failed, 0 ignored, 0 skippedpwsh ./scripts/smoke.ps1(withGE-Proton11-14wrapper): improved from20frames (PresentX 21,0 2 0/2 s) on D3D12.X: preserve native vtables and wrap fences for vkd3d-proton under Wine (#175) #867 to1067frames (PresentX 1068,59 60 58/2 s) with0crashes and0device 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(2898511) crashed before writingreport.json, so its block was extracted from the samexcl.log(peak commit: 0 MBis what Wine reports inxcl.log).main(2898511):This PR (
cfcdca7, stacked on #867):Not tested
util::under_wine()).0x1002; non-AMD fallback path is unchanged from upstream).AI use
main+ D3D12.X: preserve native vtables and wrap fences for vkd3d-proton under Wine (#175) #867, running the Proton test/smoke verification, and drafting this update.