Repository navigation
Conversation
bmjask
left a comment
There was a problem hiding this comment.
No confirmed code-level defect found, but this is high-risk and not merge-ready. The target validation gap is material: the intended assertion-enabled stock Proton/vkd3d-proton scenario was not reproduced directly; the author run used GE-Proton with assertions disabled. Please reproduce it before merge. Also, the shared runtime vtable is patched while other threads may call it; aligned entry stores are relied upon, but there is no concurrent call/patch stress test despite the process-wide blast radius. Finally, the branch is dirty/non-mergeable and stacked on #867, so it needs a rebase and refreshed CI/test evidence.
86a10c6 to
0c249f0
Compare
|
Thanks @bmjask for the review! Addressed all three points at
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Update for head
Stock assertion-enabled Proton (
Patched
Not tested
AI use
Update for head Independent test report under Wine/Proton (not native Windows), on stock Proton Experimental Tested
Not tested
AI use
Independent AMD RDNA4 / Linux (RADV, native wave64) test report for head Hardware & environment
Unit / GPU tests (
Retail title (60 s, stock assertion-enabled Proton Experimental
Not tested
AI use
|
0c249f0 to
96b91da
Compare
|
Thanks @ClosetPie107 for the independent AMD RDNA4 verification on stock assertion-enabled Proton Experimental (60 s at 30.0 fps, 0 assertions, 0 crashes) and @DavidM1911 for verifying on Windows 11! Rebased onto
AI use: Antigravity (Gemini 4 Neon) rebased onto |
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
Royalflamejlh
left a comment
There was a problem hiding this comment.
The new test concurrent_calls_and_patches_on_readonly_vtable_never_tear_or_miss_orig_fn failed on 0c249f0 under Wine in 3 of 21 runs of real::in_place_tests real::wine_vtable_tests (4 tests) at --test-threads=4, the count scripts/test.ps1 uses, at real.rs:8070 ("callers must observe the patched hook"); alone and at one thread it passed 10 of 10 each. The test is unchanged at the rebased head 96b91da (the loop and the assert are now at :8058 and :8097); we have not rerun it there. The change itself works on Linux + NVIDIA: on a vkd3d-proton built with assertions on and without XCL's relaxed-vtable patch, #867 alone aborts before the first frame and #2477 on top runs.
The callers stop after 20,000 calls each (:8058 at 96b91da), so if the patch lands after they finish, hook_hits stays 0 (a reading of the test). With the loop bounded by time instead, the same 4 tests passed 25 of 25 runs at --test-threads=4 here, each in 0.02–0.04 s: the callers still stop once the hook has been seen, so the 10 s only bounds a failing run:
// real.rs:8058 at 96b91da, in place of `for _ in 0..20_000 {`
let until = std::time::Instant::now() + std::time::Duration::from_secs(10);
while std::time::Instant::now() < until {Setup: main e0d93c84 (the commit this head is rebased on) + #684 e56dbc3, then + #867 f98da36, then + #2477 0c249f0. RTX 4070 12 GB (615.71.09), Fedora 44, Wine 11.21 Staging, release, Series X profile, 100 s, XCL_PSO_PRELOAD=0. vkd3d-proton v3.1-90-g30b0eb9b without the relaxed-vtable patch, assertions on (d3d12core.dll 5b59f1b8…) and off.
| tree | assertions | runs | result |
|---|---|---|---|
| base + #684 | on | 1 | Assertion failed: iface->lpVtbl == &d3d12_heap_vtbl (vkd3d_private.h:1078), 0 frames |
| + #867 | on | 1 | the same, 0 frames |
| + #867 + #2477 | on | 2 | ran, presented until about 76 and 70 s |
| + #867 + #2477 | off | 1 | ran, presented until about 88 s |
- The heads before the rebase (
86a10c6,c79e3b3) gave the same pattern on the assertion build: the base and #867 aborted in 2 of 2 runs each, and #2477 ran in 3 of 3.
Not tested: Proton's own build; the suite; Windows.
AI use: Claude Code (Claude Opus 5.5) ran the title and the tests, tried the fix and wrote this comment.
96b91da to
94a05e5
Compare
|
Thanks @Royalflamejlh for the assertion-enabled Applied the suggested 10 s deadline loop in
AI use: Antigravity (Gemini 4 Neon) applied the time-bounded loop fix, ran the 25× stress test and smoke run, and drafted this comment. |
|
Tested on an RTX 5080 16 GB, NVIDIA 620.73.04, Linux, stock Proton Experimental (vkd3d-proton
The parent started with 14,308 MiB free VRAM; this run started with 10,883 MiB. The local guard ended the latter at 5,045 MiB free (cutoff 5,120), about 14 s after preflight. This verifies the heap fix on this Proton build. World rendering, stability beyond that point and gameplay FPS remain unmeasured. Follow-up on AI use: OpenAI Codex (gpt-6.2-astra) ran the comparison, checked the logs and capture, and wrote this report. RTX 5080 / Proton Experimental follow-up on the same NVIDIA base, af2cecc. With the heap-only port of #2477, full preparation processed 26,503/26,503 entries in 27,081.6 s and created 2,671 GPU pipelines, zero refused. The title then exited 3 at the shared-fence vtable check in vkd3d_private.h:757 before its first present. The on-demand run had reached the same assertion. A separate GPU test on that base creates a shared fence through the title device and calls queue Signal(1), Wait(1), Signal(2). The heap-only build hit the same assertion. Adding the Wine fence adapter from #867 made the same test reach completed value 2 in a 0.66 s test run. Both GPU probes used the same driver, single_queue and VK_NV_optical_flow disabled. The candidate is a local port, not a test of the latest #2477 head. AI use: OpenAI Codex (gpt-6.2-astra) adapted the existing fence changes, prepared and ran the probes, and wrote this follow-up. |
|
Reviewed The last assertion of Moving the condition into a small helper ( Read only ( AI use: Antigravity (Claude Sonnet 5.5) read the diff and the call sites; I re-checked the point |
94a05e5 to
9b9012c
Compare
|
Thanks @safesearch77, good catch: off Wine, Updated at
@Royalflamejlh, your time-bounded loop is in since AI use: Claude Code (Claude Opus 5.5) made the change, ran the tests and the smoke run, and drafted this reply; I checked it. |
|
Under Wine 11.21 Staging, at head The callers' loop is now bounded by 10 s instead of 20,000 calls ( Setup: release, Not tested: the title at this head; the whole test suite; Windows. AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this comment. Posted without review by a person: the account owner was away and reads replies later. |
Royalflamejlh
left a comment
There was a problem hiding this comment.
At 9b9012c8 the callers' loop is bounded by 10 s, the change we asked for, and the five real::in_place_tests real::wine_vtable_tests tests passed in 21 of 21 runs under Wine at --test-threads=4 (details: #2477 (comment)). This replaces our request for changes.
AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this review.
9b9012c to
a970ef3
Compare
…add XCL_PREPARE=0 opt-out Bring fork main in sync with the latest upstream PR review fixes: - xcl-dev#867: UnadoptGuard COM +1 refcount pin, under_wine() gate on create_raw_fence, and track_end_title_fence for list_x cell fences. - xcl-dev#2477: skips_guard helper and 10 s deadline loop in concurrent in-place vtable test. - xcl-dev#1732: RbStatus + retained FIFO deferred retry and per-64-byte-segment RbSnapshot/last_rb CPU-write protection for async/deferred readbacks. - present/preparation: allow XCL_PREPARE=0 (matching upstream nvidia-dev) to skip startup shader preparation during smoke runs and quick iterations. Assisted-by: Antigravity (Gemini 4 Neon)
|
Independent native Windows 11 desktop NVIDIA regression verification of PR #2477 at head Environment
Targeted release tests & build (
|
| Command | Result |
|---|---|
cargo test --release -p xcl --lib a_vtable_patched_in_place_keeps_its_originals_and_its_neighbour -- --nocapture |
1 passed; 0 failed; 0 ignored; 1336 filtered out (0.00s) |
cargo test --release -p xcl --lib concurrent_calls_and_patches_on_readonly_vtable_never_tear_or_miss_orig_fn -- --nocapture |
1 passed; 0 failed; 0 ignored; 1336 filtered out (0.00s) |
cargo test --release -p xcl --lib unadopt_guard_restores_native_vtable_and_reapplies_extended_on_drop -- --nocapture |
1 passed; 0 failed; 0 ignored; 1336 filtered out (0.00s) |
cargo test --release -p xcl --lib concurrent_release_during_unadopt_guard_still_runs_hooked_cleanup -- --nocapture |
1 passed; 0 failed; 0 ignored; 1336 filtered out (0.00s) |
cargo test --release -p xcl --lib fence_proxy_forwards_signal_unwraps_and_frees_on_final_release -- --nocapture |
1 passed; 0 failed; 0 ignored; 1336 filtered out (0.02s) |
cargo test --release -p xcl --lib track_end_title_fence_registers_once_and_addrefs -- --nocapture |
1 passed; 0 failed; 0 ignored; 1336 filtered out (0.00s) |
cargo test --release -p xcl --lib hle::d3d12x::real:: -- --test-threads=4 (3 consecutive runs) |
65 passed; 0 failed; 0 ignored; 1272 filtered out × 3 (0.66s, 0.67s, 0.70s) |
cargo test --release -p xcl --lib hle::d3d12x::list_x:: |
40 passed; 0 failed; 0 ignored; 1297 filtered out (0.68s) |
cargo test --release -p xcl --lib hle::d3d12x::sparse:: |
17 passed; 0 failed; 1 ignored; 1319 filtered out (0.30s; early_commit_timing is #[ignore]) |
cargo build --release -p xcl --bin xcl |
Clean build (1m 10s, exit 0) |
Paired quiet 60 s retail smoke (title: 29640639)
Merge-base (08db8020d323bf478964fcc586152cce54959cfc, cached baseline on the same machine):
xcl-smoke v1
commit: 08db8020d323bf478964fcc586152cce54959cfc
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1588 (PresentX 1588)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14000 MB
PR #2477 (a970ef38a57d72a642e5f7994b35fea968c17a15):
xcl-smoke v1
commit: a970ef38a57d72a642e5f7994b35fea968c17a15
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1594 (PresentX 1594)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 14011 MB
Runtime log observations (xcl.log)
9222log lines,0[ERROR]/ device-removal / panic lines.- Standard native Windows vtable adoption active (
ID3D12Device14,ID3D12Heap1,ID3D12CommandQueue,ID3D12Fence1). - Final draw/memory telemetry in log:
19483 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample14011 MB committed by the process; video memory 6116 MB local, 4683 MB non-local.
Limits of coverage
- This is a native Windows 11 (non-Wine) regression check on RTX 4060; Linux / Wine + vkd3d-proton runtime execution was NOT tested here.
- In-place vtable patching,
UnadoptGuard, and fence-proxy mechanics were verified via the 6 new unit tests (in_place_testsandwine_vtable_tests), while 3× parallelhle::d3d12x::real:: -- --test-threads=4,list_x::,sparse::(early_commit_timingremained#[ignore]), and the paired 60 s retail smoke confirm zero regression on native Windows D3D12.
AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
|
Offscreen Wine/NVIDIA verification of #2477 Crucially, the hardware legs used stock assertion-enabled vkd3d-proton Stock SHA-256: Test executable SHA-256: Machine/config: Linux 6.17, Wine 11.0, Intel i7-13620H, 16 GiB RAM, physical RTX 4060 Laptop 8 GiB / NVIDIA 590.48.01, Rust 1.98.1 / Windows MSVC target. Results / reproducible selection Hardware groups used The six CPU fixtures cover original-method/neighbor preservation, two patchers racing four callers, skip-guard behavior, concurrent final-release cleanup, fence proxy forwarding/unwrapping, and end-title fence registration. They use fake vtables, not GPU stress. The allocator group contains two bookkeeping fixtures and two hardware paths; it is not four shader tests. Evidence caveats: the CPU test binary returned 6/6, but my first postprocessor returned exit 1 because it compared single-backslash paths with Wine's escaped Local evidence:
Not tested: a matched parent-only run, full suite, all interleavings, other drivers/adapters, title loading/RAM/FPS, or our separate Game-Init stalled-fence watchdog. This supports the selected stock-vkd3d compatibility and concurrency paths; it does not certify the whole nvidia-dev merge or justify repeating an unchanged crashing title launch. Suggested owner follow-through: retain the per-caller completion/page-protection assertions and run the same adopted-device→subsequent-submit sequence in full-suite/native-Windows coverage. AI-assisted verification/report: omp, OpenAI GPT-6 Astra; all pass counts above come from executed commands. |
…er Wine (xcl-dev#175) vkd3d-proton validates iface->lpVtbl on adopted D3D12 objects passed back into d3d12core.dll (command allocators, lists, heaps, resources, PSOs, and fences). On unmodified assertion-free vkd3d-proton (such as GE-Proton or -Db_ndebug=true builds), XCL's in-place vtable adoption causes CreateCommandList/Reset to fail with E_INVALIDARG and fence waits to reject adopted fences. Under Wine (gated behind util::under_wine(), native Windows unchanged): - UnadoptGuard temporarily restores the native vtable 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. - FenceProxy wraps title ID3D12Fence1 objects so the underlying PC fence keeps its native lpVtbl, unwrapping in queue Signal/Wait while preserving Fence::xcl-dev#12 completed_value_address and freeing on final Release. - real::create_raw_fence creates un-proxied native ID3D12Fence objects for XCL's own internal queue tracking (late_release, alloc_pool, list_x, cpu_writes, present, vram, drain_gpu) so un-adopted internal queues like sparse::queue() never receive a FenceProxy. Note: assert-enabled vkd3d-proton builds (such as stock Proton Experimental) still validate iface->lpVtbl inside an adopted object's own methods, so an assertion-free build (-Db_ndebug=true / GE-Proton) remains required for in-place adoption. Assisted-by: Antigravity (Google DeepMind)
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)
a970ef3 to
5225ddc
Compare
xcl-dev#867 keeps vkd3d-proton's native vtables and wraps the title's fences, xcl-dev#2477 patches the assert-checked vtables in place under Wine: together they replace the relaxed-vtable patch the stack ran with in vkd3d-proton. Both sit on main f9a0cb8, so main comes along from b49be18. Conflicts, both sides kept: - title_textures.rs: main's read with the under-Wine guard (xcl-dev#2844), which already has the stack's ReadProcessMemory fast path. - real.rs: main's UnadoptGuard around the allocator Reset, then the stack's dispatch_chain and console_list resets. - shaders.rs: xcl-dev#2070's 64 MB precompile workers with main's cancel check, error counts and record_done; the stack's rodata on the translation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main gained 345 commits since 753e8b1, most of them bmjask's stack (xcl-dev#2959), plus xcl-dev#2872, xcl-dev#3085 and xcl-dev#3086 from this branch. Conflicts, per PR: - xcl-dev#2404 + xcl-dev#2633 (split chained ExecuteIndirect): main's xcl-dev#2959 took both over (ed98461, a05fbc4, 8626d5b: IndirectBuild/IndirectChain on a CBV root, one-command slicer, separate cache namespace). Main's side kept in dispatch_chain.rs, pso.rs (slicer, command signature, chain root), bind.rs (ExecuteIndirect path), device_x.rs (signature traits), pso_async.rs (no background whole build, so no build_waited_on), real.rs (ComputeBuild, driver_cache names) and shaders.rs (blob names). Dropped with them: slab_count, record_slicer, abi_signature_id names, the direct root-CBV constant blocks, list_x::predicated, the split.rs/runner.rs ExecuteIndirect test and the list_x chain-scratch test. Not in main: xcl-dev#2404 ran the pieces before any whole form was built; main runs the whole form (built on the title's thread) until the indirect set is ready. - xcl-dev#2707 (allocator reclaim): main has it (31930d8, 057f463, 8e7b566). alloc_pool.rs is main's, with xcl-dev#867's changes on top; bind.rs takes main's native_backing; xcl-dev#2707's tests and bind::push_uma_for_test go. - xcl-dev#867 + xcl-dev#2477 (Wine vtables and fences), adapted to main's new code: real.rs keeps the in-place patching, UnadoptGuard and FenceProxy beside main's native_queue_* helpers; guards in cl_reset, bind_pipeline_exact, clear_pipeline_exact, reset_pc_allocator, the title ExecuteCommandLists closure and native_queue_execute; Signal/Wait unwrap the title's fence (also in native_queue_signal/wait); list_x guards in reset_reserved_segment and KickoffX's submit closures; create_raw_fence for main's new internal fences in alloc_pool.rs (SubmissionGate), title_textures.rs, present.rs, vram.rs, sparse.rs, cpu_writes.rs; tests as xcl-dev#2477 had them; runner.rs is main's plus submit_list. - xcl-dev#1803 (heap addresses): kept, carried into main's PreparedSplit and PreparedAbiState (prepared_abi_io takes the heaps). - xcl-dev#1368 (NodeMask 0): kept in compute_container, before main's per-node blob names, so names and pipeline use node 0. - xcl-dev#1860, xcl-dev#2082 (cfg.rs, module/opt.rs): cfg.rs is 1567f72's version (xcl-dev#1860 on main's Succs); opt.rs is that plus xcl-dev#2082's arm and test. - xcl-dev#2229 (rodata): kept through main's kernel.rs entry points; translate_entry_rodata loses wave32_only as main dropped per-GPU tables (3cde0cc); pso.rs and coverage.rs call it with main's options (no_remap, split for graphics); recomp Options keeps rodata and no_remap. - xcl-dev#1975: kept in emit.rs and lower_valu.rs; its mesh barrier guard and its test dropped, main's wider guard (2ca9127) covers it; the now-unused lower::has_non_uniform_barrier goes. - xcl-dev#2070 (64 MB stacks): pso_async::WORKER_STACK on main's worker, helper and preload threads; shaders.rs's piece threads on worker_thread. - xcl-dev#2551 (whole forms prebuilt): split_whole_roots(false) is DirectChain, so the precompile builds every split program's whole form; main built it only for programs an earlier run used through ExecuteIndirect. - xcl-dev#688 (dxc.rs imports), xcl-dev#2762 (host.rs log line), xcl-dev#3090 (list_x tests), arch/window-title-commit (present.rs with_commit on main's compiling_text), README.md: both sides. - list_x.rs: main dropped title_textures::list_reset; main's side. - sparse.rs, vram.rs: main's quarantine_tiles_for and per-device retire state, with create_raw_fence. - xcl-dev#3090, xcl-dev#3092 tests: runner::device and Uma::block_len added from nvidia-dev (5 and 12 lines) so the lib tests compile. - xcl-dev#751: its commit is already in main (b84e037, via xcl-dev#2844); it leaves the README table with xcl-dev#2404, xcl-dev#2633, xcl-dev#2707, xcl-dev#2872, xcl-dev#3085 and xcl-dev#3086. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Closing as I'm stepping away from the project, but anyone is welcome to rebase and reuse these commits. |
main has merged nvidia-dev (xcl-dev#3203): its two-pass mesh, sparse and upload paths now submit through real::native_queue_execute / _signal / _wait. Those already carry xcl-dev#867's UnadoptGuard and unwrap_fence; the conflicts and the main-only submit paths were resolved as follows. Taken from main, the stack's version dropped (main does the same): - recomp/dxc.rs (3): xcl-dev#688's private DXC heaps; main's form (3842807) falls back on any failure and never destroys a heap. - device_x.rs (10): xcl-dev#3091 (cherry-pick 511a297); main's 7e24237 keeps interned shader copies for base pipelines. xcl-dev#3091's tests and its real.rs test counter (GRAPHICS_FALLBACK_ATTEMPTS) and README line go; xcl-dev#2753's console_bytes is re-applied on main's file. - bind.rs (16): the stack's only change there was xcl-dev#1803, merged in main. main's file, plus the xcl-dev#2816 feedback-copy UnadoptGuard in poll_two_pass_feedback (ed887d2, from linux/stack-nvidia-dev). - pso.rs: main has daae033 (multidimensional groups take direct DXIL, xcl-dev#3189's change), so the stack-only commit is in main; translate calls take main's translate_compute_rodata / translate_entry_rodata_rt32. - list_x.rs tests: xcl-dev#3090's barrier tests were in twice (cherry-pick and main's merge); the cherry-picked copy goes. - runner.rs device(), xbox.rs Fssm::rodata: added on both sides; one copy. - README.md: the precompile-wrapper paragraph was added on both sides; one copy. Both kept: - build.rs (2): TRANSLATION_GLUE_REVISION "pso-glue-v5-linux-multidimensional- direct" (main's v5 + the stack suffix); translator sources keep xcl-dev#2229's cfg.rs and code_loads.rs, drop dxc.rs as main does. - dxil/kernel.rs (6): TRANSLATOR_VERSION 13 (main 12; the stack's xcl-dev#2229 head output differs, as on linux/stack-nvidia-dev); main's rt32 entry points with xcl-dev#2229's code_loads. - dxil/lower.rs (4), lower_mem.rs (3), lower_window.rs (1), recomp/emit.rs (11), recomp/mod.rs (3), recomp/tests.rs (1), core_tests.rs: main has an earlier copy of xcl-dev#2229 (41f1a85); xcl-dev#2229's head (code_loads, xcl_cload / xcl_gload(hi, a)) is kept over it, as on linux/stack-nvidia-dev; main's loop_ids, IO slots, ps_mask_live_scc and rt32 mask kept beside it, and main's duplicate core_tests copy of the rodata test goes. lower_mem.rs keeps the stack's scratch_ptr insert-before-terminator line. - real.rs (6): the class scan keeps `own` with main's release_through_its_own_vtable; xcl-dev#2477's in-place patch after main's two-pass defer hooks; q_signal_pc / q_wait_pc beside main's page mappings; the title ExecuteCommandLists keeps xcl-dev#867's list guards inside main's watch::in_driver scope; test modules of both. - list_x.rs (1): xcl-dev#867's allocator / PSO guards with main's `on = pc_alloc`. - sparse.rs (1): main's new_state, with xcl-dev#867's raw fences for the sparse and readback fences and the async readback fence pairs (as on linux/stack-nvidia-dev); pc_execute (main's texture_upload submit path) unadopts its list for the submit. - title_textures.rs (1): main's early fence creation, as a raw fence. - dstorage.rs (4): xcl-dev#2864's unpack cache on main's Cow source and stage buffers. - xg.rs (2): main's copy_args (adccb7d) covers xcl-dev#684's argument fix; xcl-dev#684's destination guard kept. - present.rs (1), gpu_compute_e2e.rs (1), README.md (2): tests and text of both. linux/README.md: main line updated; xcl-dev#1599, xcl-dev#2082, xcl-dev#1803, xcl-dev#3090, xcl-dev#688, xcl-dev#3091 and the stack-only multidimensional row leave the table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fences (xcl-dev#175) vkd3d-proton takes an object only with its own vtable. For command lists and allocators it checks at run time and returns NULL, which its submit path then reads (`NULL+0x2b28`); for heaps, resources, descriptor and query heaps, root signatures, pipeline states and command signatures an assertion ends the process; a fence is cast without a check on its queue thread. Under Wine only: - the assert-checked classes keep the runtime's table and XCL's PC slots are written into it, with the entries it had kept for `orig_fn`; - `UnadoptGuard` gives a list, allocator, heap or pipeline its native table back for the length of the host call that takes it as an argument; - the title's fences are thin proxies over the runtime's fence, unwrapped at the queue's Signal and Wait, and XCL's own fences come from `create_raw_fence`. This is xcl-dev#867 and xcl-dev#2477 by gustavsi, which were closed unmerged, carried onto the current `main`: the submit, fence and reset sites `main` has gained since (`native_queue_execute`, the sparse queues, the two-pass feedback poll, the own-work submit, the retire and upload fences) get the same guard or raw fence. One test new on `main` signalled a device fence on a PC queue and takes a raw fence now. On Windows nothing changes: `under_wine()` gates each branch. Co-authored-by: gustavsi <86445165+gustavsi@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…fences (xcl-dev#175) vkd3d-proton takes an object only with its own vtable. For command lists and allocators it checks at run time and returns NULL, which its submit path then reads (`NULL+0x2b28`); for heaps, resources, descriptor and query heaps, root signatures, pipeline states and command signatures an assertion ends the process; a fence is cast without a check on its queue thread. Under Wine only: - the assert-checked classes keep the runtime's table and XCL's PC slots are written into it, with the entries it had kept for `orig_fn`; - `UnadoptGuard` gives a list, allocator, heap or pipeline its native table back for the length of the host call that takes it as an argument; - the title's fences are thin proxies over the runtime's fence, unwrapped at the queue's Signal and Wait, and XCL's own fences come from `create_raw_fence`. This is xcl-dev#867 and xcl-dev#2477 by gustavsi, which were closed unmerged, carried onto the current `main`: the submit, fence and reset sites `main` has gained since (`native_queue_execute`, the sparse queues, the two-pass feedback poll, the own-work submit, the retire and upload fences) get the same guard or raw fence. One test new on `main` signalled a device fence on a PC queue and takes a raw fence now. On Windows nothing changes: `under_wine()` gates each branch. Co-authored-by: gustavsi <86445165+gustavsi@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…fences (xcl-dev#175) vkd3d-proton takes an object only with its own vtable. For command lists and allocators it checks at run time and returns NULL, which its submit path then reads (`NULL+0x2b28`); for heaps, resources, descriptor and query heaps, root signatures, pipeline states and command signatures an assertion ends the process; a fence is cast without a check on its queue thread. Under Wine only: - the assert-checked classes keep the runtime's table and XCL's PC slots are written into it, with the entries it had kept for `orig_fn`; - `UnadoptGuard` gives a list, allocator, heap or pipeline its native table back for the length of the host call that takes it as an argument; - the title's fences are thin proxies over the runtime's fence, unwrapped at the queue's Signal and Wait, and XCL's own fences come from `create_raw_fence`. This is xcl-dev#867 and xcl-dev#2477 by gustavsi, which were closed unmerged, carried onto the current `main`: the submit, fence and reset sites `main` has gained since (`native_queue_execute`, the sparse queues, the two-pass feedback poll, the own-work submit, the retire and upload fences) get the same guard or raw fence. One test new on `main` signalled a device fence on a PC queue and takes a raw fence now. On Windows nothing changes: `under_wine()` gates each branch. Co-authored-by: gustavsi <86445165+gustavsi@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…fences (xcl-dev#175) vkd3d-proton takes an object only with its own vtable. For command lists and allocators it checks at run time and returns NULL, which its submit path then reads (`NULL+0x2b28`); for heaps, resources, descriptor and query heaps, root signatures, pipeline states and command signatures an assertion ends the process; a fence is cast without a check on its queue thread. Under Wine only: - the assert-checked classes keep the runtime's table and XCL's PC slots are written into it, with the entries it had kept for `orig_fn`; - `UnadoptGuard` gives a list, allocator, heap or pipeline its native table back for the length of the host call that takes it as an argument; - the title's fences are thin proxies over the runtime's fence, unwrapped at the queue's Signal and Wait, and XCL's own fences come from `create_raw_fence`. This is xcl-dev#867 and xcl-dev#2477 by gustavsi, which were closed unmerged, carried onto the current `main`: the submit, fence and reset sites `main` has gained since (`native_queue_execute`, the sparse queues, the two-pass feedback poll, the own-work submit, the retire and upload fences) get the same guard or raw fence. One test new on `main` signalled a device fence on a PC queue and takes a raw fence now. On Windows nothing changes: `under_wine()` gates each branch. Co-authored-by: gustavsi <86445165+gustavsi@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…fences (xcl-dev#175) vkd3d-proton takes an object only with its own vtable. For command lists and allocators it checks at run time and returns NULL, which its submit path then reads (`NULL+0x2b28`); for heaps, resources, descriptor and query heaps, root signatures, pipeline states and command signatures an assertion ends the process; a fence is cast without a check on its queue thread. Under Wine only: - the assert-checked classes keep the runtime's table and XCL's PC slots are written into it, with the entries it had kept for `orig_fn`; - `UnadoptGuard` gives a list, allocator, heap or pipeline its native table back for the length of the host call that takes it as an argument; - the title's fences are thin proxies over the runtime's fence, unwrapped at the queue's Signal and Wait; their GetCompletedValue, SetEventOnCompletion and Signal run XCL's fence hooks on the runtime's fence, as an adopted fence's do on Windows. XCL's own fences (`create_raw_fence`, and those made in its own work) stay the runtime's, as `main` leaves them unadopted. This is xcl-dev#867 and xcl-dev#2477 by gustavsi, which were closed unmerged, carried onto the current `main`: the submit, fence and reset sites `main` has gained since (`native_queue_execute`, the sparse queues, the two-pass feedback poll, the own-work submit, the retire and upload fences) get the same guard or raw fence. One test new on `main` signalled a device fence on a PC queue and takes a raw fence now. On Windows nothing changes: `under_wine()` gates each branch. Co-authored-by: gustavsi <86445165+gustavsi@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fences (xcl-dev#175) vkd3d-proton takes an object only with its own vtable. For command lists and allocators it checks at run time and returns NULL, which its submit path then reads (`NULL+0x2b28`); for heaps, resources, descriptor and query heaps, root signatures, pipeline states and command signatures an assertion ends the process; a fence is cast without a check on its queue thread. Under Wine only: - the assert-checked classes keep the runtime's table and XCL's PC slots are written into it, with the entries it had kept for `orig_fn`; - `UnadoptGuard` gives a list, allocator, heap or pipeline its native table back for the length of the host call that takes it as an argument; - the title's fences are thin proxies over the runtime's fence, unwrapped at the queue's Signal and Wait; their GetCompletedValue, SetEventOnCompletion and Signal run XCL's fence hooks on the runtime's fence, as an adopted fence's do on Windows. XCL's own fences (`create_raw_fence`, and those made in its own work) stay the runtime's, as `main` leaves them unadopted. This is xcl-dev#867 and xcl-dev#2477 by gustavsi, which were closed unmerged, carried onto the current `main`: the submit, fence and reset sites `main` has gained since (`native_queue_execute`, the sparse queues, the two-pass feedback poll, the own-work submit, the retire and upload fences) get the same guard or raw fence. One test new on `main` signalled a device fence on a PC queue and takes a raw fence now. On Windows nothing changes: `under_wine()` gates each branch. Co-authored-by: gustavsi <86445165+gustavsi@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fences (xcl-dev#175) vkd3d-proton takes an object only with its own vtable. For command lists and allocators it checks at run time and returns NULL, which its submit path then reads (`NULL+0x2b28`); for heaps, resources, descriptor and query heaps, root signatures, pipeline states and command signatures an assertion ends the process; a fence is cast without a check on its queue thread. Under Wine only: - the assert-checked classes keep the runtime's table and XCL's PC slots are written into it, with the entries it had kept for `orig_fn`; - `UnadoptGuard` gives a list, allocator, heap or pipeline its native table back for the length of the host call that takes it as an argument; - the title's fences are thin proxies over the runtime's fence, unwrapped at the queue's Signal and Wait and the device's CreateSharedHandle and SetEventOnMultipleFenceCompletion; their GetCompletedValue, SetEventOnCompletion and Signal run XCL's fence hooks on the runtime's fence, as an adopted fence's do on Windows. XCL's own fences (`create_raw_fence`, and those made in its own work) stay the runtime's, as `main` leaves them unadopted. This is xcl-dev#867 and xcl-dev#2477 by gustavsi, which were closed unmerged, carried onto the current `main`: the submit, fence and reset sites `main` has gained since (`native_queue_execute`, the sparse queues, the two-pass feedback poll, the own-work submit, the retire and upload fences) get the same guard or raw fence. One test new on `main` signalled a device fence on a PC queue and takes a raw fence now. On Windows nothing changes: `under_wine()` gates each branch. Co-authored-by: gustavsi <86445165+gustavsi@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Patch
vkd3d-proton's assert-checked COM vtables in place under Wine so stock assertion-enabledvkd3d-protonbuilds (such as Proton Experimental) no longer abort on adopted heaps, resources, descriptor/query heaps, root signatures, pipeline states, and command signatures. Part of #175 and #1701.Stacked on #867 (
021b2c33); only the top commit (5225ddcb) belongs here. Carries forward the permitted implementation from closed #1395 (originally authored by @cmt8), composed cleanly with #867'sUnadoptGuard.Under Wine,
vkd3d-protonkeepsassert(iface->lpVtbl == &d3d12_*_vtbl)active even in release builds for these seven classes. Because their console slots sit inside the PC interface, patching their PC slots in place (saving the runtime's original function pointers inIN_PLACEfororig_fn) preserves the runtime's own vtable pointer and eliminates those aborts. All new paths are gated behindutil::under_wine(); native Windows behavior is unchanged.What is in it
crates/xcl/src/hle/d3d12x/real.rs:IN_PLACE/in_place_original/in_place_kind/patch_in_place(from closed D3D12.X: under Wine, vkd3d-proton's assert-checked classes keep their vtable #1395) forHeap,Resource,DescriptorHeap,RootSignature,PipelineState,QueryHeap, andCommandSignatureunder Wine.IN_PLACE_Nis published withOrdering::Releaseandregister()runs before each changed slot is written via an alignedAtomicUsize::store(..., Ordering::Release).UnadoptGuard::newskip vtables patched in place (skips_guard:!is_ext_fast(cur) || in_place_original(cur, 0).is_some()) soext[-1]is never dereferenced on runtime-owned vtables.in_place_tests:a_vtable_patched_in_place_keeps_its_originals_and_its_neighbourconcurrent_calls_and_patches_on_readonly_vtable_never_tear_or_miss_orig_fn(4 caller threads continuously invoking slot Implement XSystemGetDeviceType/PLS thunks and Opus audio carrier parsing #1 through aPAGE_READONLYvtable while 2 patcher threads race to callpatch_in_place, with a 10 s deadline instead of a fixed iteration cap so callers do not exit before the patch lands under--test-threads=4; verifies exact-once patching, zero torn entries ororig_fnmisses, and thatskips_guardskips the patched table; the latter is asserted directly becauseUnadoptGuard::newreturns early off Wine, and fails with the in-place check removed).Tested
x86_64-pc-windows-msvc(clang-cl+lld-link).Proton - Experimentalvkd3d-protond3d12core.dllcontainingiface->lpVtbl == &d3d12_heap_vtblassertions; also independently reproduced by @ClosetPie107 on RX 9070 / stock Proton Experimental, by @Royalflamejlh on RTX 4070 / assertion-enabledvkd3d-proton, and by @pickles976 on RTX 4060 Laptop / stock assertion-enabledvkd3d-proton):#867(without this PR):--exact gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmemaborts immediately withAssertion failed: iface->lpVtbl == &d3d12_heap_vtbl, file ../src-vkd3d-proton/libs/vkd3d/vkd3d_private.h, line 1077(exit3).#867:real::passed with0assertions,gpu_sparse_vram_descriptors_buffers_and_xmem+gpu_valu_float_and_intpassed2/0with0assertions, and a 20 s retail title run exited0with337frames shown and all 7 assert-checked classes patched in place.021b2c33, onmainf9a0cb80) at5225ddcb(no conflicts, commit diff unchanged) underGE-Proton11-14:real::in_place_tests real::wine_vtable_tests --test-threads=4: 6 passed, 0 failed, 0 ignoredhle::d3d12x::real:: --test-threads=1: 69 passed, 0 failed, 0 ignoredhle::d3d12x::alloc_pool:: --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, 0SKIPPEDpwsh ./scripts/smoke.ps1(XCL_PREPARE=0):22frames shown (PresentX 22,1 0 2/2 s),exit: 0x0,0crashes,0device 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 unmodifiedpwsh ./scripts/smoke.ps1via a thin Wine wrapper;main(e0d93c84) crashed before writingreport.json, so its block was extracted from the samexcl.log(peak commit: 0 MBis what Wine reports inxcl.log).main(e0d93c84):This PR (
5225ddcb, stacked on #867):Not tested
util::under_wine()).vkd3d-protonby @Royalflamejlh, @wayback94, and @pickles976).AI use
Gemini 4 Neon) restacked cleanly onto updated D3D12.X: preserve native vtables and wrap fences for vkd3d-proton under Wine (#175) #867 (021b2c33, onmainf9a0cb80) at5225ddcb, ran the Proton tests and 60 s smoke run, and updated this description (as well as the earlier time-bounded caller loop fix).skips_guardand its direct assertion (@safesearch77's review) and ran the earlier9b9012c8verification.