Repository navigation
D3D12.X: a wait an earlier signal covers does not make a signal a cycle - #2052
Draft
nicolasabosch wants to merge 1 commit into
Draft
nicolasabosch wants to merge 1 commit into
nicolasabosch wants to merge 1 commit into
Conversation
`would_signal_close_cycle` took every armed wait on the target cell with `val <= sig_val` as waiting on the new signal. A wait that an earlier signal of the cell already satisfies (submitted on the GPU or released on the CPU) does not depend on it. With pipelined frames – queue A waits on cell X >= N, queue B then signals X = N + 1 after waiting on something A signals later – every such frame was reported as a cycle, signalled on the CPU and its waiters released before the GPU work they wait for ran. A retail title on an RTX 4070 Laptop broke 14-32 such "cycles" in each run's world load (traced: queue 1 waiting on 0x...fde0 >= 0x6db, covered by queue 2's earlier 0x6db signal, counted against queue 2's 0x6dc signal). With the fix: no cycle break in two runs of the same load. The waiters taken now are those no earlier signal covers (`val > max(submitted_max, cpu_signaled_max)`); a test reproduces the traced case and keeps the true cycle detected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Code review on
|
theaustinayers
added a commit
to theaustinayers/xcl
that referenced
this pull request
Nov 25, 2026
…al a cycle" Local test only (the upstream PR is a draft, xcl-dev#2052). On this title the change left a real multi-queue wait cycle: at 111 s of the world load all five queues waited on each other for values one past their completed ones, the watchdog released 102 GPU waits and the title froze. The cycle breaks logged before the change had been the false positives it meant to avoid; the true ones it no longer breaks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
would_signal_close_cycletook every armed wait on the target cell withval <= sig_valas one that waits on the newWrite64signal. A wait that an earlier signal of the same cell already satisfies (submitted on the GPU, or released on the CPU) does not depend on the new one. With pipelined frames (queue A waits on cell X >= N; queue B then signals X = N + 1 after waiting on something A signals later), every such frame was reported as a cycle. The signal then went out on the CPU, and its waiters were released before the GPU work they wait for had run.Found while working on #1269 (a retail title on an RTX 4070 Laptop). A local trace of the world load showed queue 1 waiting on a cell
>= 0x6db, a wait already covered by queue 2's earlier0x6dbsignal. That wait was counted against queue 2's0x6dcsignal, and the "cycle" was broken on the CPU. Each run of that load broke 14–32 such cycles.What is in it
crates/xcl/src/hle/d3d12x/list_x.rs: the target waiters are only the armed waits no earlier signal covers (val > max(submitted_max, cpu_signaled_max)).pipelined_next_frame_write_is_not_false_cycle: case 3 reproduces the traced case (no cycle), then turns the wait into one that only the new signal satisfies (a true cycle, still detected). Without the fix, the new no-cycle assertion fails.Tested
cargo build --workspace && cargo test --workspace -- --test-threads=4on b67c8f0: 1120 passed, 0 failed, 46 ignored. SKIPPED: 20 × no wave64, 3 × refused (gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics), 1 × no heap windows.ID3D12Fencewaits inbreak_cycles_before_title_signal, which is not in this PR). The title still loses the device later in that load, so this fix alone does not get it further.Regression run
main:
PR:
Not tested
ID3D12Fencewaits (break_cycles_before_title_signal) have the same pattern. They are left for a separate PR with a test of their own.AI use
🤖 Generated with Claude Code