Repository navigation
D3D12.X: split title_list command lists around mid-list Wait64 after Write64 - #797
Merged
theaustinayers merged 2 commits intoNov 24, 2026
Merged
Conversation
Bridge monotonic `Wait64BitValueX` / `Wait32BitValueX` and `Write64BitValueX` sequences across queues via real `ID3D12Fence` `queue.Wait` / `queue.Signal` instead of blocking the CPU submission thread until timeout (related to xcl-dev#505). Track submitted and pending wait/signal dependencies as an exact `(queue, seq)` directed graph (including same-cell write/wait edges and same-queue FIFO ordering) so genuine cross-queue cycles are detected and broken deterministically at Signal time without false positives on pipelined frames, backed by a GPU completion watchdog and unit/GPU regression tests.
…Write64 When a single command list records `Write64BitValueX` followed later in the same list by `Wait64BitValueX` / `Wait32BitValueX` on a value produced by another queue that waits on the earlier write, executing the list as a single atomic `ExecuteCommandLists` submission creates a cross-queue cycle. Extend `title_list` with separate `F_PRIMARY` and `F_BACKING` slots so `list_x` can transparently split `title_list`-backed command lists around mid-list waits after writes (opt-out via `XCL_SPLIT_MIDLIST_WAIT=0`), carrying active D3D12/UMA bindings across segments, expanding all segments on `ExecuteCommandLists`, and reusing closed spare PC lists on the same command allocator across `Reset` and `KickoffX`.
|
Test run of Tested
Review: Stacked on #795; I reviewed the top commit's structure only. It splits lists at mid-list waits, which #708 (open) also does, so the same choice applies as for #795. Not tested: no retail title or regression run (I have no unpacked game), no Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
wondercrash
pushed a commit
to wondercrash/xcl
that referenced
this pull request
Nov 24, 2026
… split xcl-dev#708 predates xcl-dev#795 (GPU-fence bridge) and xcl-dev#797 (mid-list split) and was not rebased. Resolution keeps main's split machinery (xcl-dev#797 + xcl-dev#851) and cpu_writes from xcl-dev#850 (the xcl-dev#708 per-queue workers with xcl-dev#873's diagnostics), and ports xcl-dev#708's core change onto it: - wait_gate.rs (from xcl-dev#708): a queue-side gate the CPU opens once it sees the progress value. - PendingWait::gate: a Wait64 GE, full mask, on a non-sparse value the CPU can read, in a direct/compute title list, that starts its PC segment (split by xcl-dev#797/xcl-dev#851, or nothing recorded before it). - execute_with_waits_on / KickoffX: gated waits arm a wait_gate instead of the xcl-dev#795 GPU-fence bridge; with sparse writes at or after the list in the batch they take the bounded CPU wait (xcl-dev#708's rule). Other waits keep the xcl-dev#795 bridge. Arming failure stops the title (xcl-dev#708). - Dropped from xcl-dev#708: its own title_list piece/split machinery, split_recording, restore_after_reopen, open-query / split-barrier tracking and the Result-returning execute_with_waits. - wait_tests.rs (from xcl-dev#708) adapted to push_segments / execute_with_waits_on.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #795; only the top commit belongs here.
Split
title_list-backed command lists around mid-listWait64BitValueX/Wait32BitValueXcalls that follow aWrite64BitValueXin the same list, avoiding cross-queue cycles where a consumer queue waits on the prefix write before signaling the value the suffix waits on. Related to #505 (note: open #708 also splits lists at recorded waits; this approach extendstitle_listwithF_PRIMARY/F_BACKINGsegment tracking, reuses closed spare PC lists on the same allocator acrossReset/KickoffX, and integrates directly with #795's exact cycle graph).What is in it
crates/xcl/src/hle/d3d12x/title_list.rs: separateF_PRIMARY(0x2FF0) andF_BACKING(0x2FF8) slots soQueryInterface/AddRef/Releasestay pinned to the primary PC list while recording advances across split segments; expand all segments viapush_segments; reclaim spare closed segments onReset(callinglist_x::reset_xdirectly) andKickoffX(reclaim_for_kickoff).crates/xcl/src/hle/d3d12x/list_x.rs,bind.rs,real.rs: addtry_split_for_wait(opt-out viaXCL_SPLIT_MIDLIST_WAIT=0), carry active D3D12 and UMA bindings (bind::inherit_for_split) across split segments, expand wrapped lists inq_execute_command_lists, and addmid_list_write64_wait64_split_avoids_cycle_and_reuses_sparesverifying 2-frame splitting, spare reuse, and zero CPU cycle breaks.Tested
rustc 1.98.1(x86_64-pc-windows-msvccross-compile), debug.cargo test --workspace --no-fail-fast --target x86_64-pc-windows-msvc -- --test-threads=4 --skip a_freed_block_is_decommitted_before_its_address_is_reused: 706 passed, 4 failed (pre-existing Wine-only failures:hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime,test_title_runs_and_game_folder_is_untouched,disk_free_space_ex_reports_pls_quota,set_predication_buffer_state_and_kickoff), 41 ignored, 1 filtered (a_freed_block_is_decommitted_before_its_address_is_reused).SKIPPEDGPU tests:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64).hle::d3d12x::list_x::tests::mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares(2 frames, 2 segments, spare reused, 0 CPU cycle breaks).Regression run
scripts/smoke.ps1runs on a retail title (Linux/Proton environment only).Not tested
scripts/smoke.ps1retail regression run.AI use