Repository navigation
Conversation
… Linux PRs ivall#867/ivall#871/ivall#877 Update fork README for upstream/main 1ec4c98 (fenced late_release and queue-wait diagnostics), newly integrated PRs (ivall#838-ivall#841, ivall#849, ivall#851, ivall#864, ivall#875, ivall#876), live gameplay audio progress, and our three open upstream Linux PRs (ivall#867, ivall#871, ivall#877). Assisted-by: Antigravity (Google DeepMind)
|
Linux / AMD RDNA3 lane report, head 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 ( Reproduced 3/3: full-suite lane run, isolated lib rerun, and a 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 AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting. |
|
Rerun on the new head
The new test covers On the review above (native Windows also takes the raw fence path): confirmed on Rerun on the new head Rerun on the new head Native Windows / NVIDIA run, since Not tested lists both. Tested
Not tested
AI use
|
|
Test report for 593b2e2 (this PR's head, on its own base), Linux:
For comparison, same machine:
Not tested: Windows, AMD, Merging this into 09940bb conflicts in AI use: Hermes agent with Claude Opus 5.5 ( |
|
Test report for Tested: AMD Radeon RX 9070 XT (RDNA4, 16 GiB), Mesa RADV 26.3.1, CachyOS (kernel 7.3), Proton Experimental
So on Proton Experimental an Testing and write-up assisted by Claude Code (Claude Opus 5.5); runs on my own hardware, checked by me. No game data attached. |
|
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
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 Testing and write-up assisted by Claude Code (Claude Opus 5.5); runs on my own hardware, checked by me. |
593b2e2 to
46944c2
Compare
|
Rebased onto
|
…ll#1221, and updated Linux PRs Update fork README for upstream/main 930e8b4 (BCPack BC1-BC7, XCL_PSO_WAIT_MS, low-VA ASLR < 2^40, alloc_pool, sparse tile parking/pool reuse, direct page moves, write-watch merge), newly integrated PRs (ivall#1078, ivall#1097, ivall#1139, ivall#1142, ivall#1150, ivall#1156, ivall#1182, ivall#1191, ivall#1195, ivall#1221), and updated Linux PRs (ivall#867, ivall#871, ivall#877). Assisted-by: Antigravity (Google DeepMind)
There was a problem hiding this comment.
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 forx86_64-pc-windows-msvc, Rust 1.99.1, debug. cargo test -p xcl --lib -- --test-threads=1plus every integration test (--test-threads=1), compared per test withmain930e8b4on 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-protonthat Proton (Experimental, and I expect other Proton builds) ships still tripsd3d12_heap_vtblandd3d12_root_signature_vtblon XCL's adopted heaps and root signatures. - On the unpatched
-Db_ndebugbuild, 14 of the 22 remaining failures are a chain: everygpu::recomptest aftergpu_sparse_vram_descriptors_buffers_and_xmemin list order reads zeros back. For example,gpu_valu_float_and_intgetslane 0 v_add_f32 left: 0.0, andgpu_unified_memory_arenagetss_load from process memory left: (0, 0). The--exactpairgpu_sparse_vram_descriptors_buffers_and_xmem gpu_valu_float_and_intreproduces it 2/2, andgpu_valu_float_and_intalone 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 failuresmainhas 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_intpasses 3/3, and all 14gpu::recomptests after it pass in the full run. - On the unpatched build, the 12 failures left are the same 9
mainhas with #257's patch, plus the #718 trio (title_textures×2,vram::d32s8). That trio fails in about 2/5 runs here onmaintoo. So with this PR, the unpatched-Db_ndebugbuild reaches parity with the patched one in the test suite. - Not tested: #867 + #1395 together (once #1395's
UnadoptGuardcondition is in). A retail title.
|
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: |
…#1395 in-place vtables Integrates 16 upstream PRs (xcl-dev#1380, xcl-dev#1383, xcl-dev#1384, xcl-dev#1395, xcl-dev#1398, xcl-dev#1400, xcl-dev#1404, xcl-dev#1405, xcl-dev#1419, xcl-dev#1420, xcl-dev#1421, xcl-dev#1423, xcl-dev#1424, xcl-dev#1427, xcl-dev#1428, xcl-dev#1429) on top of the Linux/Proton fork, plus three Proton/vkd3d-proton fixes caught during verification: - Recompiler (xcl-dev#1428): flatten IO_GROUP_LIMIT early-return in compute shaders so vkd3d-proton v3.1 dxil-spirv accepts the emitted CFG. - D3D12.X (xcl-dev#1395 + xcl-dev#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.
46944c2 to
6e94390
Compare
|
Rebased onto
|
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)
c79e3b3 to
f98da36
Compare
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)
…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)
|
Rebased onto
|
bmjask
left a comment
There was a problem hiding this comment.
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.
|
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. |
|
Tested on an RTX 5080, NVIDIA 620.73.04, Proton Experimental (vkd3d-proton 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 In the retail run, the heap + fence baseline stopped at its first 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 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 The paired runs used Tested the rebased PR head separately. I built Follow-up on the clean rebased head under Proton Experimental. Two direct 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 af2cecc. 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 af2cecc 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 e57cb65. 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 af2cecc 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 af2cecc, 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. |
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)
f98da36 to
e57cb65
Compare
|
Thanks @bmjask for the review! Addressed the
AI use: Antigravity (Gemini 4 Neon) implemented the |
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)
|
Thanks @Alm0stSurely for the detailed RTX 5080 / Proton Experimental verification! The AI use: Antigravity (Gemini 4 Neon) drafted this comment. |
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
|
NVIDIA and AMD full-suite run, to go with the reports above by Alm0stSurely, fromthemoonx, since none of them covers AMD. Tested exact head Tested
Not tested
AI use
|
|
Reviewed
Checked with AI use: Antigravity (Claude Sonnet 5.5) read and traced the diff; I re-checked the point |
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)
|
Thanks @SzczepanGrela for the detailed run on
AI use: Claude Code (Claude Opus 5.5) ran the tests on the machine above and drafted this; I checked it. |
…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)
e57cb65 to
d9e6ad5
Compare
|
Thanks @safesearch77 and @fromthemoonx for catching and confirming the Updated at
Verified at
Not tested: native Windows locally. AI use: Antigravity (Gemini 4 Neon) implemented the |
…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)
Preserve native COM vtables around
d3d12core.dllcalls and wrapID3D12Fence1in a thin proxy under Wine so XCL runs on unmodified assertion-freevkd3d-proton(novkd3d-protonvtable-check patch required). Part of #175 and #1701.vkd3d-protonvalidatesiface->lpVtblon adopted D3D12 objects passed back intod3d12core.dll(ID3D12CommandAllocator,ID3D12GraphicsCommandList,ID3D12Heap,ID3D12Resource,ID3D12PipelineState, andID3D12Fence, including on its async queue thread). With XCL's in-place vtable adoption, unmodified assertion-freevkd3d-proton(GE-Protonor-Db_ndebug=truebuilds) rejects adopted allocators/lists withE_INVALIDARGand fails fence calls. Native Windows behavior is unchanged (all new paths, includingcreate_raw_fence's bypass, are gated behindutil::under_wine()).Note: assert-enabled
vkd3d-protonbuilds (such as stock Proton Experimental) also validateiface->lpVtblinside an adopted object's own methods (for exampled3d12_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:UnadoptGuard(UNADOPTEDper-object active count with atomic vtable stores and 8-byte pointer alignment check) to temporarily restore native vtables on adopted command allocators (includingalloc_poolbackings andreset_pc_allocator), command lists, heaps (CreatePlacedResource/CreatePlacedResource1), RTV resources, and PSOs around calls intod3d12core.dllwithout restoring early under concurrent guards.AddRefbefore exposing the native vtable on the first active guard, and release it via XCL's hookedReleaseslot after restoring the extended vtable (outsideUNADOPTED) on the last guard drop: even if another thread concurrently loads the native vtable and callsRelease, refcount stays>= 1during the guard window and the final1 -> 0transition always executes XCL's hooked cleanup (pso_release,heap_release,res_release,cl_release,alloc_release).register_native/is_known_native) soorig_fnreads*ext.add(slot)directly if another thread enters a hook while anUnadoptGuardtemporarily restored the native vtable on a shared object (fixes the0xc0000005orig_fn(this, 2)race reported by @GreemSC).FenceProxy(wrap_fence_proxy,unwrap_fence,fence_proxy_release,fence_proxy_signal,fence_proxy_qi) so title PC fences keep their nativelpVtblwhile preserving console slot#12(completed_value_address), unwrapping inCommandQueue::Signal/Wait, and freeing on finalRelease.create_raw_fence(gated onutil::under_wine() && is_ext(...), so native Windows goes straight throughdev.CreateFence/dev_create_fenceunchanged) so XCL's own internal queue tracking (late_release,alloc_pool,list_x,cpu_writes,present,vram,sparse,drain_gpu) creates raw un-proxiedID3D12Fenceobjects under Wine and never passes aFenceProxyto un-adopted internal queues likesparse::queue().track_end_title_fencesolist_x::ensure_cell_fenceregisters raw cell fences inFENCESunder Wine (no-op if already tracked off Wine), ensuringend_titlesignals parkedWait64BitValueXcell fences beforedrain_gpu(fixing @safesearch77's review).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, andtrack_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:real::create_raw_fencefor XCL's internal fences (callingreal::track_end_title_fenceonlist_x::ensure_cell_fence), and guardalloc_pool::reset_list/KickoffX/#2118deferred-dispatchReset/ mid-list split calls withUnadoptGuard.crates/xcl/src/gpu/recomp/runner.rs:submit_listusingreal::UnadoptGuardso tests running afterreal::init()adopts the process-wide singletonID3D12Devicedo not submit an adopted command list to the runner's pre-existing un-adoptedID3D12CommandQueue.Tested
GE-Proton11-14-x86_64,vkd3d-proton(-Db_ndebug=true, unmodified vtable checks), DXC 1.9.2609.5, cross-compiledx86_64-pc-windows-msvc(clang-cl+lld-link).d9e6ad51(onmain08db8020, cleanly mergeable with8b957bec) under Proton (XCL_DXC_DIRset for GPU tests):hle::d3d12x::real:: --test-threads=1: 63 passed, 0 failed, 0 ignored (including all fourwine_vtable_tests, with the newtrack_end_title_fence_registers_once_and_addrefstest)hle::d3d12x::list_x:: --test-threads=1: 40 passed, 0 failed, 0 ignoredhle::d3d12x::alloc_pool:: --test-threads=4(× 3): 4 passed, 0 failed, 0 ignored eachreal::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 skippedpwsh ./scripts/smoke.ps1(withGE-Proton11-14wrapper):main(e0d93c84) exits0x3(2crashes,0frames); this PR (d9e6ad51) runs the full 60 s cleanly (exit: 0x0,22frames shown /PresentX 23,0crashes,0device removals).Regression run
Produced under Wine (
GE-Proton11-14, AMD Radeon RX 9060 XT,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 (
d9e6ad51):Not tested
create_raw_fence, are gated behindutil::under_wine()).vkd3d-protonbuilds (needs-Db_ndebug=true/GE-Protonor D3D12.X: patch assert-checked vtables in place under Wine (#175) #2477).AI use
create_raw_fenceonunder_wine(), addedtrack_end_title_fence+track_end_title_fence_registers_once_and_addrefsfor @safesearch77's review (as well as the earlierUnadoptGuardCOM reference pin and concurrent-Releaseregression test), ran the Proton test/smoke verification atd9e6ad51, and updated this description.