GPU diagnostics: keep pipeline drop reasons until they are reported #2110

Manually merged
github merged 2 commits from gh-pr/2110/head into gh-pr/2110/base 2026-11-26 04:55:06 +00:00
Owner

@⁠AwsAli05 on GitHub · 2026-11-25 05:10 UTC · original
AwsAli05:diagnostics/keep-drop-counts → main · +18 −24 · 1 files · 2 commits · merged 2026-11-25 21:54 UTC

Problem

The frame meter drains the per-reason counts every time it updates the one-second window caption. It prints those reasons only in the five-second diagnostics report, so drops during the intervening updates can disappear from that report. This can obscure pipelines that fail only during the first few seconds of world entry.

Change

Drain the per-reason counts when the diagnostics report is emitted. Divide by the number of frames in that interval, which is already recorded for the other diagnostics. The one-second caption and headline FPS sample still use their original interval.

Verification

  • GPU Clippy with all targets and features passed with warnings denied.
  • GPU diagnostics tests on Windows 11 and RTX 5070 Ti had 144 passes and two ignored tests. The run filters the two descriptor heap tests that fail on upstream main on this host.
  • Staged asset policy and git diff checks passed.

AI-assisted.

**@⁠AwsAli05** on GitHub · 2026-11-25 05:10 UTC · [original](https://github.com/Marvisak/VIctory/pull/2110) `AwsAli05:diagnostics/keep-drop-counts` → `main` · +18 −24 · 1 files · 2 commits · merged 2026-11-25 21:54 UTC ## Problem The frame meter drains the per-reason counts every time it updates the one-second window caption. It prints those reasons only in the five-second diagnostics report, so drops during the intervening updates can disappear from that report. This can obscure pipelines that fail only during the first few seconds of world entry. ## Change Drain the per-reason counts when the diagnostics report is emitted. Divide by the number of frames in that interval, which is already recorded for the other diagnostics. The one-second caption and headline FPS sample still use their original interval. ## Verification - GPU Clippy with all targets and features passed with warnings denied. - GPU diagnostics tests on Windows 11 and RTX 5070 Ti had 144 passes and two ignored tests. The run filters the two descriptor heap tests that fail on upstream main on this host. - Staged asset policy and git diff checks passed. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:55:05 +00:00
github manually merged commit 10a4259c95 into gh-pr/2110/base 2026-11-26 04:55:06 +00:00
Author
Owner

@⁠Dathinel on GitHub · 2026-11-25 05:21 UTC · original

I checked the emitted diagnostic lines on the parent (940d32f6) and this head (26eef9ba) with the same four-frame fixture. I injected six drops tagged early before frame 1 and two tagged late before frame 4. I advanced the meter's clock thresholds so frame 2 updated the caption and frame 4 emitted the report.

Reason Parent, drops/frame PR, drops/frame
early absent 1.5
late 1.0 0.5

A second, one-frame reporting interval with one new drop emitted only the new reason at 1.0/frame on both revisions. This checks retention, the four-frame denominator and reset using the actual Meter::frame logging path. The counts were synthetic; no rendering or performance measurement was involved. AI-assisted.

**@⁠Dathinel** on GitHub · 2026-11-25 05:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/2110#issuecomment-7153698929) I checked the emitted diagnostic lines on the parent (`940d32f6`) and this head (`26eef9ba`) with the same four-frame fixture. I injected six drops tagged `early` before frame 1 and two tagged `late` before frame 4. I advanced the meter's clock thresholds so frame 2 updated the caption and frame 4 emitted the report. | Reason | Parent, drops/frame | PR, drops/frame | |---|---:|---:| | early | absent | 1.5 | | late | 1.0 | 0.5 | A second, one-frame reporting interval with one new drop emitted only the new reason at 1.0/frame on both revisions. This checks retention, the four-frame denominator and reset using the actual `Meter::frame` logging path. The counts were synthetic; no rendering or performance measurement was involved. AI-assisted.
Author
Owner

@⁠fiestorra on GitHub · 2026-11-25 06:13 UTC · original

Right fix, and the same bug is still in the five lines above it

The change does what it says: take_drops() now drains where the reasons are printed, so a count survives the one-second caption updates in between, and the divisor becomes the interval's own frame count instead of the caption's. Two details I checked because they would have been easy to get wrong:

  • diagnostic_frames is incremented before the one-second early return, so it counts every present of the interval, not the last second's — that is what makes the divisor right;
  • no division by zero: the report only runs inside a present, so the value taken is at least 1.

What I would add, and it is in the same if block, five lines up. The report prints these, and all of them are drained every second and divided by the one-second frames:

let dropped = crate::draw::take_dropped() as f64 / frames;
let indirect = crate::list::take_indirect() as f64 / frames;
let root_views = crate::draw::take_root_view_slots() as f64 / frames;
…
making = crate::pipeline::making()
…
crate::texture::ALIAS_COPIES.swap(0, …) / frames,
crate::twin::COPIES.swap(0, …) / frames,

So the 5-second report's headline — dropped {dropped:.0} without a host pipeline (… being made) and {indirect:.0} indirect — is a one-second number inside a five-second report, which is the same defect this pull request fixes for the per-reason lines directly below it. A pipeline that fails only in the first second of world entry still gets flattened to "0/frame" in the report, which is the case the description says it cares about.

The fix is the same shape as yours: drain those inside the report block too, and divide them by diagnostic_frames. The caption can keep its one-second window; the two consumers just stop sharing a counter that resets at different rates — which is the general form of the bug, and worth saying in the description so the next reader does not re-introduce it by adding another per-interval count to the caption path.

On verification: I built the GPU crate with --features diagnostics (clean), but I could not produce a boot here that shows the report changing — on this machine the title removes the device at frame 64 on main (the format-115 texture), so there are no five seconds of presenting after entry, and before entry there are no pipeline drops worth counting. That half of your verification needs a machine that reaches the world; mine is not one today.

No game data is involved: code and counts.

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-11-25 06:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/2110#issuecomment-7154562007) **Right fix, and the same bug is still in the five lines above it** The change does what it says: `take_drops()` now drains where the reasons are printed, so a count survives the one-second caption updates in between, and the divisor becomes the interval's own frame count instead of the caption's. Two details I checked because they would have been easy to get wrong: - **`diagnostic_frames` is incremented before the one-second early return**, so it counts every present of the interval, not the last second's — that is what makes the divisor right; - **no division by zero**: the report only runs inside a present, so the value taken is at least 1. **What I would add, and it is in the same `if` block, five lines up.** The report prints these, and all of them are drained every second and divided by the one-second `frames`: ```rust let dropped = crate::draw::take_dropped() as f64 / frames; let indirect = crate::list::take_indirect() as f64 / frames; let root_views = crate::draw::take_root_view_slots() as f64 / frames; … making = crate::pipeline::making() … crate::texture::ALIAS_COPIES.swap(0, …) / frames, crate::twin::COPIES.swap(0, …) / frames, ``` So the 5-second report's headline — `dropped {dropped:.0} without a host pipeline (… being made) and {indirect:.0} indirect` — is a **one-second number inside a five-second report**, which is the same defect this pull request fixes for the per-reason lines directly below it. A pipeline that fails only in the first second of world entry still gets flattened to "0/frame" in the report, which is the case the description says it cares about. The fix is the same shape as yours: drain those inside the report block too, and divide them by `diagnostic_frames`. The caption can keep its one-second window; the two consumers just stop sharing a counter that resets at different rates — which is the general form of the bug, and worth saying in the description so the next reader does not re-introduce it by adding another per-interval count to the caption path. **On verification**: I built the GPU crate with `--features diagnostics` (clean), but I could not produce a boot here that shows the report changing — on this machine the title removes the device at frame 64 on `main` (the format-115 texture), so there are no five seconds of presenting after entry, and before entry there are no pipeline drops worth counting. That half of your verification needs a machine that reaches the world; mine is not one today. No game data is involved: code and counts. Written with an AI assistant.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 10:41 UTC · original · edited 2026-11-25 16:17 UTC

Automated triage for the maintainers.

Merge candidate. In host.rs Meter::frame, the five-second report used to drain and divide some counters every second, using that second's frames. These were the dropped, indirect and root-view counts, the per-reason pipeline drops, ALIAS_COPIES and twin copies, and read-backs. The report therefore showed one-second numbers, or lost the counts entirely. After this PR they are drained only inside the report block and divided by report_frames, which counts every present since the last report. That covers the follow-up raised in the thread as well. I checked that the window caption uses none of these counters, so it keeps its one-second fps/ms/draws. No other code drains them: draw.rs only loads ALIAS_COPIES. report_frames is at least 1 whenever the report runs. CI (check) is passing on this head, and the PR merges cleanly.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 10:41 UTC · [original](https://github.com/Marvisak/VIctory/pull/2110#issuecomment-7160042827) · edited 2026-11-25 16:17 UTC <!-- victory-triage v1 head=10a4259c95db41a9606fad00ef1a615d966576ba verdict=merge-candidate at=2026-11-25T16:17:37Z --> Automated triage for the maintainers. Merge candidate. In `host.rs` `Meter::frame`, the five-second report used to drain and divide some counters every second, using that second's `frames`. These were the dropped, indirect and root-view counts, the per-reason pipeline drops, `ALIAS_COPIES` and twin copies, and read-backs. The report therefore showed one-second numbers, or lost the counts entirely. After this PR they are drained only inside the report block and divided by `report_frames`, which counts every present since the last report. That covers the follow-up raised in the thread as well. I checked that the window caption uses none of these counters, so it keeps its one-second fps/ms/draws. No other code drains them: `draw.rs` only `load`s `ALIAS_COPIES`. `report_frames` is at least 1 whenever the report runs. CI (`check`) is passing on this head, and the PR merges cleanly. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2110
No description provided.