GPU: dropped draws say whether their pipeline was refused or is still being made #3166
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3168"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by pablogonz12 on 2026-11-26T10:50:48Z.
What
draw::Statedrops a draw or dispatch that has no host pipeline, and the frame line said only how many of them:dropped 4440 without a host pipeline (4 being made). One number reads the same for two very different states: a pipeline whose shaders do not translate, whose draws are lost every frame to the end of the run, and one still being made, which costs its draws one frame. The per-reason lines that tell them apart (dropped N/frame without a host pipeline: <reason>) are printed only by adiagnosticsbuild, so a plain run cannot say why it is dropping.pipeline::note_dropnow counts in every build, on one of two sides, from what the pending pipeline actually holds: refused (a shader did not translate, the host driver declined to make it, or no pipeline is set at all) and waiting (still being made).take_dropped_split()returns[refused, waiting], and the frame line prints both:The drop sites in
draw.rscount in every build now (theDROPPEDtrace marker stays insidediagnostics), which is what feeds the counters.Counters and log text only: no behaviour change, so no off switch — a run that wants the old text reads the first number, which is unchanged.
Test
a_refused_pipeline_counts_its_drops_apart_from_one_still_being_made(crates/victory-gpu/src/pipeline.rs): a pipeline hand-built from junk shader words (no game data, no card involved) is counted as waiting while it is unmade, made on the spot (Pending::now) it is refused on the junk container and counted as refused, and a draw with no pipeline set at all counts as refused too —take_dropped_split()gives[0,1]and then[2,0].Numbers
cargo xwin clippy -p victory-gpu --all-targets --target x86_64-pc-windows-msvc -- -D warnings: clean, and the same with--features victory-gpu/diagnostics.--test-threads=1): 232 passed, 0 failed, 1 ignored.Other hardware
Counting and one log line: no shader translation, no heap layout and no GPU object changes, so every adapter takes exactly the path it took before. The counters are plain relaxed atomics, as the
diagnosticscounters already were, and the split is read once per report. Not tested on NVIDIA hardware; nothing in the diff reads an adapter, vendor or driver, but a log line from a Windows/NVIDIA run of the new frame line would confirm the text there.Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T11:08:54Z.
Review: APPROVED
Verified on RTX 5090 against
origin/main(63bcca4):cargo test -p victory-gpu --lib pipeline:: -- --test-threads=1: 24/24 passed (includinga_refused_pipeline_counts_its_drops_apart_from_one_still_being_made).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Cleanly distinguishes refused pipelines from still-compiling pipelines in dropped-draw reporting.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by Jackster on 2026-11-26T23:02:19Z.
Windows 11,
63bcca4+ this PR, Radeon RX 7900 XTX:cargo test -p victory-gpu --lib: 232 passed / 0 failed / 1 ignored (unpatched63bcca4here: 231).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.a_refused_pipeline_counts_its_drops_apart_from_one_still_being_madepasses; the frame-line drop tests are unchanged. Synthetic only. AI-assisted.Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-27T00:16:04Z.
Review: CHANGES_REQUESTED
Tested
9cd45776da512f52adcba85eb96e5b78e8ab6bc4withcargo xtask policy,cargo clippy --tests(default and--features diagnostics),pipeline::tests, and live probes on RTX 5090 and WARP (VICTORY_D3D12_DEBUG=1).pipeline::absent/Pending::madeand the new unit test are clean, but two regressions/accounting bugs show up indraw.rsandhost.rs:NOT_RUNis double-consumed under--features diagnostics, blanking everyDROPPED ... ()breadcrumb (crates/victory-gpu/src/draw.rs:169-204)dropped()callscount_dropped()at line 170, which unconditionally executeslet why = NOT_RUN.with(|w| w.replace(""));at line 192.dropped()callslet why = NOT_RUN.with(|w| w.replace(""));a second time at line 173, which now always returns"". As a result,list.note_op(...)(lines 174–179) always records"DROPPED {kind} () ..."with an empty reason instead of the actualnot_run(...)message.not_run("indexed rectangles")+count_dropped(0, "indexed"),NOT_RUNis already""before line 173 runs.NOT_RUNonce indropped()(and passingwhyintocount_dropped, or returning it fromcount_dropped) preserves bothnote_whyandlist.note_op.DROPPED_SPLIT(refused/waiting) countsexecute_indirectdrops thatdraw::DROPPEDdoes not count (crates/victory-gpu/src/draw.rs:1729, 1753-1757, 1808-1819,crates/victory-gpu/src/host.rs:3073-3086,crates/victory-gpu/src/list.rs:1625-1638)State::execute_indirectcallscrate::pipeline::note_drop(incrementingDROPPED_SPLIT) when there is no host pipeline (line 1754, plus lines 1729 and 1810 underdiagnostics), while its callerlist.rs:1638incrementslist::INDIRECTrather thandraw::DROPPED.host.rs:3081-3083prints:dropped {dropped:.0} without a host pipeline ({refused:.0} refused, {waiting:.0} waiting for one, {making} being made) and {indirect:.0} indirectwhich presents
(refused, waiting)as a breakdown of{dropped}.--features diagnosticsbuilds on RTX 5090 and WARP): 1 direct dropped dispatch + 5 dropped indirect calls producesdraw::take_dropped() == 1alongsidepipeline::take_dropped_split() == [6, 0](refused + waitingexceedsdroppedby 6×; on frames dropping ~1,500 indirect calls this makes the parenthetical breakdown wildly larger thandropped).draw.rs:1810only callsnote_dropunder#[cfg(feature = "diagnostics")], making the split inconsistent between default and diagnostic builds. Please either keep indirect drops out ofDROPPED_SPLIT(or track them separately) or reword the log format so the(refused, waiting)split explicitly covers direct + indirect drops together consistently across builds.Imported from Marvisak/VIctory. Originally posted by pablogonz12 on 2026-11-27T10:34:52Z.
Both are real. Fixed in
9c1fac9b1, one commit on top of9cd45776d.NOT_RUNread once.count_droppednow returns the reason it read and the trace formats that (draw.rs:172,:191); the second read indropped()is gone. SoDROPPED ... (...)carries thenot_run(...)text again instead of().note_dropfor an indirect call that finds no host pipeline moved out of the#[cfg(feature = "diagnostics")]block (draw.rs:1826); only thenote_opbreadcrumb stays behind the feature.draw::DROPPEDstill counts direct drops alone, so the frame line no longer presents the split as its breakdown: it now readsdropped N without a host pipeline and M indirect not run: R refused, W waiting for one, K being made (both counts together)(host.rs:3081), andtake_dropped_split's doc says the same (pipeline.rs:341). I kept one counter for both paths rather than a second split for indirect calls, since the question the line answers is "how much of this frame is waiting on a pipeline".Tested on RX 9070 XT (RDNA4), Mesa 26.3.1 RADV, this tree at
9c1fac9b1:cargo xwin clippy --workspace --all-targets --target x86_64-pc-windows-msvc -- -D warnings: clean.cargo xwin clippy -p victory-gpu --all-targets --target x86_64-pc-windows-msvc -- -D warnings: clean, and clean again with--features victory-gpu/diagnostics.cargo xtask policy: 191 files ok.victory-gpulib tests under Wine (GE-Proton11-14),--test-threads=1: 140 passed, 5 failed, then the process exits atqueue::tests::aliased_present_planes_preserve_the_host_texture_state. Those 5 (dynamic_slots_are_held_until_released,a_texture_written_in_one_format_reads_in_another_through_a_placed_view,lists_share_a_table_and_copies_keep_their_views,a_rejected_blob_gives_an_empty_library,pipelines_load_on_many_threads_at_once) fail on base63bcca43con this machine too, and the process exits at the same test there, so this diff is not what changes them.pipeline::tests::plusdraw::tests::a_texture_written...filtered: 6 passed, 1 failed (that texture test, also failing on base).Not tested here: NVIDIA, Windows, WARP, a release build, and the title - no game run, so the frame line itself was not read out in a frame, only unit-tested.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.