Repository navigation
Conversation
When a title binds many uncompiled compute pipelines in a single frame (e.g. during world load), a per-pipeline wait budget (XCL_PSO_WAIT_MS) still multiplies across every pending pipeline in that frame. Add an opt-in XCL_PSO_FRAME_WAIT_MS=<ms> setting (off by default) that caps the total time spent waiting on pending pipelines across a frame and refills on PresentX. Pipelines skipped because the frame budget was exhausted are not marked permanently late so they can still wait on subsequent frames if needed.
…xcl-dev#1931) When a title binds many uncompiled compute pipelines in a single frame (e.g. during world load), a per-pipeline wait budget (XCL_PSO_WAIT_MS) still multiplies across every pending pipeline in that frame. Add an opt-in XCL_PSO_FRAME_WAIT_MS=<ms> setting (off by default) that caps the total time spent waiting on pending pipelines across a frame and refills on PresentX. Pipelines skipped because the frame budget was exhausted are not marked permanently late so they can still wait on subsequent frames if needed.
|
Code review on \e870dd2:\n\n- \XCL_PSO_FRAME_WAIT_MS\ in \pso_async.rs\ and \present.rs\ cleanly shares a microsecond per-frame budget across |
|
Test report: #1931 on the retail title's world load I tested head Setup
Results
Findings
Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Native Windows comparison of the runtime hunks from
The enabled run had only a few later presents. The last sampled image remained loading artwork, and I did not verify any rendered gameplay. The final queue timeouts included a producer whose fence had been submitted but was still one value short of the requested completion. This directly shows the PSO wait signal dropping and queue timeouts appearing in this pair, without establishing that the timeouts caused the crash.
|
|
Test report for Builds: local merges, never pushed. This PR conflicts with
Tested
Not tested
AI use: Claude Code. A Claude Sonnet 5.5 session made the local merges, ran the title runs and collected the counts; Claude Opus 5.5 wrote this report. |
|
Two contributors checked independently and found that #1652 #2114 solves the same problem (for #505) in a different way: #1607, group D95. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table. |
luckyteagirl
left a comment
There was a problem hiding this comment.
On e870dd2, the frame budget is read before resolve_wait_for_ex and debited only after it returns. Two title threads resolving different pending PSOs can each read the same 40 ms remaining value, each wait for 40 ms, and then subtract 40 ms. That admits roughly 80 ms of aggregate bind waiting in a frame whose setting promises a 40 ms total cap. The sequential unit test at lines 511–543 does not exercise simultaneous callers.
There is a related frame-boundary race: begin_frame stores the new frame's allowance while an old wait is still in flight; the old wait's later consume_frame_budget subtracts its elapsed time from the new frame. Could each caller reserve its allowance atomically before sleeping, then refund unused time only to the frame generation it reserved from? A barrier fixture that starts two pending binds together, plus one that refills during an outstanding wait, would cover both cases.
This is an exact-head source review. I did not run a concurrent repro or title smoke test.
Adds an opt-in shared per-frame wait budget (
XCL_PSO_FRAME_WAIT_MS=<ms>, off by default) forpso_async::resolve_wait. When a title binds dozens of uncompiled compute pipelines in a single frame, a per-pipeline timeout (XCL_PSO_WAIT_MS) multiplies across each pending pipeline and can stall a frame for seconds; sharing one budget across the frame caps total stall time and refills onPresentX.What is in it
crates/xcl/src/hle/d3d12x/pso_async.rs: parseXCL_PSO_FRAME_WAIT_MS, track remaining microsecond wait budget for the current frame, cap eachresolve_waitbymin(XCL_PSO_WAIT_MS, frame_remaining), deduct elapsed wait time, and exposebegin_frame()to refill the budget. Pipelines skipped solely because the frame budget ran out are not marked permanentlylate, so they can still be waited for on the next frame if not finished by a worker yet.crates/xcl/src/hle/d3d12x/present.rs: callsuper::pso_async::begin_frame()inpresent_x_frame.README.md: documentXCL_PSO_FRAME_WAIT_MS.shared_frame_budget_caps_multiple_slow_pipelines_and_refills_on_next_frameverifying that a second pending pipeline returns immediately once the shared frame budget is spent and resolves after refill.Tested
rustc 1.98.1, debug test build cross-compiled tox86_64-pc-windows-msvccargo test --target x86_64-pc-windows-msvc -p xcl --lib -- pso_async::: 7 passed, 0 failed, 0 ignoredRegression run
main:
PR:
Not tested
cargo test --workspace -- --test-threads=4scripts/smoke.ps1regression run on main and this PR (required before leaving draft)AI use
pso_async::unit tests under Wine, and drafted this PR description.