F6 captures a frame; the recorder is in the release build; replay handles predication and bounded waits #4985

Open
github-bot wants to merge 5 commits from github-bot/gh-4984 into main AGit
Owner

@⁠TheDarkDnKTv on GitHub · 2026-12-01 16:25 UTC · original
TheDarkDnKTv:pr/frame-capture-key → main · +464 −75 · 19 files · 5 commits · open

What it changes

A player who sees a fault can capture the frame and send it without building the diagnostics profile, and the capture can be run again offline with victory replay. Four parts, one commit each (plus a docs commit):

  1. F6 starts the capture. With VICTORY_RECORD=<folder> set, F6 (title window in front) starts the frame recorder, as the file <folder>\go already did. VICTORY_RECORD_FRAMES=<n> captures the next n frames. One capture per process. The key is polled at every present like F1 and F3, so the title still receives it. Without VICTORY_RECORD nothing is hooked and the key is not read.
  2. The recorder is in the release build (cargo feature record, on by default in the victory app; cargo build --release --locked -p victory --no-default-features leaves it out). victory replay stays diagnostics-only. Release exe 16.65 MB with it, 16.01 MB without.
  3. Replay of frames recorded with ray tracing on. SetPredication was counted and dropped, so a replay ran predicated work unconditionally. It is now recorded (new command tag 36; older captures still read) and replayed; a predicate the replay cannot bind skips the guarded work and is counted. ExecuteIndirect calls whose arguments hold GPU addresses, calls with a missing object, and draws without their pipeline are left out and counted instead of failing. A barrier that names a committed resource on one side is replaced by one that names nothing (the list otherwise failed at Close). The replay's fence waits give up after 30 seconds and say which value was waited for (they were INFINITE); the --awake drain wait is bounded to 1 second. The recorder on the live device keeps its waits.
  4. The recorder refuses a folder inside the repository. A capture holds the title's memory and pictures. Recorder::new calls victory_core::ensure_outside_repo before it creates anything; a refused folder logs frame recorder not started: ... and the title runs on. victory-gpu now depends on victory-core (one Cargo.lock line).

Docs: docs/replay.md (key, variables, one capture per process, size: 12 to 14 GB for the captures made so far).

Cost when not armed (read from the code, not measured): without VICTORY_RECORD one env lookup when the device is made, one OnceLock load at each present and name_it, no lock, no allocation. With it set, every device method is wrapped; only the capture frame stops the title.

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): this branch was not run in the title. The same code was used in the title on the author's fork to record frames. Settings of those runs are not stated here.
  • Before / After: not measured on this branch.
  • For shader changes, the wave sizes tested: not a shader change.
  • cargo test passed for the crates it touches: yes, except two tests that also fail on main (commit d5cc3461, Windows, rustc 1.98.0):
    • cargo build --release --locked -p victory, cargo build --locked --profile diag -p victory --features diagnostics and cargo check --locked -p victory --no-default-features: ok, no warnings
    • cargo test -p victory-gpu -- --test-threads=1: 1095 passed, 0 failed, 66 ignored
    • cargo test -p victory-gpu --features record --lib: 1114 passed, 0 failed, 66 ignored (the three new tests pass: held key is one press, folder inside the repository refused and not created, folder outside accepted)
    • cargo test -p victory-gpu --features diagnostics --locked --test replay: 1 passed (records a frame and replays it, including a predicate change; returns early without an adapter)
    • cargo test -p victory-gpu --features diagnostics --lib: 1170 passed, 2 failed, 69 ignored. compose::tests::bgrx_plane_selects_a_typed_view fails the same way on main; host::card_steps::tests::shared_scratch_eliminates_flight_settle_end_to_end passes alone and fails only in the parallel run (another timing test fails there on main).
    • cargo test --workspace --locked --no-fail-fast: 2506 passed, 1 failed, 96 ignored. The failure is victory-hle modules::xmem::tests::a_read_by_range_waits_only_for_a_remapping_that_meets_it: it fails in every victory-hle --lib run and passes alone, also on main; this branch changes no victory-hle code.
    • cargo clippy --workspace --all-targets --locked -- -D warnings (and --all-features) does not pass: 5 findings in host/font.rs, host/menu.rs and host/panel.rs, none in code this branch adds, the same on main. With those three lints allowed on the command line both runs are clean.
    • cargo xtask policy: ok

Not tested: F6, a capture and the replay of a real capture in the title on this branch; the cost of an armed recorder; the --no-default-features build beyond cargo check.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related, none covers F6, the release recorder, predication, bounded waits or the folder check:
    • #896 (merged) and #3508 (open) are about VICTORY_CAPTURE (PNG and target dumps), a different tool from VICTORY_RECORD.
    • #2143 fixes the same replay Close failure for aliasing barriers by leaving the barrier out; both edit Player::barrier, so whichever lands second needs a rebase, and this hunk can be dropped in favour of #2143's.
    • #2751 adds ClearUavUint as wire tag 36, the same tag as Predication here: one line to renumber in whichever lands second.
    • #4016 also edits Worker::wait in replay/gpu.rs.

🤖 Generated with Claude Code

**@⁠TheDarkDnKTv** on GitHub · 2026-12-01 16:25 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4984) `TheDarkDnKTv:pr/frame-capture-key` → `main` · +464 −75 · 19 files · 5 commits · open ## What it changes A player who sees a fault can capture the frame and send it without building the diagnostics profile, and the capture can be run again offline with `victory replay`. Four parts, one commit each (plus a docs commit): 1. **F6 starts the capture.** With `VICTORY_RECORD=<folder>` set, F6 (title window in front) starts the frame recorder, as the file `<folder>\go` already did. `VICTORY_RECORD_FRAMES=<n>` captures the next `n` frames. One capture per process. The key is polled at every present like F1 and F3, so the title still receives it. Without `VICTORY_RECORD` nothing is hooked and the key is not read. 2. **The recorder is in the release build** (cargo feature `record`, on by default in the `victory` app; `cargo build --release --locked -p victory --no-default-features` leaves it out). `victory replay` stays diagnostics-only. Release exe 16.65 MB with it, 16.01 MB without. 3. **Replay of frames recorded with ray tracing on.** `SetPredication` was counted and dropped, so a replay ran predicated work unconditionally. It is now recorded (new command tag 36; older captures still read) and replayed; a predicate the replay cannot bind skips the guarded work and is counted. `ExecuteIndirect` calls whose arguments hold GPU addresses, calls with a missing object, and draws without their pipeline are left out and counted instead of failing. A barrier that names a committed resource on one side is replaced by one that names nothing (the list otherwise failed at Close). The replay's fence waits give up after 30 seconds and say which value was waited for (they were `INFINITE`); the `--awake` drain wait is bounded to 1 second. The recorder on the live device keeps its waits. 4. **The recorder refuses a folder inside the repository.** A capture holds the title's memory and pictures. `Recorder::new` calls `victory_core::ensure_outside_repo` before it creates anything; a refused folder logs `frame recorder not started: ...` and the title runs on. `victory-gpu` now depends on `victory-core` (one `Cargo.lock` line). Docs: `docs/replay.md` (key, variables, one capture per process, size: 12 to 14 GB for the captures made so far). **Cost when not armed** (read from the code, not measured): without `VICTORY_RECORD` one env lookup when the device is made, one `OnceLock` load at each present and `name_it`, no lock, no allocation. With it set, every device method is wrapped; only the capture frame stops the title. ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): this branch was not run in the title. The same code was used in the title on the author's fork to record frames. Settings of those runs are not stated here. - Before / After: not measured on this branch. - For shader changes, the wave sizes tested: not a shader change. - `cargo test` passed for the crates it touches: yes, except two tests that also fail on `main` (commit `d5cc3461`, Windows, rustc 1.98.0): - `cargo build --release --locked -p victory`, `cargo build --locked --profile diag -p victory --features diagnostics` and `cargo check --locked -p victory --no-default-features`: ok, no warnings - `cargo test -p victory-gpu -- --test-threads=1`: 1095 passed, 0 failed, 66 ignored - `cargo test -p victory-gpu --features record --lib`: 1114 passed, 0 failed, 66 ignored (the three new tests pass: held key is one press, folder inside the repository refused and not created, folder outside accepted) - `cargo test -p victory-gpu --features diagnostics --locked --test replay`: 1 passed (records a frame and replays it, including a predicate change; returns early without an adapter) - `cargo test -p victory-gpu --features diagnostics --lib`: 1170 passed, 2 failed, 69 ignored. `compose::tests::bgrx_plane_selects_a_typed_view` fails the same way on `main`; `host::card_steps::tests::shared_scratch_eliminates_flight_settle_end_to_end` passes alone and fails only in the parallel run (another timing test fails there on `main`). - `cargo test --workspace --locked --no-fail-fast`: 2506 passed, 1 failed, 96 ignored. The failure is `victory-hle` `modules::xmem::tests::a_read_by_range_waits_only_for_a_remapping_that_meets_it`: it fails in every `victory-hle --lib` run and passes alone, also on `main`; this branch changes no `victory-hle` code. - `cargo clippy --workspace --all-targets --locked -- -D warnings` (and `--all-features`) does not pass: 5 findings in `host/font.rs`, `host/menu.rs` and `host/panel.rs`, none in code this branch adds, the same on `main`. With those three lints allowed on the command line both runs are clean. - `cargo xtask policy`: ok **Not tested:** F6, a capture and the replay of a real capture in the title on this branch; the cost of an armed recorder; the `--no-default-features` build beyond `cargo check`. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related, none covers F6, the release recorder, predication, bounded waits or the folder check: - #896 (merged) and #3508 (open) are about `VICTORY_CAPTURE` (PNG and target dumps), a different tool from `VICTORY_RECORD`. - #2143 fixes the same replay Close failure for aliasing barriers by leaving the barrier out; both edit `Player::barrier`, so whichever lands second needs a rebase, and this hunk can be dropped in favour of #2143's. - #2751 adds `ClearUavUint` as wire tag 36, the same tag as `Predication` here: one line to renumber in whichever lands second. - #4016 also edits `Worker::wait` in `replay/gpu.rs`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
- With VICTORY_RECORD set, pressing F6 with the title's window in front starts the capture, as the
  file `go` in the folder does. The key is polled at every present (like the F1 and F3 keys), so the
  title still receives it. A capture is one frame, or the next VICTORY_RECORD_FRAMES frames; there is
  one capture per process.
- Without VICTORY_RECORD nothing is hooked and the key is not read.
- The recorder's start line names the key.
- Test: a held key counts as one press (replay::snap::tests::a_held_key_is_one_press).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
- New cargo feature `record` in victory-gpu and victory-hle; in the victory app it is on by default,
  so `cargo build --release --locked -p victory` has the recorder and a user can capture a faulty
  frame without a diagnostics build. `--no-default-features` leaves it out. Replaying a capture
  (`victory replay`) still needs the diagnostics build.
- The recorder's module and the places that call it (device creation, name_it, present, and the
  copies of the F1 menu and the F3 panel, which are not part of a recorded frame) are compiled for
  `any(feature = "diagnostics", feature = "record")`.
- Without VICTORY_RECORD nothing is hooked, as before: the call sites cost one OnceLock load.
- The offline player's helpers (gpu::to_props, gpu::psnr, pso::make, four state constants, four
  wire methods) stay diagnostics-only, so a recorder-only build has no dead code. The recorder's own
  screenshot is encoded with the screenshot module's PNG encoder, which every build has.
- docs/replay.md: recording needs no diagnostics build, replaying does.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
- SetPredication was counted and left out, so a replay ran predicated work (the texture upload guard
  sets a predicate at submission time) unconditionally. It is now a command of its own (tag 36; the
  other tags keep their layout, older captures still read). The recorder collects the predicate
  buffer's eight bytes with the other CPU-visible data; the player keeps the predicate active until
  the recorded clear, and a predicate it cannot bind skips the guarded work and is counted once.
- The player leaves out, and reports by count: ExecuteIndirect calls whose arguments hold GPU
  addresses (including indirect rays) or whose signature, argument or count buffer is missing, and
  draws or dispatches without their recorded pipeline. Native acceleration-structure buffers are not
  captured or made again. A barrier that names a committed resource on a side the capture overlaid in
  a heap is replaced by one that names nothing (the list otherwise fails to close).
- A list that does not close says why (with the debug layer: its messages).
- The replay's fence waits give up after 30 seconds and say the value waited for and the one
  completed; the replay device is then removed so pending work is dropped before objects are
  released. The `--awake` thread's drain wait is bounded to one second. The recorder on the live
  device keeps its waits.
- Tests: crates/victory-gpu/tests/replay.rs (adapter; diagnostics) replays a directory lookup into a
  raw UAV arena, an in-frame arena copy and a predicate that changes across submissions, and compares
  the picture and the compute output byte for byte; a test in replay/gpu.rs checks that an unsignalled
  fence times out and a signalled one completes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
- A capture holds the title's memory and screenshots, which must never land in a checkout
  (docs/asset-policy.md). Recorder::new now calls victory_core::ensure_outside_repo, the check the
  other dump switches use, before it creates anything. A refused folder logs `frame recorder not
  started: VICTORY_RECORD names a folder that is not allowed: ...` and the title runs on without the
  recorder. This matters more now that the recorder is in the release build.
- victory-gpu depends on victory-core for it (Cargo.lock: one line; victory-core is a leaf crate that
  victory-gpu already links through victory-pipeline).
- Tests (no device needed): a folder in the checkout is refused with PermissionDenied and is not
  created; a folder in the temp directory is accepted.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
- docs/replay.md: start the title with VICTORY_RECORD (and VICTORY_RECORD_FRAMES for several frames),
  press F6 with the title's window in front; one capture per process; what a capture weighs (12 to 14 GB
  for captures of the title on our test machine).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 16:29:12 +00:00
This pull request has changes conflicting with the target branch.
  • apps/victory/Cargo.toml
  • crates/victory-gpu/Cargo.toml
  • crates/victory-gpu/src/host/menu.rs
  • crates/victory-gpu/src/host/panel.rs
  • crates/victory-gpu/src/lib.rs
  • crates/victory-hle/Cargo.toml
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4984'
git switch 'github-bot/gh-4984'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4984'
git switch 'github-bot/gh-4984'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4984'
git switch 'main'
git merge --squash 'github-bot/gh-4984'
git switch 'main'
git merge --ff-only 'github-bot/gh-4984'
git switch 'main'
git merge 'github-bot/gh-4984'
git push origin 'main'
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/trustno1-coder--VIctory-NVIDIA!4985
No description provided.