Diagnostics: the card's clock counts list-translation waits on their own, and copystat gives bytes copied beside bytes looked at #387

Open
github-bot wants to merge 2 commits from github-bot/gh-387 into main AGit
Owner

@⁠Jesper-Andersson on GitHub · 2026-11-26 22:02 UTC · original
Jesper-Andersson:diag-card-clock-lists → main · +59 −16 · 3 files · 2 commits · open

Fixes #366.

Two frame-line counters pointed the wrong way when looking for what sets the frame.

The card's clock (host.rs card_clock_line) split the card's idle time into "the submitting thread was working" and "the rest while the title had not submitted". With VICTORY_THIN=1 (a play.ps1 default), a submission waits in the line of submissions (queue/behind.rs) until its lists are translated. The thread that serves the line is not "working" then, so that wait was counted as the title's.

copystat's "copied from" lines summed the length of each refreshed range, not the bytes the refresh copied. In #367's runs one range read "~9.8x a frame, 1.79 GB a frame" in 2.6 ms, where about 43 MB a frame were copied.

Change

  • host.rs: TRANSLATING, translating(on) and translated(), kept like WORKING / worked(). The clock takes the difference over each idle stretch into a fourth counter.
    • The line now reads: nothing of ours queued X ms ..., Y ms of that while the submitting thread was working, Z ms while the line of submissions stood at lists still being translated (VICTORY_THIN), the rest while the title had not submitted; ...
  • queue/behind.rs Lane::step:
    • When nothing is free to go and a head is a folded Lists job (lists still being translated), it calls translating(true).
    • When it takes an entry, or the line is empty, it calls translating(false).
    • Only the one thread that serves the line calls these.
  • copystat.rs range() takes the bytes copied too (from shadow.update's return value). The line gives both: ... MB/frame looked at, ... MB/frame copied.
  • No switch: these are diagnostics lines. The atomics cost a few loads and stores per pass of the line, and the copystat call is behind diagnostics as before.

Measured

RTX 2070 SUPER 8 GB, Ryzen 7 5800X, 32 GB, Windows 11, diag build of a local branch (test at b9b32e4 plus these commits), scripts\play.ps1 defaults, Series S, DLSS.

  • The new part, from gameplay seconds: medians of 0-4.3 ms a frame. The pool from #221 had already removed the long translation waits.
  • Before the pool, the old line put 230 ms a frame on "the title had not submitted" in a second where the title waited 261 ms at presents (#366).
  • Frame time: a control run of test's own code built the same way gave the same frame times with and without these commits (204 against 200 ms, same route).

Checks

  • cargo build --profile diag -p victory --features "dlss diagnostics": ok, on the local branch
  • cargo test -p victory-gpu --lib --locked queue::behind: 5 passed
  • cargo clippy --workspace --all-targets --locked -- -D warnings: fails on main's existing errors only, none in the changed files: victory-loader/src/descriptor_sites.rs:494,559 (transmute annotations), victory-gpu/src/list.rs:1870 (totals never used) and watch.rs:3626 (open). See #241, #324, #362.
  • cargo xtask policy: 265 files ok
  • In game: five runs with the new lines, read with drains.py

Not checked

  • No new unit test for the split. The statics are global, and Lane::step runs in the existing parallel behind tests, so a test reading them would race. The value is checked against the neighbouring lines in game instead.
  • AMD, Linux.

This change was made with AI assistance (Claude Code).

**@⁠Jesper-Andersson** on GitHub · 2026-11-26 22:02 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/387) `Jesper-Andersson:diag-card-clock-lists` → `main` · +59 −16 · 3 files · 2 commits · open Fixes #366. Two frame-line counters pointed the wrong way when looking for what sets the frame. **The card's clock** (`host.rs` `card_clock_line`) split the card's idle time into "the submitting thread was working" and "the rest while the title had not submitted". With `VICTORY_THIN=1` (a `play.ps1` default), a submission waits in the line of submissions (`queue/behind.rs`) until its lists are translated. The thread that serves the line is not "working" then, so that wait was counted as the title's. **copystat's "copied from" lines** summed the length of each refreshed range, not the bytes the refresh copied. In #367's runs one range read "~9.8x a frame, 1.79 GB a frame" in 2.6 ms, where about 43 MB a frame were copied. ## Change - `host.rs`: `TRANSLATING`, `translating(on)` and `translated()`, kept like `WORKING` / `worked()`. The clock takes the difference over each idle stretch into a fourth counter. - The line now reads: `nothing of ours queued X ms ..., Y ms of that while the submitting thread was working, Z ms while the line of submissions stood at lists still being translated (VICTORY_THIN), the rest while the title had not submitted; ...` - `queue/behind.rs` `Lane::step`: - When nothing is free to go and a head is a folded `Lists` job (lists still being translated), it calls `translating(true)`. - When it takes an entry, or the line is empty, it calls `translating(false)`. - Only the one thread that serves the line calls these. - `copystat.rs` `range()` takes the bytes copied too (from `shadow.update`'s return value). The line gives both: `... MB/frame looked at, ... MB/frame copied`. - No switch: these are diagnostics lines. The atomics cost a few loads and stores per pass of the line, and the copystat call is behind `diagnostics` as before. ## Measured RTX 2070 SUPER 8 GB, Ryzen 7 5800X, 32 GB, Windows 11, diag build of a local branch (`test` at `b9b32e4` plus these commits), `scripts\play.ps1` defaults, Series S, DLSS. - The new part, from gameplay seconds: medians of 0-4.3 ms a frame. The pool from #221 had already removed the long translation waits. - Before the pool, the old line put 230 ms a frame on "the title had not submitted" in a second where the title waited 261 ms at presents (#366). - Frame time: a control run of `test`'s own code built the same way gave the same frame times with and without these commits (204 against 200 ms, same route). ## Checks - `cargo build --profile diag -p victory --features "dlss diagnostics"`: ok, on the local branch - `cargo test -p victory-gpu --lib --locked queue::behind`: 5 passed - `cargo clippy --workspace --all-targets --locked -- -D warnings`: fails on main's existing errors only, none in the changed files: `victory-loader/src/descriptor_sites.rs:494,559` (transmute annotations), `victory-gpu/src/list.rs:1870` (`totals` never used) and `watch.rs:3626` (`open`). See #241, #324, #362. - `cargo xtask policy`: 265 files ok - In game: five runs with the new lines, read with `drains.py` ## Not checked - No new unit test for the split. The statics are global, and `Lane::step` runs in the existing parallel `behind` tests, so a test reading them would race. The value is checked against the neighbouring lines in game instead. - AMD, Linux. ## Related - #366 (the issue), #367 and #370 (the runs that showed it), #221 (the pool). This change was made with AI assistance (Claude Code).
The frame line counted it as "while the title had not submitted":
with VICTORY_THIN a submission waits in the line until its lists are
translated, and the thread that serves the line is not working then.

This change was made with AI assistance (Claude Code).
A refresh copies only the pages written since the last one; the line
summed the refreshed ranges' lengths, so a range read as copied ~10x a
frame (1.8 GB a frame in 2.6 ms) where ~43 MB a frame were copied.

This change was made with AI assistance (Claude Code).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:56:26 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/387/head:github-bot/gh-387'
git switch 'github-bot/gh-387'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-387'
git switch 'github-bot/gh-387'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-387'
git switch 'github-bot/gh-387'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-387'
git switch 'main'
git merge --squash 'github-bot/gh-387'
git switch 'main'
git merge --ff-only 'github-bot/gh-387'
git switch 'main'
git merge 'github-bot/gh-387'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.