Repository navigation
Conversation
…ot shown A draw whose pipeline is still being made is dropped and leaves its targets as they were. When it is the draw that writes a presented image (Grand Theft Auto VI's final upscale, PS_TAA2_SpatialUpscaleWithDithering), that back buffer still holds the frame drawn into it two presents ago, and the window alternates between two old frames. On a cold driver cache the world's first frame wants ~1,900 new pipelines; the upscale's was made 41 s after its first use, and frames 1300-1346 alternated black and dim. Such a draw now puts its pipeline at the head of the workers' queue (make::hurry), and a present of an image it left unwritten is not shown: the window keeps the last frame shown (crate::shown), for at most 10 s (HOLD_LIMIT). Past that the frames are shown as they come, and the log names the pipelines waited for, so a pipeline that never arrives (a dead worker, a hung driver compile) cannot freeze the window. Refused pipelines do not count at all. VICTORY_SHOW_UNWRITTEN=1 shows those frames as before.
Dukestar69
left a comment
There was a problem hiding this comment.
LGTM — verified on RTX 5090 (Windows / D3D12) against origin/main (63bcca4).
- Tracking whether a presented frame's image was left unwritten by a dropped draw/dispatch avoids flashing stale/unwritten frames while keeping normal presentation unaffected.
cargo test -p victory-gpu --lib shown:: -- --test-threads=1: all passed.cargo test -p victory-gpu --lib pipeline::make:: -- --test-threads=1: all passed.cargo test -p victory-gpu --lib draw:: -- --test-threads=1: 20 passed, 0 failed.cargo test -p victory-gpu --lib queue:: -- --test-threads=1: 5 passed, 0 failed.cargo clippy -p victory-gpu --all-targets -- -D warnings(default +--features diagnostics): clean.cargo xtask policy: 192 files ok.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
|
I resolved the The new regression takes both queues through the two-worker case with the compute slot occupied. The urgent draw goes first, ordinary graphics can follow, and compute resumes when a slot is available. The other queue and presentation tests passed too (11 with default features, 12 with diagnostics). Both strict all-target Clippy checks and the policy check passed. These were scheduler and presentation-state tests. If this or #3025 lands first, the combined commit is available for the second PR’s rebase. Please preserve the Git author or add |
|
@andrewpozdnakov7-jpg thank you, that saves a careful rebase. I checked that If #3025 lands first, I'll rebase onto your resolution and keep you as the commit's author (or add the One heads-up: I have a follow-up on top of this PR that also touches that queue. When the presented image is written but still dark, it walks back from the image and hurries the dropped passes that feed it. It's in testing now and not opened yet, and it uses the same "first" place, so it should fit your resolution as is; I'll check that when I rebase. AI-assisted (Claude); no game data shared. |
fuzeofficlal
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (63bcca43) at PR head 489ec500 (Windows 11 x64, NVIDIA GeForce RTX 5090 + Microsoft WARP, VICTORY_D3D12_DEBUG=1):
crates/victory-gpu/src/{draw.rs, pipeline.rs, pipeline/make.rs, queue.rs, shown.rs}:draw.rs(L539,L1736-L1738) andpipeline.rs(dropped_into,L259-L273) only flag a presented target and promote its pipeline viamake::hurrywhenmake::being_made(&p.host)is true, so refused/untranslated pipelines and compute indirect dispatches never trigger holds, and clear-only/copy-only frames without dropped draws always show normally.pipeline/make.rs(Place::First,hurried,L232-L246,L292-L309): duplicate front insertion is safely deduplicated byp.taken.swap(true)in the worker loop without double-decrementingWAITING.queue.rs(present,L538,holds,L589-L621):pump_held, frame accounting/budget reset, and diagnostics target dumps still run beforeholds(), so holding does not stall submission progress or wait budgets, andHOLD_LIMITbounds any hold run to 10 s.
cargo xtask policy: 192 files ok.cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--all-features): 0 warnings.cargo test --locked -p victory-gpu --features diagnostics --lib -- shown:: pipeline::make:: draw:: queue::: 33/33 passed on both RTX 5090 (0.65s) and WARP (3.09s) withVICTORY_D3D12_DEBUG=1.- Extra synthetic probe (not committed): verified clear-only frames never hold, multi-plane
[unwritten, new]registers both planes and clearsunwrittenvia the non-short-circuiting fold.
Two small non-blocking follow-up notes:
- In
shown.rs(unwritten, lines 104-106), whenself.images.remove(0)evicts an old image at capacityIMAGES, removing that pointer fromself.unwrittenas well (self.unwritten.retain(|&s| s != evicted)) prevents a stale entry if a later allocation reuses the same address. - In
shown.rs(frame, lines 172-174),if *SHOW_ALL && matches!(frame, Frame::Hold { .. })suppressesHoldbut still returnsShowAgain { held }/GiveUp { held, waited_for }toqueue.rs::holds(), which can log non-zeroheldcounts even thoughVICTORY_SHOW_UNWRITTEN=1showed every frame.
Solid fix overall; synthetic tests only, looks good to merge.
…olds and counts nothing
|
@fuzeofficlal thanks for the review and the synthetic probe. Both notes are fixed in
Tested: AI-assisted (Claude); no game data shared. |
|
I retested the new eviction and show-all cases at Combined commit @neonbyte1, if your follow-up uses the same |
|
@andrewpozdnakov7-jpg thanks again, and good catch. I read it in
AI-assisted (Claude); no game data shared. |
|
Follow-up for the dark phase mentioned above: #3378, stacked on this PR. It hurries the dropped passes the presented image reads (at most 8 per present) and remembers them for the next cold start. In the same cold-cache runs, the lighting resolve went from 47–54 s waiting in the queue to being made ~6 s after its first bind, and the next run makes the final upscale before it's needed. AI-assisted (Claude); measured on my machine, no game data shared. |
What is wrong
A draw whose pipeline is still being made is dropped once the frame's wait budget is spent, and leaves its render targets as they were. When that draw is the one that writes a presented image, the image still holds what was drawn into it the last time. Titles present two back buffers in turn, so the window alternates between two old frames.
In Grand Theft Auto VI's world start with a cold driver cache (seven runs, RTX 5090, Wine + vkd3d-proton), the first world frame first-binds ~1,900 pipelines. The final upscale (
VS_TAA2_SpatialUpscale+PS_TAA2_SpatialUpscaleWithDithering) is one of them, queued behind the others: in one run it waited 41 s and then took 3.3 ms to make. Until then every other frame was black (the fade's last frame in one back buffer) and the others dim (the first fade-in frame in the other), 46 frames in a row. In every run the flicker stopped within one frame of that pipeline being made; runs whose cache was warm had it before the world started and never flickered.What changes
make::hurry).crate::shown). The log says where a run of held frames starts and ends.HOLD_LIMIT): the pipeline held for is the next one a worker takes, and the longest worker job in my cold-cache runs was 10.5 s (typically 4–6 s). Past it the frames are shown as they come and the log names the pipelines waited for, so a pipeline that never arrives (a dead worker, a hung driver compile) cannot freeze the window.VICTORY_SHOW_UNWRITTEN=1shows those frames as before.Trade-off: a first-use draw into the back buffer (a new HUD element) whose pipeline misses the budget now holds the frame until it is made, which is the next thing a worker makes, instead of showing a frame without it.
Related: #2582/#2435 give full-screen passes their own workers (that would also shorten this if the upscale classifies as one, but never holds), #3025 orders graphics before compute; both edit the same queue in
pipeline/make.rs, so whichever lands second needs a small rebase. I found no open PR that holds the present of an unwritten image.Tested
New tests:
shown::tests(an unwritten image is held once, an image never presented is never held, old images are forgotten, a hold is given up after the limit with an injected clock) andpipeline::make::tests::a_pipeline_a_presented_image_waits_for_goes_first(order, once, not when taken or made). They pass under Wine.clippy
-D warningsforx86_64-pc-windows-msvc, with and without--all-features: clean;cargo xtask policyok.In game: two 8-minute runs of the same build with the driver's and vkd3d-proton's shader caches off (
__GL_SHADER_DISK_CACHE=0 VKD3D_SHADER_CACHE_PATH=0), so the first world frame starts with the backlog every time:made firstvertex 0309a446…, pixel 4f4ec7b1…)Captures of frames 1300–1303 show the alternation without the change (dark, stale grey, dark, stale grey) and a steady image with it.
Not fixed here: after the upscale exists, the world stays dark (brightness 0–1) until a
CS_RaytracingResolvecompute pipeline is made, about 50 s and ~55 frames later in the cold run. That image is written, so holding is not the right tool; making the pipelines that feed the presented image earlier is a follow-up I'm looking at.AI-assisted (Claude); measured on my machine, no game data shared.