Memory: avoid amdgpu userptr stalls under Wine (#175) #865

Closed
gustavsi wants to merge 2 commits from upstream-pr/871 into main
gustavsi commented 2026-11-24 07:07:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-24T07:07:15Z.


Avoid amdgpu userptr submission stalls under Wine/vkd3d-proton on Linux by capping the coherent UMA window to 512 MiB on AMD GPUs (without MEM_WRITE_WATCH) and routing overflow PAGE_GRAPHICS_* heaps into the sparse VRAM windows. Part of #175 and #1701.

Stacked on #867 (021b2c33); only the top commit (cb3902a4) belongs here.

On Linux with amdgpu, importing a multi-GiB coherent UMA window via OpenExistingHeapFromAddress (VK_EXT_external_memory_host userptr) causes two severe stalls:

  1. GetWriteWatch(WRITE_WATCH_FLAG_RESET) on the userptr range triggers amdgpu MMU-notifier evictions (~100–200 ms per submit).
  2. A multi-GiB userptr BO stalls every Vulkan GPU submission (~150 ms/frame, dropping PresentX frames).

All new paths are gated behind util::under_wine(), and the window cap and write-watch changes behind wine_amd_gpu() (Wine and XCL's own D3D12 adapter is AMD); native Windows behavior is unchanged.

What is in it

  • crates/xcl/src/gpu/uma.rs:
    • Key the default 512 MiB coherent_hint() cap under Wine on AMD GPUs (wine_amd_gpu(), VendorId == 0x1002), so NVIDIA Linux keeps a full-size coherent window unless XCL_COHERENT_MB is explicitly set (per @notdxbi's RTX 5060 benchmark). wine_amd_gpu() checks the adapter XCL's D3D12 backend opens – high-performance order, d3d12_adapter / XCL_ADAPTER, falling back to auto like real::init – via the new gpu::adapter::chosen_vendor, so hybrid machines (AMD iGPU + NVIDIA dGPU, Intel iGPU + AMD dGPU) get the right choice (@safesearch77's review).
    • Under Wine on AMD (wine_amd_gpu()), allocate the coherent window without MEM_WRITE_WATCH and omit it from watch_regions(); elsewhere it stays write-watched as on Windows.
  • crates/xcl/src/hle/d3d12x/title_textures.rs & crates/xcl/src/hle/dstorage.rs:
    • Add title_textures::mark_dirty_range and call it on DirectStorage copies into coherent memory under Wine.
    • Where the coherent window is not write-watched (wine_amd_gpu()), hash small/dynamic coherent-window textures on submit and round-robin sweep large (> 4 MiB) static coherent textures 1/16 per submit. mark_dirty_range stays on for all Wine runs (a DirectStorage write may not be seen by the write watch there; it only marks textures for upload).
    • Copy coherent-window textures via copy_committed_region (ReadProcessMemory) in read_committed_into / with_title_bytes / refresh under Wine instead of raw copy_nonoverlapping / from_raw_parts, fixing the 0xc0000005 ucrtbase.dll memcpy fault on unreadable coherent-window pages reported by @TobiasFornell while preserving #2849's safe copy outside the coherent window on native Windows (and updating title_bytes_are_copied_outside_the_coherent_window to assert safe copying under Wine and in-place reading on native Windows).
  • crates/xcl/src/hle/kernelx.rs:
    • Route overflow PAGE_GRAPHICS_* VirtualAlloc calls under Wine into the sparse VRAM windows when the coherent window is full.

Tested

  • Hardware / OS: AMD Radeon RX 9060 XT (16 GiB VRAM, RADV Mesa 26.2.7), Linux, GE-Proton11-14-x86_64, vkd3d-proton (-Db_ndebug=true), DXC 1.9.2609.5, cross-compiled x86_64-pc-windows-msvc (clang-cl + lld-link).
  • Rebased onto main (f9a0cb80, resolving #2849's with_title_bytes conflict) + updated #867 (021b2c33) at cb3902a4 and verified under GE-Proton11-14 (--test-threads=1 unless noted):
    • gpu::adapter::: 4 passed, 0 failed, 0 ignored (including chosen_vendor_is_the_adapter_the_backend_opens)
    • gpu::uma::: 12 passed, 0 failed, 0 ignored
    • hle::d3d12x::title_textures::: 21 passed, 0 failed, 0 ignored (including title_bytes_are_copied_outside_the_coherent_window)
    • hle::d3d12x::real::: 67 passed, 0 failed, 0 ignored
    • hle::d3d12x::alloc_pool:: --test-threads=4: 4 passed, 0 failed, 0 ignored
  • Retail title 60 s smoke run via unmodified pwsh ./scripts/smoke.ps1 (with GE-Proton11-14 wrapper, XCL_PREPARE=0): improved from 31 frames (PresentX 31) on #867 to 1044 frames (PresentX 1044, 45 44 44/2 s) at cb3902a4 with 0 crashes and 0 device removals.

Regression run
Produced under Wine (GE-Proton11-14, AMD Radeon RX 9060 XT, XCL_PREPARE=0 XCL_NETWORK=0 XCL_PSO_PRELOAD=0 XCL_RUN_SECONDS=60 XCL_ACTIVITY=1, VKD3D_CONFIG=""). The PR run used unmodified pwsh ./scripts/smoke.ps1 via a thin Wine wrapper; main (e0d93c84) crashed before writing report.json, so its block was extracted from the same xcl.log (peak commit: 0 MB is what Wine reports in xcl.log).

main (e0d93c84):

xcl-smoke v1
commit: e0d93c84ad8253f6e17738d14741c1bab7061127
gpu: AMD Radeon RX 9060 XT
title: retail-title
seconds: 60
exit: 0x3
frames shown: 0 (did not reach end)
presents per 2 s (last 3): 0 0
device removals: 0
crashes: 2
peak commit: 0 MB

This PR (cb3902a4, stacked on #867):

xcl-smoke v1
commit: cb3902a4897ad5cdad4cb6a0091d639134d22537
gpu: AMD Radeon RX 9060 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1044 (PresentX 1044)
presents per 2 s (last 3): 45 44 44
device removals: 0
crashes: 0
peak commit: 0 MB

Not tested

  • Native Windows (all new paths are gated behind util::under_wine()).
  • NVIDIA Linux GPUs: with the adapter-aware gating the coherent window there stays write-watched (as on Windows) instead of hashed; not measured here (no NVIDIA hardware).
  • Hybrid (two-GPU) machines: covered by the chosen_vendor unit test only; the DXGI enumeration itself was not run on one.

AI use

  • T3 Code, Antigravity (Gemini 4 Neon) rebased onto main (f9a0cb80) + updated #867 (021b2c33), resolved the #2849 title_textures.rs conflict, ran the Proton tests and 60 s smoke run at cb3902a4, and updated this description.
  • Claude Code (Claude Opus 5.5) made the adapter-aware wine_amd_gpu() / write-watch gating change from @safesearch77's review, wrote the chosen_vendor test, and ran the earlier 1a7f146b verification.
<!-- greyfinch-sync:ivall/xcl:issue:5467714395 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/871). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-24T07:07:15Z. --- Avoid `amdgpu` `userptr` submission stalls under Wine/vkd3d-proton on Linux by capping the coherent UMA window to 512 MiB on AMD GPUs (without `MEM_WRITE_WATCH`) and routing overflow `PAGE_GRAPHICS_*` heaps into the sparse VRAM windows. Part of #175 and #1701. Stacked on #867 (`021b2c33`); only the top commit (`cb3902a4`) belongs here. On Linux with `amdgpu`, importing a multi-GiB coherent UMA window via `OpenExistingHeapFromAddress` (`VK_EXT_external_memory_host` `userptr`) causes two severe stalls: 1. `GetWriteWatch(WRITE_WATCH_FLAG_RESET)` on the `userptr` range triggers `amdgpu` MMU-notifier evictions (~100–200 ms per submit). 2. A multi-GiB `userptr` BO stalls every Vulkan GPU submission (~150 ms/frame, dropping `PresentX` frames). All new paths are gated behind `util::under_wine()`, and the window cap and write-watch changes behind `wine_amd_gpu()` (Wine and XCL's own D3D12 adapter is AMD); native Windows behavior is unchanged. **What is in it** - `crates/xcl/src/gpu/uma.rs`: - Key the default 512 MiB `coherent_hint()` cap under Wine on AMD GPUs (`wine_amd_gpu()`, `VendorId == 0x1002`), so NVIDIA Linux keeps a full-size coherent window unless `XCL_COHERENT_MB` is explicitly set (per @notdxbi's RTX 5060 benchmark). `wine_amd_gpu()` checks the adapter XCL's D3D12 backend opens – high-performance order, `d3d12_adapter` / `XCL_ADAPTER`, falling back to `auto` like `real::init` – via the new `gpu::adapter::chosen_vendor`, so hybrid machines (AMD iGPU + NVIDIA dGPU, Intel iGPU + AMD dGPU) get the right choice (@safesearch77's review). - Under Wine on AMD (`wine_amd_gpu()`), allocate the coherent window without `MEM_WRITE_WATCH` and omit it from `watch_regions()`; elsewhere it stays write-watched as on Windows. - `crates/xcl/src/hle/d3d12x/title_textures.rs` & `crates/xcl/src/hle/dstorage.rs`: - Add `title_textures::mark_dirty_range` and call it on DirectStorage copies into coherent memory under Wine. - Where the coherent window is not write-watched (`wine_amd_gpu()`), hash small/dynamic coherent-window textures on submit and round-robin sweep large (> 4 MiB) static coherent textures 1/16 per submit. `mark_dirty_range` stays on for all Wine runs (a DirectStorage write may not be seen by the write watch there; it only marks textures for upload). - Copy coherent-window textures via `copy_committed_region` (`ReadProcessMemory`) in `read_committed_into` / `with_title_bytes` / `refresh` under Wine instead of raw `copy_nonoverlapping` / `from_raw_parts`, fixing the `0xc0000005` `ucrtbase.dll` `memcpy` fault on unreadable coherent-window pages reported by @TobiasFornell while preserving #2849's safe copy outside the coherent window on native Windows (and updating `title_bytes_are_copied_outside_the_coherent_window` to assert safe copying under Wine and in-place reading on native Windows). - `crates/xcl/src/hle/kernelx.rs`: - Route overflow `PAGE_GRAPHICS_*` `VirtualAlloc` calls under Wine into the sparse VRAM windows when the coherent window is full. **Tested** - Hardware / OS: AMD Radeon RX 9060 XT (16 GiB VRAM, RADV Mesa 26.2.7), Linux, `GE-Proton11-14-x86_64`, `vkd3d-proton` (`-Db_ndebug=true`), DXC 1.9.2609.5, cross-compiled `x86_64-pc-windows-msvc` (`clang-cl` + `lld-link`). - Rebased onto `main` (`f9a0cb80`, resolving #2849's `with_title_bytes` conflict) + updated #867 (`021b2c33`) at `cb3902a4` and verified under `GE-Proton11-14` (`--test-threads=1` unless noted): - `gpu::adapter::`: **4 passed, 0 failed, 0 ignored** (including `chosen_vendor_is_the_adapter_the_backend_opens`) - `gpu::uma::`: **12 passed, 0 failed, 0 ignored** - `hle::d3d12x::title_textures::`: **21 passed, 0 failed, 0 ignored** (including `title_bytes_are_copied_outside_the_coherent_window`) - `hle::d3d12x::real::`: **67 passed, 0 failed, 0 ignored** - `hle::d3d12x::alloc_pool:: --test-threads=4`: **4 passed, 0 failed, 0 ignored** - Retail title 60 s smoke run via unmodified `pwsh ./scripts/smoke.ps1` (with `GE-Proton11-14` wrapper, `XCL_PREPARE=0`): improved from `31` frames (`PresentX 31`) on #867 to **`1044` frames (`PresentX 1044`, `45 44 44`/2 s)** at `cb3902a4` with `0` crashes and `0` device removals. **Regression run** Produced under Wine (`GE-Proton11-14`, AMD Radeon RX 9060 XT, `XCL_PREPARE=0 XCL_NETWORK=0 XCL_PSO_PRELOAD=0 XCL_RUN_SECONDS=60 XCL_ACTIVITY=1`, `VKD3D_CONFIG=""`). The PR run used unmodified `pwsh ./scripts/smoke.ps1` via a thin Wine wrapper; `main` (`e0d93c84`) crashed before writing `report.json`, so its block was extracted from the same `xcl.log` (`peak commit: 0 MB` is what Wine reports in `xcl.log`). `main` (`e0d93c84`): ``` xcl-smoke v1 commit: e0d93c84ad8253f6e17738d14741c1bab7061127 gpu: AMD Radeon RX 9060 XT title: retail-title seconds: 60 exit: 0x3 frames shown: 0 (did not reach end) presents per 2 s (last 3): 0 0 device removals: 0 crashes: 2 peak commit: 0 MB ``` This PR (`cb3902a4`, stacked on #867): ``` xcl-smoke v1 commit: cb3902a4897ad5cdad4cb6a0091d639134d22537 gpu: AMD Radeon RX 9060 XT title: retail-title seconds: 60 exit: 0x0 frames shown: 1044 (PresentX 1044) presents per 2 s (last 3): 45 44 44 device removals: 0 crashes: 0 peak commit: 0 MB ``` **Not tested** - Native Windows (all new paths are gated behind `util::under_wine()`). - NVIDIA Linux GPUs: with the adapter-aware gating the coherent window there stays write-watched (as on Windows) instead of hashed; not measured here (no NVIDIA hardware). - Hybrid (two-GPU) machines: covered by the `chosen_vendor` unit test only; the DXGI enumeration itself was not run on one. **AI use** - T3 Code, Antigravity (`Gemini 4 Neon`) rebased onto `main` (`f9a0cb80`) + updated #867 (`021b2c33`), resolved the #2849 `title_textures.rs` conflict, ran the Proton tests and 60 s smoke run at `cb3902a4`, and updated this description. - Claude Code (Claude Opus 5.5) made the adapter-aware `wine_amd_gpu()` / write-watch gating change from @safesearch77's review, wrote the `chosen_vendor` test, and ran the earlier `1a7f146b` verification.
fromthemoonx commented 2026-11-24 08:25:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-11-24T08:25:43Z.


Rerun on the new head cb3902a (rebased onto main f9a0cb8, with the conflict resolution in title_textures.rs): still passes on native Windows / NVIDIA, as part of the stack run on #877 (3b76b08 contains this commit): 1470 passed, 0 failed, 47 ignored, 25 SKIPPED lines; title_textures:: 3 of 3 at --test-threads=8. Same RTX 3060 (driver 610.88), Rust 1.100.0, debug. Not tested: Wine / amdgpu. The reports below are for older heads.


Rerun on the new head a800c38 (this commit unchanged, now on #867's d9e6ad5): still passes on native Windows / NVIDIA, as part of the stack run on #877 (2935240 contains this commit): merged onto main 8b957be (clean), 1452 passed, 0 failed, 47 ignored, 25 SKIPPED lines. Same RTX 3060 (driver 610.88), Rust 1.100.0, debug. Not tested: Wine / amdgpu. The reports below are for older heads.


Rerun on the new head b3f2f7c (rebased with #867's a4c5a82): still passes on native Windows / NVIDIA. cargo test --workspace --no-fail-fast -- --test-threads=4, now with no --skip: 977 passed, 0 failed, 45 ignored. The merged run of the whole stack is on #877: no conflicts with main 5796cc4, 1060 passed, 0 failed. Same RTX 3060 (driver 610.88), DXC 1.9.2602.17, debug. Not tested: Wine / amdgpu. The report below is for de6d71c.


Native Windows / NVIDIA run, since Not tested lists native Windows.

Tested

  • Exact head de6d71c5e8e2ab708410606e4cf7bb9bfd5b77f7 (this PR's commit on top of #867's 593b2e2), clean worktree, not merged onto main
  • NVIDIA GeForce RTX 3060 12 GB (32-lane waves), driver 32.0.16.1088; AMD Ryzen 7 5700X; native Windows 11 Pro 26H2 (build 26300.9974); rustc 1.100.0 stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0); debug
  • cargo build --workspace, then cargo test --workspace -- --test-threads=4 --skip a_freed_block_is_decommitted_before_its_address_is_reused: 714 passed, 0 failed, 41 ignored, 1 filtered out (lib 673 / 0 / 21; all 7 gpu::uma::tests passed). The skip is #913: on this 12 GB card, that test fills video memory and makes unrelated tests fail with E_OUTOFMEMORY.
  • SKIPPED (no wave64 on this adapter): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware
  • XCL_SAMPLE_* not set

Not tested

  • A retail title (no smoke.ps1 run here), and anything under Wine. Since the changes are behind under_wine(), this only shows the native Windows path is unchanged in the test suite.
  • Release build.

AI use

  • Claude Code (Claude Opus 5.5) ran the build and tests on the machine above and wrote this report from the log.
<!-- greyfinch-sync:ivall/xcl:comment:7126122549 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/871#issuecomment-7126122549). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-11-24T08:25:43Z. --- **Rerun on the new head `cb3902a` (rebased onto `main` `f9a0cb8`, with the conflict resolution in `title_textures.rs`): still passes on native Windows / NVIDIA, as part of the stack run on #877** (`3b76b08` contains this commit): 1470 passed, 0 failed, 47 ignored, 25 `SKIPPED` lines; `title_textures::` 3 of 3 at `--test-threads=8`. Same RTX 3060 (driver 610.88), Rust 1.100.0, debug. Not tested: Wine / amdgpu. The reports below are for older heads. --- **Rerun on the new head `a800c38` (this commit unchanged, now on #867's `d9e6ad5`): still passes on native Windows / NVIDIA, as part of the stack run on #877** (`2935240` contains this commit): merged onto `main` `8b957be` (clean), 1452 passed, 0 failed, 47 ignored, 25 `SKIPPED` lines. Same RTX 3060 (driver 610.88), Rust 1.100.0, debug. Not tested: Wine / amdgpu. The reports below are for older heads. --- **Rerun on the new head `b3f2f7c` (rebased with #867's `a4c5a82`): still passes on native Windows / NVIDIA.** `cargo test --workspace --no-fail-fast -- --test-threads=4`, now with no `--skip`: 977 passed, 0 failed, 45 ignored. The merged run of the whole stack is on #877: no conflicts with main `5796cc4`, 1060 passed, 0 failed. Same RTX 3060 (driver 610.88), DXC 1.9.2602.17, debug. Not tested: Wine / amdgpu. The report below is for `de6d71c`. --- Native Windows / NVIDIA run, since **Not tested** lists native Windows. **Tested** - Exact head `de6d71c5e8e2ab708410606e4cf7bb9bfd5b77f7` (this PR's commit on top of #867's `593b2e2`), clean worktree, not merged onto `main` - NVIDIA GeForce RTX 3060 12 GB (32-lane waves), driver 32.0.16.1088; AMD Ryzen 7 5700X; native Windows 11 Pro 26H2 (build 26300.9974); rustc 1.100.0 `stable-x86_64-pc-windows-msvc`; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0); debug - `cargo build --workspace`, then `cargo test --workspace -- --test-threads=4 --skip a_freed_block_is_decommitted_before_its_address_is_reused`: **714 passed, 0 failed, 41 ignored, 1 filtered out** (lib 673 / 0 / 21; all 7 `gpu::uma::tests` passed). The skip is #913: on this 12 GB card, that test fills video memory and makes unrelated tests fail with `E_OUTOFMEMORY`. - SKIPPED (no wave64 on this adapter): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` - `XCL_SAMPLE_*` not set **Not tested** - A retail title (no `smoke.ps1` run here), and anything under Wine. Since the changes are behind `under_wine()`, this only shows the native Windows path is unchanged in the test suite. - Release build. **AI use** - Claude Code (Claude Opus 5.5) ran the build and tests on the machine above and wrote this report from the log.
SlopTart commented 2026-11-24 09:07:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T08:09:54Z.


Linux / AMD RDNA3 lane report, head de6d71c merged onto main 1ec4c98 (lane merge shas: 877 d905182, 871 8e45b96, 867 ad333d2 - see my note that all three of the #175-cluster PRs show the identical signature, whichever lands).

This PR hard-crashes the test harness on my Wine/RDNA3 lane. Not a test failure: the lib test binary dies with exit status 5, no panic message, no failure list. Everything after it (e2e, gpu_compute_e2e, pls_quota, predication_e2e targets) then fails to run, which is why the lane totals look collapsed (36 passed / 2 suites).

Crash point, pinned with sequential runs (--test-threads=1): it dies at or immediately after gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem, the sparse-VRAM test. That test passes clean on plain main 1ec4c98 on this exact rig (3 separate lanes this batch, ... ok), and passed on this rig before. So the crash is attributable to this PR's change to the sparse/VRAM path, not the environment.

Reproduced 3/3: full-suite lane run, isolated lib rerun, and a --test-threads=1 run.

Counts only, no game data.

Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross x86_64-pc-windows-gnu, XCL_NETWORK=0, release profile. My Linux rows: #42 / #718.

AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7125802223 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/871#issuecomment-7125802223). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-24T08:09:54Z. --- Linux / AMD RDNA3 lane report, head `de6d71c` merged onto main `1ec4c98` (lane merge shas: 877 `d905182`, 871 `8e45b96`, 867 `ad333d2` - see my note that all three of the #175-cluster PRs show the identical signature, whichever lands). **This PR hard-crashes the test harness on my Wine/RDNA3 lane.** Not a test failure: the lib test binary dies with **exit status 5**, no panic message, no failure list. Everything after it (e2e, gpu_compute_e2e, pls_quota, predication_e2e targets) then fails to run, which is why the lane totals look collapsed (36 passed / 2 suites). Crash point, pinned with sequential runs (`--test-threads=1`): it dies at or immediately after `gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem`, the sparse-VRAM test. That test **passes clean on plain main `1ec4c98` on this exact rig** (3 separate lanes this batch, `... ok`), and passed on this rig before. So the crash is attributable to this PR's change to the sparse/VRAM path, not the environment. Reproduced 3/3: full-suite lane run, isolated lib rerun, and a `--test-threads=1` run. Counts only, no game data. **Machine:** RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross `x86_64-pc-windows-gnu`, `XCL_NETWORK=0`, release profile. My Linux rows: #42 / #718. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
freemanovec commented 2026-11-24 09:07:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by freemanovec on 2026-11-24T08:23:10Z.


Written by an AI agent (Claude Code, Claude Opus 5.5) on this account, from runs on this machine.

A second RDNA3 data point for this PR and #867: RX 7900 XTX, Mesa 26.3.1 RADV, CachyOS (kernel 7.3.5), Wine 11.22 (Arch build, kernel write watches), vkd3d-proton v3.1 (4522cc1a) with #257's patch and -Db_ndebug=true, DXVK from Proton Experimental, DXC 1.9.2609. XCL cross-built for x86_64-pc-windows-gnu with llvm-mingw (plus -Wl,-u,_tls_used, see #464), release, XCL_NETWORK=0. The newer retail game, 300 s per run, A held 6 s at 90/130/170/210/250 s.

build frames shown / PresentX fps (150–300 s) GPU busy avg crashes / removals
main a1672ef 71 / 113 0–1 94.5 % 0 / 0
a1672ef + a local change like cmt8's 2b10a05, gated by a start-up probe (coherent window left out of the look, its textures hashed every look) 2,844 / 2,845 10.7 5.9 % 0 / 0
this PR de6d71c (with #867) 7,776 / 7,776 30.0 flat (the title's own interval, 33,333 µs) 8.9 % 0 / 0
#867 + this PR cherry-picked onto a1672ef dies at ~20 s, 2 of 2 runs – – exit 0xC0000005 / 0
same, XCL_LATE_RELEASE=0 7,761 / 7,762 30.0 8.6 % 0 / 0
  • On current main the stack crashes unless XCL_LATE_RELEASE=0: an access violation in title code, then one in a vkd3d-proton worker writing through overwritten memory. So it is the combination with #866's late release (e7da8a1); root cause not found. This may be the same thing as @SlopTart's exit 5 above. The sparse filter of the lib tests passed on that build both ways (14 passed, 0 failed, 1 ignored); the full lib suite was not run there.
  • Round-robin hashing, no stale textures seen: the UI TEXT SIZE, SUBTITLES and BRIGHTNESS pages are pixel-identical between this PR and the hash-every-look build (quarter-size dumps, 0 pixels differ by more than 24). No video playback or gameplay was reached, so streaming in the world is not covered.
  • The affected tests on de6d71c, under Wine (debug, --test-threads=4): gpu::uma 7/0/0, title_textures 13/0/0, sparse 14/0/1, dstorage 13/0/0 (passed/failed/ignored), no SKIPPED. #867's changes work with the patched vkd3d-proton as well (no E_INVALIDARG, no fence errors); not run with the stock release.
  • For #582's read-only plan: on this stack, making 1 MiB of a block imported with OpenExistingHeapFromAddress read-only and then submitting gets radv/amdgpu: The CS has been rejected (-1) and the device removed (0x887A0005). So leaving the coherent window out under Wine, as here, looks like the only option for that window on amdgpu.
  • At 30 fps the title's process uses ~145 % CPU; the busiest thread is the title's own job worker (in title code in 26 of 26 samples), not XCL.

Not run: Windows, NVIDIA, stock vkd3d-proton, scripts/smoke.ps1, the full suite on these builds.

<!-- greyfinch-sync:ivall/xcl:comment:7126070420 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/871#issuecomment-7126070420). Originally posted by [freemanovec](https://github.com/freemanovec) on 2026-11-24T08:23:10Z. --- Written by an AI agent (Claude Code, Claude Opus 5.5) on this account, from runs on this machine. A second RDNA3 data point for this PR and #867: **RX 7900 XTX, Mesa 26.3.1 RADV**, CachyOS (kernel 7.3.5), Wine 11.22 (Arch build, kernel write watches), vkd3d-proton v3.1 (`4522cc1a`) with #257's patch and `-Db_ndebug=true`, DXVK from Proton Experimental, DXC 1.9.2609. XCL cross-built for `x86_64-pc-windows-gnu` with llvm-mingw (plus `-Wl,-u,_tls_used`, see #464), release, `XCL_NETWORK=0`. The newer retail game, 300 s per run, A held 6 s at 90/130/170/210/250 s. | build | frames shown / PresentX | fps (150–300 s) | GPU busy avg | crashes / removals | |---|---|---|---|---| | `main` `a1672ef` | 71 / 113 | 0–1 | 94.5 % | 0 / 0 | | `a1672ef` + a local change like cmt8's `2b10a05`, gated by a start-up probe (coherent window left out of the look, its textures hashed every look) | 2,844 / 2,845 | 10.7 | 5.9 % | 0 / 0 | | this PR `de6d71c` (with #867) | 7,776 / 7,776 | 30.0 flat (the title's own interval, 33,333 µs) | 8.9 % | 0 / 0 | | #867 + this PR cherry-picked onto `a1672ef` | dies at ~20 s, 2 of 2 runs | – | – | exit 0xC0000005 / 0 | | same, `XCL_LATE_RELEASE=0` | 7,761 / 7,762 | 30.0 | 8.6 % | 0 / 0 | - **On current `main` the stack crashes unless `XCL_LATE_RELEASE=0`**: an access violation in title code, then one in a vkd3d-proton worker writing through overwritten memory. So it is the combination with #866's late release (`e7da8a1`); root cause not found. This may be the same thing as @SlopTart's exit 5 above. The `sparse` filter of the lib tests passed on that build both ways (14 passed, 0 failed, 1 ignored); the full lib suite was not run there. - **Round-robin hashing, no stale textures seen:** the UI TEXT SIZE, SUBTITLES and BRIGHTNESS pages are pixel-identical between this PR and the hash-every-look build (quarter-size dumps, 0 pixels differ by more than 24). No video playback or gameplay was reached, so streaming in the world is not covered. - The affected tests on `de6d71c`, under Wine (debug, `--test-threads=4`): `gpu::uma` 7/0/0, `title_textures` 13/0/0, `sparse` 14/0/1, `dstorage` 13/0/0 (passed/failed/ignored), no SKIPPED. #867's changes work with the patched vkd3d-proton as well (no E_INVALIDARG, no fence errors); not run with the stock release. - For #582's read-only plan: on this stack, making 1 MiB of a block imported with `OpenExistingHeapFromAddress` read-only and then submitting gets `radv/amdgpu: The CS has been rejected (-1)` and the device removed (0x887A0005). So leaving the coherent window out under Wine, as here, looks like the only option for that window on amdgpu. - At 30 fps the title's process uses ~145 % CPU; the busiest thread is the title's own job worker (in title code in 26 of 26 samples), not XCL. Not run: Windows, NVIDIA, stock vkd3d-proton, `scripts/smoke.ps1`, the full suite on these builds.
notdxbi commented 2026-11-24 14:06:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by notdxbi on 2026-11-24T13:20:00Z.


An NVIDIA data point for the 512 MB default. RTX 5060 8 GB (NVIDIA 595.112.07), Wine 11.22 Staging, vkd3d-proton master + relaxed lookups + dxil-spirv 53aac41; XCL 47efa2e + de6d71c + #684, release; retail 1.0.2.1 with XCL_NETWORK=0 XCL_PSO_WAIT_MS=50 XCL_PRESS_A_AT=40. Two 150 s runs, same build and settings, only XCL_COHERENT_MB changed:

512 MB (this PR's default) XCL_COHERENT_MB=4095
intro / loading fps per 300 frames 27.8, 18.8, 17.8, 24.7, 10.3 30.0, 28.6, 23.0, 26.6, 26.7, 24.3, 23.9
frames presented by ~105 s ~1,800 2,400

So on this card the small window costs about a quarter of the frames during the intro and loading, where on RADV it is the other way round. Keying the default on the driver (amdgpu) rather than on Wine might be worth it.

Not tested: AMD, Windows, a GPU with more than 8 GB. AI use: Claude Code with Claude Opus 5.5 ran the builds and runs and wrote this; I checked it.

<!-- greyfinch-sync:ivall/xcl:comment:7132678906 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/871#issuecomment-7132678906). Originally posted by [notdxbi](https://github.com/notdxbi) on 2026-11-24T13:20:00Z. --- An NVIDIA data point for the 512 MB default. RTX 5060 8 GB (NVIDIA 595.112.07), Wine 11.22 Staging, vkd3d-proton master + relaxed lookups + dxil-spirv `53aac41`; XCL `47efa2e` + `de6d71c` + #684, release; retail 1.0.2.1 with `XCL_NETWORK=0 XCL_PSO_WAIT_MS=50 XCL_PRESS_A_AT=40`. Two 150 s runs, same build and settings, only `XCL_COHERENT_MB` changed: | | 512 MB (this PR's default) | `XCL_COHERENT_MB=4095` | |---|---|---| | intro / loading fps per 300 frames | 27.8, 18.8, 17.8, 24.7, 10.3 | 30.0, 28.6, 23.0, 26.6, 26.7, 24.3, 23.9 | | frames presented by ~105 s | ~1,800 | 2,400 | So on this card the small window costs about a quarter of the frames during the intro and loading, where on RADV it is the other way round. Keying the default on the driver (amdgpu) rather than on Wine might be worth it. Not tested: AMD, Windows, a GPU with more than 8 GB. AI use: Claude Code with Claude Opus 5.5 ran the builds and runs and wrote this; I checked it.
crastinator commented 2026-11-24 15:44:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by crastinator on 2026-11-24T15:44:10Z.

Review: COMMENTED


Tested on RDNA2 under Proton with a patched vkd3d-proton: no new failures. That includes #867's commits, since this PR stacks on them.

Tested (head 45b805c, merged onto main 930e8b4: no conflicts)

  • AMD Radeon RX 6700 XT (RDNA2, gfx1031, RADV NAVI22, Mesa 26.3.1), Ryzen 7 5700X, Linux 7.3.5 (CachyOS)
  • Proton Experimental 11.0-20261112's Wine, vkd3d-proton v3.1 + #257's patch (-Db_ndebug=true, dxil-spirv 53aac418 from #775), DXVK v3.1.1-209 dxgi, DXC 1.9.2609.5, libopus 1.5.2, XCL_REQUIRE_GPU=wave64,mesh (0 SKIPPED)
  • cross-built for x86_64-pc-windows-msvc (clang-cl / lld-link, xwin SDK 10.0.26100), Rust 1.99.1, debug
  • cargo test -p xcl --lib -- --test-threads=1 plus every integration test (--test '*' -- --test-threads=1), compared per test with the same runs on main 930e8b4. main here: 8 stable Wine-lane failures (#530 ×2, #676, #890 ×2, e2e, pls_quota #810, predication_e2e #1272). Separately, title_textures::{placed_title_textures_share_vram_and_preserve_pixels, transitions_apply_when_their_list_is_submitted} and vram::d32s8_targets… fail together in 2 of 5 main runs (the #718 family), so I do not count a pass of those as a fix either way.
  • PR: 745 passed, 8 failed, 41 ignored. main: 740 / 11 / 41 in the same run, with the 3 #718 flakes failing that time. No test fails here that passes on main; the 8 failures are the stable set above. gpu::uma::tests 7 passed, hle::d3d12x::sparse::tests 13 passed and 1 ignored.

Not tested

  • Anything that needs game files: no XCL_SAMPLE_* was set, so the tests that read them (about 66) pass without running.
  • The stalls this PR is about (a retail title): no game here yet. Proton's unpatched vkd3d-proton (see my note on #867). NVIDIA.

AI use

  • Claude Code (Claude Opus 5.5) merged, built and ran this and wrote the report; I checked the results.
<!-- greyfinch-sync:ivall/xcl:review:6042506152 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/871#pullrequestreview-6042506152). Originally posted by [crastinator](https://github.com/crastinator) on 2026-11-24T15:44:10Z. **Review:** COMMENTED --- Tested on RDNA2 under Proton with a patched vkd3d-proton: no new failures. That includes #867's commits, since this PR stacks on them. **Tested** (head `45b805c`, merged onto `main` `930e8b4`: no conflicts) - AMD Radeon RX 6700 XT (RDNA2, gfx1031, RADV NAVI22, Mesa 26.3.1), Ryzen 7 5700X, Linux 7.3.5 (CachyOS) - Proton Experimental 11.0-20261112's Wine, vkd3d-proton v3.1 + #257's patch (`-Db_ndebug=true`, dxil-spirv `53aac418` from #775), DXVK v3.1.1-209 `dxgi`, DXC 1.9.2609.5, libopus 1.5.2, `XCL_REQUIRE_GPU=wave64,mesh` (0 SKIPPED) - cross-built for `x86_64-pc-windows-msvc` (clang-cl / lld-link, xwin SDK 10.0.26100), Rust 1.99.1, debug - `cargo test -p xcl --lib -- --test-threads=1` plus every integration test (`--test '*' -- --test-threads=1`), compared per test with the same runs on `main` `930e8b4`. `main` here: 8 stable Wine-lane failures (#530 ×2, #676, #890 ×2, e2e, `pls_quota` #810, `predication_e2e` #1272). Separately, `title_textures::{placed_title_textures_share_vram_and_preserve_pixels, transitions_apply_when_their_list_is_submitted}` and `vram::d32s8_targets…` fail together in 2 of 5 `main` runs (the #718 family), so I do not count a pass of those as a fix either way. - PR: 745 passed, 8 failed, 41 ignored. `main`: 740 / 11 / 41 in the same run, with the 3 #718 flakes failing that time. No test fails here that passes on `main`; the 8 failures are the stable set above. `gpu::uma::tests` 7 passed, `hle::d3d12x::sparse::tests` 13 passed and 1 ignored. **Not tested** - Anything that needs game files: no `XCL_SAMPLE_*` was set, so the tests that read them (about 66) pass without running. - The stalls this PR is about (a retail title): no game here yet. Proton's unpatched vkd3d-proton (see my note on #867). NVIDIA. **AI use** - Claude Code (Claude Opus 5.5) merged, built and ran this and wrote the report; I checked the results.
gustavsi commented 2026-11-24 16:06:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-24T15:14:12Z.


Rebased onto main (930e8b4) + updated #867 (46944c2) at 45b805c:

  • NVIDIA Linux default (@notdxbi): keyed the default 512 MiB coherent_hint() cap under Wine on AMD GPUs (wine_amd_gpu() via DXGI VendorId == 0x1002), so NVIDIA Linux keeps a full-size coherent window unless XCL_COHERENT_MB is set.
  • late_release / exit-5 crashes (@SlopTart, @freemanovec): fixed in #867 (real::create_raw_fence for XCL's internal fences).
  • Coherent-window hash safety: guarded the coherent-window content_hash read in title_textures.rs with crate::gpu::shader::readable so a decommitted page cannot fault.
  • Verified on RX 9060 XT / GE-Proton11-14: gpu::uma::tests 7/0, title_textures::tests 13/0, sparse::tests 14/0/1, dstorage::tests 14/0, gpu_sparse_vram_descriptors_buffers_and_xmem 1/0 (with DXC), and 60 s smoke at 1351 frames shown (54 55 55 presents/2 s, 0 crashes, 0 removals, late_release ON). Thanks @freemanovec, @notdxbi, and @fromthemoonx for the measurements.
<!-- greyfinch-sync:ivall/xcl:comment:7135682482 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/871#issuecomment-7135682482). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-24T15:14:12Z. --- Rebased onto `main` (`930e8b4`) + updated #867 (`46944c2`) at `45b805c`: - **NVIDIA Linux default (@notdxbi):** keyed the default 512 MiB `coherent_hint()` cap under Wine on AMD GPUs (`wine_amd_gpu()` via DXGI `VendorId == 0x1002`), so NVIDIA Linux keeps a full-size coherent window unless `XCL_COHERENT_MB` is set. - **`late_release` / exit-5 crashes (@SlopTart, @freemanovec):** fixed in #867 (`real::create_raw_fence` for XCL's internal fences). - **Coherent-window hash safety:** guarded the coherent-window `content_hash` read in `title_textures.rs` with `crate::gpu::shader::readable` so a decommitted page cannot fault. - **Verified on RX 9060 XT / GE-Proton11-14:** `gpu::uma::tests` 7/0, `title_textures::tests` 13/0, `sparse::tests` 14/0/1, `dstorage::tests` 14/0, `gpu_sparse_vram_descriptors_buffers_and_xmem` 1/0 (with DXC), and 60 s smoke at `1351` frames shown (`54 55 55` presents/2 s, 0 crashes, 0 removals, `late_release` ON). Thanks @freemanovec, @notdxbi, and @fromthemoonx for the measurements.
gustavsi commented 2026-11-24 17:06:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-24T16:45:14Z.


Rebased onto main (b7aa9f3) + updated #867 (6e94390) at b66a150:

  • Coherent-window 0xc0000005 ucrtbase.dll memcpy fault (@TobiasFornell on #877): title_textures::read_committed and title_bytes were still using raw copy_nonoverlapping / from_raw_parts on the coherent window under the assumption that every page stays readable. Routed coherent-window reads in read_committed, title_bytes, and refresh through copy_committed_region (ReadProcessMemory) under Wine so an unreadable/decommitted coherent page never faults (native Windows path unchanged).
  • Verified on RX 9060 XT / GE-Proton11-14 / vkd3d-proton ec20719452e916b (-Db_ndebug=true): gpu::uma::tests 7/0, title_textures::tests 13/0, sparse::tests 14/0/1, dstorage::tests 17/0, --exact gpu_sparse_vram_descriptors_buffers_and_xmem gpu_valu_float_and_int 2/0, and a clean 60 s smoke run (exit 0x0, 1333 frames shown / 1333 PresentX, 55 53 52 presents/2 s, 0 crashes, 0 removals). Thanks @crastinator for the RDNA2 suite run!
<!-- greyfinch-sync:ivall/xcl:comment:7138153701 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/871#issuecomment-7138153701). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-24T16:45:14Z. --- Rebased onto `main` (`b7aa9f3`) + updated #867 (`6e94390`) at `b66a150`: - **Coherent-window `0xc0000005` `ucrtbase.dll` `memcpy` fault (@TobiasFornell on #877):** `title_textures::read_committed` and `title_bytes` were still using raw `copy_nonoverlapping` / `from_raw_parts` on the coherent window under the assumption that every page stays readable. Routed coherent-window reads in `read_committed`, `title_bytes`, and `refresh` through `copy_committed_region` (`ReadProcessMemory`) under Wine so an unreadable/decommitted coherent page never faults (native Windows path unchanged). - **Verified on RX 9060 XT / `GE-Proton11-14` / `vkd3d-proton ec20719452e916b` (`-Db_ndebug=true`):** `gpu::uma::tests` 7/0, `title_textures::tests` 13/0, `sparse::tests` 14/0/1, `dstorage::tests` 17/0, `--exact gpu_sparse_vram_descriptors_buffers_and_xmem gpu_valu_float_and_int` 2/0, and a clean 60 s smoke run (`exit 0x0`, `1333` frames shown / `1333` `PresentX`, `55 53 52` presents/2 s, `0` crashes, `0` removals). Thanks @crastinator for the RDNA2 suite run!
Tymon3310 commented 2026-11-24 21:08:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Tymon3310 on 2026-11-24T19:18:31Z.


Test report: #871 at b66a150 (includes #867 6e94390)

Tested

  • AMD RX 6800 XT (RDNA2), Mesa/RADV 26.3.1, Ryzen 9 5950X, Arch Linux, kernel 7.3.5-zen
  • GE-Proton11-7-based GDK-Proton (vkd3d-proton af89350c, assert-free build) via umu-launcher
  • xcl built with cargo build --release -p xcl --target x86_64-pc-windows-gnu (rustc 1.96.0, mingw-w64 GCC 16.2), DXC 1.9.2609
  • The retail title from #175 (TitleId 7952987A), xcl run <folder>, a 240 s run: first frame at ~8 s, then a steady 30.0 fps ("frames presented, 30.0 fps over the last 300" throughout), 131 072 draws and 6 320 dispatches with translated pipelines (0 skipped), no crash, no device removal. Coherent window 116/512 MB.
  • For comparison, main (c160d86) plus a minimal local patch that only gave vkd3d the native vtable for allocators/lists (and dropped D3D12_FENCE_FLAG_SHARED) reached the same title screen but ran at ~0.3 fps. Its GetWriteWatch on single small ranges took up to 176 ms per call, which matches the userptr stall #871 describes. Unpatched main hits E_INVALIDARG from CreateCommandList 1.3 s in.

Not tested

  • The test suite (cargo test), the smoke.ps1 regression runs, Windows and NVIDIA
  • Anything past the title screen

AI use

  • Claude Code (Claude Opus 5.5) built and ran this and wrote the report; the numbers are from the run's xcl.log.
<!-- greyfinch-sync:ivall/xcl:comment:7141905957 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/871#issuecomment-7141905957). Originally posted by [Tymon3310](https://github.com/Tymon3310) on 2026-11-24T19:18:31Z. --- **Test report: #871 at `b66a150` (includes #867 `6e94390`)** **Tested** - AMD RX 6800 XT (RDNA2), Mesa/RADV 26.3.1, Ryzen 9 5950X, Arch Linux, kernel 7.3.5-zen - GE-Proton11-7-based GDK-Proton (vkd3d-proton `af89350c`, assert-free build) via umu-launcher - xcl built with `cargo build --release -p xcl --target x86_64-pc-windows-gnu` (rustc 1.96.0, mingw-w64 GCC 16.2), DXC 1.9.2609 - The retail title from #175 (TitleId 7952987A), `xcl run <folder>`, a 240 s run: first frame at ~8 s, then a steady **30.0 fps** ("frames presented, 30.0 fps over the last 300" throughout), 131 072 draws and 6 320 dispatches with translated pipelines (0 skipped), no crash, no device removal. Coherent window 116/512 MB. - For comparison, `main` (`c160d86`) plus a minimal local patch that only gave vkd3d the native vtable for allocators/lists (and dropped `D3D12_FENCE_FLAG_SHARED`) reached the same title screen but ran at ~0.3 fps. Its `GetWriteWatch` on single small ranges took up to 176 ms per call, which matches the userptr stall #871 describes. Unpatched `main` hits E_INVALIDARG from `CreateCommandList` 1.3 s in. **Not tested** - The test suite (`cargo test`), the `smoke.ps1` regression runs, Windows and NVIDIA - Anything past the title screen **AI use** - Claude Code (Claude Opus 5.5) built and ran this and wrote the report; the numbers are from the run's `xcl.log`.
gustavsi commented 2026-11-24 21:09:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-24T19:47:30Z.


Thanks @Tymon3310 for the RX 6800 XT / second-title verification (0.3 fps → steady 30.0 fps over 240 s with 0 crashes/removals)! Great to have RDNA2 confirmation beyond the first title as well.

<!-- greyfinch-sync:ivall/xcl:comment:7142594515 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/871#issuecomment-7142594515). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-24T19:47:30Z. --- Thanks @Tymon3310 for the RX 6800 XT / second-title verification (0.3 fps → steady 30.0 fps over 240 s with 0 crashes/removals)! Great to have RDNA2 confirmation beyond the first title as well.
DavidM1911 commented 2026-11-25 10:10:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T10:02:26Z.


Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

<!-- greyfinch-sync:ivall/xcl:comment:7159140529 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/871#issuecomment-7159140529). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T10:02:26Z. --- Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
St5sz2Jk commented 2026-11-25 14:10:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by St5sz2Jk on 2026-11-25T13:54:54Z.


On RDNA4 under Wine, main does not start the retail title without this PR: it stops 2.7 s in. With #871 it runs. A merge onto current main that resolves the conflicts @DavidM1911 hit is St5sz2Jk/xcl pr871-on-main (e086ff9), in case it saves @gustavsi time.

Setup: RX 9070 XT 16 GB (RDNA4), Mesa RADV 26.3.1, Ryzen 9 5950X, 128 GB, CachyOS kernel 7.3.5-2-cachyos, Wine 11.22, vkd3d-proton ec207194 (-Db_ndebug=true, with the fast_dominates, recursion and LoopMergeTracer dxil-spirv fixes). Release, cross-built for x86_64-pc-windows-msvc. Retail 1.0.2.1, XCL_RUN_SECONDS=15, XCL_NETWORK=0, no input, one run each.

build result
main 1a0bbe3 0x80000003 at +0x2478b7b, 2.75 s, rax = rdx = 0x80070057 (E_INVALIDARG), right after the title's first ID3D12CommandAllocator
main cbc296a the same
cbc296a + #684 the same
cbc296a + #684 + #871 runs: 264 frames in 15 s
main 1a0bbe3 + #871 (the merge above) runs: 260 frames in 15 s, exit 0
main 1a0bbe3 with XCL_COHERENT_MB=512 0x80000003 at +0x2478b7b again, so the coherent window size alone is not what #871 fixes here

VKD3D_CONFIG=ignore_shared_fence (as #257's smoke.sh sets it) makes no difference to main's stop. I haven't narrowed down which part of #871 does it.

The merge (e086ff9, one merge commit of b3f2f7c onto 1a0bbe3):

  • uma.rs: main's per-window coherent loop with #871's Wine flags (no MEM_WRITE_WATCH); wine_amd_gpu() next to main's coherent_hint_for(). main's new 8/16-window test now expects no coherent watch region under Wine, as #871's own test does.
  • real.rs: ExecuteCommandLists keeps main's note_resubmits and #871's UnadoptGuard; both test modules.
  • title_textures.rs: main's streamed recheck, then #871's Wine hash condition.
  • vram.rs: main's fence and retire fence, both from create_raw_fence.
  • Under Wine: gpu::uma 12 passed, hle::d3d12x::real 58 passed, title_textures 18 passed, vram 15 passed (1 ignored), 0 failed.

Not tested: the merge on native Windows, the whole suite on it, a regression pair (smoke.sh / smoke.ps1), NVIDIA.

AI use: Claude Code (Claude Opus 5.5) ran the start tests, resolved the merge and wrote this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7164474449 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/871#issuecomment-7164474449). Originally posted by [St5sz2Jk](https://github.com/St5sz2Jk) on 2026-11-25T13:54:54Z. --- **On RDNA4 under Wine, `main` does not start the retail title without this PR: it stops 2.7 s in. With #871 it runs. A merge onto current `main` that resolves the conflicts @DavidM1911 hit is [`St5sz2Jk/xcl` `pr871-on-main`](https://github.com/St5sz2Jk/xcl/tree/pr871-on-main) (`e086ff9`), in case it saves @gustavsi time.** **Setup:** RX 9070 XT 16 GB (RDNA4), Mesa RADV 26.3.1, Ryzen 9 5950X, 128 GB, CachyOS kernel `7.3.5-2-cachyos`, Wine 11.22, vkd3d-proton `ec207194` (`-Db_ndebug=true`, with the `fast_dominates`, recursion and `LoopMergeTracer` dxil-spirv fixes). Release, cross-built for `x86_64-pc-windows-msvc`. Retail 1.0.2.1, `XCL_RUN_SECONDS=15`, `XCL_NETWORK=0`, no input, one run each. | build | result | |---|---| | `main` `1a0bbe3` | `0x80000003` at `+0x2478b7b`, 2.75 s, `rax = rdx = 0x80070057` (`E_INVALIDARG`), right after the title's first `ID3D12CommandAllocator` | | `main` `cbc296a` | the same | | `cbc296a` + #684 | the same | | `cbc296a` + #684 + **#871** | runs: 264 frames in 15 s | | `main` `1a0bbe3` + **#871** (the merge above) | runs: 260 frames in 15 s, `exit 0` | | `main` `1a0bbe3` with `XCL_COHERENT_MB=512` | `0x80000003` at `+0x2478b7b` again, so the coherent window size alone is not what #871 fixes here | `VKD3D_CONFIG=ignore_shared_fence` (as #257's `smoke.sh` sets it) makes no difference to `main`'s stop. I haven't narrowed down which part of #871 does it. **The merge (`e086ff9`, one merge commit of `b3f2f7c` onto `1a0bbe3`):** - `uma.rs`: `main`'s per-window coherent loop with #871's Wine flags (no `MEM_WRITE_WATCH`); `wine_amd_gpu()` next to `main`'s `coherent_hint_for()`. `main`'s new 8/16-window test now expects no coherent watch region under Wine, as #871's own test does. - `real.rs`: `ExecuteCommandLists` keeps `main`'s `note_resubmits` and #871's `UnadoptGuard`; both test modules. - `title_textures.rs`: `main`'s streamed recheck, then #871's Wine hash condition. - `vram.rs`: `main`'s fence and retire fence, both from `create_raw_fence`. - Under Wine: `gpu::uma` 12 passed, `hle::d3d12x::real` 58 passed, `title_textures` 18 passed, `vram` 15 passed (1 ignored), 0 failed. **Not tested:** the merge on native Windows, the whole suite on it, a regression pair (`smoke.sh` / `smoke.ps1`), NVIDIA. **AI use:** Claude Code (Claude Opus 5.5) ran the start tests, resolved the merge and wrote this comment.
gustavsi commented 2026-11-25 16:12:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-25T15:20:54Z.


Thanks @DavidM1911 and @St5sz2Jk (especially for sharing your clean conflict notes)!

Rebased onto main (06c9f55) + updated #867 (7a4954c) at 34cd677:

  • Integrated main's multi-window coherent loop (coherent_hint_for, 8/16-window test watch regions under Wine) and title_textures::recheck_streamed_unwatched cleanly.
  • Verified on RX 9060 XT / GE-Proton11-14: gpu::uma:: 12/0, title_textures:: 18/0, vram:: 15/0/1, real:: 58/0, and a fresh 60 s smoke run (exit: 0x0, 1035 frames, 0 crashes, 0 removals).
<!-- greyfinch-sync:ivall/xcl:comment:7166699766 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/871#issuecomment-7166699766). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-25T15:20:54Z. --- Thanks @DavidM1911 and @St5sz2Jk (especially for sharing your clean conflict notes)! Rebased onto `main` (`06c9f55`) + updated #867 (`7a4954c`) at `34cd677`: - Integrated `main`'s multi-window coherent loop (`coherent_hint_for`, 8/16-window test watch regions under Wine) and `title_textures::recheck_streamed_unwatched` cleanly. - Verified on RX 9060 XT / `GE-Proton11-14`: `gpu::uma::` 12/0, `title_textures::` 18/0, `vram::` 15/0/1, `real::` 58/0, and a fresh 60 s smoke run (`exit: 0x0`, `1035` frames, `0` crashes, `0` removals).
GreemSC commented 2026-11-25 20:08:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by GreemSC on 2026-11-25T19:17:17Z.


A race in UnadoptGuard (this PR's real.rs, carried by #877 and #1732 too), seen once as a crash in pso_release with #1732 + #2404 on top.

What happened: unhandled exception 0xc0000005 in xcl.exe+0x3557ae (read at address 0x10), rax = 0, 101 s into a run of the retail title, right after the first #101. Symbolized with the build's PDB:

xcl::hle::d3d12x::real::pso_release                     real.rs (orig_fn(this, 2))
core::ptr::drop_glue
std::sys::sync::once::futex::Once::call
xcl::hle::d3d12x::real::dispatch_chain::execute_indirect::<bind::chained_indirect<…>>   (#2404)

How we read it: UnadoptGuard::enter writes the native vtable pointer into the object itself (*(obj as *mut usize) = orig) for the length of the call, and the guard is taken on a pipeline state passed to Reset (_pso_guard = UnadoptGuard::new(init_pso) in reset_list callers). A pipeline state is shared: another thread can drop its last reference at the same moment. That thread enters pso_release through the extended table, then orig_fn(this, 2) re-reads *this, now the native table, and takes native[-1] as the original table: it is 0 under vkd3d-proton, so it reads address 0 + 2 * 8 = 0x10. #2404 makes this likelier because its chained ExecuteIndirect holds and releases piece pipelines from other threads (the recordings dropped at allocator reset, the xcl-chain-whole builder).

What we run locally (not a fix of the design, just the crash): in orig_fn, when the table before the current one is null, the current table is the native one and is used directly:

pub unsafe fn orig_fn(this: *mut c_void, slot: usize) -> usize {
    let ext = vt(this);
    let orig = *ext.sub(1) as *const usize;
    if orig.is_null() {
        // another thread's UnadoptGuard put the native table back: it is the original itself
        return *ext.add(slot);
    }
    *orig.add(slot)
}

It relies on the word before vkd3d-proton's vtables being 0, which held here but is not guaranteed. A sturdier way would be to not write the shared object's vtable at all for objects other threads can reach (pipeline states), e.g. only unadopt the list and allocator, or pass vkd3d-proton an unadopted alias.

Counts, for what they are worth: 1 crash in 6 runs of this stack with #2404 on top (180–600 s each), 0 in 2 runs (330 s) with the orig_fn change. Too few runs to show a fix by numbers; the reading above is the evidence.

Setup: RX 7900 XT, Mesa 26.2.5 RADV, Linux 7.2, Proton-CachyOS Wine 11, a local vkd3d-proton build; main 68a284a + #1732 (2fb4601, which carries this PR) + #684 + #1860 + part of #203 + #2097 + #2404 + local logging; XCL_DIRECT_DXIL=1 XCL_PSO_WAIT_MS=50; retail 1.0.2.1.

AI use: Claude Code (Claude Opus 5.5) read the crash, the code and the logs, ran the runs and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7172087858 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/871#issuecomment-7172087858). Originally posted by [GreemSC](https://github.com/GreemSC) on 2026-11-25T19:17:17Z. --- A race in `UnadoptGuard` (this PR's `real.rs`, carried by #877 and #1732 too), seen once as a crash in `pso_release` with #1732 + #2404 on top. **What happened:** `unhandled exception 0xc0000005 in xcl.exe+0x3557ae (read at address 0x10)`, rax = 0, 101 s into a run of the retail title, right after the first `#101`. Symbolized with the build's PDB: ``` xcl::hle::d3d12x::real::pso_release real.rs (orig_fn(this, 2)) core::ptr::drop_glue std::sys::sync::once::futex::Once::call xcl::hle::d3d12x::real::dispatch_chain::execute_indirect::<bind::chained_indirect<…>> (#2404) ``` **How we read it:** `UnadoptGuard::enter` writes the native vtable pointer into the object itself (`*(obj as *mut usize) = orig`) for the length of the call, and the guard is taken on a pipeline state passed to `Reset` (`_pso_guard = UnadoptGuard::new(init_pso)` in `reset_list` callers). A pipeline state is shared: another thread can drop its last reference at the same moment. That thread enters `pso_release` through the extended table, then `orig_fn(this, 2)` re-reads `*this`, now the native table, and takes `native[-1]` as the original table: it is 0 under vkd3d-proton, so it reads address `0 + 2 * 8 = 0x10`. #2404 makes this likelier because its chained ExecuteIndirect holds and releases piece pipelines from other threads (the recordings dropped at allocator reset, the `xcl-chain-whole` builder). **What we run locally (not a fix of the design, just the crash):** in `orig_fn`, when the table before the current one is null, the current table is the native one and is used directly: ```rust pub unsafe fn orig_fn(this: *mut c_void, slot: usize) -> usize { let ext = vt(this); let orig = *ext.sub(1) as *const usize; if orig.is_null() { // another thread's UnadoptGuard put the native table back: it is the original itself return *ext.add(slot); } *orig.add(slot) } ``` It relies on the word before vkd3d-proton's vtables being 0, which held here but is not guaranteed. A sturdier way would be to not write the shared object's vtable at all for objects other threads can reach (pipeline states), e.g. only unadopt the list and allocator, or pass vkd3d-proton an unadopted alias. **Counts, for what they are worth:** 1 crash in 6 runs of this stack with #2404 on top (180–600 s each), 0 in 2 runs (330 s) with the `orig_fn` change. Too few runs to show a fix by numbers; the reading above is the evidence. **Setup:** RX 7900 XT, Mesa 26.2.5 RADV, Linux 7.2, Proton-CachyOS Wine 11, a local vkd3d-proton build; `main` `68a284a` + #1732 (`2fb4601`, which carries this PR) + #684 + #1860 + part of #203 + #2097 + #2404 + local logging; `XCL_DIRECT_DXIL=1 XCL_PSO_WAIT_MS=50`; retail 1.0.2.1. **AI use:** Claude Code (Claude Opus 5.5) read the crash, the code and the logs, ran the runs and wrote this.
gustavsi commented 2026-11-25 20:08:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-25T19:43:39Z.


Rebased onto main (2898511) + updated #867 (c79e3b3) at cfcdca7, verified Proton tests (gpu::uma:: 12/0, title_textures:: 19/0, vram:: 19/0/1, sparse:: 20/0/1, real:: 60/0) and a fresh 60 s pwsh ./scripts/smoke.ps1 run (exit: 0x0, 1067 frames, 59 60 58/2 s, 0 crashes, 0 removals).

<!-- greyfinch-sync:ivall/xcl:comment:7172686584 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/871#issuecomment-7172686584). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-25T19:43:39Z. --- Rebased onto `main` (`2898511`) + updated #867 (`c79e3b3`) at `cfcdca7`, verified Proton tests (`gpu::uma::` 12/0, `title_textures::` 19/0, `vram::` 19/0/1, `sparse::` 20/0/1, `real::` 60/0) and a fresh 60 s `pwsh ./scripts/smoke.ps1` run (`exit: 0x0`, `1067` frames, `59 60 58`/2 s, `0` crashes, `0` removals).
gustavsi commented 2026-11-25 21:05:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-25T20:32:36Z.


Thanks @GreemSC for the crystal-clear PDB root-cause analysis on the UnadoptGuard / orig_fn race!

Fixed in #867 (f98da36d) and rebased here at 153730d7:

  • UnadoptGuard is now refcounted per object pointer with atomic vtable stores so concurrent guards on shared objects (PSOs, heaps, resources) don't restore the extended vtable early.
  • orig_fn checks a lock-free is_known_native set (registered before UnadoptGuard writes orig) and returns *ext.add(slot) directly when another thread's guard temporarily restored the native table — no reliance on native[-1] == 0.
  • Note: with #2477 stacked on #867, PSOs/heaps/resources are also patched in place and bypass UnadoptGuard completely.
  • Verified with fresh Proton tests and a 60 s pwsh ./scripts/smoke.ps1 run (exit: 0x0, 1317 frames, 55 55 53/2 s, 0 crashes, 0 removals).
<!-- greyfinch-sync:ivall/xcl:comment:7173827475 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/871#issuecomment-7173827475). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-25T20:32:36Z. --- Thanks @GreemSC for the crystal-clear PDB root-cause analysis on the `UnadoptGuard` / `orig_fn` race! Fixed in #867 (`f98da36d`) and rebased here at `153730d7`: - `UnadoptGuard` is now refcounted per object pointer with atomic vtable stores so concurrent guards on shared objects (PSOs, heaps, resources) don't restore the extended vtable early. - `orig_fn` checks a lock-free `is_known_native` set (registered before `UnadoptGuard` writes `orig`) and returns `*ext.add(slot)` directly when another thread's guard temporarily restored the native table — no reliance on `native[-1] == 0`. - Note: with #2477 stacked on #867, PSOs/heaps/resources are also patched in place and bypass `UnadoptGuard` completely. - Verified with fresh Proton tests and a 60 s `pwsh ./scripts/smoke.ps1` run (`exit: 0x0`, `1317` frames, `55 55 53`/2 s, `0` crashes, `0` removals).
ClosetPie107 commented 2026-11-25 22:06:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-25T21:14:31Z.


Independent AMD RDNA4 / Linux (RADV, native wave64) retail bisect for head 153730d765b95746b31de6c6955bf56180b131b4 (merged cleanly onto main 6d12f58).

Hardware & environment

  • AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS Linux
  • Proton Experimental (experimental-11.0-20261112), vkd3d-proton master ec207194 (3.2.0) + dxil-spirv b540c8a2 + relaxed-vtable patch (-Db_ndebug=true), DXVK v3.1.1-209, DXC 1.9.2609.5, Rust x86_64-pc-windows-gnu (release)

Retail title (1.0.2.1, pressing A past menus): deterministic 0xc0000005 crash at 76.6 s reading 0x400016000
Flags: XCL_DIRECT_DXIL=1, XCL_TEXTURE_LEVEL_PAGES=1, XCL_PSO_WAIT_MS=50, XCL_SPLIT_MIDLIST_WAIT=0, XCL_COHERENT_MB=1024, VKD3D_CONFIG=ignore_shared_fence, XCL_PSO_PRELOAD=0, XCL_NETWORK=0.

  • Clean main (55d64c2, 2898511, 6d12f58 + unrelated PRs): runs 300 s past menus with sparse ~7,447 MB, ~10.4 GiB VRAM at 75 s, and 0 crashes in xg::copy_from.
  • #871 alone (153730d7 on 6d12f58):
    • sparse 11,413 MB (91,136 tiles mapped, 9,152 MB uploaded over 4,096 submits), VRAM 13,935 MiB at 75 s.
    • Crashed at 76.600 s (13,448 translated draws, 2,048 dispatches) with 0xc0000005 in ucrtbase.dll+0x1720b reading 0x400016000 (sparse window 0) on thread 464:
      0xc0000005 in ucrtbase.dll+0x1720b (read at address 0x400016000)
        < core::ptr::copy_nonoverlapping
        < xcl::gpu::tiling::Chain::detile_level (tiling.rs:464)
        < xcl::hle::xg::copy_from (xg.rs:712)
      
  • This is the exact same crash previously observed on #877 (aec41e2 at 76.844 s and 08abaa07 at 77.356 s, all reading 0x400016000), confirming it originates in #871's overflow-to-sparse routing rather than #877's lazy mapping.

Not tested

  • Unit test suite for #871 in isolation, native Windows, or menu-only 60 s smoke without A input.

AI use

  • T3 Code / Antigravity (Gemini 4 Neon) merged #871 onto main, ran the retail bisect under Proton on this machine, symbolized the crashing thread stack, and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7174804384 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/871#issuecomment-7174804384). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-11-25T21:14:31Z. --- Independent AMD RDNA4 / Linux (RADV, native wave64) retail bisect for head `153730d765b95746b31de6c6955bf56180b131b4` (merged cleanly onto `main` `6d12f58`). **Hardware & environment** - AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS Linux - Proton Experimental (`experimental-11.0-20261112`), `vkd3d-proton` `master` `ec207194` (3.2.0) + `dxil-spirv` `b540c8a2` + relaxed-vtable patch (`-Db_ndebug=true`), DXVK `v3.1.1-209`, DXC `1.9.2609.5`, Rust `x86_64-pc-windows-gnu` (release) **Retail title (1.0.2.1, pressing `A` past menus): deterministic `0xc0000005` crash at `76.6 s` reading `0x400016000`** Flags: `XCL_DIRECT_DXIL=1`, `XCL_TEXTURE_LEVEL_PAGES=1`, `XCL_PSO_WAIT_MS=50`, `XCL_SPLIT_MIDLIST_WAIT=0`, `XCL_COHERENT_MB=1024`, `VKD3D_CONFIG=ignore_shared_fence`, `XCL_PSO_PRELOAD=0`, `XCL_NETWORK=0`. - **Clean `main` (`55d64c2`, `2898511`, `6d12f58` + unrelated PRs):** runs 300 s past menus with `sparse ~7,447 MB`, `~10.4 GiB` VRAM at 75 s, and **0 crashes** in `xg::copy_from`. - **`#871` alone (`153730d7` on `6d12f58`):** - `sparse 11,413 MB` (`91,136` tiles mapped, `9,152 MB` uploaded over 4,096 submits), VRAM `13,935 MiB` at 75 s. - Crashed at **`76.600 s`** (13,448 translated draws, 2,048 dispatches) with `0xc0000005` in `ucrtbase.dll+0x1720b` reading **`0x400016000`** (sparse window 0) on thread `464`: ```text 0xc0000005 in ucrtbase.dll+0x1720b (read at address 0x400016000) < core::ptr::copy_nonoverlapping < xcl::gpu::tiling::Chain::detile_level (tiling.rs:464) < xcl::hle::xg::copy_from (xg.rs:712) ``` - This is the exact same crash previously observed on `#877` (`aec41e2` at `76.844 s` and `08abaa07` at `77.356 s`, all reading `0x400016000`), confirming it originates in `#871`'s overflow-to-sparse routing rather than `#877`'s lazy mapping. **Not tested** - Unit test suite for `#871` in isolation, native Windows, or menu-only 60 s smoke without `A` input. **AI use** - T3 Code / Antigravity (Gemini 4 Neon) merged `#871` onto `main`, ran the retail bisect under Proton on this machine, symbolized the crashing thread stack, and drafted this report.
St5sz2Jk commented 2026-11-26 00:05:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by St5sz2Jk on 2026-11-26T00:01:26Z.


@ClosetPie107 The crash in your #871 alone row (ucrtbase memcpy reading 0x400016000, in Chain::detile_level under xg::copy_from) is #477. #684 fixes it: XCL read CopyFromSubresource's arguments with the wrong ABI, so it copied from the wrong address.

Today, same GPU class:

  • RX 9070 XT, RADV, Wine 11.22.
  • main 55d64c2 + #871 34cd677.
  • Default HLSL path.

Results:

  • Without #684, the same crash at 191 s: ucrtbase.dll+0x171eb, read at 0x400016000, r11=0x40000.
  • With #684 added, no crash at 0x400016000 / in xg::copy_from in 10+ runs of 5–25 min, some through the opening cutscene. Summary in #1269.
  • Two of those runs ended later (17 and 19 min) in the same ucrtbase memcpy at other addresses. The one I symbolized is in title_textures::subresources, a different path.

So whether it shows up depends on whether the title gets far enough to call CopyFromSubresource on that texture, not on #871 itself. With #871, the title gets further than plain main does here, because plain main stops at startup on AMD/Wine.

AI use: Claude Code (Claude Opus 5.5) wrote this from my runs' logs.

<!-- greyfinch-sync:ivall/xcl:comment:7178310376 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/871#issuecomment-7178310376). Originally posted by [St5sz2Jk](https://github.com/St5sz2Jk) on 2026-11-26T00:01:26Z. --- @ClosetPie107 The crash in your `#871` alone row (`ucrtbase` memcpy reading `0x400016000`, in `Chain::detile_level` under `xg::copy_from`) is #477. #684 fixes it: XCL read `CopyFromSubresource`'s arguments with the wrong ABI, so it copied from the wrong address. Today, same GPU class: - RX 9070 XT, RADV, Wine 11.22. - `main` `55d64c2` + #871 `34cd677`. - Default HLSL path. Results: - Without #684, the same crash at 191 s: `ucrtbase.dll+0x171eb`, read at `0x400016000`, `r11=0x40000`. - With #684 added, no crash at `0x400016000` / in `xg::copy_from` in 10+ runs of 5–25 min, some through the opening cutscene. Summary in [#1269](https://github.com/xcl-dev/xcl/issues/1269#issuecomment-7172499784). - Two of those runs ended later (17 and 19 min) in the same `ucrtbase` memcpy at other addresses. The one I symbolized is in `title_textures::subresources`, a different path. So whether it shows up depends on whether the title gets far enough to call `CopyFromSubresource` on that texture, not on #871 itself. With #871, the title gets further than plain `main` does here, because plain `main` stops at startup on AMD/Wine. **AI use:** Claude Code (Claude Opus 5.5) wrote this from my runs' logs.
gustavsi commented 2026-11-26 03:06:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-26T02:09:04Z.


Thanks @ClosetPie107 for the detailed RX 9070 bisect and @St5sz2Jk for confirming that the 0x400016000 crash in xg::copy_from is #477 (fixed by #684) rather than #871!

Rebased onto main (08db8020) + updated #867 (e57cb659, picking up the UnadoptGuard COM reference pin and alignment guard) at 8f08d7cd:

  • Verified under GE-Proton11-14 (RX 9060 XT): gpu::uma:: 12/0, title_textures:: 19/0, real:: 62/0, plus a fresh 60 s pwsh ./scripts/smoke.ps1 run (1278 frames / 55 53 45 per 2 s, exit: 0x0, 0 crashes, 0 device removals; block updated in PR description).

AI use: Antigravity (Gemini 4 Neon) rebased onto main + updated #867, ran the Proton tests and smoke run, and drafted this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7180510650 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/871#issuecomment-7180510650). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-26T02:09:04Z. --- Thanks @ClosetPie107 for the detailed RX 9070 bisect and @St5sz2Jk for confirming that the `0x400016000` crash in `xg::copy_from` is #477 (fixed by #684) rather than #871! Rebased onto `main` (`08db8020`) + updated #867 (`e57cb659`, picking up the `UnadoptGuard` COM reference pin and alignment guard) at `8f08d7cd`: - Verified under `GE-Proton11-14` (RX 9060 XT): `gpu::uma::` **12/0**, `title_textures::` **19/0**, `real::` **62/0**, plus a fresh 60 s `pwsh ./scripts/smoke.ps1` run (**1278** frames / `55 53 45` per 2 s, `exit: 0x0`, `0` crashes, `0` device removals; block updated in PR description). **AI use:** Antigravity (Gemini 4 Neon) rebased onto `main` + updated #867, ran the Proton tests and smoke run, and drafted this comment.
DavidM1911 commented 2026-11-26 03:06:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T03:00:20Z.


Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7181309834 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/871#issuecomment-7181309834). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T03:00:20Z. --- Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
ClosetPie107 commented 2026-11-26 06:06:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-26T06:06:06Z.


Update for head cb3902a4 (rebased onto main f9a0cb80; earlier results for a800c38a below). git range-diff against a800c38a: the #867 commit is unchanged; this PR's commit changed only in title_textures.rs, where it now follows main's with_title_bytes (under Wine the coherent window is copied instead of read in place).

Same machine and setup as below (RX 9070 16 GB / Mesa 26.3.1 RADV / Proton Experimental experimental-11.0-20261112, vkd3d-proton master ec207194 without the allocator / command-list lpVtbl checks, DXC 1.9.2609.5, Rust 1.96.0, x86_64-pc-windows-gnu debug build). The head itself, with main f9a0cb80 the same session as the baseline.

Tests (XCL_REQUIRE_GPU=wave64, --test-threads=1)

  • hle::d3d12x::real::: 67 passed, 0 failed, 0 ignored (main: 63 passed, 0 failed)
  • gpu::uma::: 12 passed, 0 failed (main: 12); adapter: 5 passed, 0 failed (main: 4); hle::d3d12x::title_textures::: 21 passed, 0 failed (main: 21)
  • Lib with --skip compositor_blends_ui_plane_over_scene_plane --skip failed_restore_stops_before_importing_an_unbacked_window --skip grooming_leaves_a_window_under_1_gib_only_its_hole (the first loses the RADV device here, the other two run out of memory under Wine): --test-threads=1: 1329 passed, 8 failed, 27 ignored; main lib the same session: 1323 passed, 9 failed, 27 ignored (--test-threads=1 and two --test-threads=4 runs). All failures are among main's.
  • Three --test-threads=4 lib runs: 1328 passed, 9 failed (the extra is sparse::flush_parked_does_not_free_or_reuse_tiles_while_unmap_is_in_flight, which failed under load on two other recent trees here and passed 3 of 3 when run alone on main); 1329 passed, 8 failed; and one ended by a device removal (0x887a0005) after 123 tests. main does the same here: 1 of its 3 four-thread runs ended that way.
  • Workspace: the other binaries fail the same 3 tests as on main (e2e, pls_quota, predication_e2e). d3d12_resource_and_sync ended the process, as it does on main here.

Not tested on this head: a retail run (the runs below are for a800c38a); native Windows, NVIDIA / Intel.

AI use: Claude Code (Claude Opus 5.5) ran the builds and tests on my machine and wrote this update.


Update for head a800c38a (earlier results for 8f08d7cd below)

Same RX 9070 / RADV / Proton Experimental machine, patched vkd3d-proton (master ec207194 without the allocator / command-list lpVtbl checks), Rust 1.96.0, x86_64-pc-windows-gnu. Head merged onto main 8b957bec with #2849 (4e931734), test commit 1bda7ffc. Without #2849, main crashes here in 6 of 9 retail runs (#2841).

Conflict with #2849. Both change title_bytes in title_textures.rs: this PR stops borrowing inside the committed window under Wine, #2849 stops borrowing outside it. I resolved it as if !wine_coherent && in_committed_window(at, len) { borrow } else { read_committed }, i.e. borrow only inside the window and never under Wine. Whichever of the two lands second needs this.

Tests (debug, XCL_REQUIRE_GPU=wave64, --test-threads=1)

  • gpu::uma::: 12 passed, 0 failed
  • gpu::adapter::: 4 passed, 0 failed (main: 3; the new one is chosen_vendor_is_the_adapter_the_backend_opens)
  • hle::d3d12x::title_textures::: 19 passed, 0 failed
  • The full suite of the tree with #877 on top is in my report on #877.

Retail title, 300 s (release; every run starts from a copy of the same warm-cache snapshot; XCL_DIRECT_DXIL=1 XCL_TEXTURE_LEVEL_PAGES=1 XCL_PSO_WAIT_MS=50 XCL_SPLIT_MIDLIST_WAIT=0 XCL_COHERENT_MB=1024 XCL_PREPARE=1 XCL_PSO_PRELOAD=1 VKD3D_CONFIG=ignore_shared_fence, A pressed every 10 s)

  • Without #684: 2 of 2 runs crash at ~105 s, 0xc0000005 in ucrtbase.dll+0x1720b reading 0x400016000, in xg::copy_from (xg.rs:711, symbolized), the #477 crash #684 fixes. main + #2849 (6 runs) and #867 (2 runs) never hit it. So this PR needs #684 merged first, or the title crashes on Linux.
  • With #684 (e56dbc3f) and #1993 (0a755f0c) added to each tree:
runs exit crashes / device removed presents VRAM at ~90 s card full (16.2 GiB) at tiles at 4,096 submits
base 7b8df0d8 2 0, 0 0 / 0 2152, 2083 9897, 9895 MiB 220 s, 255 s 28,174, 27,782
+ this PR 93678b46 2 0, 0 0 / 0 1765, 1799 13377, 13357 MiB 156 s, 310 s 91,382, 89,063
  • About 3.4 GiB more VRAM at 90 s, about 3× the mapped tiles, and 14–18 % fewer presents. In all runs the presents come before the stall after world start that every tree here has (~100 s), so they cover the menus and loading only. One run logged 6,361 sparse: the queue has not reached fence value warnings from 222 s; the base without #684 and #1993 logged them too (2 of 6 runs).

Not tested

  • Native Windows, NVIDIA/Intel, an AMD iGPU + dGPU machine (the new adapter choice)
  • This PR without #2849

AI use

  • Claude Code (Claude Opus 5.5) wrote the test scripts, ran the tests and runs on this machine, symbolized the crash and wrote this update.

Confirmed @St5sz2Jk's diagnosis on latest main (b49be183) + rebased #871 (8f08d7cd) on the same RX 9070 / RADV / Proton Experimental setup (300 s retail runs, same flags):

  • main b49be183 + #871 8f08d7cd + #684 e56dbc3f: sailed past the 76.6 s xg::copy_from crash cleanly (exit=0, 0 crashes, 0 device removals), then hit the same sparse copy-back fence cycle @St5sz2Jk noted in #1269 (44 sparse: the queue has not reached fence value ... after 5 s (at 42915) warnings starting at 81.609 s, 5 s after Wait64BitValueX at 0x42437fae8 in sparse window 0).
  • main b49be183 + #871 8f08d7cd + #684 e56dbc3f + #1993 0a755f0c: full 300 s (exit=0), 0 crashes, 0 device removals, 0 sparse: the queue has not reached fence value warnings, 16,384 translated draws (48 skipped), 22,268 dispatches (73 skipped) + 195 chained split-compute dispatches, 1,620 PresentX frames, 63,477 Opus packets (0 errors), 15,140 MiB peak VRAM / 12,543 MiB peak RSS (swap=0), and no new warnings vs main.

So the 76.6 s crash was indeed #477 (fixed by #684) and the subsequent sparse queue stall is fixed by #1993 (0a755f0c, which now composes cleanly with #871 under Wine via create_own_list).

Not tested

  • Native Windows or full workspace test suite on 8f08d7cd.

AI use

  • T3 Code / Antigravity (Gemini 4 Neon) merged the stack onto main, ran the 300 s retail verification under Proton on this machine, and drafted this follow-up.
<!-- greyfinch-sync:ivall/xcl:comment:7184093102 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/871#issuecomment-7184093102). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-11-26T06:06:06Z. --- **Update for head `cb3902a4`** (rebased onto `main` `f9a0cb80`; earlier results for `a800c38a` below). `git range-diff` against `a800c38a`: the #867 commit is unchanged; this PR's commit changed only in `title_textures.rs`, where it now follows `main`'s `with_title_bytes` (under Wine the coherent window is copied instead of read in place). Same machine and setup as below (RX 9070 16 GB / Mesa 26.3.1 RADV / Proton Experimental `experimental-11.0-20261112`, vkd3d-proton master `ec207194` without the allocator / command-list `lpVtbl` checks, DXC 1.9.2609.5, Rust 1.96.0, `x86_64-pc-windows-gnu` debug build). The head itself, with `main` `f9a0cb80` the same session as the baseline. **Tests** (`XCL_REQUIRE_GPU=wave64`, `--test-threads=1`) - `hle::d3d12x::real::`: **67 passed, 0 failed**, 0 ignored (`main`: 63 passed, 0 failed) - `gpu::uma::`: **12 passed, 0 failed** (`main`: 12); `adapter`: **5 passed, 0 failed** (`main`: 4); `hle::d3d12x::title_textures::`: **21 passed, 0 failed** (`main`: 21) - Lib with `--skip compositor_blends_ui_plane_over_scene_plane --skip failed_restore_stops_before_importing_an_unbacked_window --skip grooming_leaves_a_window_under_1_gib_only_its_hole` (the first loses the RADV device here, the other two run out of memory under Wine): `--test-threads=1`: 1329 passed, 8 failed, 27 ignored; `main` lib the same session: 1323 passed, 9 failed, 27 ignored (`--test-threads=1` and two `--test-threads=4` runs). All failures are among `main`'s. - Three `--test-threads=4` lib runs: 1328 passed, 9 failed (the extra is `sparse::flush_parked_does_not_free_or_reuse_tiles_while_unmap_is_in_flight`, which failed under load on two other recent trees here and passed 3 of 3 when run alone on `main`); 1329 passed, 8 failed; and one ended by a device removal (`0x887a0005`) after 123 tests. `main` does the same here: 1 of its 3 four-thread runs ended that way. - Workspace: the other binaries fail the same 3 tests as on `main` (`e2e`, `pls_quota`, `predication_e2e`). `d3d12_resource_and_sync` ended the process, as it does on `main` here. **Not tested** on this head: a retail run (the runs below are for `a800c38a`); native Windows, NVIDIA / Intel. AI use: Claude Code (Claude Opus 5.5) ran the builds and tests on my machine and wrote this update. --- **Update for head `a800c38a`** (earlier results for `8f08d7cd` below) Same RX 9070 / RADV / Proton Experimental machine, patched `vkd3d-proton` (master `ec207194` without the allocator / command-list `lpVtbl` checks), Rust 1.96.0, `x86_64-pc-windows-gnu`. Head merged onto `main` `8b957bec` with #2849 (`4e931734`), test commit `1bda7ffc`. Without #2849, `main` crashes here in 6 of 9 retail runs (#2841). **Conflict with #2849.** Both change `title_bytes` in `title_textures.rs`: this PR stops borrowing inside the committed window under Wine, #2849 stops borrowing outside it. I resolved it as `if !wine_coherent && in_committed_window(at, len) { borrow } else { read_committed }`, i.e. borrow only inside the window and never under Wine. Whichever of the two lands second needs this. **Tests** (debug, `XCL_REQUIRE_GPU=wave64`, `--test-threads=1`) - `gpu::uma::`: 12 passed, 0 failed - `gpu::adapter::`: 4 passed, 0 failed (`main`: 3; the new one is `chosen_vendor_is_the_adapter_the_backend_opens`) - `hle::d3d12x::title_textures::`: 19 passed, 0 failed - The full suite of the tree with #877 on top is in my report on #877. **Retail title, 300 s** (release; every run starts from a copy of the same warm-cache snapshot; `XCL_DIRECT_DXIL=1 XCL_TEXTURE_LEVEL_PAGES=1 XCL_PSO_WAIT_MS=50 XCL_SPLIT_MIDLIST_WAIT=0 XCL_COHERENT_MB=1024 XCL_PREPARE=1 XCL_PSO_PRELOAD=1 VKD3D_CONFIG=ignore_shared_fence`, `A` pressed every 10 s) - **Without #684: 2 of 2 runs crash at ~105 s**, `0xc0000005` in `ucrtbase.dll+0x1720b` reading `0x400016000`, in `xg::copy_from` (`xg.rs:711`, symbolized), the #477 crash #684 fixes. `main` + #2849 (6 runs) and #867 (2 runs) never hit it. **So this PR needs #684 merged first**, or the title crashes on Linux. - With #684 (`e56dbc3f`) and #1993 (`0a755f0c`) added to each tree: | | runs | exit | crashes / device removed | presents | VRAM at ~90 s | card full (16.2 GiB) at | tiles at 4,096 submits | |---|---|---|---|---|---|---|---| | base `7b8df0d8` | 2 | 0, 0 | 0 / 0 | 2152, 2083 | 9897, 9895 MiB | 220 s, 255 s | 28,174, 27,782 | | + this PR `93678b46` | 2 | 0, 0 | 0 / 0 | 1765, 1799 | 13377, 13357 MiB | 156 s, 310 s | 91,382, 89,063 | - **About 3.4 GiB more VRAM at 90 s**, about 3× the mapped tiles, and 14–18 % fewer presents. In all runs the presents come before the stall after world start that every tree here has (~100 s), so they cover the menus and loading only. One run logged 6,361 `sparse: the queue has not reached fence value` warnings from 222 s; the base without #684 and #1993 logged them too (2 of 6 runs). **Not tested** - Native Windows, NVIDIA/Intel, an AMD iGPU + dGPU machine (the new adapter choice) - This PR without #2849 **AI use** - Claude Code (Claude Opus 5.5) wrote the test scripts, ran the tests and runs on this machine, symbolized the crash and wrote this update. --- Confirmed @St5sz2Jk's diagnosis on latest `main` (`b49be183`) + rebased #871 (`8f08d7cd`) on the same RX 9070 / RADV / Proton Experimental setup (300 s retail runs, same flags): - **`main b49be183 + #871 8f08d7cd + #684 e56dbc3f`**: sailed past the `76.6 s` `xg::copy_from` crash cleanly (`exit=0`, **0 crashes**, **0 device removals**), then hit the same sparse copy-back fence cycle @St5sz2Jk noted in #1269 (`44` `sparse: the queue has not reached fence value ... after 5 s (at 42915)` warnings starting at `81.609 s`, 5 s after `Wait64BitValueX at 0x42437fae8` in sparse window 0). - **`main b49be183 + #871 8f08d7cd + #684 e56dbc3f + #1993 0a755f0c`**: full **300 s (`exit=0`)**, **0 crashes**, **0 device removals**, **0 `sparse: the queue has not reached fence value` warnings**, `16,384` translated draws (`48` skipped), `22,268` dispatches (`73` skipped) + `195` chained split-compute dispatches, `1,620` `PresentX` frames, `63,477` Opus packets (0 errors), `15,140 MiB` peak VRAM / `12,543 MiB` peak RSS (`swap=0`), and no new warnings vs `main`. So the `76.6 s` crash was indeed #477 (fixed by #684) and the subsequent sparse queue stall is fixed by #1993 (`0a755f0c`, which now composes cleanly with #871 under Wine via `create_own_list`). **Not tested** - Native Windows or full workspace test suite on `8f08d7cd`. **AI use** - T3 Code / Antigravity (Gemini 4 Neon) merged the stack onto `main`, ran the 300 s retail verification under Proton on this machine, and drafted this follow-up.
futurepro62 commented 2026-11-26 09:07:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-26T08:48:32Z.


NVIDIA and AMD full-suite run, to go with the reports above by fromthemoonx, since none of them covers AMD. Tested exact head 8f08d7cd (on its base 08db802).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1420 passed, 0 failed, 45 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, dispatch_chain_native_wave64_builds_whole, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: unadopt_guard_restores_native_vtable_and_reapplies_extended_on_drop, concurrent_release_during_unadopt_guard_still_runs_hooked_cleanup, fence_proxy_forwards_signal_unwraps_and_frees_on_final_release.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1431 passed, 0 failed, 47 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main b49be183 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests, const_and_null_mask_operands_agree_with_hlsl_on_the_gpu and mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7187045696 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/871#issuecomment-7187045696). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-26T08:48:32Z. --- NVIDIA and AMD full-suite run, to go with the reports above by fromthemoonx, since none of them covers AMD. Tested exact head `8f08d7cd` (on its base `08db802`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests`: **1420 passed, 0 failed, 45 ignored**. SKIPPED (no wave64): `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `dispatch_chain_native_wave64_builds_whole`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`. - The new tests ran and passed: `unadopt_guard_restores_native_vtable_and_reapplies_extended_on_drop`, `concurrent_release_during_unadopt_guard_still_runs_hooked_cleanup`, `fence_proxy_forwards_signal_unwraps_and_frees_on_final_release`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **1431 passed, 0 failed, 47 ignored**. SKIPPED: `f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `--skip` leaves out tests that fail on main `b49be183` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651), the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests, `const_and_null_mask_operands_agree_with_hlsl_on_the_gpu` and `mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu` ([follow-up on #1651](https://github.com/xcl-dev/xcl/issues/1651#issuecomment-7146069648)) fail because `runner::skip_test` turns their skips into failures under `XCL_REQUIRE_GPU=mesh`, and `gpu::dxil::fuzz_tests` seeds 70, 545, 1019 and 1507 fail `CreateComputePipelineState` with `E_OUTOFMEMORY` on this card (drivers 616.64 and 621.40). On AMD: `fuzz_validate_and_gpu_1` fails on seed 540 (`res[833]` 0x7 vs CPU 0x6). The AMD run does not set `XCL_REQUIRE_GPU`. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
safesearch77 commented 2026-11-26 16:40:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by safesearch77 on 2026-11-26T16:40:10Z.


Reviewed commit 8f08d7cd (e57cb659..8f08d7cd, leaving #867's base commit aside) against
main (8b957bec). Two Linux multi-GPU / NVIDIA-under-Wine issues in uma.rs and
title_textures.rs:

  1. wine_amd_gpu() (crates/xcl/src/gpu/uma.rs:796-817) inspects only the first non-software
    DXGI adapter and returns immediately, ignoring XCL_ADAPTER / d3d12_adapter.

    let mut i = 0u32;
    while let Ok(adapter) = unsafe { factory.EnumAdapters1(i) } {
        i += 1;
        if let Ok(desc) = unsafe { adapter.GetDesc1() } {
            if (desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE.0 as u32) == 0 {
                return desc.VendorId == 0x1002;
            }
        }
    }
    

    On hybrid Linux machines (very common on Ryzen + RTX laptops/desktops and Intel + Radeon setups):

    • AMD iGPU (0x1002, adapter 0) + discrete NVIDIA dGPU (0x10de, adapter 1):
      wine_amd_gpu() returns true on adapter 0 and falsely clamps NVIDIA's coherent window to
      512 MiB (RUNTIME_COMMITTED_CAP, uma.rs:98, 828-830).
    • Intel iGPU (0x8086, adapter 0) + discrete AMD dGPU (0x1002, adapter 1):
      wine_amd_gpu() returns false on adapter 0 and leaves the discrete AMD dGPU with a 4 GiB
      coherent window, hitting the exact ~150 ms/frame amdgpu userptr stall #871 fixes.
      Selecting the adapter with crate::gpu::adapter::Selector (matching real::init's
      d3d12_adapter / XCL_ADAPTER, or preferring discrete over integrated when unset) ensures
      VendorId is checked on the GPU XCL actually opens.
  2. MEM_WRITE_WATCH is stripped for all under_wine() (uma.rs:271, 497, 569), forcing full
    ReadProcessMemory + CPU hashing of every coherent-window texture on every submit on NVIDIA
    Linux (title_textures.rs:825, 847-858).

    • coherent_hint_for (uma.rs:828-830) was narrowed from under_wine() to wine_amd_gpu()
      after @notdxbi's NVIDIA report, so NVIDIA Linux keeps its full up-to-4 GiB coherent window —
      but uma.rs:271, 497, 569 still strips MEM_WRITE_WATCH whenever under_wine() is true, and
      title_textures::refresh_once (title_textures.rs:825, 847-858) still gates the
      GetWriteWatch bypass on under_wine().
    • On NVIDIA's proprietary Linux driver there is no amdgpu userptr HMM invalidation stall, so
      stripping MEM_WRITE_WATCH on NVIDIA Linux forces refresh_once to copy_committed_region
      (ReadProcessMemory) and FNV-hash every coherent-window texture on every ExecuteCommandLists
      call while holding TEXTURES.lock(). Gating the MEM_WRITE_WATCH strip and refresh_once
      fallback on the same wine_amd_gpu() predicate (with an optional env override) keeps
      GetWriteWatch active on NVIDIA Linux while preserving the amdgpu fix on RADV.

Checked by source audit against main (8b957bec); no GPU, Wine or Windows run.

AI use: Antigravity (Gemini 4 Carbon High) audited e57cb659..8f08d7cd and traced adapter selection
and title_textures::refresh_once; independently verified by Gemini 4 Hydrogen XHigh.

<!-- greyfinch-sync:ivall/xcl:comment:7197944669 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/871#issuecomment-7197944669). Originally posted by [safesearch77](https://github.com/safesearch77) on 2026-11-26T16:40:10Z. --- Reviewed commit `8f08d7cd` (`e57cb659..8f08d7cd`, leaving `#867`'s base commit aside) against `main` (`8b957bec`). Two Linux multi-GPU / NVIDIA-under-Wine issues in `uma.rs` and `title_textures.rs`: 1. **`wine_amd_gpu()` (`crates/xcl/src/gpu/uma.rs:796-817`) inspects only the first non-software DXGI adapter and returns immediately, ignoring `XCL_ADAPTER` / `d3d12_adapter`.** ```rust let mut i = 0u32; while let Ok(adapter) = unsafe { factory.EnumAdapters1(i) } { i += 1; if let Ok(desc) = unsafe { adapter.GetDesc1() } { if (desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE.0 as u32) == 0 { return desc.VendorId == 0x1002; } } } ``` On hybrid Linux machines (very common on Ryzen + RTX laptops/desktops and Intel + Radeon setups): - **AMD iGPU (`0x1002`, adapter 0) + discrete NVIDIA dGPU (`0x10de`, adapter 1):** `wine_amd_gpu()` returns `true` on adapter 0 and falsely clamps NVIDIA's coherent window to `512 MiB` (`RUNTIME_COMMITTED_CAP`, `uma.rs:98, 828-830`). - **Intel iGPU (`0x8086`, adapter 0) + discrete AMD dGPU (`0x1002`, adapter 1):** `wine_amd_gpu()` returns **`false`** on adapter 0 and leaves the discrete AMD dGPU with a 4 GiB coherent window, hitting the exact ~150 ms/frame `amdgpu` `userptr` stall `#871` fixes. Selecting the adapter with `crate::gpu::adapter::Selector` (matching `real::init`'s `d3d12_adapter` / `XCL_ADAPTER`, or preferring discrete over integrated when unset) ensures `VendorId` is checked on the GPU XCL actually opens. 2. **`MEM_WRITE_WATCH` is stripped for all `under_wine()` (`uma.rs:271, 497, 569`), forcing full `ReadProcessMemory` + CPU hashing of every coherent-window texture on every submit on NVIDIA Linux (`title_textures.rs:825, 847-858`).** - `coherent_hint_for` (`uma.rs:828-830`) was narrowed from `under_wine()` to `wine_amd_gpu()` after `@notdxbi`'s NVIDIA report, so NVIDIA Linux keeps its full up-to-4 GiB coherent window — but `uma.rs:271, 497, 569` still strips `MEM_WRITE_WATCH` whenever `under_wine()` is true, and `title_textures::refresh_once` (`title_textures.rs:825, 847-858`) still gates the `GetWriteWatch` bypass on `under_wine()`. - On NVIDIA's proprietary Linux driver there is no `amdgpu` `userptr` HMM invalidation stall, so stripping `MEM_WRITE_WATCH` on NVIDIA Linux forces `refresh_once` to `copy_committed_region` (`ReadProcessMemory`) and FNV-hash every coherent-window texture on every `ExecuteCommandLists` call while holding `TEXTURES.lock()`. Gating the `MEM_WRITE_WATCH` strip and `refresh_once` fallback on the same `wine_amd_gpu()` predicate (with an optional env override) keeps `GetWriteWatch` active on NVIDIA Linux while preserving the `amdgpu` fix on RADV. Checked by source audit against `main` (`8b957bec`); no GPU, Wine or Windows run. AI use: Antigravity (Gemini 4 Carbon High) audited `e57cb659..8f08d7cd` and traced adapter selection and `title_textures::refresh_once`; independently verified by Gemini 4 Hydrogen XHigh.
gustavsi commented 2026-11-26 16:59:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-26T16:59:08Z.


Thanks @safesearch77, both points hold. Fixed at 1a7f146b (still one commit on #867 e57cb659):

  1. Adapter: wine_amd_gpu() now asks the new gpu::adapter::chosen_vendor about the adapter the D3D12 backend actually opens – high-performance order, d3d12_adapter / XCL_ADAPTER, falling back to auto as real::init does – instead of the first EnumAdapters1 entry. Test chosen_vendor_is_the_adapter_the_backend_opens covers AMD iGPU + NVIDIA dGPU, Intel iGPU + AMD dGPU, an explicit selector, the auto fallback and WARP.
  2. Write watch: the coherent window's MEM_WRITE_WATCH strip (both allocations), its exclusion from watch_regions() and the per-submit hashing in title_textures now follow the same wine_amd_gpu() predicate, so NVIDIA under Wine keeps the write watch as on Windows. One correction on the cost: only textures ≤ 4 MiB were hashed every submit; larger ones were swept 1/16 per submit. Two things stay on for all Wine runs: title_bytes' copy through read_committed, and mark_dirty_range on DirectStorage writes (the write watch may not see those under Wine; it only marks textures for upload).

Verified on RX 9060 XT / GE-Proton11-14 (counts and the new smoke block are in the description): gpu::adapter:: 4/0, gpu::uma:: 12/0, title_textures:: 19/0, real:: 62/0, sparse:: 17/0/1, vram:: 19/0/1, hle::dstorage:: 31/0; 60 s smoke 1316 frames, 0 crashes, with the 512 MB window still chosen on AMD.

Not measured: NVIDIA under Wine with the write watch back on (no NVIDIA hardware here). @notdxbi, if you get a moment, an intro / loading comparison on your RTX 5060 between 8f08d7cd and 1a7f146b would show whether it helps there.

AI use: Claude Code (Claude Opus 5.5) made the change, ran the tests and the smoke run, and drafted this reply; I checked it.

<!-- greyfinch-sync:ivall/xcl:comment:7198342691 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/871#issuecomment-7198342691). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-26T16:59:08Z. --- Thanks @safesearch77, both points hold. Fixed at `1a7f146b` (still one commit on #867 `e57cb659`): 1. **Adapter:** `wine_amd_gpu()` now asks the new `gpu::adapter::chosen_vendor` about the adapter the D3D12 backend actually opens – high-performance order, `d3d12_adapter` / `XCL_ADAPTER`, falling back to `auto` as `real::init` does – instead of the first `EnumAdapters1` entry. Test `chosen_vendor_is_the_adapter_the_backend_opens` covers AMD iGPU + NVIDIA dGPU, Intel iGPU + AMD dGPU, an explicit selector, the `auto` fallback and WARP. 2. **Write watch:** the coherent window's `MEM_WRITE_WATCH` strip (both allocations), its exclusion from `watch_regions()` and the per-submit hashing in `title_textures` now follow the same `wine_amd_gpu()` predicate, so NVIDIA under Wine keeps the write watch as on Windows. One correction on the cost: only textures ≤ 4 MiB were hashed every submit; larger ones were swept 1/16 per submit. Two things stay on for all Wine runs: `title_bytes`' copy through `read_committed`, and `mark_dirty_range` on DirectStorage writes (the write watch may not see those under Wine; it only marks textures for upload). Verified on RX 9060 XT / `GE-Proton11-14` (counts and the new smoke block are in the description): `gpu::adapter::` 4/0, `gpu::uma::` 12/0, `title_textures::` 19/0, `real::` 62/0, `sparse::` 17/0/1, `vram::` 19/0/1, `hle::dstorage::` 31/0; 60 s smoke 1316 frames, 0 crashes, with the 512 MB window still chosen on AMD. Not measured: NVIDIA under Wine with the write watch back on (no NVIDIA hardware here). @notdxbi, if you get a moment, an intro / loading comparison on your RTX 5060 between `8f08d7cd` and `1a7f146b` would show whether it helps there. AI use: Claude Code (Claude Opus 5.5) made the change, ran the tests and the smoke run, and drafted this reply; I checked it.
gustavsi commented 2026-11-29 03:52:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-29T03:52:57Z.


Closing as I'm stepping away from the project, but anyone is welcome to rebase and reuse these commits.

<!-- greyfinch-sync:ivall/xcl:comment:7250316561 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/871#issuecomment-7250316561). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-29T03:52:57Z. --- Closing as I'm stepping away from the project, but anyone is welcome to rebase and reuse these commits.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!865
No description provided.