Repository navigation
Conversation
|
Review (head c6ca119, diff read, not a merge-check; draft, checks red): No problems found in the diff. Checked that the default stays 2000 ms ( AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
bmjask
left a comment
There was a problem hiding this comment.
Review of c6ca1196: 1 finding(s) (1 medium), most severe first.
- Medium
crates/xcl/src/hle/d3d12x/present.rs:1013: XCL_PRESENT_WAIT_MS has no upper bound: only 0 and u32::MAX are rejected, so values close to u32::MAX are accepted and give an effectively unbounded wait while the PRESENTER mutex is held. (inline)
These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
|
@Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any. |
c6ca119 to
11d7ddd
Compare
|
Right, there was no upper bound. 11d7ddd caps A value above the 2 s / 5 s watchdogs can still trip them; that is what the switch is for (to see whether a longer wait gets the frame), so I left it. Not done: a run with the variable set. Claude Code with Claude Fable 5.2 checked the point and wrote the change and this reply. |
bmjask
left a comment
There was a problem hiding this comment.
Review of 11d7ddd0: 2 finding(s) (2 medium), most severe first.
- Medium
crates/xcl/src/hle/d3d12x/present.rs:1515: The new timeout warning has no rate limit, andlog::writeflushes the file for Warn, so on default settings every timed-out frame does a synchronous file write and flush on the title's present thread while holding PRESENTER. (inline) - Medium
crates/xcl/src/hle/d3d12x/present.rs:1042: Allowing up to 60000 ms lets the N-2 wait hold PRESENTER (and PRESENTX_LOCK) up to 30x longer than before, soquiesce_queue(line 584,PRESENTER.lock()) can be blocked for a minute or starved indefinitely. (inline)
These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
| } | ||
| if wait_val > 0 { | ||
| let timeout_ms = if is_present_x { 2000 } else { 100 }; | ||
| let timeout_ms = if is_present_x { present_wait_ms() } else { 100 }; |
There was a problem hiding this comment.
Medium: Allowing up to 60000 ms lets the N-2 wait hold PRESENTER (and PRESENTX_LOCK) up to 30x longer than before, so quiesce_queue (line 584, PRESENTER.lock()) can be blocked for a minute or starved indefinitely. With XCL_PRESENT_WAIT_MS=60000 and a stalled GPU, each PresentX holds PRESENTER for 60 s, drops it, and the title's next PresentX takes it straight back (std Mutex isn't fair). A queue retirement in invalidate_queue_caches -> quiesce_queue then waits a minute or more, so the queue is never released and the retirement worker hangs. Waiting on the fence without holding PRESENTER, or capping the wait well below the retirement timeout, would avoid it.
11d7ddd to
52bbcc3
Compare
Suite on the new head: 3005 passed, 0 failed, 52 ignored; smoke pair in the description. Claude Code with Claude Fable 5.2 checked the points and wrote the change. |
bmjask
left a comment
There was a problem hiding this comment.
Review of 52bbcc38: 1 finding(s) (1 medium), most severe first.
Re-review at 52bbcc38. The timeout warning now has a counter and wasn't flagged again, so the per-frame flush looks addressed. The 60 s cap holding PRESENTER (and blocking quiesce_queue) from the 11d7ddd0 review is still open. One new item below.
- Medium
crates/xcl/src/hle/d3d12x/present.rs:1042: XCL_PRESENT_WAIT_MS changes only the frame N-2 wait. (inline)
These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
| } | ||
| if wait_val > 0 { | ||
| let timeout_ms = if is_present_x { 2000 } else { 100 }; | ||
| let timeout_ms = if is_present_x { present_wait_ms() } else { 100 }; |
There was a problem hiding this comment.
Medium: XCL_PRESENT_WAIT_MS changes only the frame N-2 wait. The other fence waits on the same present path keep their hardcoded limits: the drain before ResizeBuffers (line 1384, 2000 ms), the frame-dump copy wait (line 1704, 2000 ms), the queue-switch wait (line 1480, 1000 ms) and Presenter::drop (1000 ms). For a title whose GPU frame takes ~5 s, run with XCL_PRESENT_WAIT_MS=10000, the PresentX wait now succeeds, but the first swap-chain resize still times out at 2000 ms: ensure_swapchain logs 'drain before resize: GPU fence still pending after 2000 ms' and returns false, so no frame is shown even though the user raised the wait. Frame dumps under XCL_FRAME_DUMP are skipped the same way. Using the setting for every present-path wait, or at least the resize drain, would make it do what the README says.
There was a problem hiding this comment.
Right: the setting changes only the PresentX wait for the copy of frame N-2. The drain before a resize (2000 ms), the frame-dump wait (2000 ms), the queue-switch wait and Presenter::drop (1000 ms each) keep their limits, so a title with ~5 s GPU frames still fails at the first resize.
I kept this PR to what its title says and made the README say so (a4893ccc): only that wait is set. Giving the other four waits the setting changes behaviour on the resize and shutdown paths and wants its own PR with a run that reaches them; the description lists the gap under Not tested.
On the 60 s cap holding PRESENTER: unchanged, it is a debug setting with a default that is as before. If you have a concrete case where the cap should be lower, or the wait should let the lock go, I am open to it.
Written with Claude Code (Claude Fable 5.2).
|
Follow-up review of In short: The PR logs PresentX waits for the copy of frame N-2 that time out, and adds Checked and fine
Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point. |
PresentX waits up to 2000 ms for the copy of frame N-2. When that times out it returned without a log line, and present_x still reports the flip. Each time-out is now logged with a counter, and XCL_PRESENT_WAIT_MS sets the limit (default 2000, as before). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
52bbcc3 to
a4893cc
Compare
|
Follow-up review of In short: This push only adds a sentence to the README: Checked and fine
Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point. |
|
merge-check
|
PresentX waits up to 2000 ms for the copy of frame N-2. When that wait times out it returns without a log line, while
present_xstill reports the flip: a title that stops showing frames this way leaves nothing inxcl.log. Each time-out is now logged with a count, andXCL_PRESENT_WAIT_MSsets the limit (default 2000, as before).What is in it
present.rs: the warning with a counter (the first eight, then at each doubling, so a title that times out on every frame does not fill the log);XCL_PRESENT_WAIT_MS(a whole number of ms above 0, anything else the default; at most 60000, since the wait holds the presenter's lock that a queue's release needs too), a log line with the wait in effect when it is set, and its unit testREADME.md: one entry. It says the setting changes only the PresentX wait: the waits before a swap chain resize (2000 ms), for a frame dump (2000 ms), at a queue switch and at shutdown (1000 ms each) keep their limits (review of 52bbcc3)Tested
cargo build --workspace: ok;cargo test --workspace --no-fail-fast -- --test-threads=4(debug) on this head (a4893cc): 3005 passed, 0 failed, 52 ignored (main 817eb1f: 3004 passed)XCL_NETWORK=0on both sides: see belowRegression run
main:
this PR's head:
Not tested
XCL_PRESENT_WAIT_MSdoes not get it past a swap chain resize.AI use
🤖 Generated with Claude Code