feat(replay): --bytes shows what a capture holds of a buffer #577

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

@⁠Serph91P on GitHub · 2026-12-05 11:13 UTC · original
Serph91P:feat/replay-bytes → main · +308 −2 · 3 files · 2 commits · open

What this does

victory replay <capture> --bytes <resource>[:<at>:<bytes>] reads the capture's files alone: a buffer's contents at the frame's start and what the CPU had changed in it by each submission, each with how many dwords are not zero and the dwords of the window asked for, as hex and floats (48 at most). No device is made.

It tells constants that were wrong in the title's bytes already from ones lost on the way to the card.

Ported by hand from the VIctory-7900XTX tree, where it was commit 8003422 on secure-silicon/VIctory-7900XTX, branch faces-and-replay-bytes, authored as local <local@localhost> (kept as co-author; the commit carries no other identity). Changed in the port: the window's text is checked, a texture is named as one instead of read as a buffer, and a piece the file does not hold all of is an error.

Checks

  • New behaviour is behind a switch that is off by default: a new diagnostics-build argument. Nothing else changes.
  • Docs move with the code: docs/DIAGNOSTICS.md, "What a capture holds of a buffer".
  • No unrelated cleanup. The second commit only moves this PR's own code within look.rs, so that it does not collide with the --flow-draws PR.
  • Tests: replay::play::look::tests::a_pieces_dwords_are_counted_and_shown, a_buffers_bytes_are_read_from_the_capture (a synthetic capture's files), and victory replay::tests::a_buffers_window_is_read. They call functions that are new.
  • Check the queue before opening: no open PR or issue touches this. Independent of my other three diagnostics PRs; the four merge cleanly together onto main at 8bf4878 (built and tested so).
  • Nothing that only exists in my fork; cargo xtask policy passes.

Verified

Hardware and stack: RX 7900 XTX, the patched RADV 26.3.1 and vkd3d-proton that ./setup.sh builds, Proton-CachyOS wine.

  • cargo xtask policy: ok.
  • cargo fmt --all --check: no new diffs against main (which has its own); clippy for victory-gpu and victory gives the same warning set as main.
  • ./build.sh and PROFILE=diag ./build.sh: ok.
  • PROFILE=diag PKG=victory-gpu ./build.sh test --lib -- replay::: 29 passed, 1 ignored. PROFILE=diag PKG=victory ./build.sh test -- replay: 3 passed.
  • Whole victory-gpu lib suite (diag): descriptor::tests::views_die_with_their_resource ends the test process here on main too (exit 5), so the whole suite was run serially without it: 396 passed, 7 failed, 24 ignored; main: 394 passed and the same 7 failed (2 in indirect::tests, 4 in watch, 1 in timeline::report).
  • victory.exe replay <capture> --bytes 23 --bytes 20:0:20 --bytes 12 --bytes 999 on the capture tests/replay.rs records: the shared buffer's three changed pages by submission, the default-heap buffer's contents at the frame's start, "#12 'target' is a texture", "#999 is not in the capture". --bytes 12:40 is refused with the form it wants.
  • Not verified: a capture of the title (I have none here).

Cost

None outside --bytes.

**@⁠Serph91P** on GitHub · 2026-12-05 11:13 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/577) `Serph91P:feat/replay-bytes` → `main` · +308 −2 · 3 files · 2 commits · open ## What this does `victory replay <capture> --bytes <resource>[:<at>:<bytes>]` reads the capture's files alone: a buffer's contents at the frame's start and what the CPU had changed in it by each submission, each with how many dwords are not zero and the dwords of the window asked for, as hex and floats (48 at most). No device is made. It tells constants that were wrong in the title's bytes already from ones lost on the way to the card. Ported by hand from the VIctory-7900XTX tree, where it was commit 8003422 on `secure-silicon/VIctory-7900XTX`, branch `faces-and-replay-bytes`, authored as `local <local@localhost>` (kept as co-author; the commit carries no other identity). Changed in the port: the window's text is checked, a texture is named as one instead of read as a buffer, and a piece the file does not hold all of is an error. ## Checks - [x] New behaviour is behind a switch that is off by default: a new diagnostics-build argument. Nothing else changes. - [x] Docs move with the code: `docs/DIAGNOSTICS.md`, "What a capture holds of a buffer". - [x] No unrelated cleanup. The second commit only moves this PR's own code within `look.rs`, so that it does not collide with the `--flow-draws` PR. - [x] Tests: `replay::play::look::tests::a_pieces_dwords_are_counted_and_shown`, `a_buffers_bytes_are_read_from_the_capture` (a synthetic capture's files), and `victory replay::tests::a_buffers_window_is_read`. They call functions that are new. - [x] Check the queue before opening: no open PR or issue touches this. Independent of my other three diagnostics PRs; the four merge cleanly together onto `main` at 8bf4878 (built and tested so). - [x] Nothing that only exists in my fork; `cargo xtask policy` passes. ## Verified Hardware and stack: RX 7900 XTX, the patched RADV 26.3.1 and vkd3d-proton that `./setup.sh` builds, Proton-CachyOS wine. - `cargo xtask policy`: ok. - `cargo fmt --all --check`: no new diffs against `main` (which has its own); clippy for `victory-gpu` and `victory` gives the same warning set as `main`. - `./build.sh` and `PROFILE=diag ./build.sh`: ok. - `PROFILE=diag PKG=victory-gpu ./build.sh test --lib -- replay::`: 29 passed, 1 ignored. `PROFILE=diag PKG=victory ./build.sh test -- replay`: 3 passed. - Whole `victory-gpu` lib suite (diag): `descriptor::tests::views_die_with_their_resource` ends the test process here on `main` too (exit 5), so the whole suite was run serially without it: 396 passed, 7 failed, 24 ignored; `main`: 394 passed and the same 7 failed (2 in `indirect::tests`, 4 in `watch`, 1 in `timeline::report`). - `victory.exe replay <capture> --bytes 23 --bytes 20:0:20 --bytes 12 --bytes 999` on the capture `tests/replay.rs` records: the shared buffer's three changed pages by submission, the default-heap buffer's contents at the frame's start, "#12 'target' is a texture", "#999 is not in the capture". `--bytes 12:40` is refused with the form it wants. - Not verified: a capture of the title (I have none here). ## Cost None outside `--bytes`.
When a draw reads constants that look wrong, the first question is whether
the title's bytes were wrong already or were lost on the way to the card.
Answering it took a replay on a card and --images of a buffer, which shows
what the replay holds after its own copies, not what was recorded.

--bytes <resource>[:<at>:<bytes>] reads the capture's files alone: the
buffer's contents at the frame's start and what the CPU had changed in it
by each submission, each with how many of its dwords are not zero and the
dwords of the window asked for, as hex and as floats (48 at most; `at` and
`bytes` hexadecimal, 0 and 80 if left out). No device is made. A texture is
named as one, a piece the file does not hold all of is an error.

Ported from the 7900XTX tree (7e33764 there), where the window's text was
not checked and a texture's contents were read as a buffer's.

Tests: replay::play::look, 3 passed (two new ones); victory replay::tests,
3 passed (one new).

Co-authored-by: local <local@localhost>
The buffer reader and its tests stood right after `flow` and the texel
test, where other changes to the flow add theirs. They now stand before
`Images` and before the texel test. Nothing but the place changed.

Tests: replay::play::look, as before.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 11:18:17 +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/577/head:github-bot/gh-577'
git switch 'github-bot/gh-577'

Merge

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