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. 56 remaining items

  16. PedroSilvaAlves commented on Nov 24, 2026

    @PedroSilvaAlves

    I tested the Xbox Series 1.0.2.1 title on an RTX 3070 Ti 8 GB (NVIDIA 615.78.08), Ryzen 9 5900X, and 32 GB RAM on Omarchy (Linux 7.2.15). I cross-built release binaries for x86_64-pc-windows-msvc and ran xcl run Z:\game under Proton Experimental (11.0, 2026-10-14), using its bundled vkd3d-proton 3.1 (0bb64c56c8f0dcc), DXVK, and DXC 1.9.2609.5. Both XCL_NETWORK=0 and an isolated network namespace were in use. I set VKD3D_CONFIG=ignore_shared_fence.

    • Upstream main 9e3831e reached the title entry point and initialized the real D3D12 backend, then exited at iface->lpVtbl == &d3d12_heap_vtbl with zero presents.
    • wine-fixes-2 at bbc472f passed that assertion. XCL recorded 445 presents before 0x80000003 at game_scarlett_master.exe+0x4dcbc9d, with callers +0x4e52a83 and +0x4e529c4. The title’s crash log reported 39 seconds, game frame 82, zero streaming requests, and 271/6236 MB of tile heap in use. The breakpoint and game frame match a separate report in VIctory #698.
    • Same Wine build with fresh XCL state exited before presenting. The first vkd3d-proton error was d3d12_command_queue_flush_bind_sparse: Failed to perform sparse binding, vr -4, followed by VK_ERROR_DEVICE_LOST (0x887a0005). This run did not reproduce the frame-82 breakpoint.

    I did not verify gameplay or test Windows on this machine. AI use was OpenAI Codex (GPT-6 family, exact variant unavailable) for the local runs, log analysis, and drafting this report.

  17. YaBulochka commented on Nov 24, 2026

    @YaBulochka

    Tested #1395 and #1395+#867 under Wine on RADV, on main 9e3831e (so #1211 is in). Numbers are wall-clock seconds from xcl.log up to process ends with status 0x3.

    Setup: Linux, Wine 11.22 inside a Proton 11.0 prefix, vkd3d-proton from Proton 11.0 (release, the asserts are kept), DXVK dxgi, RADV from Mesa 26.3.1, RX 7600 XT (RADV NAVI33). XCL_NETWORK=0.

    build ends at last line before the abort
    main 0.543 s ID3D12Heap1 – … (Heap, PC vtable d3d12core.dll+0x40acc0)
    main + #1395 1.403 s ID3D12Fence1 – … (Fence, PC vtable d3d12core.dll+0x40afa0)
    main + #1395 + #867 1.630 s display target 3840x2160 format 28: 0x1ff8000 bytes of the title's memory at 0x463c00000

    So both PRs do what they say on this title: #1395 carries the heap and the queue, and the next stop is the fence — exactly the arm you put in #867. With #867 as well the process adopts resources and descriptor heaps and then aborts inside d3d12core.dll+0x38b840 right after the display target line, so the remaining wall here is that target's creation, not a vtable assert.

    One more data point for the same title: the console heap is 1,245,184 view slots, and XCL's one shader-visible PC heap of 1000000 view descriptors line fires for it — the same 1,000,000 cap VIctory hits on this game.

    Happy to keep testing; I can rerun with the Windows-style d3d12_debug/DRED settings or with a specific vkd3d-proton commit if that helps narrow the 0x38b840 abort.

  18. pickles976 commented on Nov 24, 2026

    @pickles976

    Registering your +0x4dcbc9d against the shared kill-map (hash-matched copy, VIctory#630): verified deliberate, partially decoded — the int3 sits in a tail block attached to a size/limit validation helper: the function compares a requested quantity ([rsp+0x2c]) against a stored limit ([rdi+0x1c]) and the int3 is a non-linear jump target at the tail (same tail-block shape as the 2 MiB range cap at +0x247af2d — report-then-dispatch style stops, not inline asserts). Your caller pair (+0x4e52a83/+0x4e529c4) sits in a helper that early-returns on [obj+0x18] == 0 — a count/queue emptiness check before the size gate. Shape read: a bounded queue/size assertion on a non-empty structure fails at frame 82 — consistent with your "0 streaming requests, 271 MB tile heap" (nothing streamed → whatever the structure counts never populated → the gate that requires population fires). Two asks to finish the decode: ① does your log carry a parameter … value debug line just before (like #534's GPU Loc Sig)? If yes, post the value; ② the frame-82 match with VIctory#698 makes this the ecosystem's first deterministic early stop (vs the ~1–5 min watchdog) — if your wine-fixes-2 fork is public, the repro is worth pinning for whoever owns the early-boot path.

  19. YaBulochka commented on Nov 24, 2026

    @YaBulochka

    Follow-up on the same combination (#1395 + #867), same setup. With the vkd3d asserts left on (VKD3D_DEBUG=err), the run now gets past heaps, queue, fence and the earlier resource adoption, reaches the title's 4K display target, and dies on a resource assert:

    [1.745] D3D12.X: display target 3840x2160 format 28: 0x1ff8000 bytes of the title's memory at 0x463c00000
    Assertion failed: iface->lpVtbl == &d3d12_resource_vtbl, file ../src-vkd3d-proton/libs/vkd3d/vkd3d_private.h, line 1243
    process ends with status 0x3; stack: d3d12core.dll+0x38b840, msvcrt.dll+0x76f90, kernel32.dll+0x1a24a, d3d12core.dll+0x40aea0, …
    

    So the remaining one on this title is the placed resource the display target is built from (the path that places a resource at the title's own memory address, 0x463c00000 here). It looks like that path does not go through the vtable-preserving adoption that #1395/#867 add for the other classes — the assert fires on the line right after XCL logs the target.

    Environment unchanged: Wine 11.22 in a Proton 11.0 prefix, vkd3d-proton from Proton 11.0 (release, asserts kept), DXVK dxgi, RADV Mesa 26.3.1, RX 7600 XT; main 9e3831e + #1395 + #867.

    If it helps, I can rerun with any patch you want on that path, or with VKD3D_DEBUG=fixme to see which vkd3d call the object is passed back through.

  20. pickles976 commented on Nov 24, 2026

    @pickles976

    Source-side read of your remaining assert from the in-place-placement lane (hash-matched build of 9e3831e): your observation fits the adoption convention exactly. Adoption is done at creation factories — the codebase even has the rule as a comment ("made through the titles device it is adopted already", alloc_pool.rs:239) — and the display-target path (real.rs:2276+, the "console memory comes from the titles allocation hook" factory, CreateCommittedResource (console, slot 76)) is one of the paths that reaches for the underlying PC device rather than the title-facing device. [INFERENCE] from what I can trace statically: that makes its returned resource the remaining non-adopted creation object on the assert-bearing path, and the one-line completion is adopting it at creation (adopt(res, Kind::Resource) after success), same as the allocator pool does — but that call needs confirmation from @ksanjeev284/#1395-owner, who knows the passback bookkeeping better than a static read. Two notes on severity so the queue ranks it right: ① this assert is a diagnostics-build wall — vkd3d-proton release without asserts passes the pointer fine, which is why your earlier runs with this title got past display targets; it blocks the assert-keeping cohort (the very people producing your best reports), not production users. ② Your offer to rerun with VKD3D_DEBUG=fixme is worth taking for this object only — the vkd3d call the object is passed back through names the exact passback site, converting my [INFERENCE] into a line number. Worth 10 minutes on the next run.

  21. pickles976 commented on Nov 24, 2026

    @pickles976

    Your +0x4dcbc9d decode is complete from the exe side — I posted the full read on the map thread (VIctory#630), short version: the int3 fires iff requested append quantity > fixed capacity − used — an inline overflow guard in the title's own append routine (+0x4dcbc40), so at frame 82 a container received more records than it was sized for. One ask sized to your repro, high value: at the moment just before the trap (or at the heap/format creation calls preceding it), dump the emulator-reported sizing inputs the title could be planning from — custom-heap properties (tile size, attributes), GetCustomHeapTextureSizes-equivalents, and any format-topology counts — so we can diff them against console-expected values. If one is reported at a granularity that multiplies record counts (tile size ÷16 ⇒ count ×16), you have the fix in one line instead of a bisect.

  22. wayback94 commented on Nov 24, 2026

    @wayback94

    Linux test run of main at 9e3831e on an RTX 3080 (Ampere, 32-lane waves) under Proton Experimental's Wine, with the vkd3d-proton build from #257.

    Tested

    test result under Wine / vkd3d-proton
    gpu::recomp::tests::gpu_more_atomics_sub_dword_scratch_valu kernel dispatch: GPU fence still pending after 10000 ms, also when run alone (--exact)
    hle::d3d12x::device_x::tests::gpu_depth_buffer_created_for_unordered_access_is_placed new since the reports in #257 (the test is from 5383506): UNORDERED_ACCESS without the UAV flag (device_x.rs:1113). The test places a D16 texture whose PC description has ALLOW_DEPTH_STENCIL and no ALLOW_UNORDERED_ACCESS (pc_resource_desc drops it) in D3D12_RESOURCE_STATE_UNORDERED_ACCESS, and expects an error. vkd3d-proton v3.1 returns success: d3d12_resource_validate_create_info / _initial_resource_state (libs/vkd3d/resource.c) check RENDER_TARGET and DEPTH_WRITE/READ states against their flags, but UNORDERED_ACCESS only for acceleration structures. Fails alone too, 2 of 2 runs
    hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime left: 0, right: 12291 (xaudio2.rs:1599), as in #257 (Proton's Wine)
    predication_e2e::set_predication_buffer_state_and_kickoff EQUAL_ZERO(0) must skip dst[0] (2863267840 vs 286331153)
    e2e::test_title_runs_and_game_folder_is_untouched test title: user32 … W: not cloaked, XMA2 GetState: ctx=0x0, queued=1
    pls_quota::disk_free_space_ex_reports_pls_quota left: (0, 2), right: (0, 3)

    Same PC, same commit, on Windows (for comparison)

    • Windows 11 Home 26H2 (build 26300.9974), NVIDIA driver 610.88 (32.0.16.1088), Rust 1.100.0 stable-x86_64-pc-windows-msvc, MSVC 14.44 / Windows SDK 10.0.26100.0 (its DXC 1.9.2602.17), debug
    • .\scripts\test.ps1, no XCL_SAMPLE_*, nothing skipped: 776 passed, 0 failed, 41 ignored, the same 3 SKIPPED lines. No hang, no device removal. All 6 tests in the table above pass, so on this PC all 6 differences come from Wine, vkd3d-proton or the Linux driver.
    • gpu_depth_buffer_created_for_unordered_access_is_placed alone (--exact): passes 3 of 3 on driver 610.88, and 3 of 3 again after updating to driver 621.14 (32.0.16.2114), same build. So Windows' D3D12 refuses the UNORDERED_ACCESS placement without the UAV flag, as the test expects. The HRESULT it returns was not recorded.
    • With XCL_SAMPLE_RPF set to my own copy of the shader pack: also 776 / 0 / 41.

    Not tested

    • Release builds; the retail title (run.sh / smoke.sh / smoke.ps1); XCL_SAMPLE_* tests under Wine
    • The whole Windows suite and the XCL_SAMPLE_RPF run on driver 621.14 (only the depth test was rerun there)
    • The Linux and Windows drivers differ (620.73.04 vs 610.88 for the Windows suite), so the GPU hang is not yet pinned to Wine/vkd3d-proton rather than the driver version
    • Which HRESULT Windows returns for the depth+UAV placement; which D3D12 runtime (Agility SDK or the OS's) the Windows run used
    • Other Wine builds (system Wine 11.22), stock vkd3d-proton

    AI use

    • Claude Code (Claude Opus 5.5) set up the toolchains on Linux and Windows, ran the tests and wrote this report; I checked the counts against the logs.
  23. pickles976 commented on Nov 24, 2026

    @pickles976

    Three things from reading the matrix as a whole: ① depth+UAV has a spec-side tiebreaker: D3D12 forbids ALLOW_UNORDERED_ACCESS on depth-stencil formats — CreateCommittedResource must fail E_INVALIDARG — so the fork is one line: if the test expects rejection and vkd3d-proton returns S_OK, that is an upstream validation gap worth a 2-line repro against vkd3d-proton proper (not a #257 artifact); if the test expects success, the test carries a console-side allowance that PC validation does not honor, and the test is the thing to change. Either way it stops being an open question the moment someone names which side it asserts. ② The 3080 skips are the good posture made visible: gpu_wave32_program_in_wave64_hardware and the prefix-count test skip loudly when hardware cannot host them — the sibling runtime's legalize-without-remap default would run those same programs and return quietly wrong cross-lane values instead of skipping. This report is a nice exhibit for the #1407 wave-log argument: the skip line names the class, the silent path names nothing. ③ Your AI-use disclosure (agent set up toolchain + wrote report; human checked counts against logs) is exactly the standard the triage thread asked for — counts-verified is the load-bearing half, and it is why this report is directly citable. The scratch_valu cascade matches #257 exactly (same post-reset contamination; isolating it from the "2 failed" set was the right call).

  24. wayback94 commented on Nov 24, 2026

    @wayback94

    Thanks. One correction on ①: the test doesn't create a depth texture with ALLOW_UNORDERED_ACCESS. pc_resource_desc drops that flag, and the test then places the texture with CreatePlacedResource in D3D12_RESOURCE_STATE_UNORDERED_ACCESS, without the flag, and expects an error. vkd3d-proton v3.1 accepts it. In libs/vkd3d/resource.c it checks the render-target and depth states against their flags, but checks UNORDERED_ACCESS only for acceleration structures.

    Update: Windows answers it. On the same PC and commit (9e3831e, RTX 3080, Windows 11, driver 610.88), the test passes 3 of 3, so Windows' D3D12 refuses the placement as the test expects. That makes it a missing check in vkd3d-proton, not a problem in the test or in XCL. The whole suite on Windows on that PC gave 776 passed, 0 failed, 41 ignored, so all six differences in the Linux run come from Wine, vkd3d-proton or the Linux driver. I counted both runs with a script that adds up each test binary's test result: line.

    AI-assisted: Claude Code (Claude Opus 5.5) checked the vkd3d-proton source, ran the Windows tests and drafted this reply.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions