Card meter: the whole table by pipeline in a file (VICTORY_CARD_METER_FILE), not only the largest 48 in the log #1180

Closed
wildheathen wants to merge 1 commit from upstream-pr/1183 into main
wildheathen commented 2026-11-25 23:07:37 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by wildheathen on 2026-11-25T23:07:37Z.


With VICTORY_CARD_METER_PIPELINES=1 the card meter logs, every 256 frames, the 48 pipelines that took the most of the card's time. In the world that is a little over half of it: in one run on an RTX 5080 the 48 covered 61% of 69 ms a frame, and the other 39% (about 1,500 pipelines) could not be attributed from the log.

VICTORY_CARD_METER_FILE=<path> writes the whole table to a file at each of those moments: one tab-separated line per pipeline with the window's number, its frames, the total of all pipelines, and this pipeline's ms per frame, bindings per frame, microseconds per binding and name. A header line goes first when the file is empty.

  • Unset, nothing changes: the log's lines are the same, and the only added work is one OnceLock read every 256 frames.
  • The numbers are the log's own (same sums, same division by frames), with more decimals.
  • A write error is logged once and the file is left alone after that.
  • Only crates/victory-gpu/src/cardmeter.rs, +69 lines, one test for the line's format.

What it gave

Two world runs of 8 minutes on an RTX 5080 (one on ca8829f plus local changes outside this file, one on 9c184b3):

  • In every window the file's lines add up to the total in the log's header (within 0.003 ms), and its first 48 lines are the log's 48, in the same order with the same values.
  • With the names joined on the hash translate --list prints, the card's 71 ms a frame split into compute 40.9 ms (817 pipelines), mesh and pixel 23.6 ms (1,314 bindings a frame), vertex and pixel 4.8 ms, the rest 1.8 ms. Half of the time is in about 27 pipelines; 90% takes 334.
  • The part the log does not show is a long tail and hides no heavy program: below the 48th, a binding costs 13 µs on average.

Checks

  • cargo test -p victory-gpu --features diagnostics --lib cardmeter: 3 passed.
  • cargo clippy -p victory-gpu --features diagnostics --lib -- -D warnings stops at the warnings main already has in draw.rs, shadow.rs, watch.rs, fpsbox.rs, queue.rs and pipeline/library.rs; none is in cardmeter.rs.
  • Based on 6d20eed. #977 and #902 also touch the card meter (keeping timestamp pairs, skipping timestamps when logging is off); both change cardmeter.rs too. This does not depend on either; I have not merged it with them, so a textual conflict is possible.

Windows 11, RTX 5080. No game data included.

<!-- greyfinch-sync:fxceless/victory-fork:issue:5500732910 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1183). Originally posted by [wildheathen](https://github.com/wildheathen) on 2026-11-25T23:07:37Z. --- With `VICTORY_CARD_METER_PIPELINES=1` the card meter logs, every 256 frames, the 48 pipelines that took the most of the card's time. In the world that is a little over half of it: in one run on an RTX 5080 the 48 covered 61% of 69 ms a frame, and the other 39% (about 1,500 pipelines) could not be attributed from the log. `VICTORY_CARD_METER_FILE=<path>` writes the whole table to a file at each of those moments: one tab-separated line per pipeline with the window's number, its frames, the total of all pipelines, and this pipeline's ms per frame, bindings per frame, microseconds per binding and name. A header line goes first when the file is empty. - Unset, nothing changes: the log's lines are the same, and the only added work is one `OnceLock` read every 256 frames. - The numbers are the log's own (same sums, same division by frames), with more decimals. - A write error is logged once and the file is left alone after that. - Only `crates/victory-gpu/src/cardmeter.rs`, +69 lines, one test for the line's format. ## What it gave Two world runs of 8 minutes on an RTX 5080 (one on `ca8829f` plus local changes outside this file, one on `9c184b3`): - In every window the file's lines add up to the total in the log's header (within 0.003 ms), and its first 48 lines are the log's 48, in the same order with the same values. - With the names joined on the hash `translate --list` prints, the card's 71 ms a frame split into compute 40.9 ms (817 pipelines), mesh and pixel 23.6 ms (1,314 bindings a frame), vertex and pixel 4.8 ms, the rest 1.8 ms. Half of the time is in about 27 pipelines; 90% takes 334. - The part the log does not show is a long tail and hides no heavy program: below the 48th, a binding costs 13 µs on average. ## Checks - `cargo test -p victory-gpu --features diagnostics --lib cardmeter`: 3 passed. - `cargo clippy -p victory-gpu --features diagnostics --lib -- -D warnings` stops at the warnings `main` already has in `draw.rs`, `shadow.rs`, `watch.rs`, `fpsbox.rs`, `queue.rs` and `pipeline/library.rs`; none is in `cardmeter.rs`. - Based on `6d20eed`. #977 and #902 also touch the card meter (keeping timestamp pairs, skipping timestamps when logging is off); both change `cardmeter.rs` too. This does not depend on either; I have not merged it with them, so a textual conflict is possible. Windows 11, RTX 5080. No game data included.
wildheathen commented 2026-11-29 09:32:26 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by wildheathen on 2026-11-29T09:32:26Z.


Closing this: main now carries VIctory-NVIDIA's tree (368967f), so this branch no longer applies. VIctory-NVIDIA already prints the card meter in every build (trustno1-coder/VIctory-NVIDIA#1626); if the full per-pipeline table in a file is still missing there, I'll propose it on VIctory-NVIDIA.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7253830687 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1183#issuecomment-7253830687). Originally posted by [wildheathen](https://github.com/wildheathen) on 2026-11-29T09:32:26Z. --- Closing this: main now carries VIctory-NVIDIA's tree (368967f), so this branch no longer applies. VIctory-NVIDIA already prints the card meter in every build (trustno1-coder/VIctory-NVIDIA#1626); if the full per-pipeline table in a file is still missing there, I'll propose it on VIctory-NVIDIA.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
fxceless/victory-fork!1180
No description provided.