Skip to content

Linux (Wine + vkd3d-proton): a retail game reaches what main reaches on Windows; the obstacle is replaced vtables — proposal: proxies #175

Open

Description

@ozimchuk

With #92 and #93 merged, unmodified XCL starts under Wine. This is what I measured from there up to current main (956a476), the one thing that stands in the way, and a proposal for it. It is also a partial answer to #154. I'd like to know which direction you would accept work on before writing any.

Setup

  • Linux, kernel 7.0, Wine 11.21 (Staging), in a container.
  • GeForce RTX 5060 Ti (32-lane waves) and an AMD iGPU (RADV, Mesa 25.2.8, 64-lane waves, mesh shaders).
  • vkd3d-proton: release 3.1, and master at cae8353.
  • DXVK 3.1.1 for dxgi.dll, d3d11.dll, d3d10core.dll, as Proton pairs them.

Result

Test title, xcl run <testgame> -- --hello:

vkd3d-proton AMD (RADV) RTX 5060 Ti
release 3.1 6 [PASS], then Assertion failed: iface->lpVtbl == &d3d12_heap_vtbl (vkd3d_private.h:1077) not run
master the same assertion not run
master, identity checks relaxed (below) 47 [PASS], 2 [FAIL] 47 [PASS], 2 [FAIL]

With the checks relaxed every D3D12.X check passes on both GPUs (triangle, PresentX, DMA queue and page pools, list memory methods, sparse VRAM heaps, ring-buffered uploads, depth bias, the ray-tracing surface, DirectStorage, textures in title memory and in a streaming pool). Unchanged through 66e8e97.

cargo test -p xcl --lib on the AMD GPU at 66e8e97: 373 passed. The failures are two from my packaging (tests/data/llvm-amdgpu not next to the test binary), three of Mesa's compiler (one is the ds_bpermute case below), one Wine error-code difference (get_proc_address_and_load_library_ex_reject_null_name), and frame::tests::statistics_name_each_frames_origin_…, which is timing-dependent here (it failed in 2 of 3 runs on one build and 2 of 3 on another). On the RTX 5060 Ti at 60599a9: gpu:: 222 passed, 2 failed (packaging), 2 SKIPPED … no wave64. With a retail shader pack and console DLLs (XCL_SAMPLE_RPF, XCL_SAMPLE_DLLS): gpu_pso_e2e 6 of 6 ("MS + PS pipelines through the hook: 7 / 7") and gpu_compute_e2e pass on both GPUs. The BVH builder tests fail on both without #146 and pass with it (an argument-placement fault in XCL, not a Linux matter).

A retail game on 956a476, same setup, both GPUs: the same as you report on Windows. After its load it presents a steady 30 fps (4,500 presents in 197 s on the RTX 5060 Ti, 4,200 on the iGPU), image black, no abort in 200 s. That needs the relaxed vkd3d-proton, and one more thing outside XCL's design (the shared fences below).

The ds_bpermute failure (gpu_format_stores_atomics_global_lds, "lane 0 ds_bpermute", left 1280, right 63) is RADV's: it passes with RADV_DEBUG=llvm and on NVIDIA. ACO's emit_bpermute_shared_vgpr puts its two shared VGPRs at align(num_vgprs, 4); this kernel uses all 256, so they come out as v0 / v1 and the index is overwritten (Mesa 25.2.8, RDNA2). Nothing for XCL to do.

The obstacle: vkd3d-proton recognises its objects by vtable pointer

XCL replaces the vtable pointer of host objects with its extended table (real.rs, adopt). vkd3d-proton compares that pointer with its own tables:

  • eleven assert(iface->lpVtbl == &…_vtbl) in the impl_from_* helpers. They are compiled into the official release, so this is what a Proton user gets.
  • d3d12_command_allocator_from_iface returns NULL for an allocator whose table is not its own.
  • d3d12_command_list_from_iface (used by ExecuteCommandLists) returns NULL for a list whose table is not one of its seven; the caller then reads through it (an access violation at address 0x2b20).
  • one place dispatches on it: is_shared_ID3D12Fence1 picks between two different fence structures by comparing the vtable with d3d12_shared_fence_vtbl. A retail game creates its fences with D3D12_FENCE_FLAG_SHARED. With XCL's table in place the shared fence is handled as an ordinary one: the queue's Signal reaches d3d12_fence_lock on a structure with no mutex at that place, the queue's submission worker blocks for good, the fence never advances, and the game's own watchdog ends it about 30 s later. With assertions on, the assertion beside that check fires instead.

The 47 and the 30 fps above are with vkd3d-proton built with -Db_ndebug=true and the two from_iface functions changed to accept any table (about ten lines), and, for the shared fences, with the sharing bits cleared before CreateFence (VKD3D_CONFIG=ignore_shared_fence does the same). All of that is diagnostic: it removes checks for every application, or works around the replaced table rather than fixing it. Nothing vkd3d-proton could ship, and nothing I would propose as a PR.

This is not only a Linux matter. Microsoft's runtime treats the vtable pointer as state too: per HANDOFF (#75), Agility 1.620+ swaps a list's vtable on Close / Reset, and real::preserve_vtable / readopt chase it at eight call sites on current main (list_x.rs, real.rs, device_x.rs). The count of internal slots after the public ones also had to be probed per runtime (device 125 vs 104, queue 42 vs 19). Every new D3D12 runtime can move either. An object the host never sees modified has neither problem.

And the caller test can pick the wrong method. A slot whose console method differs from the PC one is split by return address (guard::pick). A title function that the system calls directly, and that ends in a tail call to such a method, has a system DLL as its return address, so the PC method runs with the console's arguments. I added a check to the test title to see it: a thread start routine that is mov rax,[rcx]; jmp [rax+72] on a descriptor heap (slot 9, GetCPUDescriptorHandleForHeapStart: RAX on the console, a hidden pointer on the PC):

[FAIL] D3D12.X: a console method by tail call from a system callback (thread start): the PC method ran: returned 0x1686030 (the console handle is 0x1445fe0, the spare buffer is at 0x1686030) and wrote 0x1445fe0 through rdx

Measured under Wine; the split is XCL's own code, so I expect the same on Windows but have not run it there. Thread entry points, thread-pool work items and task-queue callbacks are where a title can hit this: compilers emit exactly this jump for return obj->Method(...); at the end of a function. With proxies the question does not arise: whoever calls through the title's object gets the console method.

Proposal

Proxies, one kind of object at a time. title_list.rs already gives the title a console-shaped list with a thunk per slot and the PC list behind it. The same shape for the other kinds leaves host objects untouched: the title holds the proxy, object arguments are unwrapped on the way in, returned objects are wrapped on the way out, and the caller-based guards are not needed on that path because the host never calls through a proxy. Starting with command lists would remove preserve_vtable on Windows and one group of assertions on Linux in the same step; fences next would make the shared-fence case above work as it is. Each further kind is a separate, reviewable change. Linux needs all fifteen before stock vkd3d-proton works; Windows gains with each.

The alternatives I considered and would not propose as PRs: a documented, relaxed vkd3d-proton build for Linux users (works today, but it removes checks for every application), and an opt-in switch in vkd3d-proton to skip identity checks (I expect them to decline, with reason: the checks are right, and the fix belongs with whoever changes the objects).

Would you take proxies if they came in small steps with tests, each checked on Windows by you before merge? I would start with command lists.

Other things a Linux user will meet

  • userfaultfd must be allowed. Wine Staging tracks MEM_WRITE_WATCH with userfaultfd write protection and falls back to read-only pages when the call is refused. In the fallback, OpenExistingHeapFromAddress on a window that has not been written yet cannot import the pages; vkd3d-proton then gives the heap memory of its own and still returns success. CPU and GPU each see their own copy and shaders read zeros (gpu_unified_memory_arena: "s_load from process memory", left (0, 0)). Docker's default seccomp profile refuses the call; with it allowed everything above holds. With it refused the test title drops to 40 [PASS], 9 [FAIL].
  • DXVK's DXGI and Direct3D 11 are needed next to vkd3d-proton. With Wine's own dxgi.dll, PresentX crashes in wined3d.dll; with DXVK's DXGI but Wine's d3d11.dll, a later check stops in DXGID3D10CreateDevice.
  • The two [FAIL]s: xmem: working-set statistics (limit 0x360000000, used 0x0) and user32: … hidden console screen: W: not cloaked. Wine differences; not looked into.
  • In the test title, after the last graphics check the run ends in Wine's xaudio2_9.dll when the mastering voice is created; my container has no audio device.
  • Once in about ten runs on RADV: radv/amdgpu: The CS has been rejected (-1), after which the device is lost. Not reproduced on demand.

I can rerun anything on both GPUs.

AI-assisted.

🤖 Generated with Claude Code

Activity

  1. martinchooxp commented on Nov 23, 2026

    @martinchooxp

    How did you build the project on linux ?. Did you use a VM ?

  2. ozimchuk commented on Nov 23, 2026

    @ozimchuk
    ContributorAuthor

    No VM. I cross-compile XCL for Windows on Linux and run the .exe under Wine.

    Build (Ubuntu 24.04, in a Docker container, but a plain Linux setup works the same):

    • mingw-w64 (gcc-mingw-w64-x86-64, g++-mingw-w64-x86-64) and Rust with the x86_64-pc-windows-gnu target
    • CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER=x86_64-w64-mingw32-gcc-posix (the POSIX-threads variant)
    • cargo build --release --workspace --target x86_64-pc-windows-gnu. Since VFS hooks: the guard keeps the thread's last error #92 and Loader: under Wine, PEB.ImageBaseAddress keeps the real main image #93 this builds unmodified main. The tests build with cargo test --release --workspace --no-run --target x86_64-pc-windows-gnu, and the test .exes run under Wine too.
    • Microsoft's DXC Windows release (dxcompiler.dll, dxil.dll) next to xcl.exe.

    Run: Wine 11.21 (Staging), with vkd3d-proton as d3d12.dll / d3d12core.dll and DXVK's dxgi.dll, d3d11.dll, d3d10core.dll, all next to xcl.exe. The GPU is the host's own Vulkan driver (NVIDIA's, or Mesa's RADV for AMD), so no passthrough is needed. Two caveats from the issue above: stock vkd3d-proton stops on its vtable-identity assertions, so my runs used a relaxed diagnostic build; and userfaultfd must be allowed (Docker's default seccomp profile blocks it).

  3. Kalmarv commented on Nov 23, 2026

    @Kalmarv
    Contributor

    An addition to the userfaultfd note above, from a plain Ubuntu 24.04 VM (no container) with an RTX 2060 (Turing), NVIDIA 595.91.07, at main 956a476, cross-built for x86_64-pc-windows-gnu. The stack is Kron4ek's Wine 11.21 Staging (wow64 build), vkd3d-proton master 30b0eb9 relaxed as described above, and DXVK 3.1.1 dxgi.

    On this stack five gpu::recomp tests read zeros from title memory, on main and on #191's branch: gpu_memory_windows_above_4_gib, gpu_unified_memory_arena, gpu_mesh_mode_reads_memory_windows, gpu_bvh64_intersect_ray_across_memory_windows_and_grazing and gpu_sparse_vram_descriptors_buffers_and_xmem. For example, gpu_unified_memory_arena fails with "s_load from process memory", left (0, 0).

    The cause is the one you describe, but this setup reaches it without any seccomp profile.

    • The userfaultfd write-watch code is a Proton Wine patch (dlls/ntdll/unix/virtual.c in ValveSoftware/wine). The Wine Staging build I used doesn't have it: its ntdll.so contains no userfaultfd code, and Kron4ek's staging-tkg build doesn't either. strace -e userfaultfd over a test run shows no such call at all. With such a Wine, MEM_WRITE_WATCH memory always takes the read-only-page fallback, whatever the host allows.
    • In that case vkd3d-proton's OpenExistingHeapFromAddress → vkd3d_import_host_memory logs Failed to import host memory, hr 0x8007000e (VKD3D_DEBUG=warn). It then allocates host-visible memory of its own and still returns S_OK (libs/vkd3d/memory.c). The CPU and the GPU each see their own copy.
    • I checked the cause with one change, an experiment and not a proposal: MEM_WRITE_WATCH set to 0 in gpu/uma.rs, same binary otherwise, same GPU and stack. Then 4 of the 5 pass: gpu_memory_windows_above_4_gib, gpu_unified_memory_arena, gpu_mesh_mode_reads_memory_windows and gpu_bvh64_intersect_ray_across_memory_windows_and_grazing. Unchanged, all 5 fail.
    • gpu_sparse_vram_descriptors_buffers_and_xmem still fails without write watches: "submit 1 lane 0 mismatch", left 0, right 1077. vkd3d-proton logs no import warning any more. It reads through the sparse VRAM windows as well, so this is a second, separate cause that I haven't identified.

    What this means for a Linux user: a Wine that tracks write watches with userfaultfd is needed, besides the host allowing the call. Proton's code passes UFFD_USER_MODE_ONLY, so it should work with Ubuntu's default vm.unprivileged_userfaultfd = 0, as long as no seccomp filter blocks it. I couldn't confirm that here: GE-Proton 11-14's Wine needs 32-bit libraries this machine doesn't have. Since vkd3d-proton reports success, nothing in XCL notices today. A start-up check could catch it: write a word through the CPU, read it back through the GPU.

    Not covered: a Proton Wine run on this machine; the sparse-VRAM failure's cause; AMD; the test title and the e2e binaries.

  4. BlestTerror commented on Nov 23, 2026

    @BlestTerror
    Contributor

    Another data point, from a different setup: Arch Linux, Wine 11.20, vkd3d-proton 3.1, DXVK 3.1.1, RTX 4060 (Ada), driver 615.78.08, main at db5dc26.

    Build: besides mingw, the MSVC target cross-compiles with cargo-xwin (cargo xwin build --workspace --target x86_64-pc-windows-msvc). One snag: libudis86-sys passes the gcc-style -includestring.h, which clang-cl ignores, so udis86.c fails on an undeclared memset; a clang-cl wrapper that adds /FIstring.h fixes it. DXVK reports an NVIDIA GPU as AMD by default; DXVK_CONFIG='dxgi.hideNvidiaGpu = False' keeps XCL's NVIDIA paths.

    cargo test -p xcl --lib (serial): the same picture as yours (the vtable assertion stops the run at gpu_sparse_vram_descriptors_buffers_and_xmem, plus the Wine error-code / timing differences), and one you did not hit on the 5060 Ti: gpu_more_atomics_sub_dword_scratch_valu hung the GPU (NVRM: Xid 109, CTX SWITCH TIMEOUT; XCL: "GPU fence still pending after 10000 ms"), and the device was lost for every GPU test after it.

    That one is a vkd3d-proton (dxil-spirv) bug, not XCL's: a RWByteAddressBuffer used with 64-bit atomics carries only the { Atomic64Use, 1 } extended property, dxil-spirv read that 1 as a structured stride, and its BDA (root descriptor) loads / stores on that buffer then added the undef element offset to the address. It shows up when a load from the buffer feeds a 64-bit atomic on it, e.g. the rmw64 compare-exchange loop for GLOBAL_ATOMIC_INC_X2 / DEC_X2. Whether undef comes out as 0 depends on the driver, which would explain why the 5060 Ti passes.

    Fix: HansKristian-Work/dxil-spirv#372. With vkd3d-proton 3.1 rebuilt on it, the test passes and the serial run reaches the vtable assertion with no failures and no Xid. Nothing to change in XCL.

  5. Kalmarv commented on Nov 23, 2026

    @Kalmarv
    Contributor

    Correction to my comment above: there is no second cause. gpu_sparse_vram_descriptors_buffers_and_xmem has the same single cause as the other four.

    My experiment, MEM_WRITE_WATCH = 0 for all of gpu/uma.rs, also turned off XCL's dirty tracking for the sparse windows: hle/d3d12x/sparse.rs uploads only what GetWriteWatch reports. So that test read zeros because of the experiment itself.

    The narrower experiment, at main 6da33fa, removes write watch only from the runtime's coherent window (uma.rs:182) and keeps it on the sparse windows. There, gpu_sparse_vram_descriptors_buffers_and_xmem passes, 3 of 3, with no import warning from vkd3d-proton.

    A standalone repro (OpenExistingHeapFromAddress on a committed block, a CPU write, a GPU copy back; no XCL involved) shows the condition exactly. Same RTX 2060, Wine 11.21 Staging and vkd3d-proton as above:

    Imported block GPU reads the CPU's write
    plain commit, 512 MB or 1 MB yes
    MEM_WRITE_WATCH commit, 512 MB or 1 MB no: zeros, and vkd3d-proton logs Failed to import host memory, hr 0x8007000e
    plain commit next to a 12 GiB MEM_WRITE_WATCH reservation yes

    Only write watch on the imported memory itself matters. XCL needs write watch there: title_textures watches the coherent window too. So this isn't something XCL can drop. It needs a Wine with userfaultfd write watches (Proton's), as described above.

    AI use: Claude Code, Claude Opus 5.5

  6. BlestTerror commented on Nov 23, 2026

    @BlestTerror
    Contributor

    A data point on the write-watch import: on upstream (non-Staging) Wine 11.20 (Arch's wine package), with vm.unprivileged_userfaultfd = 0, the five memory-window tests pass (gpu_memory_windows_above_4_gib, gpu_unified_memory_arena, gpu_mesh_mode_reads_memory_windows, gpu_bvh64_intersect_ray_across_memory_windows_and_grazing, gpu_sparse_vram_descriptors_buffers_and_xmem), with VKD3D_DEBUG=warn and no Failed to import host memory. Also in full serial --lib runs. RTX 4060, vkd3d-proton 3.1 (+ dxil-spirv#372, relaxed as above), x86_64-pc-windows-msvc, main 6da33fa.

    So the read-only fallback looks like Wine Staging's write-watch path specifically; upstream Wine's MEM_WRITE_WATCH memory imports fine here. A Linux user may not need Proton's Wine, just not Staging. I haven't run your standalone repro here; happy to if you share it.

  7. Kalmarv commented on Nov 23, 2026

    @Kalmarv
    Contributor

    A correction to my notes above, prompted by @BlestTerror's result. The userfaultfd write-watch code is in upstream Wine, not only in Proton's: dlls/ntdll/unix/virtual.c at wine-11.20 and wine-11.21, built as USE_UFFD_WRITEWATCH. It only compiles when the build's kernel headers have UFFD_FEATURE_WP_ASYNC and PM_SCAN_WP_MATCHING, both from Linux 6.7. Kron4ek's portable builds are compiled in an Ubuntu 18.04 chroot (CHROOT_DISTRO="bionic" in create_ubuntu_bootstraps.sh), so those builds lack it. A distro Wine built against current headers, such as Arch's, has it, and the five memory-window tests pass there. What a Linux user needs is a Wine built with USE_UFFD_WRITEWATCH, running on a 6.7+ kernel. vm.unprivileged_userfaultfd=0 doesn't matter, because the call passes UFFD_USER_MODE_ONLY.

    Tested: upstream source at both tags; Kron4ek's build script; ntdll.so of Kron4ek 11.21 Staging (no userfaultfd code, no such syscall under strace).
    Not tested: a Wine built here with USE_UFFD_WRITEWATCH.

    🤖 Claude Opus 5.5

  8. notdxbi commented on Nov 23, 2026

    @notdxbi

    Another Linux data point, on current main (af20b4b), where the README says the retail game reaches its first menu (the account prompt) on the RX 9070.

    Setup: Nobara 44 (Fedora-based), kernel 7.3, RTX 5060 8 GB, NVIDIA 595.112.07, Ryzen 7 5700X, 32 GB. Wine 11.22 Staging (vm.unprivileged_userfaultfd = 0; gpu_unified_memory_arena passes anyway). XCL cross-built for x86_64-pc-windows-gnu with Fedora's mingw64 (posix threads) in a rootless podman container. vkd3d-proton master 30b0eb9, relaxed as described in this issue (-Db_ndebug=true + the two from_iface changes), VKD3D_CONFIG=ignore_shared_fence. DXVK 3.1.1 dxgi/d3d11/d3d10core, DXC 1.9.2609. XCL_NETWORK=0.

    Tests at 956a476: lib 531 passed / 4 failed (Wine error codes in get_proc_address_and_load_library_ex_reject_null_name and vfs::truncate_existing_validation_errors, vfs_hooks::move_case_only_and_self_rename_preserve_file, and legacy_console_iids_map_to_their_own_slots, which #200 addresses). 2 SKIPPED (no wave64). With XCL_SAMPLE_RPF / _DLLS / _TTPF: gpu_pso_e2e 6/6 and gpu_compute_e2e 2/2. console_dlls_e2e 11/12 (memory_cap_is_active: Wine has no job memory limit). Test title: 48 PASS, 2 FAIL (the same two as above).

    Retail game, af20b4b, 300 s and 600 s runs:

    At 956a476 the same setup gave all-zero frames (no seam) and the title never opened audio.rpf, textures.rpf, script.rpf, pack/* or the ttdb archives in 300 s. 399 of 450 title textures stayed all zero, and its job workers sat idle after the pipeline phase. That matched what was reported on Windows.

    A side note on the Wine path: the 4 Write64BitValueBottomOfPipeX warnings are timestamps (list_x.rs timestamp()) into the title's own memory, not misaligned addresses (e.g. 0x…6698). Unlike write(), timestamp() has no cpu_writes fallback, so those are dropped. The message reads as an alignment problem but covers "not in unified memory" too. Probably harmless, just noting it.

    Whether the seam-only image is NVIDIA-specific (wave32 / split wave64 VS / PS) or Wine-specific, I can't tell from here. If anyone has the menu on NVIDIA under Windows at af20b4b, that would separate the two. I can rerun with any XCL_* trace.

    AI-assisted.

  9. notdxbi commented on Nov 23, 2026

    @notdxbi

    Follow-up to my comment above, now on main 60565c4 (with #199). Same Linux / Wine / RTX 5060 setup. I localised the black image with XCL_DEBUG_MAGENTA and XCL_TRACE_FRAME:

    • vs 7fda1be8fbc78299 / ps c1d5a4b8b07ccbce is the full-screen composite into the presented target. Forced to yellow, the whole screen is yellow, so the composite and PresentX are fine.
    • vs d2a238740e50f037 / ps e2bcc91e569d6d13 is a full-screen pass into the target the composite reads. Forced to blue, the whole screen is blue.
    • vs 28d887aa04ffa15a / ps b40d9ca24fe3d23d is the menu's element draw: ~19 draws a frame into that same 3840×2160 target, topology 4 (triangle list, not a rect list), vertices pulled through a V# in its root table (e.g. [4dbcdc00, 4, 600, 31016fac]). Forced to magenta, it covers only the 1-pixel diagonal from the bottom-left to the top-right corner. Every element's triangles are degenerate along that line, the same in every frame (16 000+ frames over 600 s). It's unchanged by D3D12.X: rect lists drawn whole through a generated geometry shader #199, which fits: these aren't rect lists.

    So the composite chain works on NVIDIA under Wine. What's wrong is the positions coming out of VS 28d887aa04ffa15a (or the data it reads). On the RX 9070, where the menu shows, the same VS runs natively as wave64; here it's the 32-lane form. That makes the wave64 VS path (upper_lanes / spill slots) my first suspect, but I haven't proven that it isn't the Wine side.

    Checked and ruled out on the Wine side: Wine 11.22 Staging calls userfaultfd with UFFD_USER_MODE_ONLY (flags 0x80801) and logs "Using kernel write watches", so vm.unprivileged_userfaultfd = 0 doesn't push it onto the slow fallback. The sparse-window write-watch scans are still slow, though (up to 5.7 s for 332 825 dirty pages).

    If someone with NVIDIA on Windows can say whether the menu shows at 60565c4, that would settle NVIDIA vs Wine. I can run XCL_DEBUG_PS_EXPR / XCL_DUMP_SHADERS on that VS if a specific output would help.

    AI-assisted.

  10. jvyden commented on Nov 23, 2026

    @jvyden

    With the patch described here and in #257 I'm able to independently confirm GTA VI booting on Linux! Starts to a black screen with what looks like the outline of a quad, I'm unsure if it gets farther yet though.

    image
  11. FilipeSilvens commented on Nov 23, 2026

    @FilipeSilvens

    A Linux data point: the retail game's menus draw under stock vkd3d-proton, with the identity problem handled on XCL's side instead of in vkd3d-proton.

    Setup: Nobara 44 (kernel 7.3), RTX 4070 Ti (NVIDIA 620.70, 32-lane waves), Ryzen 7 5800X. GE-Proton11-1's Wine and its bundled vkd3d-proton 3.1.0, unpatched (built without the assertions). XCL cross-built for x86_64-pc-windows-gnu at 6da33fa, XCL_NETWORK=0.

    Three local changes in XCL, no vkd3d-proton patch:

    • real::pc_view: under Wine only, an adopted command allocator or list gets vkd3d-proton's own vtable back for the length of the PC calls that check it (CreateCommandList(X), both Resets, ExecuteCommandLists), and XCL's afterwards.
    • The same for XCL's own lists (title texture uploads, the presenter), which go through the PC slots.
    • Under Wine, CreateFence drops the sharing bits. GE-Proton's vkd3d-proton 3.1.0 has no ignore_shared_fence; without this change the game crashed in d3d12_shared_fence_set_native_sync_handle_on_completion_explicit about 15 s in.

    Result: first frame at ~18 s, a steady 30 fps, and a 300 s run without a crash. The account prompt and the whole Settings menu draw (screenshot below). A DualSense works after setting DisableHidraw=1 under HKLM\System\CurrentControlSet\Services\winebus; otherwise Proton's Wine passes it through as raw HID and XInput sees nothing.

    image

    @notdxbi @jvyden: this is NVIDIA with 32-lane waves too, so the black image with the diagonal is probably not XCL's wave64 VS path on NVIDIA by itself. The main difference from your setups is the relaxed from_iface lookups versus vkd3d-proton seeing its own vtable during the call. I haven't checked whether other vkd3d-proton code still branches on the vtable after the relaxed lookup, so that part is a guess.

    With #283 on top, the intro movie plays here as well. Like notdxbi, I see the sparse-window write-watch scans grow under Wine (392 ms → 1662 ms between 35 s and 52 s, ~320k dirty pages each time), which pulls the frame rate down. Not looked into yet.

    These are workarounds of the same kind as the ones in this issue; proxies remain the real fix. If an interim fix is wanted, I can open the first two changes as a small draft PR, and the fence change as a separate one.

    AI-assisted: Claude Code (Claude Opus 5.5) found the causes, wrote the changes and this comment. The runs were real, on the hardware above.

  12. notdxbi commented on Nov 23, 2026

    @notdxbi
    1-account-prompt 2-navigation-experience 3-subtitles

    @FilipeSilvens @jvyden – agreed, the diagonal is not the wave64 VS path. I found what it is on my setup, plus three more things between the menus and a playable window. Same box as before (Nobara 44, RTX 5060, NVIDIA 595.112.07, Wine 11.22 Staging, relaxed vkd3d-proton master 30b0eb9, DXVK 3.1.1 dxgi). XCL is main 0e946cf plus the four local changes below. Patches are uncommitted; I can open them as separate PRs if wanted, but scripts/smoke.ps1 needs Windows.

    1. The diagonal: CBV descriptors have stride 0 (real.rs dev_create_cbv_x → buffer_words(va, 0, size, 22))

    • The menu element VS 28d887aa04ffa15a reads its 2D transform rows with buffer_load_dwordx4 v[0:3], v[0:1], s[0:3] idxen. The row index is COLOR1.z × 1020.04 + 2.1 / + 3.1, and the V# comes from its table: [4dbcdc00, 00000004, 00000600, 31016fac], which is exactly the CBV encoding.
    • With stride 0, every row reads row 0, so x = y for every vertex and the whole UI lands on the diagonal. The vertex data and input layout check out (COLOR0 / COLOR1 RGBA8, POSITION0 R32G32_FLOAT, stride 16, sensible positions, via XCL_TRACE_SHADERS).
    • Change: desc::cbv_words = stride 16, num_records = ceil(size / 16). The emitter's scalar-load limit is num_records × stride, so s_buffer_load keeps the same byte bound.
    • Result: the account prompt, then (Enter presses) NAVIGATION EXPERIENCE and SUBTITLES of the first-run setup.
    • @FilipeSilvens: 6da33fa has the same stride-0 CBV and the same idxen addressing in the emitter, so I can't explain from here why your menus draw without it. If you can run XCL_TRACE_FRAME=1 XCL_TRACE_SHADERS=28d887aa04ffa15a and compare the table's V# words, that would settle it.

    2. A white window in front (Linux only): the title's window is not cloaked under Wine

    • Wine has no DWM cloaking, so the title's 1920×1080 console-screen window (Hyprland shows it as a floating window titled "A") sits over XCL's window.
    • A layered alpha-0 window did not help: the compositor ignores the opacity Wine passes on.
    • Change (hle/user.rs): after DWMWA_CLOAK, DWMWA_CLOAKED is checked. If the window isn't cloaked it is hidden and kept hidden (WM_WINDOWPOSCHANGING drops SWP_SHOWWINDOW). No change on Windows.

    3. Then a black XCL window: the swap chain on the title's queue gets nothing

    • With a local diagnostic that reads back the swap chain image right after the presenter's copy:
      • copy on the title's queue: 0 of 518 400 samples non-black (CopyResource and CopyTextureRegion alike), while the title's image had 517 542;
      • swap chain + copy + Present on a presenter-owned queue: the full image.
    • Change (d3d12x/present.rs, Wine only): the presenter makes its own direct queue. The title's queue signals a fence, and the presenter's queue waits on it, copies and presents.
    • This is probably the same problem your vtable hand-back for XCL's own lists solves.

    4. #298's crash (+0x13936) looks like a race in kernelx/lazy.rs; I'll add a comment there

    • In my run, 4 threads faulted within 3 ms writing to fresh pages of one region, 3 of them in the same 64 KiB page.
    • handler → commit removes the page from LAZY before committing it. The second thread to fault on the page finds it no longer lazy, gets EXCEPTION_CONTINUE_SEARCH, and the title's first store into a new pool object crashes. ensure (DirectStorage destinations) races the same way.
    • Change: the commit happens under the lock, and a fault on a page committed by that path (read or write, page now committed RW) continues.
    • Unit test a_fault_that_raced_the_commit_goes_on drives the handler with the losing thread's fault. It fails without the change and passes with it. Not verified in-game yet; this comment gets an edit when it is.

    Tested (Wine, RTX 5060)

    • lib suite: 612 passed, 0 failed, 20 ignored; SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
    • Each change has a unit or GPU test that fails without it, except 3: that needs vkd3d-proton with an adopted queue.
    • Intermittent here: gpu_f64_math_random (all-zero results, 1 of 3 isolated runs) and gpu_built_bvh_nodes_match_the_cpu_node_test (1 run).
    • Excluded: the new mesh_dispatch::tests::gpu_* / paired_* hang the RTX 5060 (NVRM Xid 109 CTX SWITCH TIMEOUT, then device lost; every later GPU test fails as fallout).

    Not tested: Windows (none of this was run there), AMD, the in-game effect of 4.

    AI use: Claude Code (Claude Opus 5.5) found the causes, wrote the changes and the tests, and wrote this comment; the runs were real, on the hardware above.

  13. wiktorekdev commented on Nov 23, 2026

    @wiktorekdev

    A Linux data point past the menus: the retail game reaches its loading screen and stays on it.

    Setup: EndeavourOS (kernel 6.18 LTS), RTX 4070 12 GB, NVIDIA 620.70.06, Ryzen 5 7600X, 30 GB. Proton Experimental's Wine, a relaxed vkd3d-proton, XCL_NETWORK=0, run inside a network namespace with no network. XCL built for x86_64-pc-windows-msvc from main 0e946cf with #273 and eight commits from theaustinayers' modified-build: the DirectStorage destination fixes (landed as #289), the lazy-page race, write-watched GPU-visible memory, rect-list corners, bounded pipeline waits, and #283.

    Local changes on top (not proposed; listed so the result can be judged):

    Result: accessibility, language, settings and legal screens, then the loading-screen artwork at a steady 30 fps (screenshot). The run goes past 500 s with no crash, ~10 GB of video memory, and no DirectStorage failures.

    loading-screen

    Where it stops:

    • DirectStorage serves 2 066 requests up to ~150 s, then 0 requests for the rest of the run.
    • The window title stays at 0 running, 0 done, 58746 pipelines queued; the PSO workers wait on an empty queue.
    • No XCL call blocks: the thread dumps show the title's threads waiting in its own code. The main thread sits in a timed WaitForSingleObject (+0x2250c0, called from +0x2431600) between frames. The render thread presents normally (wait_frame_event_x).
    • The only recurring runtime call is the ROS ticket request (CreateTicketXbl3), answered with "no Xbox Live" every ~16 s, then with growing gaps (153 s, 260 s, 400 s).

    So the title seems to wait on a condition that never becomes true, not on XCL. VIctory's README reports this step taking about 50 s, so it is passable. I haven't found the condition yet. If anyone got past the loading screen with XCL, which runtime areas were served differently would narrow it down.

    Not tested: Windows, AMD, the Series S profile at this stage.

    AI use: Claude Code (Claude Opus 5.5) did the investigation, the local changes and this comment. The runs were real, on the hardware above.

  14. FilipeSilvens commented on Nov 23, 2026

    @FilipeSilvens

    @notdxbi ran it: XCL_TRACE_FRAME=1 XCL_TRACE_SHADERS=28d887aa04ffa15a, 60 s on the account prompt, same Linux setup as above. Two XCL builds: 6da33fa + the three Proton changes, and 9ab7d76 (which includes 7a033c8) + the same changes + #283 + #273.

    All 24 traced draws of vs 28d887aa04ffa15a / ps b40d9ca24fe3d23d, on both builds, have this in slot 0 of their table (the base address in word 0 changes from draw to draw):

    [4eaadc00, 00100004, 00000060, 0002403c]
    
    • stride 16 (word 1 bits 16–29), num_records 0x60 = 96 rows of 16 bytes = 1536 bytes, the same size as yours.
    • Word 3 is 0x0002403c. XCL's encoder (desc::buffer_words) always writes 0xFAC | format << 12 | 1 << 24 | oob << 28 there, which for stride 0 and format 22 is exactly your 0x31016FAC. So yours came from XCL's CreateConstantBufferView path (real.rs, dev_create_cbv_x), and here the title wrote the descriptor itself, in the console's format.

    So the same title on the same version reaches this draw by two paths: it writes the V# itself here, and it calls XCL's CBV creation on your setup. The title's own descriptor uses stride 16, which backs your fix. I don't know yet what makes it pick the other path on your side. 7a033c8 isn't it (same result with and without it). Your four local changes, Wine 11.22 Staging vs GE-Proton11-1, or the relaxed vkd3d-proton are what's left.

    AI-assisted: Claude Code (Claude Opus 5.5) ran the traces, read the descriptor words and wrote this comment. The runs were real, on the hardware above.

  15. 8 remaining items

  16. ozimchuk commented on Nov 23, 2026

    @ozimchuk
    ContributorAuthor

    The diagonal: #335 makes XCL's constant buffer views stride 16 (num_records = size / 16), as the title writes this descriptor itself (@FilipeSilvens' trace above). It is the same change as @notdxbi's item 1; details and measurements are in #307 and #335.

    For Linux setups that want to try it before it is merged, our fork's linux branch has main plus this change and two local stopgaps:

    • CreateFence without the sharing flags, so ignore_shared_fence is not needed;
    • XCL_PC_VIEW=1, the vtable hand-back for unmodified vkd3d-proton. It covers @FilipeSilvens' calls plus the console ResetX, which needs it too.

    Branch: https://github.com/ozimchuk/xcl/tree/linux. The stopgaps are not for upstream; proxies remain the fix.

    AI-assisted (Claude Code, Claude Opus 5.5).

  17. bKNNNNN commented on Nov 24, 2026

    @bKNNNNN

    Follow-up on the illustrated loading screen from the RTX 5080 report above. Tested on XCL commit 3516080d53daac0f7749b5c02bc9b1e371479557, under Proton Experimental with networking disabled. Newer commits have landed since this run.

    At 145 s and 180 s, the guest entry thread had the same stack, with a return site at guest module offset +0x56a0d. The Wine relay trace showed one outstanding WaitForSingleObject(handle, INFINITE) at that site. Querying the handle type during the wait with NtQueryObject(ObjectTypeInformation) returned Semaphore. The wait had no recorded return before the timed stop at 190 s. XCL continued presenting at 30 FPS through the final sampling interval (2,914 frames shown in total). The furthest screen observed was the loading artwork.

    The producer that should release the semaphore is still unknown. A matching stack and object type from another setup would help establish whether we are seeing the same wait.

    AI-assisted local diagnostic (OpenAI Codex).

  18. notdxbi commented on Nov 24, 2026

    @notdxbi

    Update from my side, now on main a6f5f7a (so #335 / CBV stride 16, #283, #244, #288 and #294 are upstream; thanks @ozimchuk for taking item 1 in). Same box: RTX 5060 8 GB, NVIDIA 595.112.07, Wine 11.22 Staging, relaxed vkd3d-proton, DXVK 3.1.1 dxgi.

    1. The 5 fps intro video / loading screen is CPU detiling. With faster detiling it runs at 22–29 fps here.

    I timed title_textures::refresh per 5 s during the video (A pressed at the account prompt). Before:

    • refresh: ~4.9 s of every 5 s
    • detile: ~4.5 s for ~430 MB (≈ 95 MB/s, one thread, on the title's submit thread)
    • upload: ~0.3 s
    • write-watch: ~0.07 s

    Change (gpu/tiling.rs only, +~150 lines with tests), in the same direction as @gw1337x's diff on #283:

    • Chain::detile_level splits the rows of a level of ≥ 256 K elements across available_parallelism / 2 threads (max 8).
    • The x terms of offset_z (block column bytes, in-block x bits) are worked out once per level and the y terms once per row, so the inner loop is row_base + col[x] + (col_xor[x] ^ row_xor).
    • Whole rows whose blocks lie in src use fixed-size copies; linear levels (the video planes, mode 0) are copied a row at a time (gw1337x's idea).
    • Test detile_matches_element_at compares with element_at per element: modes 0 + all 14 tiled modes, 1 / 4 / 16-byte elements, a height that doesn't split evenly, a short source, mip-tail levels and slice 1.

    Same timing afterwards: ~2.1 GB detiled in ~1.9 s per 5 s (≈ 1.1 GB/s). The video phase went 5 → 22–29 fps (frames presented over 300: 23.1 / 22.0 / 29.4 / 26.8).

    2. The tiling tables were rebuilt for every placed texture.

    • 15 thread dumps during world streaming: in 6 of 15 the render thread was in CreatePlacedResource → title_textures::register → xg::Texture::with_pipes → Surface::new → tiling::Layout::from_bits.
    • from_bits rebuilds ox/oy/oz and the "high" tables (up to 3 × 8 192 entries) each time.
    • Change: from_bits is memoized per (mode, element size, block bits, pattern, dims).
    • Tests: the existing permutation / retail-pattern / round-trip tests run on cached layouts, plus a consistency test.

    3. @gw1337x: your Uploader diff (#283, 23:30) does not work as-is on top of #288.

    4. What's left after the video, sampled the same way (15 dumps, 3 s apart, symbols from the build):

    • render thread: 7 / 15 waiting in the title (+0x56a0d, which matches @bKNNNNN's semaphore wait);
    • 2 / 15 in texture::wait (the synchronous upload wait);
    • 2 / 15 detiling;
    • 1 / 15 in res_release of the upload staging;
    • 1 / 15 in refresh;
    • 2 / 15 in winevulkan.

    So an async uploader that fits #288 would help the streaming phase, but the long stop is the title's own wait.

    5. Sound under Wine: Fedora's mingw64-opus (libopus 1.6) gives a libopus-0.dll that #294 picks up next to xcl.exe (imports only KERNEL32 / msvcrt). The run logs Opus packets decoded (0 errors) with non-zero samples.

    6. Still needed under Wine, not upstream:

    • the title's window hidden when it can't be cloaked (items 2 and 3 of my first update);
    • the presenter's swap chain on its own queue.

    Without those, the XCL window here is white, then black. I can open these two as PRs (Wine-only, util::under_wine()), but smoke.ps1 needs a Windows box.

    Tested: on a6f5f7a + my changes:

    • --skip gpu::, 4 threads: 364 passed, 0 failed, 3 ignored;
    • gpu::, 1 thread: 273 passed, 0 failed, 18 ignored; SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
    • With 4 threads the GPU tests sometimes lose the device here (NVRM Xid 109 CTX SWITCH TIMEOUT); serially they all pass.
    • The new mesh_dispatch::tests::gpu_* / paired_* hang this card every time, so they are excluded.

    Not tested: Windows, AMD.

    AI use: Claude Code (Claude Opus 5.5) did the measurements, the changes, the tests and this comment; the runs were real, on the hardware above.

  19. lucsoft commented on Nov 24, 2026

    @lucsoft

    A Linux AMD data point (RDNA3), since every Linux report so far is NVIDIA. Two findings: on this stack the learned coherent window makes the retail game unplayably slow, and the workaround for that ends in a reproducible GPU hang right after the intro.

    Setup: NixOS, kernel 7.3.5, RX 7800 XT (Navi 32), Mesa 26.1.8 RADV, Ryzen 7 7800X3D, 32 GB. Wine 11.8 Staging (nixpkgs; ntdll.so has "Using kernel write watches"), vkd3d-proton 3.1 built with -Db_ndebug=true + the two from_iface lookups relaxed, VKD3D_CONFIG=ignore_shared_fence, DXVK 3.1.1 dxgi/d3d11/d3d10core, DXC 1.9.2609. XCL main 85bdf21 cross-built for x86_64-pc-windows-gnu, plus the CBV change from #307 (stride 16). XCL_NETWORK=0. Retail GTA VI.

    1. CBV stride (#307): confirmed on AMD as well. Without it the menu is the diagonal; with it the account prompt and setup pages draw.

    2. With the learned coherent window (4095 MB; uma_coherent.txt says 4.8 GB): under 0.5 fps

    3. With 512 / 1024 MB: a reproducible GPU hang right after the intro

    • In every run: two XErrorReport 0x89240107, about 2 s later amdgpu: ring gfx_0.0.0 timeout (process main, thread vkd3d_queue), then D3D12 device removed: 0x887a0005 (or 0x80004005). This happened 74–151 s in, depending on how fast the run got there, and also with 1024 MB.
    • RADV_DEBUG=hang (three runs, one with nocache for the disassembly): the same draw every time. Pipeline (RADV hash 71ae6799889aaddb), a DrawIndexed of 30 indices, the index buffer in sparse window 0 (a virtual BO, the range bound). vm_fault.log is empty; GE_BUSY/SPI_BUSY are set. VGT_SHADER_STAGES_EN = 0x06012010, so no GS: a plain VS (NGG) + PS. Neither shader has a backward branch.
    • Ruled out: the rect list GS (disabled locally, same hang, same draw), and Retail title reaches its title screen and menus: GPU title memory in large pages, to_zero pruned once #203 alone (it logs AllocateTitlePhysicalPages(99776): no room in unified memory; it needs Memory windows from the descriptor heap (no per-access switch); NVIDIA OOM fallback; physical-page fixes #187, which no longer applies to main).
    • What I think it is: with a 512 / 1024 MB window most of the title's ~4.4 GB of GPU heaps don't fit (coherent 116/512 MB) and fall back to plain memory, which per the comment in kernelx.rs its shaders read as zeros. So the hang is probably a consequence of the workaround, and the real problem is point 2.
    • Update: with XCL_COHERENT_MB=2048 (1851 MB of the title's heaps in the window) the hang still comes, at the same point in the game: the two XErrorReport lines, then the ring timeout, 786 s in at 0.7–1.3 fps. So it does not depend on the window size, and the bullet above does not hold.
    • Update 2: RADV_DEBUG=nonggc changes nothing. With XCL_TRACE_FRAME=1, three pipelines draw for the first time right after the two XErrorReport lines, ~2 s before the hang: vs cc7a1fd71cd7f6b2 / ps 5306d4e7f6e2ca6e, vs ff0798b8f97355d1 / ps 8ab8dca315291c32 and vs 3f448213eab8a2da / ps f618f478d0c51397. All three draw triangle lists into the 3840×2160 target with alpha blending, depth off with a D32S8 DSV bound, and no culling. Their console VS are 18–32 instructions: a 2×3 transform from a CBV via s_buffer_load (records cover the reads exactly), attributes passed through, no branches, no indexed loads. So the hang sits in fixed-function vertex/index fetch or primitive assembly, not in shader code. vkd3d-proton logs Broken NULL PRT with SMEM detected, per-game workarounds may apply on this GPU, and the hanging draw's index buffer lies in sparse window 0.

    Side notes for whoever debugs GPU hangs under Wine

    • stop_if_device_removed calls TerminateProcess at once. vkd3d-proton marks the device removed before it writes its breadcrumbs (and waits up to 5 s for VK_EXT_device_fault), so breadcrumbs never get written. A local wait before TerminateProcess gets past that.
    • VKD3D_LOG_FILE stays empty: the launcher's GPU probe opens the file first, and the host process can't open it again.

    Not tested: Windows, NVIDIA, a full-window run up to the post-intro point (at < 0.5 fps it doesn't get there).

    AI use: Claude Code (Claude Opus 5.5) did the investigation and wrote this comment. The runs were real, on the hardware above.

  20. notdxbi commented on Nov 24, 2026

    @notdxbi

    Two more things past the loading screen, on main a6f5f7a / 2997c9a (no code change between them). Same box: RTX 5060 8 GB, Wine 11.22 Staging, relaxed vkd3d-proton. Neither is in an open PR or issue as far as I can find.

    1. The endless loading screen: XNetworkingGetConnectivityHint says "online" while XCL_NETWORK=0 blocks everything.

    • The hint reports the host's connectivity (level 3, InternetAccess) even with XCL_NETWORK=0. The title believes it is online and keeps asking for ROS tickets (CreateTicketXbl3, "no Xbox Live", with growing gaps, as @wiktorekdev saw).
    • Change (xgameruntime/networking.rs): _ if crate::hle::netoff::enabled() => 1 (None) before the host mapping, i.e. a console without a network.
    • Result: no token requests at all, and after the intro and loading art the title streams its world instead of sitting on the loading screen. @bKNNNNN's semaphore wait at +0x56a0d was with the "online" answer; I haven't checked that same wait with this change.

    2. Then the title stops on its own int3 at +0xb18de7: XMemMapPhysicalPagesScatter(addresses, n, NULL) is refused.

    • +0xb18dc0 calls xmem!XMemMapPhysicalPagesScatter(&addrs, count, NULL) (the IAT slot resolves to it) and executes int3 if it returns 0. The Breakpad reporter follows.
    • XCL returns ERROR_INVALID_PARAMETER for a NULL page array. Page 0 already means "unmap this address" in the scatter, so I take NULL as page 0 for every address.
    • Test scatter_without_pages_unmaps (map two pages, write, unmap with NULL, the addresses are no longer committed, mapped again they read what was written): fails without the change ("refused"), passes with it.
    • With 1 + 2 the run goes past 113 s, to 160 s+.

    3. Next stop (still open), on an 8 GB card while the world streams:

    • Series X profile: VRAM full (7.7 / 8.15 GB), then device lost. The kernel log has NVRM Xid 31, an MMU fault in a copy engine (CE0) at a GPU VA with nothing mapped.
    • My reading: kernelx::unmap_away → sparse::decommitted → unmap_tiles runs UpdateTileMappings(NULL) on the sparse-window queue straight away. Nothing orders that after GPU work already submitted on the title's queues or XCL's upload queues that may still use those tiles. Before 2, these unmaps were refused, so this path wasn't reached. I'm working on making the tile unmap wait for that work.
    • An earlier run without 2 ended in vkd3d-proton (status 3) after the driver logged NV_ERR_NO_MEMORY (system memory). Same phase, same memory pressure as @pedro-anthony on 12 GB.

    4. device_type = "lockhart" (Series S) with #242: steady 30 fps, but every dumped frame is black (0 of 129 600 samples non-black, 1920×1080), so it isn't a way around the memory limit. Back on "anaconda".

    Also (Linux): Wine's PipeWire stream runs with a 256/48000 quantum. The audio comes in bursts while the title loads (decode 97–118 % of real time per 5 s), so it crackles. PULSE_LATENCY_MSEC=60 / PIPEWIRE_LATENCY=1024/48000 help.

    Tested (Wine, RTX 5060), on a6f5f7a + these changes + my earlier ones: lib CPU tests 364/0, GPU tests (serial) 273/0, plus the new scatter test. Runs: A pressed at the account prompt, 160–300 s.
    Not tested: Windows, AMD.

    AI use: Claude Code (Claude Opus 5.5) found these, wrote the changes, the test and this comment; the runs were real, on the hardware above.

  21. notdxbi commented on Nov 24, 2026

    @notdxbi

    I just heard the first part of the intro I've gotten like 0.5 seconds into the first cutscene by the looks of it.

  22. bKNNNNN commented on Nov 24, 2026

    @bKNNNNN

    An audio comparison for the semaphore wait in my earlier RTX 5080 report. Both runs used unmodified XCL a6f5f7a74cc620c1f88a9e3669a633d10c3c8212, Proton Experimental, the same saved profile and XCL_NETWORK=0 in an isolated network namespace.

    Without an audio output in the sandbox, the guest entry thread was still in the same infinite wait at guest offset +0x56a0d at 145 and 180 seconds. With a private PipeWire null sink, Wine opened a playback stream. At that same call site the trace recorded 195 successful wait returns across the two semaphores (98 and 97). This was with upstream networking behavior. The effect of the connectivity-hint change on this wait remains untested here.

    In a separate run with the virtual output active and Wine relay tracing off, the last screen I could confirm was the loading artwork. At 223.5 s XCL reported 0xc0000005 at guest offset +0x23cf683 (write to null). For anyone comparing traces under Proton, it would help to record whether Wine actually opened a playback stream during loading.

    AI-assisted local testing (OpenAI Codex).

  23. notdxbi commented on Nov 24, 2026

    @notdxbi

    The three changes from my last comment are now draft PRs, each with a test that fails without it and the lib suite run on the branch (Linux/Wine, RTX 5060). They need someone with Windows for the smoke.ps1 regression run:

    A correction to my earlier comment, after @bKNNNNN's audio comparison: our runs always had a PipeWire output. So the semaphore wait at +0x56a0d was probably never what held us. What #494 changes for sure is the token loop; I can't say it is what gets past the loading screen.

  24. sperm commented on Nov 24, 2026

    @sperm

    An RDNA4 data point, since the Linux reports so far are NVIDIA and one RDNA3 card.

    Update (rerun): the early stall below is fixed by VKD3D_CONFIG=ignore_shared_fence, the setting in #257's docs/linux.md. With it the retail game runs: 1,303 presents at a steady 30.0 fps, 3840×2160. The last sampled frame (XCL_FRAME_DUMP=120, frame 1220) has 517,542 of 518,400 sampled pixels non-dark. No crash and no watchdog; I closed the window at 61 s. I haven't checked yet what is on screen (menus, intro or loading).

    Update 2 (played into the world): with a controller, the menus go through, and the game loads into the world. The title's crash context says Game Running, 3m18s, frame 2455, 637 streaming requests, tile heap 3,685 / 6,236 MB. It runs at 30 fps, drops to about 7 fps for the last minute while compute pipelines build, then the "GPU Loc Sig" abort (+0x23cf683, #505 / #534) comes at 229.8 s. With #533 it's the same at 202.7 s (report).

    Update 3 (where the slow pipeline builds go on Linux): XCL main 508a0c7 plus #533 (f849ecc), #208/#273 (5f12643), #267 (043d1f7), #567 (7a63914) and #574 (86a5d0b), merged locally (#574 conflicted with #267 in bind.rs; I took #574's side). Same machine and Wine as below.

    • vkd3d-proton 3.1: once the world loads, compute pipelines "still building after 4000 ms" pile up (16 in a 535 s run), and 19 draws are lost to D3D12.X: a draw waits at most 4 s for a pipeline still building (#232) #267's limit, one graphics pipeline still unbuilt after more than two minutes. Six xcl-pso workers sat at 100% CPU. 18 of 18 stack samples were inside vkd3d-proton's dxil-spirv structurizer, almost all in CFGNode::find_common_post_dominator (the rest in get_outer_selection_dominator, dominates_all_reachable_exits and can_optimize_conditional_branch_to_static). So on Linux the time goes in DXIL → SPIR-V, a step native Windows drivers don't have.
    • D3D12.X: bound wait_for_commit so big background compiles cannot deadlock #567 isn't what helps here: its "proceeding with serialized big compute PSO compile" line was never logged, so the page-file wait isn't the stall under Wine (30 GB RAM + 30 GB swap).
    • vkd3d-proton master 30b0eb9 (dxil-spirv 34f0ff8, with the structurizer rewrite from dxil-spirv XGameSave: a long valid container name makes every save to it fail #326), same relaxed from_iface checks: no samples in dxil-spirv any more; the one busy worker was inside RADV (Mesa 26.2.6, no symbols). In a 239 s run: 9 compute pipelines over 4 s, 0 draws lost, 256 dispatches skipped (6,223 with 3.1). The run was shorter, so it's a direction, not a measurement. The first minute is slower (the vkd3d shader cache starts cold after the version change).
    • The watchdog still fires with all of the above: +0x2215c35 at 117 s (run on 3.1), +0x23cf683 at 185 s (run on master), both while frames dropped to 7–12 fps. Held with a local vectored handler that parks that one thread, the game went back to 30 fps after the 117 s one.
    • Two windows under Wine: Wine's DwmSetWindowAttribute doesn't implement DWMWA_CLOAK, so the title's own window stays visible next to XCL's. Moving it off-screen in WM_WINDOWPOSCHANGING (local change) hides it.

    DualSense over Bluetooth under Wine: out of the box, Wine opens it as raw hidraw, and XInput sees no pad. With HKLM\System\CurrentControlSet\Services\winebus DisableHidraw = 1 (DWORD) in the prefix, Wine's SDL backend presents it as XInput pad 0, and XCL's GameInput uses it with no code change. This works inside the network namespace too. (#552 leaves a Bluetooth DualSense out on Windows.)

    Setup: CachyOS, kernel 7.3.4, RX 9070 XT (RADV GFX1201), XCL main at 508a0c7, DXC 1.9.2609.

    • Wine: Proton Experimental's wine. System Wine 11.22 was also tried for the stall below.
    • DXVK dxgi.
    • vkd3d-proton 3.1 built from source as a release build with b_ndebug, with d3d12_command_allocator_from_iface and d3d12_command_list_from_iface accepting any non-null object (the same idea as Linux: docs/linux.md, scripts/linux and Wine start-up checks for vkd3d-proton and DXVK (#154, #241) #257's patch).
    • XCL built from Linux: -Zbuild-std, lld-link, clang-cl + xwin.
    • XCL_NETWORK=0, XCL_COHERENT_MB=512, isolated network namespace.

    Without ignore_shared_fence (four runs, same every time, both Wine builds)

    • The title boots: one PresentX, 839 unique shaders, DirectStorage requests flow.
    • At about 11 s it submits one queue #35 ExecuteCommandListsX (1 lists, value 0x1), after BVH build/copy and meta commands, then spins on the value.
    • That work never completes. The title's watchdog fires about 30.5 s later: 0xc0000005 write at +0x2215c35, at 41.6–42.4 s. The crash context says Game State: Game Init, frame 0.
    • No amdgpu ring timeout or reset in the kernel log. Proton's wine logs winevulkan: signaller_worker wait timed out with non-empty poll list.
    • called_stubs: list #131 and #132, allocator #9.

    Not tested: #494 / #495 / #496 / #572, RADV_DEBUG=hang, a run on vkd3d-proton master as long as the 3.1 one, Mesa with symbols (which RADV pass is slow), an RDNA3 or NVIDIA card on the same build.

    Breakpad warning for Linux testers: without network isolation, the title's crash reporter uploaded its minidump to submit.backtrace.io here too (as in #505). Run inside unshare -n or behind a firewall block; inside the namespace the upload fails with WinHTTP 12029.

    AI use: Claude Code, Claude Opus 5.5: ran the builds and the runs, and wrote this report from their logs. Counts and outcomes only, no game files.

  25. radv-tinker commented on Nov 24, 2026

    @radv-tinker

    An RDNA4 data point for the post-intro GPU hang @lucsoft reported on RDNA3: same hang, same draw, plus what I ruled out and one log line that precedes it in every run.

    Setup: Fedora 43, kernel 7.0.11, RX 9070 XT (GFX1201), Mesa 25.3.6 RADV. Proton Experimental's Wine, vkd3d-proton v3.1 with the #257 patch (-Db_ndebug=true), DXVK dxgi/d3d11/d3d10core from Proton, DXC 1.9.2609. XCL main 2997c9a + #257 + #451 + #486, cross-built for x86_64-pc-windows-gnu. XCL_COHERENT_MB=512, XCL_NETWORK=0. Retail GTA VI 1.0.2.1.

    The hang. Every run: account prompt answered with A, intro plays, then amdgpu: ring gfx_0.0.0 timeout (thread vkd3d_queue) and D3D12 device removed: 0x887a0005, 2–3 min in. Seven runs, seven hangs at the same point.

    RADV_DEBUG=hang,nocache: the last trace point the CP reached is right after a DRAW_INDEX_2 with VGT_NUM_INDICES = 30, index buffer at 0xffff8001a3a7… (sparse window), then a PS_PARTIAL_FLUSH that never completes. VS (NGG) + PS only, neither has a backward branch (the VS is mostly bounds-checked scalar loads + 3 attribute-ring stores). GE_BUSY, SPI_BUSY, SC_BUSY, DB_BUSY, BCI_BUSY set; UTCL2_BUSY/EA_BUSY clear; vm_fault.log empty. RADV also prints "The CS has been cancelled because the context is lost. This context is innocent." in a normal run. So it is the same draw as on RDNA3.

    Ruled out:

    • ACO optimisations: ACO_DEBUG=noopt,nosched,force-waitcnt with RADV_DEBUG=nocache hangs the same way.
    • RADV_DEBUG=llvm can't be tried: vkd3d-proton then reports SM 6.0 and XCL refuses the device.
    • BCPack: with refused requests filled and reported as successful, same hang. I also wired a strict BCPack decoder (BC1/BC3/BC4/BC5) into dstorage.rs locally; the BC1 request that used to fail just before the hang now decodes (BCPack decoded so far: 4 requests (BC1 4)), hang unchanged.

    One line before every hang. In every run that reached the hang, and in none that stopped earlier, there is exactly one:

    D3D12.X: CopyMemoryToMemoryX: 0x117bb70000 → 0x3dfe9440 (0x4000 bytes) is not in unified memory – not done
    

    The source varies only a little across runs (0x117b9f0000 … 0x117bb70000); the destination is always around 0x3dfe…–0x3e87…. With a local diagnostic in copy_memory_x:

    CopyMemoryToMemoryX source 0x117bb70000: readable=false gpu-view-of=Some(0xb7bb70000) mirror-readable=false physical-page=false
    … (dst in UMA: false, src in UMA: false)
    

    So the source is in a GPU view whose CPU view is not committed (nothing the CPU wrote), it is not a physical page, and the destination is outside unified memory too. A local attempt to stage the source through upload memory (as gpu_va does for buffers) can't help, because there is nothing readable to stage. My guess, not verified: those 16 KB are something the GPU wrote earlier through that GPU view, the copy is skipped, and the 30-index draw then reads stale data that NVIDIA tolerates and AMD's GE doesn't. I haven't found who writes 0xb7bb70000's GPU view or what reads 0x3dfe… afterwards.

    Side result: #451 + #486 together took the intro video from ~5 fps to ~20 fps here (menus ~23 fps), so they help on AMD under Wine too.

    Happy to run a trace (XCL_TRACE_FRAME, extra logging in copy_memory_x, a build of a branch) on this card.

    AI-assisted.

  26. matheusfermiano-source commented on Nov 24, 2026

    @matheusfermiano-source

    Test suite under Wine on an RDNA2 iGPU (Radeon 660M, RADV) and an RTX 3050 Laptop, main a6f5f7a, built for x86_64-pc-windows-gnullvm. The Linux reports so far are NVIDIA, RDNA3 and RDNA4; this adds RDNA2 (gfx1035) and three Linux notes that aren't in this thread yet.

    Tested

    GPU passed failed ignored SKIPPED
    Radeon 660M (wave32 + wave64, mesh) 669 7 41 0
    RTX 3050 Laptop (wave32) 671 5 41 2 (no wave64)

    Failing on both GPUs (Wine / vkd3d-proton, not the GPU):

    • predication_e2e::set_predication_buffer_state_and_kickoff: dst[0] is 0xAAAA0000, want 0x11111111. vkd3d-proton predicates draws and dispatches but not CopyBufferRegion, and this test's predicated commands are copies.
    • pls_quota::disk_free_space_ex_reports_pls_quota: error 2 instead of 3 for S:\missing. The hook forwards to Wine's GetDiskFreeSpaceExW, which returns ERROR_FILE_NOT_FOUND.
    • e2e::test_title_runs_and_game_folder_is_untouched: W: not cloaked (no DWM cloaking, @notdxbi's item 2) and XMA2 GetState: ctx=0x0, queued=1, the same as hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime (also failing).

    Radeon 660M only: gpu_f64_roots and gpu_f64_math_random (v_rsq_f64 of negatives and NaN = 0, what #530 fixes; RDNA4 there, the same on RDNA2), and gpu_nonfused_mad_and_mac_prevent_fma_contraction (fused control gives +inf: RADV on RDNA2 leaves mad() unfused like the RDNA1 Windows driver in #472). All three pass on the RTX 3050 under the same Wine and vkd3d-proton.

    RTX 3050 only: gpu_more_atomics_sub_dword_scratch_valu hangs the GPU (NVRM: Xid 109, CTX SWITCH TIMEOUT), the dxil-spirv bug @BlestTerror found above (HansKristian-Work/dxil-spirv#372, still open). Every GPU test after it then runs on a lost device, so the other lib counts are from a rerun with --skip for it.

    Linux notes

    • Without a display, NVIDIA GPU tests skip and the run still looks green. DXVK logs Failed to create Vulkan instance, every GPU test prints SKIPPED …: no GPU and passes (87 such lines in my first run). NVIDIA's Vulkan driver has no VK_EXT_headless_surface; RADV has it, which is why the 660M ran headless. With DISPLAY set, the 3050 is used. Check the SKIPPED count before trusting a run over SSH or in a container.
    • Without a display the 660M has two hangs too. The two e2e tests that start xcl.exe never finish (over 10 min). gpu_pso_e2e hangs in sample_pack_read_errors_fail_instead_of_skipping when the whole binary runs (5 of 5 runs); alone it passes. With DISPLAY set, both binaries finish in seconds on both GPUs.
    • x86_64-pc-windows-gnullvm builds main with llvm-mingw unchanged, with no MinGW gcc and no xwin. Set the linker and CC/CXX/AR for that target to llvm-mingw's x86_64-w64-mingw32-*, and copy llvm-mingw's libunwind.dll and libc++.dll next to xcl.exe and the test executables (debug/ and debug/deps/), otherwise they exit with 0xC0000135. Its xcl.exe has a TLS directory (llvm-readobj --coff-tls-directory) and pe::tests::parses_own_test_binary_tls passes, so TLS: xcl.exe built with MinGW and lld keeps its TLS directory #464's problem does not come up with this target.

    Not tested: Windows; any retail title; a release build of the tests; GCN (Vega).

    AI use: Claude Code (Claude Opus 5.5) set up the build and the runs, read the failures and wrote this comment. The runs were real, on the hardware above. Counts only, no game files.

  27. pickles976 commented on Nov 24, 2026

    @pickles976

    Test-suite ground truth from a second Linux/Wine setup (host: Ubuntu 22.04, Wine 9 built-in d3d12 = vkd3d, Mesa llvmpipe Vulkan — no vendor D3D12 anywhere in the stack), cross-build recipe in #520 (llvm-mingw linker; gotcha: -lunwind must resolve to the static libunwind.a before libunwind.dll.a, else the exe dies silently at startup):

    • cargo test -p xcl --lib --target x86_64-pc-windows-gnu under Wine: 286 tests pass, until the process aborts in hle::d3d12x::bind::tests::create_list_reset_and_clear_state_track_initial_pso_on_d3d12:
      Assertion failed: iface->lpVtbl == &d3d12_root_signature_vtbl,
        file libs/vkd3d/libs/vkd3d/state.c, line 197
      
      Right before it: D3D12.X: ID3D12Device5 – 65 PC methods, … (+64 stubs, PC vtable wined3d.dll+0x2259c0) — XCL hands a wrapped/guarded interface to vkd3d, and vkd3d answers with a vtable-identity assertion instead of an error code.

    This is a direct datapoint for the thread's thesis (the obstacle is vtable replacement): even XCL's own unit tests, touching nothing console-specific, abort at a vtable-identity check once the host driver is vkd3d rather than MS d3d12.dll. Windows d3d12 would return E_INVALIDARG; vkd3d (including Wine's built-in one, asserts enabled even in release builds) kills the process. Any proxy-object design that ever passes a non-canonical iface into a host ID3D12* method will hit this class of assert; the unit suite run under Wine is a cheap canary for it — worth wiring into CI once the one test is green (or #[ignore]-gated for vkd3d hosts).

    Also: 286/287 means the CPU-side HLE (acphal/XGameSave/PLS/shader decode…) is fully healthy under Wine — the earlier per-area Wine reports hold up; the boundary is exactly where real device objects are handed across.

  28. pickles976 commented on Nov 24, 2026

    @pickles976

    Follow-up with the e2e binaries on the same Wine 9 + llvmpipe setup (--test-threads=2, xvfb):

    suite result
    console_dlls_e2e ok — 13 passed
    console_shaders ok — 3 passed, 4 ignored
    disasm_e2e ok — 1 passed
    heap_probe 0 run (4 ignored — needs device)
    pls_quota 1 failed — environment, not logic
    lib (--lib) 286 passed, 1 vkd3d vtable assert (comment above)

    The pls_quota failure is a Wine-only export-location gap: hook: kernelbase.dll!CopyFile2 not found. On Windows CopyFile2 is a kernelbase export; Wine still exports it from kernel32. One-line portability fix for the hook resolver: when a kernelbase.dll!<fn> lookup misses under Wine, retry kernel32.dll!<fn> (the reverse also holds for a few kernel32 functions Wine moved into kernelbase). With that, the whole CPU-side suite is green on Linux/Wine — the only remaining blocker in the lib suite is the vkd3d vtable-identity assert noted above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions