Repository navigation
Conversation
…hreads `BUDGET` is "waiting allowed per title frame, over all threads", but each wait took what was left of it when the wait began and counted its own time only on return. The title records its lists on several threads: a thread that began to wait while another still waited got the whole budget again, from its own start. The frame then stood still for up to twice the budget (a thread that begins just before the first returns), and its threads waited a budget each. The waits of a frame now end together (`Waits`): time counts while any thread waits, once however many do; waits one after the other share what is left; a thread still naming the frame before brings no budget back. The frame line prints the time waited: these waits are on the recording threads, outside the submissions, so they were in none of its times. Tests, no GPU: waits_of_a_frame_share_its_budget (the accounting, on given instants) and a_thread_that_waits_while_another_does_gets_no_budget_of_its_own (four threads waiting on pipelines never made). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at Overlap, from reading: #275 (open, conflicting with AI-assisted (Claude Code). |
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (940d32f, Windows 11 x64, Rust 1.98.1 MSVC):
cargo test -p victory-gpu --lib pipeline::— 17 passed, 0 failedcargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— ok (183 files ok)
Clean shared per-frame pipeline wait budget across recording threads. Looks good.
AI-assisted (Gemini 4 Neon).
catminou4
left a comment
There was a problem hiding this comment.
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Frame's pipeline wait is one budget for all requests — replaces per-request waits; check the budget arithmetic against slow pipeline compiles.
|
@catminou4 on slow compiles: the budget is per title frame, as on AI-assisted (Claude Code). |
|
Automated triage for the maintainers. Thanks for merging In This overlaps #275, the older and broader fix, which no longer merges. This PR is the narrow fix on current Verdict: merge candidate (a recommendation to look, not an approval). CI: passing. Generated by Claude Code |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s do Main's Marvisak#1320 gave `Pending::new` the diagnostics build's shader hashes to skip; the test passes none, as the module's other tests do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged main AI-assisted |
…t for all recording threads
…is one budget for all recording threads
fuzeofficlal
left a comment
There was a problem hiding this comment.
Reviewed host.rs, pipeline.rs, and pipeline/make.rs at eb868bce merged onto origin/main (63bcca43) and verified on RTX 5090 and WARP (VICTORY_D3D12_WARP=1) with VICTORY_D3D12_DEBUG=1.
Concurrency & accounting audit
Waits(crates/victory-gpu/src/pipeline/make.rs:188,223,239,253) replaces the racy per-thread budget read with a shared mutex-protected frame deadline (s.since + budget.saturating_sub(s.used)): overlapping recording threads share one deadline and charge wall time once, stale frame numbers (frame < s.frame) cannot reset the budget,take(now)advancess.sinceands.usedtogether so active wait deadlines stay invariant, andsaturating_sub/saturating_duration_sinceavoid underflow.wait_within(pipeline/make.rs:337) uses an RAIIUnderguard soend()always runs even on unwind.pipeline::take_waited_ms(pipeline.rs:268) is gated#[cfg(windows)]and wired intoMeterathost.rs:3077.
Verification
cargo run -p xtask -- policy: 191 files ok.cargo clippy -p victory-gpu --all-targets -- -D warnings(default and--all-features): clean.pipeline:: host::withVICTORY_D3D12_DEBUG=1: 55/55 passed on RTX 5090 (skippingdynamic_slots_are_held_until_released) and 59/59 passed on WARP (--features diagnostics, skipping the pre-existingmaincompositor_failure_presents_primary_in_the_same_frameDebug Layer mismatch), includingwaits_of_a_frame_share_its_budget(pipeline/make.rs:495) anda_thread_that_waits_while_another_does_gets_no_budget_of_its_own(pipeline/make.rs:548).
What is wrong
pipeline/make.rslets a draw wait for its host pipeline while the title frame has budget left:BUDGETis 500 ms, documented as "waiting allowed per title frame, over all threads".waitdid not keep to that. It read what was left of the budget when the wait began and added its own time only when it returned:The title records its lists on several threads. A thread that begins to wait while another still waits reads a budget nobody has charged yet and gets all of it, from its own start. So the frame can stand still for nearly twice the budget (a thread that begins just before the first one returns), and its threads wait a whole budget each.
These waits are on the recording threads, outside
Host::execute, so none of the frame line's times holds them. A frame that stood waiting for pipelines only showed as a longer frame.What changes
Waits): time counts while at least one thread waits, once however many do, and not between waits. Waits one after the other share what is left, as before. A wait that ends early because its pipeline was made leaves the rest to later waits, as before. A thread still naming the frame before (it read the frame number, then lost the processor) no longer brings a fresh budget back: onmaina different frame number reset the count....; 12.3 ms/frame of draws waiting for pipelines.A title recording on one thread behaves as on
main.Measured (synthetic, CPU threads only, no GPU and no title)
Four threads call
wait125 ms apart for pipelines that are never made, on the 500 ms budget:main(940d32f)How much this is worth in the title depends on how often several recording threads wait in one frame, which I have not measured: the title was not run. The new number on the frame line is there so that a tester's log shows it.
Tests
No GPU needed:
waits_of_a_frame_share_its_budget: the accounting on given instants (waits that overlap, waits one after the other, a spent budget, a stale frame number, a frame that begins while a wait is under way, the time taken for the frame line while a wait is under way).a_thread_that_waits_while_another_does_gets_no_budget_of_its_own: four real threads waiting on pipelines never made; every wait is over one budget after the first began.Both fail on
main's algorithm.cargo test -p victory-gpu --features diagnosticswithVICTORY_D3D12_WARP=1(software adapter): 148 passed, 0 failed, 2 ignored.cargo clippy -p victory-gpu --all-targetsis clean.Related
main.fxceless/victory-gta6diagnosed the same defect in its own tree (it measured 2.5 s of waiting per frame summed over five recording threads). The idea of looking here is theirs; the code is written formain.AI-assisted (Claude Code). No game data was used.
🤖 Generated with Claude Code