Skip to content

D3D12.X: under Wine, vkd3d-proton's assert-checked classes keep their vtable - #1395

Closed
cmt8 wants to merge 1 commit into
xcl-dev:mainfrom
cmt8:wine-inplace-vtables
Closed

cmt8 wants to merge 1 commit into
xcl-dev:mainfrom
cmt8:wine-inplace-vtables

Conversation

@cmt8

@cmt8 cmt8 commented Nov 24, 2026

Copy link
Copy Markdown

Under Wine, XCL writes its PC slots into vkd3d-proton's own vtables for the seven classes vkd3d-proton checks only by assertion, so those objects keep their vtable pointer. Part of #175.

vkd3d-proton accepts heaps, resources, descriptor heaps, query heaps, root signatures, pipeline states and command signatures only with its own vtable: assert(iface->lpVtbl == &…_vtbl) in each of their methods (vkd3d_private.h). The official release builds keep the asserts, so XCL's adoption, which replaces the vtable pointer, ends the process at the first heap. A guard around host calls cannot fix that (see the 14:12Z comment on #867): the asserts sit in the objects' own methods.

This complements #867: #867 covers allocators and lists (run-time checks) and fences; this covers the assert-only classes. Neither alone runs on a stock release build.

What is in it

  • One commit, crates/xcl/src/hle/d3d12x/real.rs (+152 / −2): patch_in_place, in_place_kind, in_place_original; class_for patches in place only when the object answers QueryInterface for the PC interface with itself and every slot up to that interface's method count is in the runtime's module. Everything is behind util::under_wine().
  • Unit test real::in_place_tests::a_vtable_patched_in_place_keeps_its_originals_and_its_neighbour (no GPU).

Tested

  • RX 7900 XTX, Mesa 26.3.1 RADV, Ryzen 7 7800X3D, kernel 7.3.5, Wine 11.22, DXVK 3.1.1 dxgi, DXC 1.9.2609.5, rustc 1.100.0, x86_64-pc-windows-gnu, debug.
  • vkd3d-proton: the official v3.1 release, assertions on (sha256 d3d12.dll 502694a5…, d3d12core.dll 0dfd690a…).
  • cargo test --workspace --target x86_64-pc-windows-gnu --no-fail-fast -- --test-threads=4, aborted binaries rerun one test per process; no SKIPPED:
main 930e8b4 this PR fd97d91 this PR + #867 (rebased locally)
whole suite: passed / failed / aborted / ignored 734 / 6 / 11 / 41 735 / 9 / 8 / 41 744 / 6 / 4 / 41
test title 6 [PASS], abort: heap assert (1077) 30 [PASS], abort: fence assert (705) 33 [PASS], abort: fence assert (772)

Regression run

main:

xcl-smoke v1
commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56
gpu: AMD Radeon RX 7900 XTX (RADV NAVI31)
title: game
seconds: 60
exit: 0x0
frames shown: 1469 (PresentX 1469)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

This PR:

xcl-smoke v1
commit: fd97d91e6c09532dfeb130280bf34201c6e28721
gpu: AMD Radeon RX 7900 XTX (RADV NAVI31)
title: game
seconds: 60
exit: 0x0
frames shown: 1488 (PresentX 1488)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

Not tested

  • Windows (no Windows machine; the change is inert there by under_wine()), NVIDIA, Intel.
  • Proton's Wine and Proton's vkd3d-proton. vkd3d-proton master ec20719 was read, not run: same seven tables and asserts.
  • A retail title on a stock release build: it needs this PR and D3D12.X: preserve native vtables and wrap fences for vkd3d-proton under Wine (#175) #867 together.
  • The lock that makes in-place classes one at a time has no test; the race it closes was found by reading, never observed.

AI use

  • Claude Code. Code and tests written by Claude Opus 5.5 agents, supervised and reviewed by Claude Mythos 5.2; the description was written by Claude Mythos 5.2. Runs were made on my hardware.

🤖 Generated with Claude Code

https://claude.ai/code/session_019twRmV74bPu5j5TBXjrNug

… vtable

vkd3d-proton takes a heap, resource, descriptor heap, query heap, root signature, pipeline state
or command signature only with its own vtable: an assert(iface->lpVtbl == &..._vtbl) in each of
its methods and wherever one is passed in (vkd3d_private.h). The official release builds keep
these asserts, so adoption, which replaces the vtable pointer, ends the process (status 3) at
the first such object: under Wine with the v3.1 release DLLs the test title stops at its first
heap after 6 checks.

Under Wine (util::under_wine) these classes now get XCL's PC slots written into the runtime's
own table instead (VirtualProtect, as XAudio2's patch does), only up to the PC interface's
method count, and only when the object answered QueryInterface for that interface with itself
and every slot up to there is in the runtime's module. orig_fn finds the entries from before
by the table. Classes are made one at a time, so no thread scans a table another is writing.
The table is shared by every object of the class (swap-chain buffers too); the overrides
already take objects XCL did not create. These classes have no console slots past the PC
interface, so nothing is lost there.

Not covered, by design: fences (console xcl-dev#12 is past the PC table), command allocators and
lists (vkd3d-proton checks those at run time, E_INVALIDARG; xcl-dev#867 handles them), bundles. On
Windows nothing changes: every new path is behind under_wine(), and orig_fn's lookup has no
table there.

Part of xcl-dev#175.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@futurepro62

futurepro62 commented Nov 24, 2026 •

Copy link
Copy Markdown

Full-suite run, since this PR has no test report yet. Tested exact head fd97d91 (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: a_vtable_patched_in_place_keeps_its_originals_and_its_neighbour.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, no skips.

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.

@TobiasFornell

Copy link
Copy Markdown

Tested #1395 together with #877 (2dc68c2, which includes #867/#871) plus your composition hint (UnadoptGuard::new skips in-place patched tables) on stock Proton Experimental 11.0-20261112's own vkd3d-proton 3.2.0 (assert-enabled), RX 9070 XT (RDNA4) / RADV 26.3.1, title 1.0.2.1. This covers the two items listed as untested in the description (Proton's own vkd3d-proton, and a retail title on a stock release build with #867 together).

Testing and write-up assisted by Claude (AI); runs on my own hardware.

gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 24, 2026
…in-place vtables

Integrates 16 upstream PRs (ivall#1380, ivall#1383, ivall#1384, ivall#1395, ivall#1398, ivall#1400,
ivall#1404, ivall#1405, ivall#1419, ivall#1420, ivall#1421, ivall#1423, ivall#1424, ivall#1427, ivall#1428, ivall#1429)
on top of the Linux/Proton fork, plus three Proton/vkd3d-proton fixes
caught during verification:
- Recompiler (ivall#1428): flatten IO_GROUP_LIMIT early-return in compute
  shaders so vkd3d-proton v3.1 dxil-spirv accepts the emitted CFG.
- D3D12.X (ivall#1395 + ivall#867): skip UnadoptGuard on in-place-patched vtables
  and restore native vtables in runner::submit_list when a prior test
  adopted the singleton ID3D12Device.
- Tests: match Wine centered default in window_position_modes.

Verified under GE-Proton11-14 (RX 9060 XT / RADV):
- gpu_sparse_vram_descriptors_buffers_and_xmem + gpu_valu_float_and_int
  + window_position_modes: 3 passed, 0 failed
- Broad sweep (present, real, sparse, clamp, dstorage, gpu_valu,
  gpu_typed_buffer): 82 passed, 0 failed, 1 ignored, 0 skipped
- 2.5 min retail title run (XCL_MEM_LIMIT=12G): 3,000+ frames at 30.0
  fps, 6.0-6.1 GB flat committed RAM, 6.4 GB local VRAM, 0 DS failures.
@DavidM1911

Copy link
Copy Markdown
Contributor

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored.

Thanks!

@nicklin11

Copy link
Copy Markdown

Test report for #867 and #1395 (each head, and the two together), on RDNA2 / RADV under Wine (the test suite only, no game run).

Tested

  • AMD Radeon RX 6700, non-XT (RDNA2, 10 GB; RADV / Wine report the adapter as "RX 6700 XT", 10224 MiB), Mesa 26.3.1 RADV, Core i3-12100F, 15 GB RAM, kernel 7.3.5, Arch Linux.
  • Wine 11.22 (Staging), official vkd3d-proton v3.1 release with assertions on (sha256 d3d12.dll 502694a5…, d3d12core.dll 0dfd690a…), DXVK 3.1.1 dxgi, DXC 1.9.2609, rustc 1.100.0, x86_64-pc-windows-gnu, debug.
  • Every test in its own process (wine <test exe> --exact <name> --test-threads=1, 4 at a time), because a vkd3d-proton assertion ends the whole process. All 17 test targets of the workspace, whole suite per tree.
  • Three trees, all on main b7aa9f3 (D3D12.X: preserve native vtables and wrap fences for vkd3d-proton under Wine (#175) #867's head 6e94390 is based on it, so it needed no rebase):
main b7aa9f3 #867 6e94390 #867 + #1395 fd97d91 + guard skip (90b4b21)
tests 811 813 814
passed 749 753 763
failed 7 6 7
aborted 12 11 1
ignored 41 41 41

(passed includes 2 tests that print SKIPPED and pass: test_title_draws_with_a_root_signature_under_the_debug_layer, uploads_start_from_each_subresources_state)

The third column merges the two heads (textually clean) and adds the two-line change @cmt8 described in #1395's discussion, UnadoptGuard::new returning None when in_place_original(*(obj as *const usize), 0).is_some(). That change is mine, applied by hand and not reviewed by them.

Joined per test against main:

Not tested

AI use

  • Claude Code, Claude Sonnet 5.5: built and ran the suite, merged the two heads, wrote this report. I read it before posting.

@wayback94

Copy link
Copy Markdown

Test report for #867 and #1395 on NVIDIA under Wine, with Proton Experimental's own vkd3d-proton (assertions on). The test suite only, no game run.

With #867 (a4c5a82) and #1395 (fd97d91) together, plus the guard skip @cmt8 suggested, no vtable assertion is left in the suite on Proton's own vkd3d-proton, on an RTX 3080. That removes 12 aborts. The e2e test title now gets past the d3d12_heap_vtbl assertion and fails only on the two checks it fails on the patched build too. Neither PR alone is enough. On the patched vkd3d-proton (#257), both together change no test result.

Tested

tree / prefix tests passed failed aborted timed out ignored
A main, stock 1148 1083 5 14 0 46
B #867, stock 1150 1087 4 13 0 46
D #1395, stock 1149 1086 7 10 0 46
C #867 + #1395, stock 1151 1098 5 2 0 46
A main, patched 1148 1093 8 1 0 46
C #867 + #1395, patched 1151 1096 8 1 0 46

"Passed" includes 14 tests that print SKIPPED and pass, the same 14 on every tree:

  • 11 no wave64 (wave64 variants in gpu::recomp::lower / lower_dxil / tests);
  • lower_dxil::tests::f16_programs_on_the_gpu: the wave32 per-lane form is refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's));
  • heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows);
  • pso_measurement_compiles_an_exact_synthetic_record (cannot disable the driver cache (Windows Developer Mode is required): Not implemented. (0x80004001)).

Per test against main on the stock prefix. Every result that differs between A and C was rerun 3 more times on both trees, and all 3 gave the same result each time:

  • Aborts on main, stock: 11 at vtable assertions (d3d12_fence_vtbl ×4, d3d12_heap_vtbl ×3, d3d12_root_signature_vtbl ×2, d3d12_resource_vtbl ×2), plus mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares (exit 5) and the two below that aren't about vtables. The e2e test fails because its title hits d3d12_heap_vtbl (vkd3d_private.h:1077).

  • D3D12.X: preserve native vtables and wrap fences for vkd3d-proton under Wine (#175) #867 alone: a_recording_outlives_the_reset_of_the_titles_allocator goes from failed to passed. mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares goes from aborted to passed. Its two new tests pass. The fence assertions are gone, and the heap / resource / root-signature ones remain (d3d12_heap_vtbl ×4, d3d12_root_signature_vtbl ×4, d3d12_resource_vtbl ×3).

  • D3D12.X: under Wine, vkd3d-proton's assert-checked classes keep their vtable #1395 alone: the heap / root-signature / resource assertions are gone, and its new test passes. The fence assertions remain (d3d12_fence_vtbl ×7). Two tests go from an abort to a failure: gpu_sparse_vram_descriptors_buffers_and_xmem (tests.rs:3993) and create_list_reset_and_clear_state_track_initial_pso_on_d3d12 (bind.rs:1501). Both pass on C.

  • Both together: all vtable assertions are gone. These 11 go from aborted to passed:

    • gpu_compute_e2e ×2
    • sparse_reinit
    • gpu_sparse_vram_descriptors_buffers_and_xmem
    • create_list_reset_and_clear_state_track_initial_pso_on_d3d12
    • mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares
    • gpu_placed_console_depth_target_with_clear_value
    • passthrough_mesh_stream_accepts_a_triangle_driver_blob
    • title_textures ×2
    • vram::d32s8_targets_take_their_own_size_of_video_memory

    a_recording_outlives_the_reset_of_the_titles_allocator goes from failed to passed, and all three new tests pass. No test that passes on main fails or aborts.

  • predication_e2e::set_predication_buffer_state_and_kickoff goes from an abort (d3d12_resource_vtbl) to a failure (EQUAL_ZERO(0) must skip dst[0], predication_e2e.rs:360), as @nicklin11 saw on RADV. It fails the same way on main with the patched build, so the assertion was only hiding it.

  • e2e on C, stock: the title runs, and the test fails on the same two checks as on the patched build (user32 … W: not cloaked, XMA2 GetState: ctx=0x0, queued=1).

  • C on the stock prefix without VKD3D_CONFIG=ignore_shared_fence: the same result for all 1151 tests as with it.

Not about these PRs, the same on every tree:

Not tested

AI use

  • Claude Code (Claude Opus 5.5) built the trees, made the prefix, wrote the per-test runner and the script that counts and compares its output, ran the tests and wrote this report.

@Alm0stSurely

Alm0stSurely commented Nov 25, 2026 •

Copy link
Copy Markdown

Paired GPU test and startup check on EndeavourOS, Ryzen 9 9950X3D, RTX 5080, NVIDIA 620.73.04, 60 GiB usable RAM. Stock Proton Experimental vkd3d-proton 3.2 cae8353ed7959c4 (d3d12core.dll SHA-256 1c99dcd39c5de795bd4063d565ec2decabb2bb6deb4422b28dd8c34caef7eb4f). Local integration baseline used for this comparison, then the same tree plus fd97d91e6c09532dfeb130280bf34201c6e28721 alone as the runtime change.

xcl.exe --exact hle::d3d12x::real::console_format_query_tests::gpu_placed_console_depth_target_with_clear_value --nocapture --test-threads=1 in a fresh isolated Proton prefix per run (VKD3D_CONFIG=ignore_shared_fence,breadcrumbs). Before: iface->lpVtbl == &d3d12_heap_vtbl at vkd3d_private.h:1078. After: 1 passed in 0.96 s. XCL took the dedicated allocation fallback for the 256×256 format-118 texture.

Startup on the same stock driver also advanced past heap adoption. Before: last interface ID3D12Heap1, exit 3 at 0.952 s, zero presents. After: heap patched in place, then ID3D12CommandQueue and ID3D12Fence1 logged, exit 3 at 1.008 s, zero presents. The failing fence method or assertion has not been identified. This tests #1395 alone on this integration; it adds a startup observation to the suite results above.

Tested and reported with Codex (GPT-6.2 Astra).

Follow-up, same RTX 5080 and stock driver. Added a local port of #867 (a4c5a8228688d6642a21aaee80eaed5653905164) on top of #1395, including the in-place guard skip discussed above. The port retains the integration’s fence notifications and submission tracking; binary SHA-256 718d2d7dfed8624e4e92bd0c97846105b6bbc72e944e6754c070931800991865. The focused fence proxy test passed. Same launcher, input sequence, fresh prefix and initial shader cache as the #1395-only run. First PresentX at 3.389 s, 4,290 presents total. Capture confirms the account picker, intro artwork and illustrated loading screens, then black. First logged unhandled exception at 280.779 s: 0xc0000005 in d3d12core.dll+0x4b2350. A later dbghelp.dll exception occurred during reporting. No verified playable 3D scene. One title run on this composition.

Repeat on the same executable and stock DLLs, fresh copy of the same initial cache. Illustrated loading reproduced (1,719 presents). First exception differed: at 100.075 s, and again on another thread at 100.578 s, 0xc0000005 at d3d12core.dll+0x28baa6. Each thread had just logged a different compute PSO compile start (7 and 10 ms earlier). The diagnostic run had a shorter 230 s cap and stack samples scheduled at 185/205/225 s; it exited before any sample. This confirms the startup gain on two runs; the later failure site varies.

Compute translation control: same executable, stock driver, fresh copy of the same cache seed and 600 s cap as the first paired title run. Changed XCL_DIRECT_DXIL=1 to 0. Both records that were compiling during the repeat now returned successful compute PSO creation (943 ms and 2,079 ms, matched by record, sequence and thread). The title still reached illustrated loading, then black (1,681 presents). First unhandled exception at 209.901 s: 0xc0000005 in d3d12core.dll+0x4b2350, the same module offset as the first run with direct compute translation enabled. Successful creation of these two PSOs alone did not advance the visible stage.

@winne42

winne42 commented Nov 25, 2026

Copy link
Copy Markdown

Test report for fd97d91 (with #867 at a4c5a82), on NVIDIA. It confirms this PR's description: with the one guard condition, the two together pass every vkd3d-proton assertion.

Tested

  • NVIDIA GeForce RTX 3050 Laptop (4 GB, driver 580.178.04), AMD Ryzen 9 5900HX, Ubuntu 26.10 (Kubuntu), kernel 7.3.0-11, Wine 10.0, DXVK 3.1.1 dxgi
  • vkd3d-proton: the official v3.1 release, assertions on (d3d12.dll sha256 502694a5…, d3d12core.dll 0dfd690a…, the same build as in the description); DXC 1.9.2609.5
  • Rust 1.98.1, x86_64-pc-windows-gnu; hle::d3d12x tests in debug, the test title in release
  • Each tree below is main 568e7db with the PRs merged in (no conflicts). cargo test -p xcl --lib --target x86_64-pc-windows-gnu -- --test-threads=1 hle::d3d12x, and again with one test per process (--exact) where an assertion ends the run. The test title is tests/data/testgame with xcl_testtitle.exe, run for 30 s. No SKIPPED.
main 568e7db + hle::d3d12x, one process per test: ok / failed / aborted / ignored test title
nothing 166 / 3 / 8 / 2 (of 179) 5 [PASS], abort: heap assert (1077)
#867 170 / 2 / 7 / 2 5 [PASS], abort: heap assert (1077)
this PR 169 / 4 / 5 / 2 28 [PASS], abort: fence assert (705)
#867 + this PR 174 / 2 / 4 / 2 31 [PASS], abort: resource assert (1302)
#867 + this PR + guard condition 177 / 2 / 1 / 2; one process: 178 passed, 2 failed, 2 ignored runs to its end: done, failures: 11, 39 [PASS]
  • main → this PR, per test: gpu_placed_console_depth_target_with_clear_value and passthrough_mesh_stream_accepts_a_triangle_driver_blob go from an abort to ok. create_list_reset_and_clear_state_track_initial_pso_on_d3d12 goes from an abort to a fail. No pass becomes a fail.
  • D3D12.X: preserve native vtables and wrap fences for vkd3d-proton under Wine (#175) #867 + this PR as they are: gpu_placed_console_depth_target_with_clear_value aborts at the heap assert again, and create_list_reset… at a pipeline-state assert (2556), as you describe: UnadoptGuard takes ext[-1] of a table patched in place.
  • The guard condition I used, in UnadoptGuard::new on the merged tree, and nothing else:
    if !crate::util::under_wine() || !is_adopted(obj) || in_place_original(*(obj as *const usize), 0).is_some() {
    With it, all 8 tests that abort or fail on main because of Linux (Wine + vkd3d-proton): a retail game reaches what main reaches on Windows; the obstacle is replaced vtables — proposal: proxies #175 pass. The 2 that still fail (gpu_depth_buffer_created_for_unordered_access_is_placed, write_buffer_immediate_on_open_existing_heap_visible_to_cpu) and the 1 abort without an assertion (execute_indirect_reads_the_arguments_written_before_it) do the same on main.
  • The test title's 11 failures in the last row are D3D12.X checks that main never reaches: DMA copy, sparse VRAM, title-memory textures, occlusion queries, depth bias, and one XAudio2 check. Every run here also logs UMA import check: the GPU does not see what the CPU writes to unified memory (Wine without a userfaultfd write watch), which is the likely cause for most of them. I have not checked that. After done, the title ends with 0xb.

Not tested

  • A retail title. scripts/smoke.ps1 ran through a wrapper that starts xcl.exe under Wine, but only on the test title, which has no frame loop: exit 0x3 in every row except the last, which exits 0xb, no frames.
  • AMD and Intel GPUs, Proton's own Wine and vkd3d-proton, Windows.

Written with Claude Code (Claude Opus 5.5), which ran the builds and tests on my machine; part of the D51 check on #1607.

@wayback94

Copy link
Copy Markdown

Test report for #867 and #1395 on NVIDIA under Wine, with Proton Experimental's own vkd3d-proton (assertions on): the test suite, and the retail title for 60 s.

With #867 (a4c5a82) and #1395 (fd97d91) together, plus the guard skip @cmt8 suggested, no vtable assertion is left in the suite on Proton's own vkd3d-proton, on an RTX 3080. That removes 12 aborts. The e2e test title now gets past the d3d12_heap_vtbl assertion and fails only on the two checks it fails on the patched build too. Neither PR alone is enough. On the patched vkd3d-proton (#257), both together change no test result.

The retail title runs on a stock release build of vkd3d-proton with both PRs (#1395's "Not tested"). main ends 1.5 s in at d3d12_heap_vtbl, both times. With both PRs, it runs 60 s at 60 presents per 2 s, as on the patched build.

Tested

tree / prefix tests passed failed aborted timed out ignored
A main, stock 1148 1083 5 14 0 46
B #867, stock 1150 1087 4 13 0 46
D #1395, stock 1149 1086 7 10 0 46
C #867 + #1395, stock 1151 1098 5 2 0 46
A main, patched 1148 1093 8 1 0 46
C #867 + #1395, patched 1151 1096 8 1 0 46

"Passed" includes 14 tests that print SKIPPED and pass, the same 14 on every tree:

  • 11 no wave64 (wave64 variants in gpu::recomp::lower / lower_dxil / tests);
  • lower_dxil::tests::f16_programs_on_the_gpu: the wave32 per-lane form is refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's));
  • heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows);
  • pso_measurement_compiles_an_exact_synthetic_record (cannot disable the driver cache (Windows Developer Mode is required): Not implemented. (0x80004001)).

Per test against main on the stock prefix. Every result that differs between A and C was rerun 3 more times on both trees, and all 3 gave the same result each time:

  • Aborts on main, stock: 11 at vtable assertions (d3d12_fence_vtbl ×4, d3d12_heap_vtbl ×3, d3d12_root_signature_vtbl ×2, d3d12_resource_vtbl ×2), plus mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares (exit 5) and the two below that aren't about vtables. The e2e test fails because its title hits d3d12_heap_vtbl (vkd3d_private.h:1077).

  • D3D12.X: preserve native vtables and wrap fences for vkd3d-proton under Wine (#175) #867 alone: a_recording_outlives_the_reset_of_the_titles_allocator goes from failed to passed. mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares goes from aborted to passed. Its two new tests pass. The fence assertions are gone, and the heap / resource / root-signature ones remain (d3d12_heap_vtbl ×4, d3d12_root_signature_vtbl ×4, d3d12_resource_vtbl ×3).

  • D3D12.X: under Wine, vkd3d-proton's assert-checked classes keep their vtable #1395 alone: the heap / root-signature / resource assertions are gone, and its new test passes. The fence assertions remain (d3d12_fence_vtbl ×7). Two tests go from an abort to a failure: gpu_sparse_vram_descriptors_buffers_and_xmem (tests.rs:3993) and create_list_reset_and_clear_state_track_initial_pso_on_d3d12 (bind.rs:1501). Both pass on C.

  • Both together: all vtable assertions are gone. These 11 go from aborted to passed:

    • gpu_compute_e2e ×2
    • sparse_reinit
    • gpu_sparse_vram_descriptors_buffers_and_xmem
    • create_list_reset_and_clear_state_track_initial_pso_on_d3d12
    • mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares
    • gpu_placed_console_depth_target_with_clear_value
    • passthrough_mesh_stream_accepts_a_triangle_driver_blob
    • title_textures ×2
    • vram::d32s8_targets_take_their_own_size_of_video_memory

    a_recording_outlives_the_reset_of_the_titles_allocator goes from failed to passed, and all three new tests pass. No test that passes on main fails or aborts.

  • predication_e2e::set_predication_buffer_state_and_kickoff goes from an abort (d3d12_resource_vtbl) to a failure (EQUAL_ZERO(0) must skip dst[0], predication_e2e.rs:360), as @nicklin11 saw on RADV. It fails the same way on main with the patched build, so the assertion was only hiding it.

  • e2e on C, stock: the title runs, and the test fails on the same two checks as on the patched build (user32 … W: not cloaked, XMA2 GetState: ctx=0x0, queued=1).

  • C on the stock prefix without VKD3D_CONFIG=ignore_shared_fence: the same result for all 1151 tests as with it.

The retail title, 60 s, no input (intro and menus), with #257's scripts/linux/smoke.sh. The environment is the one above, without XCL_SAMPLE_*. Release builds of A (xcl.exe sha256 00d34714…) and C (6f61f795…), both from clean trees. C's commit 7d38704 is my local merge, not on GitHub. title: is the same hash smoke.ps1 prints for this folder. Under Wine peak commit reads 0 MB, so the 125 % rule can't be checked here. Runs in this order, one warm-up per prefix, all of them listed:

# tree / prefix exit frames shown presents per 2 s (last 3) device removals / crashes
1 C, stock (warm-up) 0x0 1560 60 60 60 0 / 0
2 C, stock 0x0 1590 60 60 60 0 / 0
3 A main, stock abort (status 0x3) at 1.54 s – – –
4 A, patched (warm-up) 0x0 1553 60 60 60 0 / 0
5 A main, patched 0x0 1589 60 60 60 0 / 0
6 C, patched 0x0 1592 60 60 60 0 / 0
7 C, stock 0x0 1589 60 60 60 0 / 0
8 A main, stock abort (status 0x3) at 1.55 s – – –
  • main on stock: both runs end right after XCL adopts the title's first ID3D12Heap1. A run with Wine's stderr kept prints Assertion failed: iface->lpVtbl == &d3d12_heap_vtbl, file ../src-vkd3d-proton/libs/vkd3d/vkd3d_private.h, line 1077, the same assertion as the e2e test title.
  • C on stock: XCL's log has ID3D12Heap1 – 10 PC methods written into the runtime's own vtable (Wine: vkd3d-proton checks it; …), which is D3D12.X: under Wine, vkd3d-proton's assert-checked classes keep their vtable #1395's path. There are no assertions, device removals, crashes, GPU fence still pending or [ERROR] lines. report.json gives 228 translated pipelines and the same 40 refused mesh pipelines as on the patched build, with 460 DXIL cache hits and no compiles (warm cache).
  • C against A on the patched build: 1592 against 1589 frames, with the same pipeline counts.

C, stock (run 7):

xcl-smoke v1
commit: 7d38704237596c8ab3eb5cc88507b58bba0c116d
gpu: NVIDIA GeForce RTX 3080 10GB
title: 9a60a330
seconds: 60
exit: 0x0
frames shown: 1589 (PresentX 1589)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

For main on stock, smoke.sh printed no block. When the log has no frames shown line, its frames=$(grep … | tail -n 1 | sed …) fails under set -euo pipefail, and the script exits 1 with no output instead of printing none logged. That's a bug in #257's script, not in these PRs.

Not about these PRs, the same on every tree:

Not tested

AI use

  • Claude Code (Claude Opus 5.5) built the trees, made the prefix, wrote the per-test runner and the script that counts and compares its output, ran the tests and the title runs, and wrote this report.

@pitabreadwithcheese

Copy link
Copy Markdown

I ran the PR on Nobara proton experimental here's an ai summary:

Test report for #1395 + #867 (with the 2-line UnadoptGuard::new skip for in-place patched vtables) on AMD RDNA3 / RADV under stock Proton Experimental, running the retail title (1.0.2.1).

Setup

  • GPU: AMD Radeon RX 7600 (8 GB / 7936 MiB VRAM)
  • OS / Runtime: Nobara Linux, stock Steam Proton Experimental (vkd3d-proton 3.2, assertions enabled)
  • Build: main (568e7db) + #867 + #1395 + UnadoptGuard::new in-place skip, x86_64-pc-windows-msvc release, DXC 1.9.2609.5 (01b62ad4)

Result

  • Vtable assertions: None — all 7 assert-checked classes (ID3D12Heap1, ID3D12Resource2, ID3D12DescriptorHeap, ID3D12RootSignature, ID3D12PipelineState, ID3D12QueryHeap, ID3D12CommandSignature) logged PC methods written into the runtime's own vtable with zero assertions.
  • Boot & UI progression: First game frame shown at 13.905 s (3840x2160); rendered the account picker, splash artwork (unpacking 392 BCPack BC1/BC5/BC6H/BC7 requests with 0 failures), Legal Notices, and Privacy Policy / Terms of Service screens (933 presents, 22 translated pipelines, 0 failed pipelines).
  • Where it stops: After accepting the Terms of Service and entering story prestream, the sparse queue hits 5 s fence timeouts (sparse: the queue has not reached fence value ... after 5 s) and ends at the known end-of-setup / world-entry null write (0xc0000005 write at 0x0 in game_scarlett_master.exe+0x23cf683, matching The retail title 1.0.2.1 (RTX 5070): reaches the end of the first-run setup, then deterministic 0xC0000005 write at 0x0 in game_scarlett_master.exe+0x23cf683 #846 / Roadmap: retail title past world load #1833).

@cmt8

cmt8 commented Nov 25, 2026

Copy link
Copy Markdown
Author

This isn't gonna be merged and I've moved my focus to other projects. Feel free to use the code for whatever but closing this PR

@cmt8 cmt8 closed this Nov 25, 2026
gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 25, 2026
…1860, xcl-dev#1913, xcl-dev#2192, xcl-dev#1946, xcl-dev#2237

Integrates XG CopyFromSubresource 7-arg ABI (xcl-dev#684), DirectStorage physical-page list re-read (xcl-dev#1405), vkd3d-proton in-place vtable patching with UnadoptGuard composition (xcl-dev#1395), single-back-edge Direct DXIL CFG (xcl-dev#1860), wave64 graphics Direct DXIL guard (xcl-dev#1913), and AMD RDNA2-4 DXIL fuzz fixes (xcl-dev#2192, xcl-dev#1946, xcl-dev#2237).
gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 25, 2026
Carries forward the permitted in-place vtable patching from closed xcl-dev#1395
(originally by @cmt8) on top of xcl-dev#867, skipping in-place patched tables in
UnadoptGuard::new so ext[-1] is never read on runtime-owned vtables.

Under Wine, vkd3d-proton asserts iface->lpVtbl == &d3d12_*_vtbl on heaps,
resources, descriptor/query heaps, root signatures, pipeline states and
command signatures even in release builds. Patching their PC slots in place
preserves the runtime's vtable pointer and avoids those aborts on stock
Proton Experimental / vkd3d-proton 3.2.

Assisted-by: Antigravity (Gemini 4 Neon)
gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 25, 2026
…1946, xcl-dev#1803, xcl-dev#2297, xcl-dev#2320, xcl-dev#2333

Carries forward still-open high-value upstream PRs onto upstream/main (2898511)
+ our updated Wine PR stack (xcl-dev#867, xcl-dev#1395-successor, xcl-dev#871, xcl-dev#877, xcl-dev#1732).
Preserves UnadoptGuard in xcl-dev#2320 KickoffX reset_one.

Assisted-by: Antigravity (Gemini 4 Neon)
gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 25, 2026
Carries forward the permitted in-place vtable patching from closed xcl-dev#1395
(originally by @cmt8) on top of xcl-dev#867, skipping in-place patched tables in
UnadoptGuard::new so ext[-1] is never read on runtime-owned vtables.

Under Wine, vkd3d-proton asserts iface->lpVtbl == &d3d12_*_vtbl on heaps,
resources, descriptor/query heaps, root signatures, pipeline states and
command signatures even in release builds. Patching their PC slots in place
preserves the runtime's vtable pointer and avoids those aborts on stock
Proton Experimental / vkd3d-proton 3.2.

Assisted-by: Antigravity (Gemini 4 Neon)
gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 25, 2026
Carries forward the permitted in-place vtable patching from closed xcl-dev#1395
(originally by @cmt8) on top of xcl-dev#867, skipping in-place patched tables in
UnadoptGuard::new so ext[-1] is never read on runtime-owned vtables.

Under Wine, vkd3d-proton asserts iface->lpVtbl == &d3d12_*_vtbl on heaps,
resources, descriptor/query heaps, root signatures, pipeline states and
command signatures even in release builds. Patching their PC slots in place
preserves the runtime's vtable pointer and avoids those aborts on stock
Proton Experimental / vkd3d-proton 3.2.

Assisted-by: Antigravity (Gemini 4 Neon)
gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 25, 2026
…1946, xcl-dev#1803, xcl-dev#2297, xcl-dev#2320, xcl-dev#2333

Carries forward still-open high-value upstream PRs onto upstream/main (2898511)
+ our updated Wine PR stack (xcl-dev#867, xcl-dev#1395-successor, xcl-dev#871, xcl-dev#877, xcl-dev#1732).
Preserves UnadoptGuard in xcl-dev#2320 KickoffX reset_one.

Assisted-by: Antigravity (Gemini 4 Neon)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants