Diagnostics: copies up and back by the title's memory protection (VICTORY_WC_STATS=1) #476

Open
github-bot wants to merge 2 commits from github-bot/gh-476 into a-publier AGit
Owner

@⁠icecreammule277-dot on GitHub · 2026-11-27 05:19 UTC · original
icecreammule277-dot:wc-diag → a-publier · +206 −1 · 4 files · 2 commits · open

AI-assisted (Claude Code). Numbers and log lines only.

Diagnostics only, off by default (VICTORY_WC_STATS=1): copies up to the card and back into title memory, split by the memory protection the title asked for. The split is write-combined (0x400), uncached (0x200) or cached. The console's CPU writes write-combined memory but doesn't read it back, so this shows how much of the copy traffic goes to memory the title never reads.

What it does

  • XMem's note_protection reports every protection the title asks for (victory_gpu::title_memory_protection). wc.rs keeps an interval map of them, where the newest request wins.
  • Copy-ups (refreshes, copies, fills, batch updates) and copy-backs (relay, hand-back, plan ranges, card merges) are counted by the title address they start at.
  • A line next to the frame-rate line gives MB per frame by kind, and how much address space of each kind was noted. Counters are taken every second, over the same frames as the frame-rate line.
  • Off, every hook returns at once. On, a copy costs a read lock and one map lookup.

What it showed

In a heavy scene (about 67 ms a frame), copy-back was 46.2 MB a frame, 100% of it into write-combined memory. Copy-up was 79 MB, 85% write-combined. That's the basis for the follow-up PR, which leaves shaders' writes to such memory on the card.

Tests

cargo test -p victory-gpu --lib -- wc:: covers the newest request cutting older ranges, and the protection bits picking the kind. Built with --profile diag --features diagnostics.

🤖 Generated with Claude Code

**@⁠icecreammule277-dot** on GitHub · 2026-11-27 05:19 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/476) `icecreammule277-dot:wc-diag` → `a-publier` · +206 −1 · 4 files · 2 commits · open *AI-assisted (Claude Code). Numbers and log lines only.* **Diagnostics only, off by default (`VICTORY_WC_STATS=1`):** copies up to the card and back into title memory, split by the memory protection the title asked for. The split is write-combined (0x400), uncached (0x200) or cached. The console's CPU writes write-combined memory but doesn't read it back, so this shows how much of the copy traffic goes to memory the title never reads. ## What it does - XMem's `note_protection` reports every protection the title asks for (`victory_gpu::title_memory_protection`). `wc.rs` keeps an interval map of them, where the newest request wins. - Copy-ups (refreshes, copies, fills, batch updates) and copy-backs (relay, hand-back, plan ranges, card merges) are counted by the title address they start at. - A line next to the frame-rate line gives MB per frame by kind, and how much address space of each kind was noted. Counters are taken every second, over the same frames as the frame-rate line. - Off, every hook returns at once. On, a copy costs a read lock and one map lookup. ## What it showed In a heavy scene (about 67 ms a frame), copy-back was 46.2 MB a frame, **100% of it into write-combined memory**. Copy-up was 79 MB, 85% write-combined. That's the basis for the follow-up PR, which leaves shaders' writes to such memory on the card. ## Tests `cargo test -p victory-gpu --lib -- wc::` covers the newest request cutting older ranges, and the protection bits picking the kind. Built with `--profile diag --features diagnostics`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
XMem reports every protection the title asks for; copies up (refreshes,
copies, fills, placed steps) and copies back are counted by whether their
title memory was asked for as write-combined, uncached or cached, in one
line beside the frame line. Off by default: no cost unless set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 05:20:11 +00:00
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-27 07:01 UTC · original

Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At a78f788: victory-gpu 398 passed, 0 failed, 34 ignored; victory-hle 162 passed, 0 failed, 2 ignored.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-27 07:01 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/476#issuecomment-7212072899) Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At `a78f788`: `victory-gpu` 398 passed, 0 failed, 34 ignored; `victory-hle` 162 passed, 0 failed, 2 ignored. AI-assisted (Claude Code); no game data.
This pull request can be merged automatically.
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/476/head:github-bot/gh-476'
git switch 'github-bot/gh-476'

Merge

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