Repository navigation
D3D12.X: keep vkd3d-proton's vtables under Wine and wrap the title's fences (#175) - #3492
Royalflamejlh wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
3bd9a66 to
19e8fd5
Compare
|
Test report for #3492 at Tested
Not tested
AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report. |
19e8fd5 to
c817f42
Compare
|
@ClosetPie107 thank you, that is the run this needed. One thing is still open and you may see it too: with 4 test threads, 1 of 4 runs of Your AI use: Claude Code (Claude Fable 5.2) made the runs and wrote this. |
…submit (xcl-dev#3492 c817f42) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
c817f42 to
0f347f6
Compare
… list at its PC submits (xcl-dev#3492 0f347f6) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Test report for #3492 at Tested
Not tested
AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report. |
0f347f6 to
ebc21f2
Compare
|
Review (head ebc21f2, diff read, not a merge-check:
Fine: in-place patching happens once per table under a lock and keeps the original entries, the guard pins a reference and does the final release through XCL's Release hook, and the proxy frees itself on the last release. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
ebc21f2 to
313f55e
Compare
|
Thanks. Point by point, at head
AI use: Claude Code. Claude Opus 5.5 checked the points and wrote the changes; Claude Fable 5.2 ran the tests on the card and wrote this reply. |
|
Review (head 313f55e, diff read, not a merge-check;
Fine: AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
313f55e to
7642762
Compare
|
Thanks. On the Wine-only list and the tests, at head
On the split and #3099: the four parts build in the order you give, and under Wine nothing improves before the last. #3099 is the same guard and proxy in an older form against
AI use: Claude Code. Claude Opus 5.5 checked the points and wrote the changes; Claude Fable 5.2 ran the tests on the card and wrote this reply. |
|
Re-review (head 7642762; the diff from 313f55e, which I reviewed, read:
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
…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>
7642762 to
0797336
Compare
|
The gap is closed at head
AI use: Claude Code. Claude Opus 5.5 wrote the change; Claude Fable 5.2 ran the tests on the card and wrote this reply. Edited: the first run of that command had one failure, which I had not read when I posted "0 failed"; the counts above are the corrected ones. |
|
Follow-up (head 0797336; the 57-line diff from 7642762 read). The gap is covered: under Wine, device #31 AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
Overlaps #3099 (D260): both carry UnadoptGuard, FenceProxy and create_raw_fence for vkd3d-proton's vtable checks under Wine. #3099 targets AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
…ton's fence The change of xcl-dev/xcl#3492 at 313f55e8: a title's fence went straight to vkd3d-proton and skipped the readback settling the hooks do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under Wine, vkd3d-proton takes an object only with its own vtable, and XCL replaces the vtable of every object it adopts. This carries #867 and #2477 by gustavsi (both closed unmerged on 2026-11-29: "anyone is welcome to rebase and reuse these commits") onto the current
main, as one commit with gustavsi as co-author. Part of #175 and #3067.#3099 does the fence and guard part against
amd-dev; this one is againstmainand also has #2477's in-place tables.What is in it
real.rs: under Wine, heaps, resources, descriptor and query heaps, root signatures, pipeline states and command signatures keep the runtime's table, with XCL's PC slots written into it (D3D12.X: patch assert-checked vtables in place under Wine (#175) #2477).UnadoptGuardgives a list, allocator, heap or pipeline its native table back for the host call that takes it as an argument, and the title's fences are proxies unwrapped at the queue'sSignalandWait(D3D12.X: preserve native vtables and wrap fences for vkd3d-proton under Wine (#175) #867).real.rs,list_x.rs,sparse.rs,alloc_pool.rs,vram.rs,present.rs,title_textures.rs,late_release.rs,cpu_writes.rs,bind.rs: the submit, reset and fence sitesmainhas gained since those PRs (native_queue_execute, the sparse queues, the two-pass feedback poll, the own-work submit, the retire and upload fences) get the same guard orcreate_raw_fence.main(gpu_clear_uav_of_a_stencil_uav_clears_the_twin) signalled a device fence on a PC queue; it takes a raw fence.Tested
master71cae091(assertions on), RTX 4060 Ti 16 GB (driver 615.71.09), rustc 1.98.0, release build forx86_64-pc-windows-gnu. Base9335bc0d, head3bd9a664.0797336e(2026-12-01): under Wine the device'sCreateSharedHandleandSetEventOnMultipleFenceCompletionhand vkd3d-proton its own fence too (one new test, with stand-in objects; not on a device or in a title).cargo test --lib -- fence vtable wine unadopt, RTX 4060 Ti: 57 passed, 0 failed in 5 of 6 runs; in the first,bind::tests::wait_oldest_fenced_reclaims_in_flight_buffer_before_refusingfailed once while a title was running on the same card (it passes alone, 3 of 3).76427620(2026-12-01), after a second review:UnadoptGuard::newand the tests now run the same body, so the Windows CI runs the shipped guard (the Wine-only guard test became a case of one that runs everywhere); the list of native tables warns once past its 64 entries, where it dropped a table silently.cargo test --lib -- fence vtable wine unadopt, RTX 4060 Ti: 56 passed, 0 failed. 997 added lines.313f55e8(2026-12-01), after a review: the fence proxy's GetCompletedValue, SetEventOnCompletion and Signal are nowmain's hooks, run on vkd3d-proton's own fence (they went straight to vkd3d-proton before, so a title's fence skipped the readback settlingmaingained on 2026-11-25); fences XCL makes inside its own work are not wrapped; the queue's Signal / Wait overrides are underunder_wine()again, so Windows takesmain's path; three new tests.cargo test --lib -- fence vtable wine unadopt: 57 passed, 0 failed.--lib hle::d3d12x::real::: 178 passed, 3 failed (an_older_process_cannot_remove_a_replacement_blob,a_copy_of_a_destroyed_resources_view_is_the_null_view,dev_create_root_signature_strips_xbox_flags_and_keeps_parameters; all three fail the same way on the head before it). 1,042 added lines now. In a title, the change of this head on another tree that carries this pull request beside other unmerged ones (1 run each, 600 s asked, RTX 4060 Ti,XCL_GPU_PROFILE=1): with it 630 s, 1,880 frames, no crash, no device removal; without it 673 s, 1,520 frames, no crash. Not run in a title on this branch alone: the title numbers below are from the heads they name.main7d86c5d2(headebc21f2e):main'sCreateFencenow drops console-only flag bits; the Wine path here passes the same cleaned flags.cargo test --lib -- fence vtable wine: 54 passed, 0 failed. The numbers below are from the heads they name.0f347f68(2026-11-30): the cause of the rare trap with 4 test threads. Under vkd3d-proton every test gets the same device object, and some tests adopt it. A test that then makes a fence or a list from it gets XCL's proxy or an adopted list, and its own PC queue cannot take either.bind::tests::closed_list_replay_keeps_two_pass_buffer_across_fence_and_idle_trimbesidecreate_list_reset_and_clear_state_track_initial_pso_on_d3d12ended that way 10 of 12 times; with a raw fence and the guard at its two submits, 0 of 20, andhle::d3d12x::bind::testsat 4 threads ran through 10 of 10 (4 of 16 ended early before).c817f425(2026-11-30):bind::tests::execute_indirect_reads_the_arguments_written_before_it, a test new onmainthat adopts its list and submits it on a PC queue, takes the guard at that submit. It ended in the read at0x2b28on19e8fd50(found on an RX 9070 by ClosetPie107, below; the same here) and passes now.mainf97120dc(head19e8fd50):main's rewritten late-release seal and itsInListResetincl_resetconflicted; both keep the raw fence and the guards. On the new head the release build and these modules were rerun, with the same results as before:late_release8 passed,real::wine_vtable_tests4,real::in_place_tests2,real::depth_uav_twin_tests3,title_textures65,sparse::tests140,list_x::tests101 passed and 3 failed (the three that fail on the base). The counts and title runs below are on3bd9a664.hle::d3d12xunit tests, each test module in a process of its own with--test-threads=4(96 modules, 1 pass of each tree; a whole-suite run ends early in a page fault on both trees):9335bc0d3bd9a664list_x::tests,tests)tests)The base's
list_x::testsends after 5 tests in vkd3d-proton's list check (a read at0x2b28); with this PR it runs through.hle::d3d12x::testsends the same way on both, a null read after aD3D12SerializeRootSignaturecall with an invalid version. Of this PR's 17 failures, 15 fail on the base too; the other two are inlist_x::tests, which the base does not get to in this pass, and both failed on the base in an earlier whole-suite run.game+0x2478b7bwithE_INVALIDARGinrax(the failure Wine: raw internal fences + native-vtable guards at host-runtime calls (rebased on amd-dev) #3099 describes); on this head it presented until the run's 300 s limit ended it (1,430 frames by then, lit, the last ones the loading pictures), with no crash and no device removal.master71cae091, debug build): the lib suite at 2 threads withoutgpu::and six tests that end the process or run out of memory there, 1,715 passed and 16 failed at0f347f68against 1,609 and 116 on the basef97120dc; no test fails with this PR that passes on the base.Regression run
xcl-smokeblocks will be added.Not tested
under_wine(), but the suite and the smoke pair have not run there.gpu::tests and a title run.hle::d3d12x::sparse::testsin 20 did on the first head). It is between tests: the title's device is always adopted, and its queues with it.AI use
main, ran the tests above and wrote this description. The merge resolutions it starts from were made on our Linux branch with Claude Opus 5.5.