Repository navigation
Conversation
When a bridged Wait64 expires, the watchdog's lines give each cell's recorded / submitted / completed values. They read the same for a cycle of queues and for a chain of waits behind one queue that is busy, or held by a wait outside the sync graph, because the 5 s start when the CPU issues the Wait and not when the queue reaches it (xcl-dev#505). Once per burst (at most one line per timeout, 64 lines in all) the watchdog now follows the tracked waits from the queue of an expired wait. A queue is held at its earliest tracked call in flight; when that is a wait, the chain goes on at the queue of the Signal that satisfies it. The line names the waits passed and where they end: - end=cycle: a queue already on the chain, - end=signal: a queue with no tracked wait in front of it, so it is executing or behind one of XCL's own tile-mapping waits, which are not in the graph (review of xcl-dev#795, point 2), - end=unsubmitted: a wait that no submitted Signal satisfies, - end=signal-gone: a wait on a cell that counts the value as submitted while the graph tracks no Signal for it and the fence is below it (the graph lost track; printed with the cell's submitted and CPU-signalled values). With it: how many of the cells released in that tick end at the same place, the watchdog's releases before this tick, the count of Write64 cycle breaks so far (their own line stops after 32), and the tile-mapping queue's fence and readback fence as completed / asked for. Limit: a CPU release (the watchdog's, a cycle break's) drops the cell's tracked Signals up to its value although they may still be queued. After the first one a queue can look held at a wait that really sits behind such a Signal, and a chain can end in a cycle that is none. The line is exact only while earlier_releases and write64_cycle_breaks are 0; mixed title-fence breaks are not counted. No change to what is released or signalled. The calls in flight are read under the graph lock before the releases, without pruning, and the line is written after them. The watchdog now reads the clock once per tick for the chain check and the expiry test, so both see the same waits as expired. While no wait expires the cost is one pass over the armed waits on the watchdog's 50 ms tick, skipped for one timeout after a line. sparse.rs keeps a second reference to its two fences and the value wait_for sleeps on, so that they can be read while a submit holds the state. Part of xcl-dev#505. Assisted-by: Claude Code (Claude Fable 5.2)
Owner
Author
|
Upstream PR xcl-dev#1123 was closed or merged. |
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.
Diagnostics only, the plan from xcl-dev#505 (comment). When the GPU-wait watchdog releases a wait, it now also logs, once per burst, where the chain of waits behind it ends. Part of xcl-dev#505.
Today's lines give each cell's recorded / submitted / completed values. Those read the same for a cycle of queues and for a chain of waits behind one queue that is busy or held by a wait outside the sync graph, because the 5 s start when the CPU issues the
Wait, not when the queue reaches it. Nothing is released, pruned or signalled differently.What is in it
crates/xcl/src/hle/d3d12x/list_x.rs: before the watchdog releases expired waits, it takes the trackedWait/Signalcalls still in flight (calls_in_flight, read-only) and follows them from an expired wait's queue (wait_chain): a queue is held at its earliest tracked call in flight, and when that is a wait the chain goes on at the queue of theSignalthat satisfies it. Onexlog_warn!line per burst (at most one per 5 s timeout, 64 in all), written after the releases:end=cycle: back at a queue already on the chain, so every queue on it is held at a wait.end=signal: no tracked wait is in front of the queue. It is executing, or behind one of XCL's own tile-mapping waits, which are not in the graph (@upipibi's point 2 on D3D12.X: bridge Wait64BitValueX to GPU fences with exact cycle breaking xcl-dev/xcl#795).end=unsubmitted: no submittedSignalsatisfies the last wait.end=signal-gone: the cell counts the value as submitted, but the graph tracks noSignalfor it and the fence is below it. The graph lost track (a CPU release dropped theSignal, or it was not queued because the fence was already there, and the fence went back since). Printed with the cell'ssubmittedandcpu_signaledvalues.same_end=n/m: of the m cells released in this tick, how many have a chain that ends the same way at the same queue.earlier_releases: cells the watchdog released before this tick.write64_cycle_breaks: Write64 Signals signalled on the CPU so far (the "would close a GPU cycle" line stops after 32; its counter moved to module scope for this). Mixed title-fence breaks are not counted.crates/xcl/src/hle/d3d12x/sparse.rs:fence_status()for the end of that line: the tile-mapping queue's fence and the readback fence, as completed / last value asked for (decimal, likewait_for's own line). The state keeps a second reference to both fences outsideSTATE, because a submit can sleep for 5 s inwait_forwithSTATElocked, which is the case the line is for. The values asked for are read withtry_lock; when the state is busy they print as?, with the value the submit sleeps on (wait_for=N, two atomic stores around the sleep). The watchdog never blocks on it.list_x.rs:wait_chain_names_where_expired_waits_end(graphs built by hand, no GPU: cycle, signal, unsubmitted, signal-gone, the line's text andsame_end, one line per burst) andwait_chain_leaves_out_completed_calls(real fences, WARP is enough: calls the GPU has completed are not on a chain; skips with "no GPU").Cost: while no wait expires, one pass over the armed waits on the watchdog's existing 50 ms tick (it only runs while a wait is armed), skipped for 5 s after a line. Nothing on the title's threads.
Tested
stable-x86_64-pc-windows-msvc; tests in the default (debug) profile, smoke runs in release.cargo test --workspace -- --test-threads=4: 739 passed, 0 failed, 41 ignored (SKIPPED GPU tests:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_maskandgpu::recomp::tests::gpu_wave32_program_in_wave64_hardware, both "no wave64").main384f7f7 on the same machine: 737 passed, 0 failed, 41 ignored, the same two SKIPPED.GPU wait chainline was produced.Regression run
Not tested
sparseread) are covered only by a title run.fence_status()has no unit test (it needs a sparse state and a device).vram.rs'spages.fencewait is not in the line.AI use
Mirror of xcl-dev#1123 (auto-synced, do not edit).