D3D12.X: preserve native vtables and wrap fences for vkd3d-proton under Wine (#175) #861

Closed
gustavsi wants to merge 1 commit from upstream-pr/867 into main
gustavsi commented 2026-11-24 07:03:30 +00:00 (Migrated from github.com)

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


Preserve native COM vtables around d3d12core.dll calls and wrap ID3D12Fence1 in a thin proxy under Wine so XCL runs on unmodified assertion-free vkd3d-proton (no vkd3d-proton vtable-check patch required). Part of #175 and #1701.

vkd3d-proton validates iface->lpVtbl on adopted D3D12 objects passed back into d3d12core.dll (ID3D12CommandAllocator, ID3D12GraphicsCommandList, ID3D12Heap, ID3D12Resource, ID3D12PipelineState, and ID3D12Fence, including on its async queue thread). With XCL's in-place vtable adoption, unmodified assertion-free vkd3d-proton (GE-Proton or -Db_ndebug=true builds) rejects adopted allocators/lists with E_INVALIDARG and fails fence calls. Native Windows behavior is unchanged (all new paths, including create_raw_fence's bypass, are gated behind util::under_wine()).

Note: assert-enabled vkd3d-proton builds (such as stock Proton Experimental) also validate iface->lpVtbl inside an adopted object's own methods (for example d3d12_heap_GetDesc), so either an assertion-free build (GE-Proton / -Db_ndebug=true) or complementary in-place vtable patching for the assert-only classes (#2477, stacked on this PR) is needed there.

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs:
    • Add refcounted UnadoptGuard (UNADOPTED per-object active count with atomic vtable stores and 8-byte pointer alignment check) to temporarily restore native vtables on adopted command allocators (including alloc_pool backings and reset_pc_allocator), command lists, heaps (CreatePlacedResource / CreatePlacedResource1), RTV resources, and PSOs around calls into d3d12core.dll without restoring early under concurrent guards.
    • Pin +1 COM reference via native AddRef before exposing the native vtable on the first active guard, and release it via XCL's hooked Release slot after restoring the extended vtable (outside UNADOPTED) on the last guard drop: even if another thread concurrently loads the native vtable and calls Release, refcount stays >= 1 during the guard window and the final 1 -> 0 transition always executes XCL's hooked cleanup (pso_release, heap_release, res_release, cl_release, alloc_release).
    • Track unadopted native vtables lock-free (register_native / is_known_native) so orig_fn reads *ext.add(slot) directly if another thread enters a hook while an UnadoptGuard temporarily restored the native vtable on a shared object (fixes the 0xc0000005 orig_fn(this, 2) race reported by @GreemSC).
    • Add FenceProxy (wrap_fence_proxy, unwrap_fence, fence_proxy_release, fence_proxy_signal, fence_proxy_qi) so title PC fences keep their native lpVtbl while preserving console slot #12 (completed_value_address), unwrapping in CommandQueue::Signal / Wait, and freeing on final Release.
    • Add create_raw_fence (gated on util::under_wine() && is_ext(...), so native Windows goes straight through dev.CreateFence / dev_create_fence unchanged) so XCL's own internal queue tracking (late_release, alloc_pool, list_x, cpu_writes, present, vram, sparse, drain_gpu) creates raw un-proxied ID3D12Fence objects under Wine and never passes a FenceProxy to un-adopted internal queues like sparse::queue().
    • Add track_end_title_fence so list_x::ensure_cell_fence registers raw cell fences in FENCES under Wine (no-op if already tracked off Wine), ensuring end_title signals parked Wait64BitValueX cell fences before drain_gpu (fixing @safesearch77's review).
    • Add unit tests in wine_vtable_tests: 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, and track_end_title_fence_registers_once_and_addrefs.
  • crates/xcl/src/hle/d3d12x/alloc_pool.rs, cpu_writes.rs, late_release.rs, list_x.rs, present.rs, sparse.rs, vram.rs:
    • Use real::create_raw_fence for XCL's internal fences (calling real::track_end_title_fence on list_x::ensure_cell_fence), and guard alloc_pool::reset_list / KickoffX / #2118 deferred-dispatch Reset / mid-list split calls with UnadoptGuard.
  • crates/xcl/src/gpu/recomp/runner.rs:
    • Add submit_list using real::UnadoptGuard so tests running after real::init() adopts the process-wide singleton ID3D12Device do not submit an adopted command list to the runner's pre-existing un-adopted ID3D12CommandQueue.

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, unmodified vtable checks), DXC 1.9.2609.5, cross-compiled x86_64-pc-windows-msvc (clang-cl + lld-link).
  • Rebased cleanly onto main (f9a0cb80) at 021b2c33 (commit diff unchanged) and verified under GE-Proton11-14 (XCL_DXC_DIR set for GPU tests):
    • hle::d3d12x::real:: --test-threads=1: 67 passed, 0 failed, 0 ignored (including all four wine_vtable_tests)
    • hle::d3d12x::list_x:: --test-threads=1: 40 passed, 0 failed, 0 ignored
    • hle::d3d12x::alloc_pool:: --test-threads=4: 4 passed, 0 failed, 0 ignored
    • real::wine_vtable_tests --test-threads=4: 4 passed, 0 failed, 0 ignored
    • --exact gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem gpu::recomp::tests::gpu_valu_float_and_int --test-threads=1: 2 passed, 0 failed, 0 ignored, 0 skipped
  • Retail title 60 s smoke run via unmodified pwsh ./scripts/smoke.ps1 (with GE-Proton11-14 wrapper, XCL_PREPARE=0): main (e0d93c84) exits 0x3 (2 crashes, 0 frames); this PR (021b2c33) runs the full 60 s cleanly (exit: 0x0, 31 frames shown / PresentX 31, 0 crashes, 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 (021b2c33):

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

Not tested

  • Native Windows (all new paths, including create_raw_fence, are gated behind util::under_wine()).
  • Assert-enabled vkd3d-proton builds (needs -Db_ndebug=true / GE-Proton or #2477).

AI use

  • T3 Code, Antigravity (Gemini 4 Neon) rebased cleanly onto main (f9a0cb80 -> 021b2c33), ran the Proton test/smoke verification at 021b2c33, and updated this description (as well as the earlier under_wine() gate, track_end_title_fence, and UnadoptGuard COM reference pin).
<!-- greyfinch-sync:ivall/xcl:issue:5467667817 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-24T07:03:30Z. --- Preserve native COM vtables around `d3d12core.dll` calls and wrap `ID3D12Fence1` in a thin proxy under Wine so XCL runs on unmodified assertion-free `vkd3d-proton` (no `vkd3d-proton` vtable-check patch required). Part of #175 and #1701. `vkd3d-proton` validates `iface->lpVtbl` on adopted D3D12 objects passed back into `d3d12core.dll` (`ID3D12CommandAllocator`, `ID3D12GraphicsCommandList`, `ID3D12Heap`, `ID3D12Resource`, `ID3D12PipelineState`, and `ID3D12Fence`, including on its async queue thread). With XCL's in-place vtable adoption, unmodified assertion-free `vkd3d-proton` (`GE-Proton` or `-Db_ndebug=true` builds) rejects adopted allocators/lists with `E_INVALIDARG` and fails fence calls. Native Windows behavior is unchanged (all new paths, including `create_raw_fence`'s bypass, are gated behind `util::under_wine()`). Note: assert-enabled `vkd3d-proton` builds (such as stock Proton Experimental) also validate `iface->lpVtbl` inside an adopted object's own methods (for example `d3d12_heap_GetDesc`), so either an assertion-free build (`GE-Proton` / `-Db_ndebug=true`) or complementary in-place vtable patching for the assert-only classes (#2477, stacked on this PR) is needed there. **What is in it** - `crates/xcl/src/hle/d3d12x/real.rs`: - Add refcounted `UnadoptGuard` (`UNADOPTED` per-object active count with atomic vtable stores and 8-byte pointer alignment check) to temporarily restore native vtables on adopted command allocators (including `alloc_pool` backings and `reset_pc_allocator`), command lists, heaps (`CreatePlacedResource` / `CreatePlacedResource1`), RTV resources, and PSOs around calls into `d3d12core.dll` without restoring early under concurrent guards. - Pin +1 COM reference via native `AddRef` before exposing the native vtable on the first active guard, and release it via XCL's hooked `Release` slot after restoring the extended vtable (outside `UNADOPTED`) on the last guard drop: even if another thread concurrently loads the native vtable and calls `Release`, refcount stays `>= 1` during the guard window and the final `1 -> 0` transition always executes XCL's hooked cleanup (`pso_release`, `heap_release`, `res_release`, `cl_release`, `alloc_release`). - Track unadopted native vtables lock-free (`register_native` / `is_known_native`) so `orig_fn` reads `*ext.add(slot)` directly if another thread enters a hook while an `UnadoptGuard` temporarily restored the native vtable on a shared object (fixes the `0xc0000005` `orig_fn(this, 2)` race reported by @GreemSC). - Add `FenceProxy` (`wrap_fence_proxy`, `unwrap_fence`, `fence_proxy_release`, `fence_proxy_signal`, `fence_proxy_qi`) so title PC fences keep their native `lpVtbl` while preserving console slot `#12` (`completed_value_address`), unwrapping in `CommandQueue::Signal` / `Wait`, and freeing on final `Release`. - Add `create_raw_fence` (gated on `util::under_wine() && is_ext(...)`, so native Windows goes straight through `dev.CreateFence` / `dev_create_fence` unchanged) so XCL's own internal queue tracking (`late_release`, `alloc_pool`, `list_x`, `cpu_writes`, `present`, `vram`, `sparse`, `drain_gpu`) creates raw un-proxied `ID3D12Fence` objects under Wine and never passes a `FenceProxy` to un-adopted internal queues like `sparse::queue()`. - Add `track_end_title_fence` so `list_x::ensure_cell_fence` registers raw cell fences in `FENCES` under Wine (no-op if already tracked off Wine), ensuring `end_title` signals parked `Wait64BitValueX` cell fences before `drain_gpu` (fixing @safesearch77's review). - Add unit tests in `wine_vtable_tests`: `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`, and `track_end_title_fence_registers_once_and_addrefs`. - `crates/xcl/src/hle/d3d12x/alloc_pool.rs`, `cpu_writes.rs`, `late_release.rs`, `list_x.rs`, `present.rs`, `sparse.rs`, `vram.rs`: - Use `real::create_raw_fence` for XCL's internal fences (calling `real::track_end_title_fence` on `list_x::ensure_cell_fence`), and guard `alloc_pool::reset_list` / `KickoffX` / `#2118` deferred-dispatch `Reset` / mid-list split calls with `UnadoptGuard`. - `crates/xcl/src/gpu/recomp/runner.rs`: - Add `submit_list` using `real::UnadoptGuard` so tests running after `real::init()` adopts the process-wide singleton `ID3D12Device` do not submit an adopted command list to the runner's pre-existing un-adopted `ID3D12CommandQueue`. **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`, unmodified vtable checks), DXC 1.9.2609.5, cross-compiled `x86_64-pc-windows-msvc` (`clang-cl` + `lld-link`). - Rebased cleanly onto `main` (`f9a0cb80`) at `021b2c33` (commit diff unchanged) and verified under `GE-Proton11-14` (`XCL_DXC_DIR` set for GPU tests): - `hle::d3d12x::real:: --test-threads=1`: **67 passed, 0 failed, 0 ignored** (including all four `wine_vtable_tests`) - `hle::d3d12x::list_x:: --test-threads=1`: **40 passed, 0 failed, 0 ignored** - `hle::d3d12x::alloc_pool:: --test-threads=4`: **4 passed, 0 failed, 0 ignored** - `real::wine_vtable_tests --test-threads=4`: **4 passed, 0 failed, 0 ignored** - `--exact gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem gpu::recomp::tests::gpu_valu_float_and_int --test-threads=1`: **2 passed, 0 failed, 0 ignored, 0 skipped** - Retail title 60 s smoke run via unmodified `pwsh ./scripts/smoke.ps1` (with `GE-Proton11-14` wrapper, `XCL_PREPARE=0`): `main` (`e0d93c84`) exits `0x3` (`2` crashes, `0` frames); this PR (`021b2c33`) runs the full 60 s cleanly (`exit: 0x0`, **`31` frames shown / `PresentX 31`**, `0` crashes, `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 (`021b2c33`): ``` xcl-smoke v1 commit: 021b2c33f5a7d6fb21f26ff792ca953fa36a46bd gpu: AMD Radeon RX 9060 XT title: retail-title seconds: 60 exit: 0x0 frames shown: 31 (PresentX 31) presents per 2 s (last 3): 2 0 2 device removals: 0 crashes: 0 peak commit: 0 MB ``` **Not tested** - Native Windows (all new paths, including `create_raw_fence`, are gated behind `util::under_wine()`). - Assert-enabled `vkd3d-proton` builds (needs `-Db_ndebug=true` / `GE-Proton` or #2477). **AI use** - T3 Code, Antigravity (`Gemini 4 Neon`) rebased cleanly onto `main` (`f9a0cb80` -> `021b2c33`), ran the Proton test/smoke verification at `021b2c33`, and updated this description (as well as the earlier `under_wine()` gate, `track_end_title_fence`, and `UnadoptGuard` COM reference pin).
fromthemoonx commented 2026-11-24 08:22:13 +00:00 (Migrated from github.com)

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


Rerun on the new head 021b2c3 (the same commit as d9e6ad5, rebased onto main f9a0cb8): 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; the e2e debug-layer messages match current main's. Same RTX 3060 (driver 610.88), Rust 1.100.0, debug. Not tested: Wine / vkd3d-proton. The reports below are for older heads.


Rerun on the new head d9e6ad5 (create_raw_fence gated on under_wine()): native Windows takes the old fence path again, and it still passes on NVIDIA. The same scratch log line in create_raw_fence's raw branch now fires 0 times in each of the 3 e2e title logs (41 per run on e57cb65), so on Windows every fence goes through dev_create_fence into FENCES again; no log has GPU fences still pending after 10 s.

result
cargo test --workspace --no-fail-fast -- --test-threads=4, d9e6ad5 merged onto main 8b957be (clean) 1450 passed, 0 failed, 47 ignored; 25 SKIPPED lines
track_end_title_fence_registers_once_and_addrefs alone, 40 runs; hle::d3d12x::real:: (67 tests) at --test-threads=8, 30 runs 40 of 40; 30 of 30
e2e debug-layer tests, merged the same messages as main 8b957be (3× error id 93, 1× error id 1046, 1× warning id 820, 8× id 0 per run)

The new test covers track_end_title_fence; the Windows gate itself is covered by the log count above, not by a test. The whole stack's run is on #877. Same RTX 3060 (driver 610.88), Rust 1.100.0, debug. Not tested: Wine / vkd3d-proton. AI use: Claude Code (Claude Opus 5.5) ran the tests and the scratch check and wrote this rerun.


On the review above (native Windows also takes the raw fence path): confirmed on e57cb65 on Windows / NVIDIA. With a scratch log line in create_raw_fence's is_ext branch, the e2e title (cargo test -p xcl --test e2e, native Windows, no Wine) creates 41 fences through it per run, so on Windows those fences are no longer in FENCES either. The title does not end with a queue parked on a cell fence, so none of the 3 title logs has GPU fences still pending after 10 s, and the 4 e2e tests pass (9.3 s). That means the end_title hang the review describes is not covered by this run or by the smoke pair; a title would have to quit while a queue waits on a list_x cell fence. (With XCL_CONSOLE_LISTS=1, 3 of the 4 e2e tests fail on occlusion queries (outer, inner, single) = [0, 0, 0], and they fail the same way on main e120925, so that is not this PR.) AI use: Claude Code (Claude Opus 5.5) ran this check and wrote this paragraph.


Rerun on the new head e57cb65 (the UnadoptGuard reference pin, rebased onto main 08db802): still passes on native Windows / NVIDIA. Merged onto main b49be18 (clean): cargo test --workspace --no-fail-fast -- --test-threads=4 1438 passed, 0 failed, 47 ignored, 25 SKIPPED lines. wine_vtable_tests (3 tests) 40 of 40; hle::d3d12x::real:: (63 tests) at --test-threads=8 30 of 30. The e2e debug-layer messages are the same as main b49be18's (3× error id 93, 1× error id 1046, 1× warning id 820, 8× id 0 at exit). #871 and #877 are not rebased onto this head yet. Same RTX 3060 (driver 610.88), Rust 1.100.0, debug. Not tested: Wine / vkd3d-proton. The reports below are for older heads.


Rerun on the new head 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. Merged onto main 80f4819 (no conflicts; auto-merged cpu_writes.rs, list_x.rs, real.rs): 995 passed, 0 failed, 45 ignored. The e2e debug-layer messages on the merged tree are the same as main 80f4819's (3× error id 93, 1× error id 1046, 1× warning id 820, plus the exit-time live-object report). Same RTX 3060 (driver 610.88), DXC 1.9.2602.17, debug. Not tested: Wine / vkd3d-proton (none here). The report below is for 593b2e2.


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

Tested

  • Exact head 593b2e21fc0d4659861587ca426a0e30c57c590c, 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). The skip is #913: on this 12 GB card, that test fills video memory and makes unrelated tests fail with E_OUTOFMEMORY.
  • Both new tests passed: wine_vtable_tests::fence_proxy_forwards_signal_unwraps_and_frees_on_final_release, wine_vtable_tests::unadopt_guard_restores_native_vtable_and_reapplies_extended_on_drop
  • 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: 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:7126051443 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#issuecomment-7126051443). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-11-24T08:22:13Z. --- **Rerun on the new head `021b2c3` (the same commit as `d9e6ad5`, rebased onto `main` `f9a0cb8`): 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; the e2e debug-layer messages match current `main`'s. Same RTX 3060 (driver 610.88), Rust 1.100.0, debug. Not tested: Wine / vkd3d-proton. The reports below are for older heads. --- **Rerun on the new head `d9e6ad5` (`create_raw_fence` gated on `under_wine()`): native Windows takes the old fence path again, and it still passes on NVIDIA.** The same scratch log line in `create_raw_fence`'s raw branch now fires 0 times in each of the 3 e2e title logs (41 per run on `e57cb65`), so on Windows every fence goes through `dev_create_fence` into `FENCES` again; no log has `GPU fences still pending after 10 s`. | | result | |---|---| | `cargo test --workspace --no-fail-fast -- --test-threads=4`, `d9e6ad5` merged onto `main` `8b957be` (clean) | 1450 passed, 0 failed, 47 ignored; 25 `SKIPPED` lines | | `track_end_title_fence_registers_once_and_addrefs` alone, 40 runs; `hle::d3d12x::real::` (67 tests) at `--test-threads=8`, 30 runs | 40 of 40; 30 of 30 | | e2e debug-layer tests, merged | the same messages as `main` `8b957be` (3× error id 93, 1× error id 1046, 1× warning id 820, 8× id 0 per run) | The new test covers `track_end_title_fence`; the Windows gate itself is covered by the log count above, not by a test. The whole stack's run is on #877. Same RTX 3060 (driver 610.88), Rust 1.100.0, debug. Not tested: Wine / vkd3d-proton. AI use: Claude Code (Claude Opus 5.5) ran the tests and the scratch check and wrote this rerun. --- **On the review above (native Windows also takes the raw fence path): confirmed on `e57cb65` on Windows / NVIDIA.** With a scratch log line in `create_raw_fence`'s `is_ext` branch, the e2e title (`cargo test -p xcl --test e2e`, native Windows, no Wine) creates 41 fences through it per run, so on Windows those fences are no longer in `FENCES` either. The title does not end with a queue parked on a cell fence, so none of the 3 title logs has `GPU fences still pending after 10 s`, and the 4 e2e tests pass (9.3 s). That means the `end_title` hang the review describes is not covered by this run or by the smoke pair; a title would have to quit while a queue waits on a `list_x` cell fence. (With `XCL_CONSOLE_LISTS=1`, 3 of the 4 e2e tests fail on `occlusion queries (outer, inner, single) = [0, 0, 0]`, and they fail the same way on `main` `e120925`, so that is not this PR.) AI use: Claude Code (Claude Opus 5.5) ran this check and wrote this paragraph. --- **Rerun on the new head `e57cb65` (the `UnadoptGuard` reference pin, rebased onto `main` `08db802`): still passes on native Windows / NVIDIA.** Merged onto `main` `b49be18` (clean): `cargo test --workspace --no-fail-fast -- --test-threads=4` 1438 passed, 0 failed, 47 ignored, 25 `SKIPPED` lines. `wine_vtable_tests` (3 tests) 40 of 40; `hle::d3d12x::real::` (63 tests) at `--test-threads=8` 30 of 30. The e2e debug-layer messages are the same as `main` `b49be18`'s (3× error id 93, 1× error id 1046, 1× warning id 820, 8× id 0 at exit). #871 and #877 are not rebased onto this head yet. Same RTX 3060 (driver 610.88), Rust 1.100.0, debug. Not tested: Wine / vkd3d-proton. The reports below are for older heads. --- **Rerun on the new head `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. Merged onto main `80f4819` (no conflicts; auto-merged `cpu_writes.rs`, `list_x.rs`, `real.rs`): 995 passed, 0 failed, 45 ignored. The e2e debug-layer messages on the merged tree are the same as main `80f4819`'s (3× error id 93, 1× error id 1046, 1× warning id 820, plus the exit-time live-object report). Same RTX 3060 (driver 610.88), DXC 1.9.2602.17, debug. Not tested: Wine / vkd3d-proton (none here). The report below is for `593b2e2`. --- Native Windows / NVIDIA run, since **Not tested** lists both. **Tested** - Exact head `593b2e21fc0d4659861587ca426a0e30c57c590c`, 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). The skip is #913: on this 12 GB card, that test fills video memory and makes unrelated tests fail with `E_OUTOFMEMORY`. - Both new tests passed: `wine_vtable_tests::fence_proxy_forwards_signal_unwraps_and_frees_on_final_release`, `wine_vtable_tests::unadopt_guard_restores_native_vtable_and_reapplies_extended_on_drop` - 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: 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:56Z.


Linux / AMD RDNA3 lane report, head 593b2e2 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:7125802805 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/867#issuecomment-7125802805). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-24T08:09:56Z. --- Linux / AMD RDNA3 lane report, head `593b2e2` 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.
sander110419 commented 2026-11-24 09:07:09 +00:00 (Migrated from github.com)

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


Test report for 593b2e2 (this PR's head, on its own base), Linux:

  • NVIDIA GeForce RTX 5070 Laptop GPU (8 GB, 32-lane waves), driver 595.104.02; AMD Ryzen 9 9955HX; kernel 7.2.15
  • GE-Proton11-11 (its wine, vkd3d-proton and DXVK), xcl.exe started with that wine directly; release build for x86_64-pc-windows-gnu, rustc 1.99.1
  • The newer retail game in the README table, no VKD3D_CONFIG set, 150 s run: steady 28–30 fps presents (1,800 frames at 94 s), no crash; the run ended at my timeout.

For comparison, same machine:

  • main at 09940bb: the title asserts 1.4 s in on E_INVALIDARG from CreateCommandList (vkd3d-proton: d3d12_command_list_Reset: Invalid command allocator).
  • main + only restoring the native vtable of allocators and submitted lists (no fence wrap): it reaches the menus, then the title's watchdog ends it ~30 s later (the shared-fence case from #175), unless VKD3D_CONFIG=ignore_shared_fence. So the fence part of this PR is what makes the difference here.

Not tested: Windows, AMD, cargo test on this commit.

Merging this into 09940bb conflicts in list_x.rs / real.rs with alloc_pool (#897, #907). My resolution (the guards on the alloc_pool allocator that is passed instead of the title's) crashed 12 s in with an access violation in vkd3d-proton's queue thread. That may well be my resolution and not this PR; a rebase by you would settle it.

AI use: Hermes agent with Claude Opus 5.5 (claude-opus-5-5) ran the builds and the game, and wrote this report; I checked it.

<!-- greyfinch-sync:ivall/xcl:comment:7126478910 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/867#issuecomment-7126478910). Originally posted by [sander110419](https://github.com/sander110419) on 2026-11-24T08:43:15Z. --- Test report for 593b2e2 (this PR's head, on its own base), Linux: - NVIDIA GeForce RTX 5070 Laptop GPU (8 GB, 32-lane waves), driver 595.104.02; AMD Ryzen 9 9955HX; kernel 7.2.15 - GE-Proton11-11 (its wine, vkd3d-proton and DXVK), `xcl.exe` started with that `wine` directly; release build for `x86_64-pc-windows-gnu`, rustc 1.99.1 - The newer retail game in the README table, no `VKD3D_CONFIG` set, 150 s run: steady 28–30 fps presents (1,800 frames at 94 s), no crash; the run ended at my timeout. For comparison, same machine: - `main` at 09940bb: the title asserts 1.4 s in on `E_INVALIDARG` from `CreateCommandList` (vkd3d-proton: `d3d12_command_list_Reset: Invalid command allocator`). - `main` + only restoring the native vtable of allocators and submitted lists (no fence wrap): it reaches the menus, then the title's watchdog ends it ~30 s later (the shared-fence case from #175), unless `VKD3D_CONFIG=ignore_shared_fence`. So the fence part of this PR is what makes the difference here. Not tested: Windows, AMD, `cargo test` on this commit. Merging this into 09940bb conflicts in `list_x.rs` / `real.rs` with `alloc_pool` (#897, #907). My resolution (the guards on the `alloc_pool` allocator that is passed instead of the title's) crashed 12 s in with an access violation in vkd3d-proton's queue thread. That may well be my resolution and not this PR; a rebase by you would settle it. AI use: Hermes agent with Claude Opus 5.5 (`claude-opus-5-5`) ran the builds and the game, and wrote this report; I checked it.
TobiasFornell commented 2026-11-24 13:03:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by TobiasFornell on 2026-11-24T12:26:58Z.


Test report for 593b2e2 (stack head 2f81d51, on its own base) with Proton Experimental's own vkd3d-proton, which nobody seems to have covered yet.

Tested: AMD Radeon RX 9070 XT (RDNA4, 16 GiB), Mesa RADV 26.3.1, CachyOS (kernel 7.3), Proton Experimental 11.0-20261112 (its Wine and its vkd3d-proton 3.2.0, unmodified), DXC 1.9.2609, x86_64-pc-windows-msvc cross-build, retail title 1.0.2.1, XCL_NETWORK=0.

  • Stock vkd3d-proton from Proton Experimental: the title aborts a few seconds in with Assertion failed: iface->lpVtbl == &d3d12_heap_vtbl (vkd3d_private.h:1077), right after the first ID3D12Heap1 is adopted. Valve's build keeps the assertions, and the adopted heap reaches CreatePlacedResource with the extended vtable – this PR's guards cover lists, allocators and fences, not heaps. The start-up check from #257 reports it correctly.
  • vkd3d-proton v3.1 from scripts/linux/build-vkd3d-proton.sh (-Db_ndebug=true, dxil-spirv 53aac418): boots, reaches the first screen, steady 30 fps for 8 min, no crash, no device removal.

So on Proton Experimental an ndebug build is still required even with this PR (GE-Proton evidently ships one, given @sander110419's run on GE-Proton11-11). A guard for heaps – and any other adopted object passed back as a parameter – would make stock Proton Experimental work.

Testing and write-up assisted by Claude Code (Claude Opus 5.5); runs on my own hardware, checked by me. No game data attached.

<!-- greyfinch-sync:ivall/xcl:comment:7131454311 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/867#issuecomment-7131454311). Originally posted by [TobiasFornell](https://github.com/TobiasFornell) on 2026-11-24T12:26:58Z. --- Test report for `593b2e2` (stack head `2f81d51`, on its own base) with **Proton Experimental's own vkd3d-proton**, which nobody seems to have covered yet. **Tested:** AMD Radeon RX 9070 XT (RDNA4, 16 GiB), Mesa RADV 26.3.1, CachyOS (kernel 7.3), Proton Experimental `11.0-20261112` (its Wine and its vkd3d-proton 3.2.0, unmodified), DXC 1.9.2609, `x86_64-pc-windows-msvc` cross-build, retail title 1.0.2.1, `XCL_NETWORK=0`. - **Stock vkd3d-proton from Proton Experimental:** the title aborts a few seconds in with `Assertion failed: iface->lpVtbl == &d3d12_heap_vtbl` (`vkd3d_private.h:1077`), right after the first `ID3D12Heap1` is adopted. Valve's build keeps the assertions, and the adopted heap reaches `CreatePlacedResource` with the extended vtable – this PR's guards cover lists, allocators and fences, not heaps. The start-up check from #257 reports it correctly. - **vkd3d-proton v3.1 from `scripts/linux/build-vkd3d-proton.sh`** (`-Db_ndebug=true`, dxil-spirv `53aac418`): boots, reaches the first screen, steady 30 fps for 8 min, no crash, no device removal. So on Proton Experimental an `ndebug` build is still required even with this PR (GE-Proton evidently ships one, given @sander110419's run on GE-Proton11-11). A guard for heaps – and any other adopted object passed back as a parameter – would make stock Proton Experimental work. *Testing and write-up assisted by Claude Code (Claude Opus 5.5); runs on my own hardware, checked by me. No game data attached.*
TobiasFornell commented 2026-11-24 15:05:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by TobiasFornell on 2026-11-24T14:12:31Z.


Follow-up to my report above, in case someone wants to make stock Proton Experimental's vkd3d-proton (assertions on) work by extending this PR's UnadoptGuard approach. I tried it locally and it is not enough; notes so nobody repeats it:

  • A local branch on top of this stack added guards for adopted heaps and resources passed as parameters (CreatePlacedResource/1/2, view creation, UpdateTileMappings/CopyTileMappings, MakeResident/Evict/EnqueueMakeResident, CreateSharedHandle …). The title still aborts at the same place: Assertion failed: iface->lpVtbl == &d3d12_heap_vtbl right after the first ID3D12Heap1 is adopted.
  • Reason (vkd3d-proton 3.2.0 source, vkd3d_private.h): the vtable-identity asserts sit in the impl_from_* helpers that the objects' own methods use (heap.c: QueryInterface/AddRef/Release/GetDesc/… all call impl_from_ID3D12Heap1(iface)), not only where an object is passed as a parameter. So every PC method reached through the extended vtable trips it.
  • The same assert exists for 10 interfaces: fence, shared fence, heap, resource, descriptor heap, query heap, root signature, pipeline state, command signature (vkd3d_private.h lines ~710–4068 in 3.2.0).
  • Guarding all of that would mean a vtable swap around every PC method call on every adopted object, which is also racy when two threads use the same object (one sees the native vtable while the other's guard is active).

So for stock Proton the realistic options seem to be proxy objects instead of in-place vtable replacement, or an assertion-free vkd3d-proton build (as scripts/linux does; GE-Proton evidently ships one). Not a criticism of this PR – it fixes what it targets; just the boundary for stock Proton.

Testing and write-up assisted by Claude Code (Claude Opus 5.5); runs on my own hardware, checked by me.

<!-- greyfinch-sync:ivall/xcl:comment:7134007850 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/867#issuecomment-7134007850). Originally posted by [TobiasFornell](https://github.com/TobiasFornell) on 2026-11-24T14:12:31Z. --- Follow-up to my report above, in case someone wants to make **stock Proton Experimental's vkd3d-proton** (assertions on) work by extending this PR's `UnadoptGuard` approach. I tried it locally and it is not enough; notes so nobody repeats it: - A local branch on top of this stack added guards for adopted heaps and resources passed as parameters (CreatePlacedResource/1/2, view creation, UpdateTileMappings/CopyTileMappings, MakeResident/Evict/EnqueueMakeResident, CreateSharedHandle …). The title still aborts at the same place: `Assertion failed: iface->lpVtbl == &d3d12_heap_vtbl` right after the first `ID3D12Heap1` is adopted. - Reason (vkd3d-proton 3.2.0 source, `vkd3d_private.h`): the vtable-identity asserts sit in the `impl_from_*` helpers that the objects' **own methods** use (`heap.c`: QueryInterface/AddRef/Release/GetDesc/… all call `impl_from_ID3D12Heap1(iface)`), not only where an object is passed as a parameter. So every PC method reached through the extended vtable trips it. - The same assert exists for 10 interfaces: fence, shared fence, heap, resource, descriptor heap, query heap, root signature, pipeline state, command signature (`vkd3d_private.h` lines ~710–4068 in 3.2.0). - Guarding all of that would mean a vtable swap around every PC method call on every adopted object, which is also racy when two threads use the same object (one sees the native vtable while the other's guard is active). So for stock Proton the realistic options seem to be proxy objects instead of in-place vtable replacement, or an assertion-free vkd3d-proton build (as `scripts/linux` does; GE-Proton evidently ships one). Not a criticism of this PR – it fixes what it targets; just the boundary for stock Proton. *Testing and write-up assisted by Claude Code (Claude Opus 5.5); runs on my own hardware, checked by me.*
crastinator commented 2026-11-24 15:44:08 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Tested on RDNA2 (RADV) against three vkd3d-proton builds. It works with an unpatched vkd3d-proton built with -Db_ndebug=true, and two gaps are left. Proton's own vkd3d-proton still aborts at two other vtable assertions. And on the unpatched build, one sparse test leaves later GPU tests reading zeros.

Tested (head 46944c2, which already contains main 930e8b4)

  • 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, DXVK v3.1.1-209 dxgi, DXC 1.9.2609.5, XCL_REQUIRE_GPU=wave64,mesh (0 SKIPPED). Cross-built for x86_64-pc-windows-msvc, Rust 1.99.1, debug.
  • cargo test -p xcl --lib -- --test-threads=1 plus every integration test (--test-threads=1), compared per test with main 930e8b4 on the same build:
vkd3d-proton main this PR
Proton Experimental's own (asserts on) the lib binary aborts at iface->lpVtbl == &d3d12_heap_vtbl (vkd3d_private.h:1077). The e2e title hits the same assertion, so that test fails. gpu_compute_e2e aborts at &d3d12_root_signature_vtbl (:2111), and predication_e2e and sparse_reinit abort too the same aborts, at the same assertions
v3.1, no XCL patch, -Db_ndebug=true, dxil-spirv 53aac418 699 passed, 52 failed, 41 ignored 731 passed, 22 failed, 41 ignored. 30 fixed, 0 new; 3 of the 30 are the #718 flaky group
v3.1 + #257's patch, -Db_ndebug=true, same dxil-spirv 740 / 11 / 41 742 / 11 / 41, no new failure
  • So "unmodified vkd3d-proton" holds when the build compiles its assertions out. The vkd3d-proton that Proton (Experimental, and I expect other Proton builds) ships still trips d3d12_heap_vtbl and d3d12_root_signature_vtbl on XCL's adopted heaps and root signatures.
  • On the unpatched -Db_ndebug build, 14 of the 22 remaining failures are a chain: every gpu::recomp test after gpu_sparse_vram_descriptors_buffers_and_xmem in list order reads zeros back. For example, gpu_valu_float_and_int gets lane 0 v_add_f32 left: 0.0, and gpu_unified_memory_arena gets s_load from process memory left: (0, 0). The --exact pair gpu_sparse_vram_descriptors_buffers_and_xmem gpu_valu_float_and_int reproduces it 2/2, and gpu_valu_float_and_int alone passes 2/2. With #257's patch the same pair passes. It looks like something the sparse test does goes through a vkd3d-proton path that is still not covered without the patch. The other 8 are the Wine-lane failures main has with the patch too (#530 ×2, #676, #890 ×2, e2e, pls_quota #810, predication_e2e #1272).

Not tested

  • A retail title. NVIDIA. GE-Proton's vkd3d-proton.
  • Anything that needs game files: no XCL_SAMPLE_* was set, so the tests that read them (about 66) pass without running.

AI use

  • Claude Code (Claude Opus 5.5) built the vkd3d-proton variants, ran the tests and wrote this report; I checked the results.

Update: retested at 6e94390 (rebased on main b7aa9f3, same RX 6700 XT / RADV 26.3.1 / Proton Experimental Wine; --test-threads=1, compared per test with main b7aa9f3 on the same build)

vkd3d-proton main b7aa9f3 6e94390
v3.1, no XCL patch, -Db_ndebug=true, dxil-spirv 53aac418 717 passed, 53 failed 760 passed, 12 failed: 41 fixed, 0 new
v3.1 + #257's patch (same build otherwise) 761 / 9 763 / 9, no new failure
Proton Experimental's own (asserts on) aborts (d3d12_heap_vtbl, d3d12_root_signature_vtbl) the same; #1395's part
  • The chain is gone. --exact gpu_sparse_vram_descriptors_buffers_and_xmem gpu_valu_float_and_int passes 3/3, and all 14 gpu::recomp tests after it pass in the full run.
  • On the unpatched build, the 12 failures left are the same 9 main has with #257's patch, plus the #718 trio (title_textures ×2, vram::d32s8). That trio fails in about 2/5 runs here on main too. So with this PR, the unpatched -Db_ndebug build reaches parity with the patched one in the test suite.
  • Not tested: #867 + #1395 together (once #1395's UnadoptGuard condition is in). A retail title.
<!-- greyfinch-sync:ivall/xcl:review:6042505691 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#pullrequestreview-6042505691). Originally posted by [crastinator](https://github.com/crastinator) on 2026-11-24T15:44:08Z. **Review:** COMMENTED --- Tested on RDNA2 (RADV) against three vkd3d-proton builds. It works with an unpatched vkd3d-proton built with `-Db_ndebug=true`, and two gaps are left. Proton's own vkd3d-proton still aborts at two other vtable assertions. And on the unpatched build, one sparse test leaves later GPU tests reading zeros. **Tested** (head `46944c2`, which already contains `main` `930e8b4`) - 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, DXVK v3.1.1-209 `dxgi`, DXC 1.9.2609.5, `XCL_REQUIRE_GPU=wave64,mesh` (0 SKIPPED). Cross-built for `x86_64-pc-windows-msvc`, Rust 1.99.1, debug. - `cargo test -p xcl --lib -- --test-threads=1` plus every integration test (`--test-threads=1`), compared per test with `main` `930e8b4` on the same build: | vkd3d-proton | `main` | this PR | |---|---|---| | **Proton Experimental's own** (asserts on) | the lib binary aborts at `iface->lpVtbl == &d3d12_heap_vtbl` (`vkd3d_private.h:1077`). The e2e title hits the same assertion, so that test fails. `gpu_compute_e2e` aborts at `&d3d12_root_signature_vtbl` (`:2111`), and `predication_e2e` and `sparse_reinit` abort too | **the same aborts**, at the same assertions | | **v3.1, no XCL patch, `-Db_ndebug=true`**, dxil-spirv `53aac418` | 699 passed, 52 failed, 41 ignored | **731 passed, 22 failed**, 41 ignored. 30 fixed, 0 new; 3 of the 30 are the #718 flaky group | | v3.1 + #257's patch, `-Db_ndebug=true`, same dxil-spirv | 740 / 11 / 41 | 742 / 11 / 41, no new failure | - So "unmodified vkd3d-proton" holds when the build compiles its assertions out. The `vkd3d-proton` that Proton (Experimental, and I expect other Proton builds) ships still trips `d3d12_heap_vtbl` and `d3d12_root_signature_vtbl` on XCL's adopted heaps and root signatures. - On the unpatched `-Db_ndebug` build, 14 of the 22 remaining failures are a chain: every `gpu::recomp` test after `gpu_sparse_vram_descriptors_buffers_and_xmem` in list order reads zeros back. For example, `gpu_valu_float_and_int` gets `lane 0 v_add_f32 left: 0.0`, and `gpu_unified_memory_arena` gets `s_load from process memory left: (0, 0)`. The `--exact` pair `gpu_sparse_vram_descriptors_buffers_and_xmem gpu_valu_float_and_int` reproduces it 2/2, and `gpu_valu_float_and_int` alone passes 2/2. With #257's patch the same pair passes. It looks like something the sparse test does goes through a vkd3d-proton path that is still not covered without the patch. The other 8 are the Wine-lane failures `main` has with the patch too (#530 ×2, #676, #890 ×2, e2e, `pls_quota` #810, `predication_e2e` #1272). **Not tested** - A retail title. NVIDIA. GE-Proton's vkd3d-proton. - Anything that needs game files: no `XCL_SAMPLE_*` was set, so the tests that read them (about 66) pass without running. **AI use** - Claude Code (Claude Opus 5.5) built the vkd3d-proton variants, ran the tests and wrote this report; I checked the results. --- **Update: retested at `6e94390`** (rebased on `main` `b7aa9f3`, same RX 6700 XT / RADV 26.3.1 / Proton Experimental Wine; `--test-threads=1`, compared per test with `main` `b7aa9f3` on the same build) | vkd3d-proton | `main` `b7aa9f3` | `6e94390` | |---|---|---| | v3.1, no XCL patch, `-Db_ndebug=true`, dxil-spirv `53aac418` | 717 passed, 53 failed | **760 passed, 12 failed**: 41 fixed, 0 new | | v3.1 + #257's patch (same build otherwise) | 761 / 9 | 763 / 9, no new failure | | Proton Experimental's own (asserts on) | aborts (`d3d12_heap_vtbl`, `d3d12_root_signature_vtbl`) | the same; #1395's part | - The chain is gone. `--exact gpu_sparse_vram_descriptors_buffers_and_xmem gpu_valu_float_and_int` passes 3/3, and all 14 `gpu::recomp` tests after it pass in the full run. - On the unpatched build, the 12 failures left are the same 9 `main` has with #257's patch, plus the #718 trio (`title_textures` ×2, `vram::d32s8`). That trio fails in about 2/5 runs here on `main` too. So with this PR, the unpatched `-Db_ndebug` build reaches parity with the patched one in the test suite. - Not tested: #867 + #1395 together (once #1395's `UnadoptGuard` condition is in). A retail title.
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:10Z.


Rebased onto main (930e8b4) at 46944c2 and fixed the rebase crashes reported by @SlopTart, @freemanovec, @sander110419, and @TobiasFornell:

  • Root cause of the late_release / alloc_pool / vkd3d_realloc: Out of memory / exit-5 crashes: dev_create_fence was returning a 16-byte FenceProxy to XCL's own internal CreateFence calls (late_release, alloc_pool, etc.), which then signalled un-adopted internal queues like sparse::queue() with a FenceProxy so vkd3d-proton cast the proxy struct as struct d3d12_fence. Fixed by adding real::create_raw_fence for XCL's internal fences and placing UnadoptGuard inside alloc_pool::reset_list closures, reset_pc_allocator, CreatePlacedResource/1, CreateRenderTargetView, and PSO parameters.
  • Stock Proton Experimental (assert-enabled vkd3d-proton): thanks @TobiasFornell for verifying that impl_from_ID3D12Heap1 also fires inside adopted objects' own methods; updated the PR description to state clearly that assertion-free vkd3d-proton (GE-Proton or -Db_ndebug=true) remains required for in-place adoption.
  • Verified on RX 9060 XT / GE-Proton11-14 (--test-threads=1): real:: 24/0, list_x:: 26/0, late_release:: 2/0, alloc_pool:: 3/0, gpu_sparse_vram_descriptors_buffers_and_xmem 1/0 (with DXC 1.9.2609.5, 0 skipped), plus a clean 60 s smoke run with late_release and alloc_pool enabled and VKD3D_CONFIG="". Thanks @fromthemoonx for the native Windows run as well.
<!-- greyfinch-sync:ivall/xcl:comment:7135681441 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/867#issuecomment-7135681441). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-24T15:14:10Z. --- Rebased onto `main` (`930e8b4`) at `46944c2` and fixed the rebase crashes reported by @SlopTart, @freemanovec, @sander110419, and @TobiasFornell: - **Root cause of the `late_release` / `alloc_pool` / `vkd3d_realloc: Out of memory` / exit-5 crashes:** `dev_create_fence` was returning a 16-byte `FenceProxy` to XCL's own internal `CreateFence` calls (`late_release`, `alloc_pool`, etc.), which then signalled un-adopted internal queues like `sparse::queue()` with a `FenceProxy` so `vkd3d-proton` cast the proxy struct as `struct d3d12_fence`. Fixed by adding `real::create_raw_fence` for XCL's internal fences and placing `UnadoptGuard` inside `alloc_pool::reset_list` closures, `reset_pc_allocator`, `CreatePlacedResource`/`1`, `CreateRenderTargetView`, and PSO parameters. - **Stock Proton Experimental (assert-enabled `vkd3d-proton`):** thanks @TobiasFornell for verifying that `impl_from_ID3D12Heap1` also fires inside adopted objects' own methods; updated the PR description to state clearly that assertion-free `vkd3d-proton` (`GE-Proton` or `-Db_ndebug=true`) remains required for in-place adoption. - **Verified on RX 9060 XT / GE-Proton11-14** (`--test-threads=1`): `real::` 24/0, `list_x::` 26/0, `late_release::` 2/0, `alloc_pool::` 3/0, `gpu_sparse_vram_descriptors_buffers_and_xmem` 1/0 (with DXC 1.9.2609.5, 0 skipped), plus a clean 60 s smoke run with `late_release` and `alloc_pool` enabled and `VKD3D_CONFIG=""`. Thanks @fromthemoonx for the native Windows run as well.
cmt8 commented 2026-11-24 16:07:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by cmt8 on 2026-11-24T15:47:15Z.


For the assert-only classes on stock release builds (heap, resource, descriptor heap, query heap, root signature, pipeline state, command signature), #1395 writes XCL's PC slots into vkd3d-proton's own tables, so those objects keep their vtable pointer. It complements this PR rather than replacing it. One thing for composing the two: UnadoptGuard::new needs to skip tables patched in place (for those, ext[-1] is not the native table), e.g. || in_place_original(*(obj as *const usize), 0).is_some(). Test table for this PR alone and both together on the official v3.1 DLLs is in #1395.

<!-- greyfinch-sync:ivall/xcl:comment:7136610361 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/867#issuecomment-7136610361). Originally posted by [cmt8](https://github.com/cmt8) on 2026-11-24T15:47:15Z. --- For the assert-only classes on stock release builds (heap, resource, descriptor heap, query heap, root signature, pipeline state, command signature), #1395 writes XCL's PC slots into vkd3d-proton's own tables, so those objects keep their vtable pointer. It complements this PR rather than replacing it. One thing for composing the two: `UnadoptGuard::new` needs to skip tables patched in place (for those, `ext[-1]` is not the native table), e.g. `|| in_place_original(*(obj as *const usize), 0).is_some()`. Test table for this PR alone and both together on the official v3.1 DLLs is in #1395.
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:11Z.


Rebased onto main (b7aa9f3) at 6e94390 and addressed the remaining review gap:

  • 14-test zero-read chain after gpu_sparse_vram_descriptors_buffers_and_xmem (@crastinator): root-caused and fixed. real::init() adopts the process-wide singleton ID3D12Device after runner::gpu() already created its un-adopted gpu.queue, so subsequent runner::gpu() tests created adopted command lists via the adopted device and submitted them directly to the un-adopted gpu.queue (bypassing q_execute_command_lists and UnadoptGuard). Added runner::submit_list using real::UnadoptGuard::new; --exact gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem gpu::recomp::tests::gpu_valu_float_and_int now passes 2/2 back-to-back on unmodified -Db_ndebug=true vkd3d-proton.
  • Composing with #1395 (@cmt8): thanks for the complementary in-place patching PR and the UnadoptGuard::new composition note (in_place_original(vt(obj) as usize, 0).is_some()). Noted #1395 in the PR description and happy to add that guard once #1395 lands (or compose cleanly in whichever order merges first).
  • Verified on RX 9060 XT / GE-Proton11-14 / vkd3d-proton ec20719452e916b (-Db_ndebug=true): real:: 29/0, list_x:: 26/0, late_release:: 2/0, alloc_pool:: 3/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, 10 frames shown / 18 PresentX, 0 crashes, 0 removals).
<!-- greyfinch-sync:ivall/xcl:comment:7138152424 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/867#issuecomment-7138152424). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-24T16:45:11Z. --- Rebased onto `main` (`b7aa9f3`) at `6e94390` and addressed the remaining review gap: - **14-test zero-read chain after `gpu_sparse_vram_descriptors_buffers_and_xmem` (@crastinator):** root-caused and fixed. `real::init()` adopts the process-wide singleton `ID3D12Device` *after* `runner::gpu()` already created its un-adopted `gpu.queue`, so subsequent `runner::gpu()` tests created adopted command lists via the adopted device and submitted them directly to the un-adopted `gpu.queue` (bypassing `q_execute_command_lists` and `UnadoptGuard`). Added `runner::submit_list` using `real::UnadoptGuard::new`; `--exact gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem gpu::recomp::tests::gpu_valu_float_and_int` now passes 2/2 back-to-back on unmodified `-Db_ndebug=true` `vkd3d-proton`. - **Composing with #1395 (@cmt8):** thanks for the complementary in-place patching PR and the `UnadoptGuard::new` composition note (`in_place_original(vt(obj) as usize, 0).is_some()`). Noted #1395 in the PR description and happy to add that guard once #1395 lands (or compose cleanly in whichever order merges first). - **Verified on RX 9060 XT / `GE-Proton11-14` / `vkd3d-proton ec20719452e916b` (`-Db_ndebug=true`):** `real::` 29/0, `list_x::` 26/0, `late_release::` 2/0, `alloc_pool::` 3/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`, `10` frames shown / `18` `PresentX`, `0` crashes, `0` removals).
crastinator commented 2026-11-24 17:06:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by crastinator on 2026-11-24T16:57:43Z.


@gustavsi thanks: retested 6e94390 on the RX 6700 XT. The chain is gone (the pair passes 3/3), and on the unpatched -Db_ndebug build it's now 760 passed / 12 failed against main's 717 / 53, with nothing new failing. Details in my review above (edited).

<!-- greyfinch-sync:ivall/xcl:comment:7138473768 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/867#issuecomment-7138473768). Originally posted by [crastinator](https://github.com/crastinator) on 2026-11-24T16:57:43Z. --- @gustavsi thanks: retested `6e94390` on the RX 6700 XT. The chain is gone (the pair passes 3/3), and on the unpatched `-Db_ndebug` build it's now 760 passed / 12 failed against `main`'s 717 / 53, with nothing new failing. Details in my review above (edited).
DavidM1911 commented 2026-11-25 10:10:42 +00:00 (Migrated from github.com)

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


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7159138440 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#issuecomment-7159138440). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T10:02:20Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
SzczepanGrela commented 2026-11-25 11:09:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SzczepanGrela on 2026-11-25T11:02:59Z.


Linux/RADV + Wine GPU test report on PR #867 head a4c5a82 (a4c5a8228688d6642a21aaee80eaed5653905164, local merge 6742e4cafbb7eea934512446b8bd603092cb9002 onto origin/main 568e7db7729c8fa6c8f0f4b32d798faaf11462bb; note that main later moved to c55ba167295333c81b7024a307e654ec818c475f and PR #867 currently shows CONFLICTING against live main).

Setup

  • OS/kernel: CachyOS Linux (7.3.0-5-cachyos)
  • GPU/driver: AMD Radeon RX 9070 (RADV GFX1201, native wave64) (device 0x7550, Vulkan 1.4.354, Mesa RADV 26.2.5-arch3.1)
  • Wine/DX: GE-Proton11-12 (wine-11.0 (Staging)), vkd3d-proton v3.1, DXVK dxgi.dll, DXC 1.9.2602.17 (21d28f72)
  • Build/env: rustc 1.97.1, cargo test --target x86_64-pc-windows-gnu --release --workspace --no-run (44.07s, exit 0, zero compiler warnings), XCL_REQUIRE_GPU=wave64 XCL_NETWORK=0

Results
Single-threaded unit runs and isolated module suites (cargo test --target x86_64-pc-windows-gnu --release -p xcl --lib ...):

  • hle::d3d12x::real::wine_vtable_tests: 2 passed, 0 failed, 0 ignored (0.06s, exit 0; both new tests unadopt_guard_restores_native_vtable_and_reapplies_extended_on_drop and fence_proxy_forwards_signal_unwraps_and_frees_on_final_release passed).
  • hle::d3d12x -- --test-threads=1: 178 passed, 1 failed, 2 ignored (6.61s, exit 101; failing hle::d3d12x::device_x::tests::gpu_depth_buffer_created_for_unordered_access_is_placed at crates/xcl/src/hle/d3d12x/device_x.rs:1126:13: UNORDERED_ACCESS without the UAV flag), vs baseline 568e7db abnormal exit (exit 5 inside execute_indirect_reads_the_arguments_written_before_it after 3 passed and 2 failed).
  • hle::d3d12x::real -- --test-threads=1: 48 passed, 0 failed, 0 ignored (1.04s, exit 0), vs baseline 568e7db 45 passed, 1 failed, 0 ignored (1.12s, exit 101; dma_list_release_cleans_up_list_state failed at crates/xcl/src/hle/d3d12x/real.rs:6752:120 with HRESULT(0x80070057)).
  • hle::d3d12x::list_x: 29 passed, 0 failed, 0 ignored (0.13s, exit 0), vs baseline 568e7db abnormal exit (exit 5 after 22 passed tests).
  • hle::d3d12x::alloc_pool: 3 passed, 0 failed, 0 ignored (0.15s, exit 0), vs baseline 568e7db 2 passed, 1 failed, 0 ignored (0.14s, exit 101; a_recording_outlives_the_reset_of_the_titles_allocator failed with HRESULT(0x80070057) at crates/xcl/src/hle/d3d12x/alloc_pool.rs:386:122).
  • hle::d3d12x::bind: 6 passed, 0 failed, 0 ignored (0.16s, exit 0), vs baseline 568e7db 4 passed, 2 failed, 0 ignored (0.15s, exit 101; create_list_reset_and_clear_state_track_initial_pso_on_d3d12 and execute_indirect_reads_the_arguments_written_before_it failed with HRESULT(0x80070057)).
  • hle::d3d12x::title_textures -- --test-threads=1: 14 passed, 0 failed, 0 ignored (5.44s, exit 0), vs baseline 568e7db 11 passed, 3 failed, 0 ignored (1.21s, exit 101).
  • hle::d3d12x::device_x: 7 passed, 1 failed, 0 ignored (0.07s, exit 101; gpu_depth_buffer_created_for_unordered_access_is_placed), matching baseline 568e7db 7 passed, 1 failed, 0 ignored (0.07s, exit 101).
  • hle::d3d12x remaining single-module runs: late_release 2 passed, 0 failed, 0 ignored (0.19s, vs baseline 2/0/0), cpu_writes 2 passed, 0 failed, 0 ignored (0.14s, vs baseline 2/0/0), title_list 1 passed, 0 failed, 0 ignored (0.06s, vs baseline 1/0/0), fence_x 1 passed, 0 failed, 0 ignored (0.09s, vs baseline 1/0/0), pso_async 6 passed, 0 failed, 0 ignored (0.61s, vs baseline 6/0/0), sparse 15 passed, 0 failed, 1 ignored (0.25s, early_commit_timing ignored, vs baseline 15/0/1), vram 11 passed, 0 failed, 1 ignored (2.26s, churn_update_tile_mappings_timing ignored).
  • gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem -- --exact: 1 passed, 0 failed, 0 ignored (0.38s, exit 0), vs baseline 568e7db 0 passed, 1 failed, 0 ignored (0.27s, exit 101; HRESULT(0x80070057) at crates/xcl/src/gpu/recomp/tests.rs:4116:124).
  • gpu::recomp::tests::gpu_ -- --test-threads=1 (no skips): 102 passed, 1 failed, 1 ignored (4.58s, exit 101; failing gpu_nonfused_mad_and_mac_prevent_fma_contraction at crates/xcl/src/gpu/recomp/tests.rs:7747:5), vs baseline 568e7db 83 passed, 20 failed, 1 ignored (4.08s, exit 101; 19 HRESULT(0x80070057) failures starting at gpu_sparse_vram_descriptors_buffers_and_xmem).

Parallel hle::d3d12x runs:

  • hle::d3d12x -- --test-threads=4: abnormal exit (exit status: 5) in 3 of 3 runs (2 without --nocapture, 1 with --nocapture), exiting right after xcl: D3D12.X: ID3D12GraphicsCommandList10 (86 PC methods, 0 internal slots under the guard, +64 stubs), vs baseline 568e7db 156 passed, 21 failed, 2 ignored (1.63s, exit 101).
  • hle::d3d12x::title_textures (default parallel): 12 passed, 2 failed, 0 ignored (3.52s, exit 101; placed_title_textures_share_vram_and_preserve_pixels panicked at crates/xcl/src/hle/d3d12x/title_textures.rs:1948:21: assertion left == right failed: cubemap extra_pages must be reused at same va, left: 2555904, right: 17170432, and transitions_apply_when_their_list_is_submitted panicked at crates/xcl/src/hle/d3d12x/title_textures.rs:1488:39 with PoisonError), vs baseline 568e7db 11 passed, 3 failed, 0 ignored (0.98s, exit 101).

Integration binaries (cargo test --target x86_64-pc-windows-gnu --release --test <name>):

  • d3d12_resource_and_sync -- --test-threads=1 --nocapture: 3 passed, 0 failed, 0 ignored (0.51s, exit 0), vs baseline 568e7db --test-threads=1 2 passed, 1 failed, 0 ignored (0.26s, exit 101; fence_and_command_queue_sync_timing_and_allocator_reset_match_host_and_console failed with HRESULT(0x80070057) at crates/xcl/tests/d3d12_resource_and_sync.rs:481:118).
  • d3d12_resource_and_sync (default parallel, 3 runs): Run 1 and Run 3 aborted (exit status: 1, double free or corruption (out)) after resource_map_unmap_write_and_gpu_va_match_host_and_console_contracts and descriptor_heap_console_start_handles_match_host_and_console_heap passed; Run 2 passed 3 passed, 0 failed, 0 ignored (4.69s, exit 0), vs baseline 568e7db 2 passed, 1 failed, 0 ignored (0.25s, exit 101).
  • sparse_reinit: 1 passed, 0 failed, 0 ignored (0.56s, exit 0), vs baseline 568e7db 0 passed, 1 failed, 0 ignored (0.27s, exit 101; HRESULT(0x80070057) at crates/xcl/tests/sparse_reinit.rs:38:9).
  • gpu_compute_e2e: 3 passed, 1 failed, 0 ignored (1.41s, exit 101; console_wave64_compute_through_the_pso_hook_dispatch_and_read_back passed; heap_window_out_of_memory_falls_back_to_the_switch_form panicked at crates/xcl/src/gpu/recomp/runner.rs:628:9: no heap windows, but XCL_REQUIRE_GPU=wave64), vs baseline 568e7db 2 passed, 2 failed, 0 ignored (1.03s, exit 101, where console_wave64_compute_through_the_pso_hook_dispatch_and_read_back also failed with 0x80070057).
  • predication_e2e: 0 passed, 1 failed, 0 ignored (0.52s, exit 101; set_predication_buffer_state_and_kickoff panicked at crates/xcl/tests/predication_e2e.rs:360:9: assertion left == right failed: EQUAL_ZERO(0) must skip dst[0], left: 2863267840, right: 286331153), vs baseline 568e7db 0 passed, 1 failed, 0 ignored (0.25s, exit 101; panicked earlier at crates/xcl/tests/predication_e2e.rs:308:14: CreateCommandList: Error { code: HRESULT(0x80070057), message: "Invalid parameter." }).
  • gpu_pso_e2e: 7 passed, 0 failed, 0 ignored (0.26s, exit 0), matching baseline 568e7db 7 passed, 0 failed, 0 ignored (0.26s, exit 0).
  • texture_states: 1 passed, 0 failed, 0 ignored (0.00s, exit 0), matching baseline 568e7db 1 passed, 0 failed, 0 ignored (0.00s, exit 0).
  • console_dlls_e2e: 13 passed, 0 failed, 0 ignored (0.00s, exit 0), matching baseline 568e7db 13 passed, 0 failed, 0 ignored (0.00s, exit 0).

Not tested

  • No retail game workload and no scripts/smoke.ps1 (no retail title files locally).
  • XCL_HEAP_WINDOWS=1 (left unset; heap_window_out_of_memory_falls_back_to_the_switch_form failed with no heap windows, but XCL_REQUIRE_GPU=wave64 as on baseline 568e7db).
  • gpu::dxil, XCL_DIRECT_DXIL / XCL_SPLIT_WAVE64 sweeps, and --lib / --test targets outside those listed above.

AI use

  • Diff audit, test execution, and comment drafting used Antigravity (Gemini 4 Neon) multi-agent verification, reviewed by me before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7160518737 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#issuecomment-7160518737). Originally posted by [SzczepanGrela](https://github.com/SzczepanGrela) on 2026-11-25T11:02:59Z. --- Linux/RADV + Wine GPU test report on PR `#867` head `a4c5a82` (`a4c5a8228688d6642a21aaee80eaed5653905164`, local merge `6742e4cafbb7eea934512446b8bd603092cb9002` onto `origin/main` `568e7db7729c8fa6c8f0f4b32d798faaf11462bb`; note that `main` later moved to `c55ba167295333c81b7024a307e654ec818c475f` and PR `#867` currently shows `CONFLICTING` against live `main`). **Setup** - OS/kernel: CachyOS Linux (`7.3.0-5-cachyos`) - GPU/driver: `AMD Radeon RX 9070 (RADV GFX1201, native wave64)` (device `0x7550`, Vulkan `1.4.354`, Mesa RADV `26.2.5-arch3.1`) - Wine/DX: `GE-Proton11-12` (`wine-11.0 (Staging)`), `vkd3d-proton v3.1`, DXVK `dxgi.dll`, DXC `1.9.2602.17` (`21d28f72`) - Build/env: `rustc 1.97.1`, `cargo test --target x86_64-pc-windows-gnu --release --workspace --no-run` (44.07s, exit `0`, zero compiler warnings), `XCL_REQUIRE_GPU=wave64 XCL_NETWORK=0` **Results** Single-threaded unit runs and isolated module suites (`cargo test --target x86_64-pc-windows-gnu --release -p xcl --lib ...`): - `hle::d3d12x::real::wine_vtable_tests`: **2 passed, 0 failed, 0 ignored** (0.06s, exit `0`; both new tests `unadopt_guard_restores_native_vtable_and_reapplies_extended_on_drop` and `fence_proxy_forwards_signal_unwraps_and_frees_on_final_release` passed). - `hle::d3d12x -- --test-threads=1`: **178 passed, 1 failed, 2 ignored** (6.61s, exit `101`; failing `hle::d3d12x::device_x::tests::gpu_depth_buffer_created_for_unordered_access_is_placed` at `crates/xcl/src/hle/d3d12x/device_x.rs:1126:13`: `UNORDERED_ACCESS without the UAV flag`), vs baseline `568e7db` **abnormal exit** (exit `5` inside `execute_indirect_reads_the_arguments_written_before_it` after 3 passed and 2 failed). - `hle::d3d12x::real -- --test-threads=1`: **48 passed, 0 failed, 0 ignored** (1.04s, exit `0`), vs baseline `568e7db` **45 passed, 1 failed, 0 ignored** (1.12s, exit `101`; `dma_list_release_cleans_up_list_state` failed at `crates/xcl/src/hle/d3d12x/real.rs:6752:120` with `HRESULT(0x80070057)`). - `hle::d3d12x::list_x`: **29 passed, 0 failed, 0 ignored** (0.13s, exit `0`), vs baseline `568e7db` **abnormal exit** (exit `5` after 22 passed tests). - `hle::d3d12x::alloc_pool`: **3 passed, 0 failed, 0 ignored** (0.15s, exit `0`), vs baseline `568e7db` **2 passed, 1 failed, 0 ignored** (0.14s, exit `101`; `a_recording_outlives_the_reset_of_the_titles_allocator` failed with `HRESULT(0x80070057)` at `crates/xcl/src/hle/d3d12x/alloc_pool.rs:386:122`). - `hle::d3d12x::bind`: **6 passed, 0 failed, 0 ignored** (0.16s, exit `0`), vs baseline `568e7db` **4 passed, 2 failed, 0 ignored** (0.15s, exit `101`; `create_list_reset_and_clear_state_track_initial_pso_on_d3d12` and `execute_indirect_reads_the_arguments_written_before_it` failed with `HRESULT(0x80070057)`). - `hle::d3d12x::title_textures -- --test-threads=1`: **14 passed, 0 failed, 0 ignored** (5.44s, exit `0`), vs baseline `568e7db` **11 passed, 3 failed, 0 ignored** (1.21s, exit `101`). - `hle::d3d12x::device_x`: **7 passed, 1 failed, 0 ignored** (0.07s, exit `101`; `gpu_depth_buffer_created_for_unordered_access_is_placed`), matching baseline `568e7db` **7 passed, 1 failed, 0 ignored** (0.07s, exit `101`). - `hle::d3d12x` remaining single-module runs: `late_release` **2 passed, 0 failed, 0 ignored** (0.19s, vs baseline 2/0/0), `cpu_writes` **2 passed, 0 failed, 0 ignored** (0.14s, vs baseline 2/0/0), `title_list` **1 passed, 0 failed, 0 ignored** (0.06s, vs baseline 1/0/0), `fence_x` **1 passed, 0 failed, 0 ignored** (0.09s, vs baseline 1/0/0), `pso_async` **6 passed, 0 failed, 0 ignored** (0.61s, vs baseline 6/0/0), `sparse` **15 passed, 0 failed, 1 ignored** (0.25s, `early_commit_timing` ignored, vs baseline 15/0/1), `vram` **11 passed, 0 failed, 1 ignored** (2.26s, `churn_update_tile_mappings_timing` ignored). - `gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem -- --exact`: **1 passed, 0 failed, 0 ignored** (0.38s, exit `0`), vs baseline `568e7db` **0 passed, 1 failed, 0 ignored** (0.27s, exit `101`; `HRESULT(0x80070057)` at `crates/xcl/src/gpu/recomp/tests.rs:4116:124`). - `gpu::recomp::tests::gpu_ -- --test-threads=1` (no skips): **102 passed, 1 failed, 1 ignored** (4.58s, exit `101`; failing `gpu_nonfused_mad_and_mac_prevent_fma_contraction` at `crates/xcl/src/gpu/recomp/tests.rs:7747:5`), vs baseline `568e7db` **83 passed, 20 failed, 1 ignored** (4.08s, exit `101`; 19 `HRESULT(0x80070057)` failures starting at `gpu_sparse_vram_descriptors_buffers_and_xmem`). Parallel `hle::d3d12x` runs: - `hle::d3d12x -- --test-threads=4`: **abnormal exit (`exit status: 5`) in 3 of 3 runs** (2 without `--nocapture`, 1 with `--nocapture`), exiting right after `xcl: D3D12.X: ID3D12GraphicsCommandList10` (`86 PC methods, 0 internal slots under the guard, +64 stubs`), vs baseline `568e7db` **156 passed, 21 failed, 2 ignored** (1.63s, exit `101`). - `hle::d3d12x::title_textures` (default parallel): **12 passed, 2 failed, 0 ignored** (3.52s, exit `101`; `placed_title_textures_share_vram_and_preserve_pixels` panicked at `crates/xcl/src/hle/d3d12x/title_textures.rs:1948:21`: `assertion left == right failed: cubemap extra_pages must be reused at same va`, `left: 2555904, right: 17170432`, and `transitions_apply_when_their_list_is_submitted` panicked at `crates/xcl/src/hle/d3d12x/title_textures.rs:1488:39` with `PoisonError`), vs baseline `568e7db` **11 passed, 3 failed, 0 ignored** (0.98s, exit `101`). Integration binaries (`cargo test --target x86_64-pc-windows-gnu --release --test <name>`): - `d3d12_resource_and_sync -- --test-threads=1 --nocapture`: **3 passed, 0 failed, 0 ignored** (0.51s, exit `0`), vs baseline `568e7db` `--test-threads=1` **2 passed, 1 failed, 0 ignored** (0.26s, exit `101`; `fence_and_command_queue_sync_timing_and_allocator_reset_match_host_and_console` failed with `HRESULT(0x80070057)` at `crates/xcl/tests/d3d12_resource_and_sync.rs:481:118`). - `d3d12_resource_and_sync` (default parallel, 3 runs): Run 1 and Run 3 **aborted (`exit status: 1`, `double free or corruption (out)`)** after `resource_map_unmap_write_and_gpu_va_match_host_and_console_contracts` and `descriptor_heap_console_start_handles_match_host_and_console_heap` passed; Run 2 passed **3 passed, 0 failed, 0 ignored** (4.69s, exit `0`), vs baseline `568e7db` **2 passed, 1 failed, 0 ignored** (0.25s, exit `101`). - `sparse_reinit`: **1 passed, 0 failed, 0 ignored** (0.56s, exit `0`), vs baseline `568e7db` **0 passed, 1 failed, 0 ignored** (0.27s, exit `101`; `HRESULT(0x80070057)` at `crates/xcl/tests/sparse_reinit.rs:38:9`). - `gpu_compute_e2e`: **3 passed, 1 failed, 0 ignored** (1.41s, exit `101`; `console_wave64_compute_through_the_pso_hook_dispatch_and_read_back` passed; `heap_window_out_of_memory_falls_back_to_the_switch_form` panicked at `crates/xcl/src/gpu/recomp/runner.rs:628:9`: `no heap windows, but XCL_REQUIRE_GPU=wave64`), vs baseline `568e7db` **2 passed, 2 failed, 0 ignored** (1.03s, exit `101`, where `console_wave64_compute_through_the_pso_hook_dispatch_and_read_back` also failed with `0x80070057`). - `predication_e2e`: **0 passed, 1 failed, 0 ignored** (0.52s, exit `101`; `set_predication_buffer_state_and_kickoff` panicked at `crates/xcl/tests/predication_e2e.rs:360:9`: `assertion left == right failed: EQUAL_ZERO(0) must skip dst[0]`, `left: 2863267840, right: 286331153`), vs baseline `568e7db` **0 passed, 1 failed, 0 ignored** (0.25s, exit `101`; panicked earlier at `crates/xcl/tests/predication_e2e.rs:308:14`: `CreateCommandList: Error { code: HRESULT(0x80070057), message: "Invalid parameter." }`). - `gpu_pso_e2e`: **7 passed, 0 failed, 0 ignored** (0.26s, exit `0`), matching baseline `568e7db` **7 passed, 0 failed, 0 ignored** (0.26s, exit `0`). - `texture_states`: **1 passed, 0 failed, 0 ignored** (0.00s, exit `0`), matching baseline `568e7db` **1 passed, 0 failed, 0 ignored** (0.00s, exit `0`). - `console_dlls_e2e`: **13 passed, 0 failed, 0 ignored** (0.00s, exit `0`), matching baseline `568e7db` **13 passed, 0 failed, 0 ignored** (0.00s, exit `0`). **Not tested** - No retail game workload and no `scripts/smoke.ps1` (no retail title files locally). - `XCL_HEAP_WINDOWS=1` (left unset; `heap_window_out_of_memory_falls_back_to_the_switch_form` failed with `no heap windows, but XCL_REQUIRE_GPU=wave64` as on baseline `568e7db`). - `gpu::dxil`, `XCL_DIRECT_DXIL` / `XCL_SPLIT_WAVE64` sweeps, and `--lib` / `--test` targets outside those listed above. **AI use** - Diff audit, test execution, and comment drafting used Antigravity (Gemini 4 Neon) multi-agent verification, reviewed by me before posting.
SzczepanGrela commented 2026-11-25 12:06:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SzczepanGrela on 2026-11-25T12:01:55Z.


Follow-up root cause analysis for the two parallel crashes reported above on PR #867 (a4c5a82):

  1. hle::d3d12x -- --test-threads=4 (exit status: 5): missing UnadoptGuard in crates/xcl/src/hle/d3d12x/alloc_pool.rs
  • WINEDEBUG=-all,+seh,+loaddll + llvm-symbolizer catches 0xC0000005 reading 0x2a80 at d3d12core.dll+0x476990 (d3d12_command_queue_ExecuteCommandLists vtable check trap: rdx holds XCL's heap vtable instead of d3d12core.dll+0x484fc0), called from alloc_pool::tests::a_recording_outlives_the_reset_of_the_titles_allocator at alloc_pool.rs:404.
  • Same process-wide singleton ID3D12Device adoption race already handled in runner.rs::submit_list: alloc_pool.rs:380 creates an unadopted queue, another parallel test adopts the singleton device before alloc_pool.rs:388 creates an adopted list (and alloc_pool.rs:394 can create a FenceProxy), and queue.ExecuteCommandLists(&lists) at lines 404, 413, and 426 submits the adopted list directly to the raw queue without UnadoptGuard.
  • Locally wrapping those three queue.ExecuteCommandLists(&lists) calls with UnadoptGuard::new(l) and creating fence via real::create_raw_fence(&dev) fixed the exit status: 5 crash 5/5 (a_recording_outlives_the_reset_of_the_titles_allocator ... ok 5/5). (The remaining 7 extra failures under --test-threads=4 are a separate parallel-test VirtualFree vs check_uma_import radv/amdgpu -14 CS rejection from coherent_buffer_sanitizes_console_flags_and_state, unrelated to this PR.)
  1. d3d12_resource_and_sync parallel (double free or corruption (out)): upstream vkd3d-proton UAF, not a PR #867 regression
  • Pair bisection reproduces 3/3 on resource_map + fence_and_command_queue (0/3 on the other two pairs), and still reproduces with XCL_LATE_RELEASE=0.
  • gdb + WINEDEBUG=-all,+vulkan show the exact same VkImage handle (wb_tex from crates/xcl/tests/d3d12_resource_and_sync.rs:271-277) destroyed twice via vkDestroyImage: first on the resource_map thread when wb_tex drops, then again on vkd3d_memory_transfer_queue_run_thread after vkWaitSemaphores.
  • In vkd3d-proton (libs/vkd3d/resource.c:2776 -> libs/vkd3d/memory.c:625-641, tested at 8293130eb and still present on upstream master ec20719452), vkd3d_memory_transfer_queue_write_subresource queues a raw transfer.resource pointer without calling d3d12_resource_incref until vkd3d_memory_transfer_queue_flush_locked (memory.c:475). When resource_map drops wb_tex before fence_and_command_queue calls ExecuteCommandLists, the flush dereferences the freed d3d12_resource, bumps its freed internal_refcount, and queues a second d3d12_resource_destroy / vkDestroyImage.
  • This did not trigger on main 568e7db only because fence_and_command_queue failed earlier at CreateCommandList (0x80070057) before reaching ExecuteCommandLists, and did not trigger under --test-threads=1 because resource_map runs last alphabetically.

Not tested

  • No retail game workload and no scripts/smoke.ps1.
  • Did not test whether other hle::d3d12x unit tests with raw queue.ExecuteCommandLists (bind.rs, title_textures.rs, vram.rs) can hit the same singleton adoption race under different thread interleavings.

AI use

  • Crash capture, disassembly, upstream source inspection, local patch verification, and drafting used Antigravity (Gemini 4 Neon), reviewed by me before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7161826625 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#issuecomment-7161826625). Originally posted by [SzczepanGrela](https://github.com/SzczepanGrela) on 2026-11-25T12:01:55Z. --- Follow-up root cause analysis for the two parallel crashes reported above on PR `#867` (`a4c5a82`): 1. `hle::d3d12x -- --test-threads=4` (`exit status: 5`): missing `UnadoptGuard` in `crates/xcl/src/hle/d3d12x/alloc_pool.rs` - `WINEDEBUG=-all,+seh,+loaddll` + `llvm-symbolizer` catches `0xC0000005` reading `0x2a80` at `d3d12core.dll+0x476990` (`d3d12_command_queue_ExecuteCommandLists` vtable check trap: `rdx` holds XCL's heap vtable instead of `d3d12core.dll+0x484fc0`), called from `alloc_pool::tests::a_recording_outlives_the_reset_of_the_titles_allocator` at `alloc_pool.rs:404`. - Same process-wide singleton `ID3D12Device` adoption race already handled in `runner.rs::submit_list`: `alloc_pool.rs:380` creates an unadopted `queue`, another parallel test adopts the singleton device before `alloc_pool.rs:388` creates an adopted `list` (and `alloc_pool.rs:394` can create a `FenceProxy`), and `queue.ExecuteCommandLists(&lists)` at lines `404`, `413`, and `426` submits the adopted `list` directly to the raw `queue` without `UnadoptGuard`. - Locally wrapping those three `queue.ExecuteCommandLists(&lists)` calls with `UnadoptGuard::new(l)` and creating `fence` via `real::create_raw_fence(&dev)` fixed the `exit status: 5` crash 5/5 (`a_recording_outlives_the_reset_of_the_titles_allocator ... ok` 5/5). (The remaining 7 extra failures under `--test-threads=4` are a separate parallel-test `VirtualFree` vs `check_uma_import` `radv/amdgpu` `-14` CS rejection from `coherent_buffer_sanitizes_console_flags_and_state`, unrelated to this PR.) 2. `d3d12_resource_and_sync` parallel (`double free or corruption (out)`): upstream `vkd3d-proton` UAF, not a PR `#867` regression - Pair bisection reproduces 3/3 on `resource_map` + `fence_and_command_queue` (`0/3` on the other two pairs), and still reproduces with `XCL_LATE_RELEASE=0`. - `gdb` + `WINEDEBUG=-all,+vulkan` show the exact same `VkImage` handle (`wb_tex` from `crates/xcl/tests/d3d12_resource_and_sync.rs:271-277`) destroyed twice via `vkDestroyImage`: first on the `resource_map` thread when `wb_tex` drops, then again on `vkd3d_memory_transfer_queue_run_thread` after `vkWaitSemaphores`. - In `vkd3d-proton` (`libs/vkd3d/resource.c:2776` -> `libs/vkd3d/memory.c:625-641`, tested at `8293130eb` and still present on upstream `master` `ec20719452`), `vkd3d_memory_transfer_queue_write_subresource` queues a raw `transfer.resource` pointer without calling `d3d12_resource_incref` until `vkd3d_memory_transfer_queue_flush_locked` (`memory.c:475`). When `resource_map` drops `wb_tex` before `fence_and_command_queue` calls `ExecuteCommandLists`, the flush dereferences the freed `d3d12_resource`, bumps its freed `internal_refcount`, and queues a second `d3d12_resource_destroy` / `vkDestroyImage`. - This did not trigger on `main` `568e7db` only because `fence_and_command_queue` failed earlier at `CreateCommandList` (`0x80070057`) before reaching `ExecuteCommandLists`, and did not trigger under `--test-threads=1` because `resource_map` runs last alphabetically. **Not tested** - No retail game workload and no `scripts/smoke.ps1`. - Did not test whether other `hle::d3d12x` unit tests with raw `queue.ExecuteCommandLists` (`bind.rs`, `title_textures.rs`, `vram.rs`) can hit the same singleton adoption race under different thread interleavings. **AI use** - Crash capture, disassembly, upstream source inspection, local patch verification, and drafting used Antigravity (Gemini 4 Neon), reviewed by me before posting.
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:53Z.


Thanks @SzczepanGrela for pinning the exact parallel alloc_pool crash and @DavidM1911 for the Windows verification!

Rebased onto main (06c9f55) at 7a4954c:

  • Wrapped the three raw queue.ExecuteCommandLists calls in alloc_pool::tests::a_recording_outlives_the_reset_of_the_titles_allocator (and the new list_x::tests::reset_while_the_last_submit_runs test) with UnadoptGuard::new, and switched their test fences plus vram::Pages::retire_fence and sparse::State fences to real::create_raw_fence.
  • Verified on RX 9060 XT / GE-Proton11-14: alloc_pool:: --test-threads=4 passes 3/3 (4/0 each), list_x:: 34/0, real:: 58/0, gpu_sparse_vram_descriptors_buffers_and_xmem + gpu_valu_float_and_int 2/0, plus a fresh 60 s smoke run (exit: 0x0, 20 frames, 0 crashes, 0 removals).
<!-- greyfinch-sync:ivall/xcl:comment:7166699273 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#issuecomment-7166699273). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-25T15:20:53Z. --- Thanks @SzczepanGrela for pinning the exact parallel `alloc_pool` crash and @DavidM1911 for the Windows verification! Rebased onto `main` (`06c9f55`) at `7a4954c`: - Wrapped the three raw `queue.ExecuteCommandLists` calls in `alloc_pool::tests::a_recording_outlives_the_reset_of_the_titles_allocator` (and the new `list_x::tests::reset_while_the_last_submit_runs` test) with `UnadoptGuard::new`, and switched their test fences plus `vram::Pages::retire_fence` and `sparse::State` fences to `real::create_raw_fence`. - Verified on RX 9060 XT / `GE-Proton11-14`: `alloc_pool:: --test-threads=4` passes 3/3 (4/0 each), `list_x::` 34/0, `real::` 58/0, `gpu_sparse_vram_descriptors_buffers_and_xmem` + `gpu_valu_float_and_int` 2/0, plus a fresh 60 s smoke run (`exit: 0x0`, `20` frames, `0` crashes, `0` removals).
omrih4 commented 2026-11-25 18:04:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by omrih4 on 2026-11-25T17:20:34Z.


can confirm proton-cachyos on main crashes, successfully starts up with this pr rebased on top of it

<!-- greyfinch-sync:ivall/xcl:comment:7169364477 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#issuecomment-7169364477). Originally posted by [omrih4](https://github.com/omrih4) on 2026-11-25T17:20:34Z. --- can confirm proton-cachyos on main crashes, successfully starts up with this pr rebased on top of it
pickles976 commented 2026-11-25 18:16:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-25T18:16:07Z.


#1395 is now closed unmerged (the author explicitly permitted reuse), so this PR is again the active upstream path for Wine/vkd3d object compatibility. One current consequence: exact #877 head aec41e2 + this head 7a4954c still aborts at its first sparse heap on stock assertion-enabled vkd3d-proton 3.2:

Assertion failed: iface->lpVtbl == &d3d12_heap_vtbl, .../vkd3d_private.h, line 1077

Verified on RTX 4060 Laptop / NVIDIA 590.48.1; #877 sparse tests pass 16/0/1, but the retail title exits 3 after 4.13 s. The in-place native-vtable implementation from closed #1395 gets this same machine past that heap when stacked with this PR. Since #1395 will not land independently, folding or succeeding its permitted implementation is now necessary for this PR's heap/resource half to work with release assertions enabled.

Full exact-head report: https://github.com/xcl-dev/xcl/pull/877#issuecomment-7170504083

26 November follow-through: current stacked head verified offscreen

The old-head result above is historical. Current #2477 a970ef38a57d72a642e5f7994b35fea968c17a15 directly on this PR at d9e6ad51baaad5421a794ca39c0560d1edd28421 passed 12 selected fixtures on this RTX 4060 Laptop/Wine host: 6 concurrency/proxy, 4 allocator, and the same-process sparse-XMem → VALU GPU pair. Hardware legs loaded app-local stock assertion-enabled vkd3d 2576c0b4adfae4a, verified by loader paths and hashes; installed diagnostic DLLs were not replaced. Local changes were test-only assertion strengthening. Full commands, caveats and evidence: https://github.com/xcl-dev/xcl/pull/2477#issuecomment-7206090009

This clears those selected stock-vkd3d paths, not the whole suite or our separate Game-Init stalled fence. No title run or gameplay claim. AI-assisted verification/report: omp, OpenAI GPT-6 Astra.

<!-- greyfinch-sync:ivall/xcl:comment:7170675422 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#issuecomment-7170675422). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-25T18:16:07Z. --- #1395 is now closed unmerged (the author explicitly permitted reuse), so this PR is again the active upstream path for Wine/vkd3d object compatibility. One current consequence: exact #877 head `aec41e2` + this head `7a4954c` still aborts at its first sparse heap on stock assertion-enabled vkd3d-proton 3.2: ```text Assertion failed: iface->lpVtbl == &d3d12_heap_vtbl, .../vkd3d_private.h, line 1077 ``` Verified on RTX 4060 Laptop / NVIDIA 590.48.1; #877 sparse tests pass 16/0/1, but the retail title exits 3 after 4.13 s. The in-place native-vtable implementation from closed #1395 gets this same machine past that heap when stacked with this PR. Since #1395 will not land independently, folding or succeeding its permitted implementation is now necessary for this PR's heap/resource half to work with release assertions enabled. Full exact-head report: https://github.com/xcl-dev/xcl/pull/877#issuecomment-7170504083 ### 26 November follow-through: current stacked head verified offscreen The old-head result above is historical. Current #2477 `a970ef38a57d72a642e5f7994b35fea968c17a15` directly on this PR at `d9e6ad51baaad5421a794ca39c0560d1edd28421` passed 12 selected fixtures on this RTX 4060 Laptop/Wine host: 6 concurrency/proxy, 4 allocator, and the same-process sparse-XMem → VALU GPU pair. Hardware legs loaded app-local **stock assertion-enabled vkd3d `2576c0b4adfae4a`**, verified by loader paths and hashes; installed diagnostic DLLs were not replaced. Local changes were test-only assertion strengthening. Full commands, caveats and evidence: https://github.com/xcl-dev/xcl/pull/2477#issuecomment-7206090009 This clears those selected stock-vkd3d paths, not the whole suite or our separate Game-Init stalled fence. No title run or gameplay claim. AI-assisted verification/report: omp, OpenAI GPT-6 Astra.
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:37Z.


Thanks @omrih4 for confirming startup on proton-cachyos and @pickles976 for testing against stock assertion-enabled vkd3d-proton 3.2!

Rebased onto main (2898511) at c79e3b3:

  • Switched the new internal fence sites from #2275 (vram::RetireQueue) and #2345 (sparse::State::note_queue) to real::create_raw_fence, and guarded the KickoffX split-segment prior flush with UnadoptGuard::new.
  • To keep this PR focused and under ~400 lines while replacing closed #1395 for assertion-enabled vkd3d-proton builds, I opened #2477 stacked on this PR carrying @cmt8's permitted in-place vtable patching with the UnadoptGuard::new guard.
  • Verified with fresh Proton tests and a 60 s pwsh ./scripts/smoke.ps1 run (exit: 0x0, 20 frames, 0 crashes, 0 removals).
<!-- greyfinch-sync:ivall/xcl:comment:7172686086 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#issuecomment-7172686086). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-25T19:43:37Z. --- Thanks @omrih4 for confirming startup on proton-cachyos and @pickles976 for testing against stock assertion-enabled vkd3d-proton 3.2! Rebased onto `main` (`2898511`) at `c79e3b3`: - Switched the new internal fence sites from #2275 (`vram::RetireQueue`) and #2345 (`sparse::State::note_queue`) to `real::create_raw_fence`, and guarded the `KickoffX` split-segment `prior` flush with `UnadoptGuard::new`. - To keep this PR focused and under ~400 lines while replacing closed #1395 for assertion-enabled vkd3d-proton builds, I opened #2477 stacked on this PR carrying @cmt8's permitted in-place vtable patching with the `UnadoptGuard::new` guard. - Verified with fresh Proton tests and a 60 s `pwsh ./scripts/smoke.ps1` run (`exit: 0x0`, `20` frames, `0` crashes, `0` removals).
bmjask commented 2026-11-25 21:00:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T21:00:32Z.

Review: COMMENTED


P1 concurrency hole: UnadoptGuard temporarily publishes a native vtable on a shared adopted object. A new concurrent COM call starting during that window dispatches directly to d3d12core and bypasses XCL hooks; e.g. cl_set_pipeline_state unadopts a PSO while concurrent Release can bypass pso_release async/DRED/lifetime bookkeeping. orig_fn only protects a hook already entered before the swap, not calls loading native table afterward. Add synchronization/proxying or prove a no-concurrent-use invariant, with a guard-vs-new-hook-call regression. Current head also lacks visible Windows CI.

<!-- greyfinch-sync:ivall/xcl:review:6064916395 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#pullrequestreview-6064916395). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-25T21:00:32Z. **Review:** COMMENTED --- P1 concurrency hole: UnadoptGuard temporarily publishes a native vtable on a shared adopted object. A new concurrent COM call starting during that window dispatches directly to d3d12core and bypasses XCL hooks; e.g. cl_set_pipeline_state unadopts a PSO while concurrent Release can bypass pso_release async/DRED/lifetime bookkeeping. orig_fn only protects a hook already entered before the swap, not calls loading native table afterward. Add synchronization/proxying or prove a no-concurrent-use invariant, with a guard-vs-new-hook-call regression. Current head also lacks visible Windows CI.
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:34Z.


Rebased onto main (e0d93c84) at f98da36d:

  • Fixed the multithreaded UnadoptGuard / orig_fn race reported by @GreemSC on #871 (0xc0000005 reading 0x10 in pso_release -> orig_fn(this, 2)): UnadoptGuard is now refcounted per object pointer (UNADOPTED with atomic vtable stores so overlapping guards on shared objects don't restore early), and unadopted native vtables are registered lock-free (register_native / is_known_native) so orig_fn reads *ext.add(slot) directly without touching native[-1]. Extended wine_vtable_tests to cover overlapping guards and orig_fn while guarded with a zero-prefixed native table.
  • Added UnadoptGuard::new around the two new deferred-dispatch PC_RESET sites and raw test submit from #2118.
  • Verified under Proton (real:: 61/0, list_x:: 40/0, alloc_pool:: --test-threads=4 4/0 × 3) and a fresh 60 s pwsh ./scripts/smoke.ps1 run (exit: 0x0, 21 frames, 0 crashes, 0 removals).
<!-- greyfinch-sync:ivall/xcl:comment:7173826994 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#issuecomment-7173826994). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-25T20:32:34Z. --- Rebased onto `main` (`e0d93c84`) at `f98da36d`: - Fixed the multithreaded `UnadoptGuard` / `orig_fn` race reported by @GreemSC on #871 (`0xc0000005` reading `0x10` in `pso_release` -> `orig_fn(this, 2)`): `UnadoptGuard` is now refcounted per object pointer (`UNADOPTED` with atomic vtable stores so overlapping guards on shared objects don't restore early), and unadopted native vtables are registered lock-free (`register_native` / `is_known_native`) so `orig_fn` reads `*ext.add(slot)` directly without touching `native[-1]`. Extended `wine_vtable_tests` to cover overlapping guards and `orig_fn` while guarded with a zero-prefixed native table. - Added `UnadoptGuard::new` around the two new deferred-dispatch `PC_RESET` sites and raw test submit from #2118. - Verified under Proton (`real::` 61/0, `list_x::` 40/0, `alloc_pool:: --test-threads=4` 4/0 × 3) and a fresh 60 s `pwsh ./scripts/smoke.ps1` run (`exit: 0x0`, `21` frames, `0` crashes, `0` removals).
Mantarochen23 commented 2026-11-25 22:06:40 +00:00 (Migrated from github.com)

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


As a Linux-only user, I would highly appreciate this to be merged. Building and testing on Linux seems to be very doable with this.

<!-- greyfinch-sync:ivall/xcl:comment:7174939561 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#issuecomment-7174939561). Originally posted by [Mantarochen23](https://github.com/Mantarochen23) on 2026-11-25T21:20:14Z. --- As a Linux-only user, I would highly appreciate this to be merged. Building and testing on Linux seems to be very doable with this.
Alm0stSurely commented 2026-11-26 00:43:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Alm0stSurely on 2026-11-26T00:43:18Z.


Tested on an RTX 5080, NVIDIA 620.73.04, Proton Experimental (vkd3d-proton cae8353ed7959c4). Local builds from nvidia-dev at c044dc6d48d2b46a8ae77852df275c534681f3df, with the heap change from #1395 and the Wine fence adapter from this PR (a4c5a8228688d6642a21aaee80eaed5653905164).

I could reproduce the allocator identity check outside the game. With a fresh DIRECT allocator, node mask 1 and no initial PSO, the native allocator vtable gave S_OK for both PC graphics-list IIDs (base and v6). The title's console v6 IID gave E_NOINTERFACE, which lets XCL retry with the PC IID. Copying the same nine entries to a different address gave E_INVALIDARG for all three IIDs. On a closed native list, Reset also gave E_INVALIDARG with the copied table, then S_OK on the same list after restoring the native table.

In the retail run, the heap + fence baseline stopped at its first CreateCommandListX. Exposing the native allocator during that call let all eight sampled direct/compute list creations return S_OK. With default heap placement, the title then reached the newer layout's slot 139 (Reset) and stopped with E_INVALIDARG.

In a follow-up build, the allocator selected by the pool was also exposed natively around the driver's list Reset. On the same cold, default-placement recipe, the native slot 10 returned S_OK and the title's slot 139 returned S_OK on the primary list. XCL then logged ExecuteCommandListsX with one list, followed by an access violation in the stock D3D12 runtime before the first present. I have not isolated the cause of that subsequent fault.

A further selective port of this PR's submission change passed the native list tables to the stock driver for each chunk after XCL expanded the console lists. All 16 instrumented chunks returned from the CPU call in each of two cold runs, including chunks with two lists. The title reached PresentX and created a 3840×2160 swap chain. The video showed a blank white window before shutdown. A local VRAM guard stopped the runs at 3313 and 3529 MiB free. The second run added only no_upload_hvv. No in-world frames were verified. Seven focused CPU tests passed, including a mixed-list batch with a duplicate. This is a diagnostic port; return from the submission call does not establish GPU completion.

The paired runs used xcl run <retail executable>, empty caches, VKD3D_CONFIG=ignore_shared_fence,single_queue and XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_LOOK_SKIP=1.

Tested the rebased PR head separately. I built e57cb659b8f99801089846cbf680dc9964e6800c without local changes and ran scripts/smoke.ps1 -Seconds 60 on the RTX 5080 with GE-Proton11-14, cold caches, XCL_PSO_PRELOAD=0, XCL_NETWORK=0 and no VKD3D_CONFIG flags. Proton ran directly in an offline sandbox. The title exited before its first present. vkd3d logged Failed to create Vulkan device, vr -3. Adding only single_queue gave vr -1 at the same step. Proton Experimental with single_queue also gave vr -1. All three XCL runtime reports recorded zero presents. The smoke script's subsequent Get-CimInstance fallback failed under Wine, so there is no official manifest for these runs. A separate D3D12 readback control passed on the same GPU under Proton Experimental. The author used an AMD GPU and did not identify the retail title. These runs stop before they can evaluate the rebased submission change.

Follow-up on the clean rebased head under Proton Experimental. Two direct xcl run launches with the same executable, synthetic save, empty caches and single_queue diverged. With 10,835 MiB of free VRAM at startup, both the launcher preflight and the title host failed to create a D3D12 device. With 14,308 MiB free, both initialized the RTX 5080. The second run then exited at the stock driver's heap identity assertion (iface->lpVtbl == &d3d12_heap_vtbl), with zero presents and a black window. Available VRAM was observed, not controlled. This places the second run at the heap-compatibility issue covered by #1395.

Not tested on AMD or native Windows. The local change covers selected call sites on this base. Concurrent title access to the allocator's extra slot while exposing the native vtable remains unverified. No gameplay FPS measured.

OpenAI Codex (GPT-6.2 Astra) assisted with the probes, runs and this report.

RTX 5080 / Proton Experimental, allocator identity follow-up on nvidia-dev af2cecc408. I compared the same local heap + shared-fence build with and without a Wine allocator adapter. Driver 620.73.04, single queue, optical flow disabled. The adapter exposes the console slots on a separate object and passes the selected native allocator to D3D12. A private COM reference on the native list keeps the logical allocator alive across recordings.

A standalone GPU test calls the default title device slot 73 with the console list IID. The control returned E_INVALIDARG in 0.58 s. With the adapter, creation succeeded, the list closed after the caller released its allocator, a reset with a copy allocator was rejected, and resetting with a second direct allocator and closing succeeded. Same test on both builds. Nine targeted CPU tests passed, including failed-reset ownership and console slot 9.

In the title run the allocator extension at slot 9 was called and returned. The queue then received ExecuteCommandListsX with one list. The run subsequently stopped inside the graphics driver before the first presentation. The capture ended black after a brief white flash. Both title runs used independent, verified copies of the same warm cache. This is a startup result on one RTX 5080. No world or gameplay frame rate was observed.

As a graphics control, I cleared a 1×1 RGBA8 target to magenta and copied it to a readback buffer prefilled with 0x55. Direct D3D12 on the same Proton setup completed fence 2 and returned ff00ffff in 0.62 s. With the title list wrapper and queue slot 35 the test logged the submission request and exited before reaching pixel verification. The last marker does not establish whether the final native queue call was entered.

AI assistance: OpenAI Codex (gpt-6.2-astra), local integration, tests and report.

RTX 5080, queue submission follow-up (nvidia-dev af2cecc408 plus the local heap, fence and allocator adapters above). I ran a single-list clear and readback through XCL queue slot 35 in two fresh offline Proton Experimental processes, using the same Windows test executable. NVIDIA 620.73.04, single queue, optical flow disabled. Both runs completed XCL's pre-submit refresh and reached the call to the native D3D12 queue. With the usual adopted list, that call did not return. In the second run the test owned one closed DIRECT list and exposed its native table only across that call, following the submission step from e57cb659. The call returned, fence 2 completed and the readback contained RGBA 255, 0, 255, 255 in 0.60 s. The native D3D12 control reported previously took 0.62 s.

A separate title run with boundary logging only also returned from the refresh and entered the native call with one list. The process stopped before the return marker, with zero presents. Its capture ended black after a white flash. This run used an independent verified copy of the same warm cache.

A third test left the DIRECT backing on its native table from creation onward, keeping the actual XCL title wrapper. The wrapper recorded the clear and copy, closed the list and submitted it through slot 35 without the test guard. Fence 2 completed and the same magenta pixel was read in 0.58 s. A second thread held a COM reference across submission and verified IUnknown identity and GetType before and after. This covers one segment and standard recording methods. The original single-pixel run did not exercise Reset, deferred work, split lists or the full title on this variant.

A follow-up on the same stable native DIRECT list used two render targets and two distinct readback buffers. The first fence completed with a magenta pixel and the second buffer still at its sentinel. A test-only entry then called the production newer-layout Reset #139 handler on the completed list. The second fence completed with a green pixel and the first buffer still magenta. The wrapper, native backing and second COM owner kept their identities. Both submissions and readbacks took 0.62 s together. A separate CPU test exercised caller-based slot selection. This does not cover reset during an in-flight submission.

In a fresh trace-only title run with the same warm-cache manifest, the wrapper passed to the first #35 submission matched a successful Close log containing two forwarded methods, #132 then #131. XCL maps those slots to shader/GPU cache-range flush handling. The successful Reset logged just before submission belonged to a different wrapper. The submitted wrapper resolved to one segment. The pre-submit refresh returned and the native queue call did not return. Zero presents, 10.25 s of capture ending black after a white flash. The trace records forwarded methods and has a bounded Close log. It does not measure the arguments or prove the flushes caused the stop.

Further RTX 5080 / Proton measurement on af2cecc408 with the same local adapters, Series X profile and warm cache: the single DIRECT segment reaching the first native queue submission was the one on which XCL had recorded both global UAV barriers. Slot 132 used flags 0x700000, wait 0; slot 131 used flags 0xc3c0, wait 0x80020000. Both supplied a byte count of 0xffffffffff00. Both calls to record the barrier returned. The pre-submit refresh returned; the native submission did not log a return. The 9.75 s title capture ended black, with zero presents.

In an isolated test, a wrapper with explicit handlers for those two slots kept the DIRECT backing native throughout. The first list contained only the two flush calls, in title order, with the same flags, wait and length; the handlers issued two native global UAV barriers. Submission returned and fence 1 completed. After reset, two further recordings on the same backing returned the expected magenta and green pixels at fences 2 and 3; zero-length and zero-flags/zero-wait controls emitted no additional barrier. All three submissions together took 0.65 s in the test. This covers the two explicit handlers and single segment; the test is not a complete title command-list implementation.

The same RTX 5080 setup also passed a 64-byte upload/readback control. We recorded CopyBufferRegion directly on the native primary, then recorded the two flushes through the wrapper. All 64 bytes matched after submission and fence completion. A second list in the same test omitted the copy and retained its initial 64 bytes, including after the positive run. In a separate title run with observation enabled, the first list actually submitted was the first non-DMA DIRECT wrapper created, with exactly one segment matching its original primary. Its three inline cursors were still at their initial positions at Close, and the initially empty command area contained zero nonzero bytes at that point. Transient writes are outside this measurement. The title reported an access violation in d3d12core during the first native submission and the 11.25 s capture ended black. The GPU guard's final sample had 8,916 MiB free.

RTX 5080 / Proton Experimental, local integration on af2cecc408, Series X with the same warm cache: keeping the first DIRECT list native from creation and handling its two flushes through the wrapper got the title past its first native submission. With normal post-submit processing enabled, a fresh fence on the same queue reached 1 from 0 with the list and allocator retained. Device-removal checks passed. The next native submission did not return, and the title exited in d3d12core with zero presentations. A separate diagnostic stopped before the second submission and identified one original segment on the second DIRECT list created (sixth wrapper overall). This list had a successful Reset with no stand-in or initial PSO and a successful Close. Between Reset and inspection the wrapper recorded slot counts 9 ×1, 32 ×2, 52 ×1, 71 ×2, 72 ×2, 74 ×1, 146 ×2. The captured screen ended black.

The temporary table change is confined to the test harness. Concurrent use of shared title lists with that change was not tested. AI assistance: OpenAI Codex (gpt-6.2-astra), instrumentation, tests and report.

<!-- greyfinch-sync:ivall/xcl:comment:7179047753 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#issuecomment-7179047753). Originally posted by [Alm0stSurely](https://github.com/Alm0stSurely) on 2026-11-26T00:43:18Z. --- **Tested** on an RTX 5080, NVIDIA 620.73.04, Proton Experimental (vkd3d-proton `cae8353ed7959c4`). Local builds from `nvidia-dev` at `c044dc6d48d2b46a8ae77852df275c534681f3df`, with the heap change from #1395 and the Wine fence adapter from this PR (`a4c5a8228688d6642a21aaee80eaed5653905164`). I could reproduce the allocator identity check outside the game. With a fresh DIRECT allocator, node mask 1 and no initial PSO, the native allocator vtable gave `S_OK` for both PC graphics-list IIDs (base and v6). The title's console v6 IID gave `E_NOINTERFACE`, which lets XCL retry with the PC IID. Copying the same nine entries to a different address gave `E_INVALIDARG` for all three IIDs. On a closed native list, `Reset` also gave `E_INVALIDARG` with the copied table, then `S_OK` on the same list after restoring the native table. In the retail run, the heap + fence baseline stopped at its first `CreateCommandListX`. Exposing the native allocator during that call let all eight sampled direct/compute list creations return `S_OK`. With default heap placement, the title then reached the newer layout's slot 139 (`Reset`) and stopped with `E_INVALIDARG`. In a follow-up build, the allocator selected by the pool was also exposed natively around the driver's list Reset. On the same cold, default-placement recipe, the native slot 10 returned `S_OK` and the title's slot 139 returned `S_OK` on the primary list. XCL then logged `ExecuteCommandListsX` with one list, followed by an access violation in the stock D3D12 runtime before the first present. I have not isolated the cause of that subsequent fault. A further selective port of this PR's submission change passed the native list tables to the stock driver for each chunk after XCL expanded the console lists. All 16 instrumented chunks returned from the CPU call in each of two cold runs, including chunks with two lists. The title reached `PresentX` and created a 3840×2160 swap chain. The video showed a blank white window before shutdown. A local VRAM guard stopped the runs at 3313 and 3529 MiB free. The second run added only `no_upload_hvv`. No in-world frames were verified. Seven focused CPU tests passed, including a mixed-list batch with a duplicate. This is a diagnostic port; return from the submission call does not establish GPU completion. The paired runs used `xcl run <retail executable>`, empty caches, `VKD3D_CONFIG=ignore_shared_fence,single_queue` and `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_LOOK_SKIP=1`. **Tested the rebased PR head separately.** I built `e57cb659b8f99801089846cbf680dc9964e6800c` without local changes and ran `scripts/smoke.ps1 -Seconds 60` on the RTX 5080 with GE-Proton11-14, cold caches, `XCL_PSO_PRELOAD=0`, `XCL_NETWORK=0` and no `VKD3D_CONFIG` flags. Proton ran directly in an offline sandbox. The title exited before its first present. vkd3d logged `Failed to create Vulkan device, vr -3`. Adding only `single_queue` gave `vr -1` at the same step. Proton Experimental with `single_queue` also gave `vr -1`. All three XCL runtime reports recorded zero presents. The smoke script's subsequent `Get-CimInstance` fallback failed under Wine, so there is no official manifest for these runs. A separate D3D12 readback control passed on the same GPU under Proton Experimental. The author used an AMD GPU and did not identify the retail title. These runs stop before they can evaluate the rebased submission change. **Follow-up on the clean rebased head under Proton Experimental.** Two direct `xcl run` launches with the same executable, synthetic save, empty caches and `single_queue` diverged. With 10,835 MiB of free VRAM at startup, both the launcher preflight and the title host failed to create a D3D12 device. With 14,308 MiB free, both initialized the RTX 5080. The second run then exited at the stock driver's heap identity assertion (`iface->lpVtbl == &d3d12_heap_vtbl`), with zero presents and a black window. Available VRAM was observed, not controlled. This places the second run at the heap-compatibility issue covered by #1395. **Not tested** on AMD or native Windows. The local change covers selected call sites on this base. Concurrent title access to the allocator's extra slot while exposing the native vtable remains unverified. No gameplay FPS measured. OpenAI Codex (GPT-6.2 Astra) assisted with the probes, runs and this report. **RTX 5080 / Proton Experimental, allocator identity follow-up on nvidia-dev af2cecc40886a8682ecf3267f5328c6dc4b66ad7.** I compared the same local heap + shared-fence build with and without a Wine allocator adapter. Driver 620.73.04, single queue, optical flow disabled. The adapter exposes the console slots on a separate object and passes the selected native allocator to D3D12. A private COM reference on the native list keeps the logical allocator alive across recordings. A standalone GPU test calls the default title device slot 73 with the console list IID. The control returned E_INVALIDARG in 0.58 s. With the adapter, creation succeeded, the list closed after the caller released its allocator, a reset with a copy allocator was rejected, and resetting with a second direct allocator and closing succeeded. Same test on both builds. Nine targeted CPU tests passed, including failed-reset ownership and console slot 9. In the title run the allocator extension at slot 9 was called and returned. The queue then received ExecuteCommandListsX with one list. The run subsequently stopped inside the graphics driver before the first presentation. The capture ended black after a brief white flash. Both title runs used independent, verified copies of the same warm cache. This is a startup result on one RTX 5080. No world or gameplay frame rate was observed. As a graphics control, I cleared a 1×1 RGBA8 target to magenta and copied it to a readback buffer prefilled with 0x55. Direct D3D12 on the same Proton setup completed fence 2 and returned ff00ffff in 0.62 s. With the title list wrapper and queue slot 35 the test logged the submission request and exited before reaching pixel verification. The last marker does not establish whether the final native queue call was entered. AI assistance: OpenAI Codex (gpt-6.2-astra), local integration, tests and report. **RTX 5080, queue submission follow-up (nvidia-dev af2cecc40886a8682ecf3267f5328c6dc4b66ad7 plus the local heap, fence and allocator adapters above).** I ran a single-list clear and readback through XCL queue slot 35 in two fresh offline Proton Experimental processes, using the same Windows test executable. NVIDIA 620.73.04, single queue, optical flow disabled. Both runs completed XCL's pre-submit refresh and reached the call to the native D3D12 queue. With the usual adopted list, that call did not return. In the second run the test owned one closed DIRECT list and exposed its native table only across that call, following the submission step from e57cb659. The call returned, fence 2 completed and the readback contained RGBA 255, 0, 255, 255 in 0.60 s. The native D3D12 control reported previously took 0.62 s. A separate title run with boundary logging only also returned from the refresh and entered the native call with one list. The process stopped before the return marker, with zero presents. Its capture ended black after a white flash. This run used an independent verified copy of the same warm cache. A third test left the DIRECT backing on its native table from creation onward, keeping the actual XCL title wrapper. The wrapper recorded the clear and copy, closed the list and submitted it through slot 35 without the test guard. Fence 2 completed and the same magenta pixel was read in 0.58 s. A second thread held a COM reference across submission and verified IUnknown identity and GetType before and after. This covers one segment and standard recording methods. The original single-pixel run did not exercise Reset, deferred work, split lists or the full title on this variant. A follow-up on the same stable native DIRECT list used two render targets and two distinct readback buffers. The first fence completed with a magenta pixel and the second buffer still at its sentinel. A test-only entry then called the production newer-layout Reset #139 handler on the completed list. The second fence completed with a green pixel and the first buffer still magenta. The wrapper, native backing and second COM owner kept their identities. Both submissions and readbacks took 0.62 s together. A separate CPU test exercised caller-based slot selection. This does not cover reset during an in-flight submission. In a fresh trace-only title run with the same warm-cache manifest, the wrapper passed to the first #35 submission matched a successful Close log containing two forwarded methods, #132 then #131. XCL maps those slots to shader/GPU cache-range flush handling. The successful Reset logged just before submission belonged to a different wrapper. The submitted wrapper resolved to one segment. The pre-submit refresh returned and the native queue call did not return. Zero presents, 10.25 s of capture ending black after a white flash. The trace records forwarded methods and has a bounded Close log. It does not measure the arguments or prove the flushes caused the stop. Further RTX 5080 / Proton measurement on af2cecc408 with the same local adapters, Series X profile and warm cache: the single DIRECT segment reaching the first native queue submission was the one on which XCL had recorded both global UAV barriers. Slot 132 used flags 0x700000, wait 0; slot 131 used flags 0xc3c0, wait 0x80020000. Both supplied a byte count of 0xffffffffff00. Both calls to record the barrier returned. The pre-submit refresh returned; the native submission did not log a return. The 9.75 s title capture ended black, with zero presents. In an isolated test, a wrapper with explicit handlers for those two slots kept the DIRECT backing native throughout. The first list contained only the two flush calls, in title order, with the same flags, wait and length; the handlers issued two native global UAV barriers. Submission returned and fence 1 completed. After reset, two further recordings on the same backing returned the expected magenta and green pixels at fences 2 and 3; zero-length and zero-flags/zero-wait controls emitted no additional barrier. All three submissions together took 0.65 s in the test. This covers the two explicit handlers and single segment; the test is not a complete title command-list implementation. The same RTX 5080 setup also passed a 64-byte upload/readback control. We recorded CopyBufferRegion directly on the native primary, then recorded the two flushes through the wrapper. All 64 bytes matched after submission and fence completion. A second list in the same test omitted the copy and retained its initial 64 bytes, including after the positive run. In a separate title run with observation enabled, the first list actually submitted was the first non-DMA DIRECT wrapper created, with exactly one segment matching its original primary. Its three inline cursors were still at their initial positions at Close, and the initially empty command area contained zero nonzero bytes at that point. Transient writes are outside this measurement. The title reported an access violation in d3d12core during the first native submission and the 11.25 s capture ended black. The GPU guard's final sample had 8,916 MiB free. RTX 5080 / Proton Experimental, local integration on af2cecc408, Series X with the same warm cache: keeping the first DIRECT list native from creation and handling its two flushes through the wrapper got the title past its first native submission. With normal post-submit processing enabled, a fresh fence on the same queue reached 1 from 0 with the list and allocator retained. Device-removal checks passed. The next native submission did not return, and the title exited in d3d12core with zero presentations. A separate diagnostic stopped before the second submission and identified one original segment on the second DIRECT list created (sixth wrapper overall). This list had a successful Reset with no stand-in or initial PSO and a successful Close. Between Reset and inspection the wrapper recorded slot counts 9 ×1, 32 ×2, 52 ×1, 71 ×2, 72 ×2, 74 ×1, 146 ×2. The captured screen ended black. The temporary table change is confined to the test harness. Concurrent use of shared title lists with that change was not tested. AI assistance: OpenAI Codex (gpt-6.2-astra), instrumentation, tests and report.
gustavsi commented 2026-11-26 01:05:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-26T00:52:16Z.


Thanks @bmjask for the review! Addressed the UnadoptGuard concurrent-Release P1 and rebased onto main (08db8020) at e57cb659:

  • COM reference pin across UnadoptGuard: on the first active guard for an object, UnadoptGuard::new calls native AddRef before exposing orig (raising refcount >= 2), and on the last guard drop restores ext (Ordering::Release), releases UNADOPTED, and then calls XCL's hooked Release slot (*ext.add(2)). Even if another thread concurrently loads the native vtable during the guard window and invokes Release, refcount stays >= 1 so the object cannot finalize early, and the guard exit runs XCL's hooked 1 -> 0 cleanup (pso_release, heap_release, res_release, cl_release, alloc_release). (Note: with #2477 stacked on this PR, the 7 shared assert-checked classes are patched in place and bypass UnadoptGuard altogether.)
  • Alignment guard: UnadoptGuard::new now checks (obj as usize) & 7 == 0 before its atomic vtable load so synthetic unaligned pointers cannot panic in debug builds.
  • Regression test: added wine_vtable_tests::concurrent_release_during_unadopt_guard_still_runs_hooked_cleanup spawning a concurrent thread that observes orig_vt and invokes native Release during an active guard, verifying rc == 1 while guarded and hooked pso_release cleanup on 1 -> 0 when the guard drops.
  • Verification (GE-Proton11-14, RX 9060 XT): real:: 62/0, list_x:: 40/0, alloc_pool:: --test-threads=4 4/0 (× 3), gpu_sparse_vram_descriptors_buffers_and_xmem + gpu_valu_float_and_int 2/0, plus a fresh 60 s pwsh ./scripts/smoke.ps1 run (exit: 0x0, 18 frames shown, 0 crashes, 0 removals).

AI use: Antigravity (Gemini 4 Neon) implemented the UnadoptGuard reference pin and regression test, ran the Proton tests and smoke run, and drafted this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7179196519 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#issuecomment-7179196519). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-26T00:52:16Z. --- Thanks @bmjask for the review! Addressed the `UnadoptGuard` concurrent-`Release` P1 and rebased onto `main` (`08db8020`) at `e57cb659`: - **COM reference pin across `UnadoptGuard`:** on the first active guard for an object, `UnadoptGuard::new` calls native `AddRef` before exposing `orig` (raising refcount `>= 2`), and on the last guard drop restores `ext` (`Ordering::Release`), releases `UNADOPTED`, and then calls XCL's hooked `Release` slot (`*ext.add(2)`). Even if another thread concurrently loads the native vtable during the guard window and invokes `Release`, refcount stays `>= 1` so the object cannot finalize early, and the guard exit runs XCL's hooked `1 -> 0` cleanup (`pso_release`, `heap_release`, `res_release`, `cl_release`, `alloc_release`). (Note: with #2477 stacked on this PR, the 7 shared assert-checked classes are patched in place and bypass `UnadoptGuard` altogether.) - **Alignment guard:** `UnadoptGuard::new` now checks `(obj as usize) & 7 == 0` before its atomic vtable load so synthetic unaligned pointers cannot panic in debug builds. - **Regression test:** added `wine_vtable_tests::concurrent_release_during_unadopt_guard_still_runs_hooked_cleanup` spawning a concurrent thread that observes `orig_vt` and invokes native `Release` during an active guard, verifying `rc == 1` while guarded and hooked `pso_release` cleanup on `1 -> 0` when the guard drops. - **Verification (`GE-Proton11-14`, RX 9060 XT):** `real::` **62/0**, `list_x::` **40/0**, `alloc_pool:: --test-threads=4` **4/0** (× 3), `gpu_sparse_vram_descriptors_buffers_and_xmem` + `gpu_valu_float_and_int` **2/0**, plus a fresh 60 s `pwsh ./scripts/smoke.ps1` run (`exit: 0x0`, `18` frames shown, `0` crashes, `0` removals). **AI use:** Antigravity (Gemini 4 Neon) implemented the `UnadoptGuard` reference pin and regression test, ran the Proton tests and smoke run, and drafted this comment.
gustavsi commented 2026-11-26 03:06:29 +00:00 (Migrated from github.com)

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


Thanks @Alm0stSurely for the detailed RTX 5080 / Proton Experimental verification! The iface->lpVtbl == &d3d12_heap_vtbl assertion you hit on stock Proton Experimental is indeed the heap/resource/PSO in-place vtable patching carried forward from #1395 in #2477 (stacked on this PR, now updated at 94a05e53).

AI use: Antigravity (Gemini 4 Neon) drafted this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7180642690 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#issuecomment-7180642690). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-26T02:16:51Z. --- Thanks @Alm0stSurely for the detailed RTX 5080 / Proton Experimental verification! The `iface->lpVtbl == &d3d12_heap_vtbl` assertion you hit on stock Proton Experimental is indeed the heap/resource/PSO in-place vtable patching carried forward from #1395 in #2477 (stacked on this PR, now updated at `94a05e53`). **AI use:** Antigravity (Gemini 4 Neon) 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:19Z.


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:7181309480 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#issuecomment-7181309480). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T03:00:19Z. --- 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
futurepro62 commented 2026-11-26 09:07:45 +00:00 (Migrated from github.com)

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


NVIDIA and AMD full-suite run, to go with the reports above by Alm0stSurely, fromthemoonx, since none of them covers AMD. Tested exact head e57cb659 (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:7187022900 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#issuecomment-7187022900). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-26T08:47:28Z. --- NVIDIA and AMD full-suite run, to go with the reports above by Alm0stSurely, fromthemoonx, since none of them covers AMD. Tested exact head `e57cb659` (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 15:03:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by safesearch77 on 2026-11-26T14:09:39Z.


Reviewed e57cb659 against main (b49be183); the patch applies cleanly. The refcounted
UnadoptGuard (pinned AddRef, orig_fn reading the native table while another guard is
active) closes the concurrent-guard race I would have asked about. One thing I could not
square with the diff:

create_raw_fence is not gated by under_wine(), so native Windows changes, and
end_title loses the list_x cell fences.

  • The commit message says native Windows is unchanged, but create_raw_fence only checks
    is_ext(vt(raw)), which is also true for the adopted device on Windows. Every converted
    site (list_x::ensure_cell_fence, alloc_pool::executed, cpu_writes::after,
    late_release, present, vram, sparse, drain_gpu) now skips dev_create_fence
    on Windows as well.
  • The consequence is end_title (real.rs:3587). It signals every fence in FENCES to
    u64::MAX so GPU waits release before drain_gpu. The cell fences from
    ensure_cell_fence (list_x.rs:1664) are the ones queues park on (q.Wait(&fence, w.value), list_x.rs:1982, tracked in armed_waits). Raw fences are no longer in
    FENCES, so those waits are not released, a queue stuck on one never reaches
    drain_gpu's Signal, and the drain runs into its 10 s limit (real.rs:7339)
    before TerminateProcess.
  • Either gate the raw path with under_wine(), or push the raw cell fences into
    FENCES (an AddRef'd raw pointer works, since unwrap_fence_proxy passes non-proxy
    pointers through). Since this changes a runtime path on Windows, the smoke pair should
    also say which of the two it covers.

Checked with cargo check --tests only (x86_64-pc-windows-gnu); no GPU, Wine or Windows
run.

AI use: Antigravity (Claude Sonnet 5.5) read and traced the diff; I re-checked the point
against the source before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7194361567 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#issuecomment-7194361567). Originally posted by [safesearch77](https://github.com/safesearch77) on 2026-11-26T14:09:39Z. --- Reviewed `e57cb659` against `main` (`b49be183`); the patch applies cleanly. The refcounted `UnadoptGuard` (pinned `AddRef`, `orig_fn` reading the native table while another guard is active) closes the concurrent-guard race I would have asked about. One thing I could not square with the diff: **`create_raw_fence` is not gated by `under_wine()`, so native Windows changes, and `end_title` loses the `list_x` cell fences.** - The commit message says native Windows is unchanged, but `create_raw_fence` only checks `is_ext(vt(raw))`, which is also true for the adopted device on Windows. Every converted site (`list_x::ensure_cell_fence`, `alloc_pool::executed`, `cpu_writes::after`, `late_release`, `present`, `vram`, `sparse`, `drain_gpu`) now skips `dev_create_fence` on Windows as well. - The consequence is `end_title` (`real.rs:3587`). It signals every fence in `FENCES` to `u64::MAX` so GPU waits release before `drain_gpu`. The cell fences from `ensure_cell_fence` (`list_x.rs:1664`) are the ones queues park on (`q.Wait(&fence, w.value)`, `list_x.rs:1982`, tracked in `armed_waits`). Raw fences are no longer in `FENCES`, so those waits are not released, a queue stuck on one never reaches `drain_gpu`'s `Signal`, and the drain runs into its 10 s limit (`real.rs:7339`) before `TerminateProcess`. - Either gate the raw path with `under_wine()`, or push the raw cell fences into `FENCES` (an `AddRef`'d raw pointer works, since `unwrap_fence_proxy` passes non-proxy pointers through). Since this changes a runtime path on Windows, the smoke pair should also say which of the two it covers. Checked with `cargo check --tests` only (`x86_64-pc-windows-gnu`); no GPU, Wine or Windows run. AI use: Antigravity (Claude Sonnet 5.5) read and traced the diff; I re-checked the point against the source before posting.
gustavsi commented 2026-11-26 16:06:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gustavsi on 2026-11-26T15:15:35Z.


Thanks @SzczepanGrela for the detailed run on a4c5a82. Rerun of the two parallel problems on the current head e57cb659 (RX 9060 XT, RADV, GE-Proton11-14, its vkd3d-proton, DXC 1.9.2609.5, x86_64-pc-windows-msvc debug):

  • hle::d3d12x -- --test-threads=4 exit 5: gone. 3 runs, all ran to the end (exit 101): 243 / 13 / 2 ignored, 254 / 2, 243 / 13. The 2 that fail in every run also fail at --test-threads=1 (254 passed, 2 failed): device_x::tests::gpu_promoted_uav_clear_values_pass_create_committed_resource and sparse::tests::a_tile_decommitted_and_committed_again_keeps_its_video_memory. The other 11 only fail in parallel. I have no main comparison for these: main b49be183 aborts the same filter at --test-threads=1 (exit 5) on this machine.
  • d3d12_resource_and_sync in parallel: still crashes. 3 of 3 default-parallel runs died (2× double free or corruption (out), 1× exit 5); --test-threads=1 passes 3 passed / 0 failed. By pairs at --test-threads=2, 5 runs each: resource_map_unmap_write_and_gpu_va… together with fence_and_command_queue_sync_timing_and_allocator_reset… crashes 5/5; the other two pairs pass 5/5, and the fence test alone passes 5/5. On main that pair does not get that far: the fence test fails at d3d12_resource_and_sync.rs:481 (CreateCommandList → E_INVALIDARG), 3/3. So the crash appears once #867 lets that test run; root cause not found yet. I'll follow up here.

AI use: Claude Code (Claude Opus 5.5) ran the tests on the machine above and drafted this; I checked it.

<!-- greyfinch-sync:ivall/xcl:comment:7196012416 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#issuecomment-7196012416). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-26T15:15:35Z. --- Thanks @SzczepanGrela for the detailed run on `a4c5a82`. Rerun of the two parallel problems on the current head `e57cb659` (RX 9060 XT, RADV, `GE-Proton11-14`, its vkd3d-proton, DXC 1.9.2609.5, `x86_64-pc-windows-msvc` debug): - **`hle::d3d12x -- --test-threads=4` exit 5: gone.** 3 runs, all ran to the end (exit 101): 243 / 13 / 2 ignored, 254 / 2, 243 / 13. The 2 that fail in every run also fail at `--test-threads=1` (254 passed, 2 failed): `device_x::tests::gpu_promoted_uav_clear_values_pass_create_committed_resource` and `sparse::tests::a_tile_decommitted_and_committed_again_keeps_its_video_memory`. The other 11 only fail in parallel. I have no `main` comparison for these: `main` `b49be183` aborts the same filter at `--test-threads=1` (exit 5) on this machine. - **`d3d12_resource_and_sync` in parallel: still crashes.** 3 of 3 default-parallel runs died (2× `double free or corruption (out)`, 1× exit 5); `--test-threads=1` passes 3 passed / 0 failed. By pairs at `--test-threads=2`, 5 runs each: `resource_map_unmap_write_and_gpu_va…` together with `fence_and_command_queue_sync_timing_and_allocator_reset…` crashes 5/5; the other two pairs pass 5/5, and the fence test alone passes 5/5. On `main` that pair does not get that far: the fence test fails at `d3d12_resource_and_sync.rs:481` (`CreateCommandList` → `E_INVALIDARG`), 3/3. So the crash appears once #867 lets that test run; root cause not found yet. I'll follow up here. AI use: Claude Code (Claude Opus 5.5) ran the tests on the machine above and drafted this; I checked it.
gustavsi commented 2026-11-26 20:17:04 +00:00 (Migrated from github.com)

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


Thanks @safesearch77 and @fromthemoonx for catching and confirming the create_raw_fence Windows / end_title issue, and thanks @SzczepanGrela for tracing the parallel d3d12_resource_and_sync crash down to the upstream vkd3d-proton vkd3d_memory_transfer_queue_write_subresource UAF!

Updated at d9e6ad51:

  • Gated create_raw_fence on crate::util::under_wine(): off Wine (native Windows), create_raw_fence now goes straight through dev.CreateFence(0, D3D12_FENCE_FLAG_NONE) -> dev_create_fence -> FENCES, so native Windows behavior is genuinely unchanged.
  • Tracked list_x cell fences for end_title under Wine: added real::track_end_title_fence(&created) and called it in list_x::ensure_cell_fence after installing a new cell fence (AddRef'd once and pushed into FENCES if not already present, no-op off Wine), so end_title signals parked Wait64BitValueX cell fences before drain_gpu under Wine as well while keeping internal fences (sparse::State::fence, vram, alloc_pool, etc.) out of FENCES.
  • Regression test: added wine_vtable_tests::track_end_title_fence_registers_once_and_addrefs verifying single registration, +1 AddRef, and is_fence visibility (runs on both Windows CI and Wine).

Verified at d9e6ad51 under GE-Proton11-14 (AMD Radeon RX 9060 XT, RADV Mesa 26.2.7, XCL_DXC_DIR set):

  • hle::d3d12x::real:: --test-threads=1: 63 passed, 0 failed, 0 ignored
  • hle::d3d12x::list_x:: --test-threads=1: 40 passed, 0 failed, 0 ignored
  • hle::d3d12x::alloc_pool:: --test-threads=4 (× 3): 4 passed, 0 failed, 0 ignored each
  • real::wine_vtable_tests --test-threads=4: 4 passed, 0 failed, 0 ignored
  • --exact gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem gpu::recomp::tests::gpu_valu_float_and_int --test-threads=1: 2 passed, 0 failed, 0 SKIPPED
  • 60 s pwsh ./scripts/smoke.ps1 release run: exit: 0x0, 22 frames shown (PresentX 23), 0 crashes, 0 device removals (PR description updated).

Not tested: native Windows locally.

AI use: Antigravity (Gemini 4 Neon) implemented the under_wine() gate, track_end_title_fence, and unit test, ran the Proton tests and 60 s smoke run, and drafted this reply.

<!-- greyfinch-sync:ivall/xcl:comment:7202494340 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#issuecomment-7202494340). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-26T20:17:04Z. --- Thanks @safesearch77 and @fromthemoonx for catching and confirming the `create_raw_fence` Windows / `end_title` issue, and thanks @SzczepanGrela for tracing the parallel `d3d12_resource_and_sync` crash down to the upstream `vkd3d-proton` `vkd3d_memory_transfer_queue_write_subresource` UAF! Updated at `d9e6ad51`: - **Gated `create_raw_fence` on `crate::util::under_wine()`:** off Wine (native Windows), `create_raw_fence` now goes straight through `dev.CreateFence(0, D3D12_FENCE_FLAG_NONE)` -> `dev_create_fence` -> `FENCES`, so native Windows behavior is genuinely unchanged. - **Tracked `list_x` cell fences for `end_title` under Wine:** added `real::track_end_title_fence(&created)` and called it in `list_x::ensure_cell_fence` after installing a new cell fence (AddRef'd once and pushed into `FENCES` if not already present, no-op off Wine), so `end_title` signals parked `Wait64BitValueX` cell fences before `drain_gpu` under Wine as well while keeping internal fences (`sparse::State::fence`, `vram`, `alloc_pool`, etc.) out of `FENCES`. - **Regression test:** added `wine_vtable_tests::track_end_title_fence_registers_once_and_addrefs` verifying single registration, `+1` AddRef, and `is_fence` visibility (runs on both Windows CI and Wine). **Verified at `d9e6ad51` under `GE-Proton11-14` (AMD Radeon RX 9060 XT, RADV Mesa 26.2.7, `XCL_DXC_DIR` set):** - `hle::d3d12x::real:: --test-threads=1`: **63 passed, 0 failed, 0 ignored** - `hle::d3d12x::list_x:: --test-threads=1`: **40 passed, 0 failed, 0 ignored** - `hle::d3d12x::alloc_pool:: --test-threads=4` (× 3): **4 passed, 0 failed, 0 ignored** each - `real::wine_vtable_tests --test-threads=4`: **4 passed, 0 failed, 0 ignored** - `--exact gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem gpu::recomp::tests::gpu_valu_float_and_int --test-threads=1`: **2 passed, 0 failed**, 0 `SKIPPED` - 60 s `pwsh ./scripts/smoke.ps1` release run: `exit: 0x0`, **22 frames shown (`PresentX 23`)**, `0` crashes, `0` device removals (PR description updated). **Not tested:** native Windows locally. **AI use:** Antigravity (Gemini 4 Neon) implemented the `under_wine()` gate, `track_end_title_fence`, and unit test, ran the Proton tests and 60 s smoke run, and drafted this reply.
ClosetPie107 commented 2026-11-26 23:08:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-26T23:08:28Z.


Update for head 021b2c33 (rebased onto main f9a0cb80; git range-diff shows the commit unchanged from d9e6ad51, which the results below are for)

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)

  • cargo test -p xcl --lib -- hle::d3d12x::real:: --test-threads=1: 67 passed, 0 failed, 0 ignored (main: 63 passed, 0 failed).
  • cargo test -p xcl --lib -- hle::d3d12x::list_x:: --test-threads=1: 40 passed, 0 failed, 0 ignored (main: 40 passed, 0 failed).
  • cargo test --workspace --no-fail-fast -- --test-threads=4 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): lib 1328 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. The other binaries fail the same 3 tests as on main (e2e, pls_quota, predication_e2e). d3d12_resource_and_sync: 3 passed, 0 failed.

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

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


Independent test report under Wine/Proton (not native Windows) for head d9e6ad51.

Setup

  • AMD Radeon RX 9070 (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, CachyOS Linux 7.3.5
  • Proton Experimental experimental-11.0-20261112, DXVK v3.1.1-209, DXC 1.9.2609.5, Rust 1.96.0, target x86_64-pc-windows-gnu
  • "Patched": vkd3d-proton master ec207194 with a local patch that drops the lpVtbl checks in d3d12_command_allocator_from_iface / d3d12_command_list_from_iface. "Stock": Proton's assertion-enabled d3d12core.dll (sha256 93565013…).
  • Test tree: head merged onto main 8b957bec together with #2849 (4e931734), test commit 245ee03f. Without #2849, main crashes here in 6 of 9 retail runs (#2841).

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

  • hle::d3d12x::real::: 67 passed, 0 failed (main: 63 passed, 0 failed)
  • hle::d3d12x::list_x::: 40 passed, 0 failed (main: 40 passed, 0 failed)
  • cargo test -p xcl --lib -- --test-threads=4: 1314 passed, 8 failed, 27 ignored, 8 SKIPPED. main the same run: 1310 passed, 8 failed, 27 ignored, 8 SKIPPED. The 8 failures are the same on both (f32/f64 GPU programs, FMA contraction, DXIL fuzz, UAV clear values, sparse tile recommit, Opus/XMA2 voices).

Retail title, 300 s, patched prefix (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)

runs exit crashes / device removed presents VRAM at ~90 s
main + #2849 6 all 0 0 / 0 1992–2207 9823–9954 MiB
main + #2849 + this PR 2 0, 0 0 / 0 1948, 2037 9820, 9892 MiB

No difference I can see on the patched prefix.

Stock prefix (exact head d9e6ad51 on its base 08db8020, XCL_PREPARE=0 XCL_PSO_PRELOAD=0): aborts after 5 s with Assertion failed: iface->lpVtbl == &d3d12_heap_vtbl (exit 3), as expected without #2477. #2477 on top of this commit runs the full 300 s there (report on #2477).

Not tested

  • Native Windows, NVIDIA/Intel
  • Stock Proton on current main: main + #2849 itself crashes there during the startup shader preparation (#2555), with or without this PR, so I tested stock Proton on the PR's own base instead.

AI use

  • Claude Code (Claude Opus 5.5) wrote the test scripts, ran the tests and runs on this machine and wrote this report.
<!-- greyfinch-sync:ivall/xcl:comment:7205288921 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#issuecomment-7205288921). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-11-26T23:08:28Z. --- **Update for head `021b2c33`** (rebased onto `main` `f9a0cb80`; `git range-diff` shows the commit unchanged from `d9e6ad51`, which the results below are for) 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`) - `cargo test -p xcl --lib -- hle::d3d12x::real:: --test-threads=1`: **67 passed, 0 failed**, 0 ignored (`main`: 63 passed, 0 failed). - `cargo test -p xcl --lib -- hle::d3d12x::list_x:: --test-threads=1`: **40 passed, 0 failed**, 0 ignored (`main`: 40 passed, 0 failed). - `cargo test --workspace --no-fail-fast -- --test-threads=4` 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): lib 1328 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. The other binaries fail the same 3 tests as on `main` (`e2e`, `pls_quota`, `predication_e2e`). `d3d12_resource_and_sync`: 3 passed, 0 failed. **Not tested** on this head: a retail run (the runs below are for `d9e6ad51`); native Windows, NVIDIA / Intel. AI use: Claude Code (Claude Opus 5.5) ran the builds and tests on my machine and wrote this update. --- Independent test report under Wine/Proton (not native Windows) for head `d9e6ad51`. **Setup** - AMD Radeon RX 9070 (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, CachyOS Linux 7.3.5 - Proton Experimental `experimental-11.0-20261112`, DXVK `v3.1.1-209`, DXC `1.9.2609.5`, Rust 1.96.0, target `x86_64-pc-windows-gnu` - "Patched": `vkd3d-proton` master `ec207194` with a local patch that drops the `lpVtbl` checks in `d3d12_command_allocator_from_iface` / `d3d12_command_list_from_iface`. "Stock": Proton's assertion-enabled `d3d12core.dll` (sha256 `93565013…`). - Test tree: head merged onto `main` `8b957bec` together with #2849 (`4e931734`), test commit `245ee03f`. Without #2849, `main` crashes here in 6 of 9 retail runs (#2841). **Tests** (debug, patched prefix, `XCL_REQUIRE_GPU=wave64`, `--test-threads=1`) - `hle::d3d12x::real::`: 67 passed, 0 failed (`main`: 63 passed, 0 failed) - `hle::d3d12x::list_x::`: 40 passed, 0 failed (`main`: 40 passed, 0 failed) - `cargo test -p xcl --lib -- --test-threads=4`: 1314 passed, 8 failed, 27 ignored, 8 SKIPPED. `main` the same run: 1310 passed, 8 failed, 27 ignored, 8 SKIPPED. The 8 failures are the same on both (f32/f64 GPU programs, FMA contraction, DXIL fuzz, UAV clear values, sparse tile recommit, Opus/XMA2 voices). **Retail title, 300 s, patched prefix** (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) | | runs | exit | crashes / device removed | presents | VRAM at ~90 s | |---|---|---|---|---|---| | `main` + #2849 | 6 | all 0 | 0 / 0 | 1992–2207 | 9823–9954 MiB | | `main` + #2849 + this PR | 2 | 0, 0 | 0 / 0 | 1948, 2037 | 9820, 9892 MiB | No difference I can see on the patched prefix. **Stock prefix** (exact head `d9e6ad51` on its base `08db8020`, `XCL_PREPARE=0 XCL_PSO_PRELOAD=0`): aborts after 5 s with `Assertion failed: iface->lpVtbl == &d3d12_heap_vtbl` (exit 3), as expected without #2477. #2477 on top of this commit runs the full 300 s there (report on #2477). **Not tested** - Native Windows, NVIDIA/Intel - Stock Proton on current `main`: `main` + #2849 itself crashes there during the startup shader preparation (#2555), with or without this PR, so I tested stock Proton on the PR's own base instead. **AI use** - Claude Code (Claude Opus 5.5) wrote the test scripts, ran the tests and runs on this machine and wrote this report.
gustavsi commented 2026-11-29 03:52:49 +00:00 (Migrated from github.com)

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


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

<!-- greyfinch-sync:ivall/xcl:comment:7250315222 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/867#issuecomment-7250315222). Originally posted by [gustavsi](https://github.com/gustavsi) on 2026-11-29T03:52:49Z. --- 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!861
No description provided.