Diagnostics: a dumped target counts for the frame its list is submitted in #961

Open
SantannaCarlos wants to merge 1 commit from upstream-pr/962 into main
SantannaCarlos commented 2026-11-25 13:52:09 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by SantannaCarlos on 2026-11-25T13:52:09Z.


Problem

With VICTORY_DUMP_TARGETS, a frame listed for capture is meant to dump every texture it renders to or writes. note_target decided the frame when a draw was recorded: the frame after the last one presented. The title records a frame's lists while the frame before it is still on its way to the screen, so part of each frame's targets counted for the frame before, or for no listed frame. Two dumps of the same shot, from runs of the same tree, could hold 55 and 245 textures.

Change

  • note_target takes the list. It keeps the texture's host copy in a host step of the list (defer_host). That step runs when the list is submitted (Host::submit, from both execute and execute_late) and decides the frame then, again as the frame after the last one presented.
  • Nothing is copied or scheduled unless one of the next two frames is listed, so frames that are not dumped pay nothing.
  • With VICTORY_ASYNC_SUBMIT=1 the frame stays right: a present runs its queue's line before the frame count moves on.

shortcut: with VICTORY_ASYNC_PRESENT=1 a present goes behind its queue's line and the frame count moves on first, so notes from that line may count for the frame after.

Tested

  • New test capture::tests::a_list_counts_for_the_frame_it_is_submitted_in: a step is recorded, a frame is presented, then the list is submitted, and the step sees the frame after the one it was recorded in. The old rule took the frame at recording.
  • cargo test -p victory-gpu --lib, run with VICTORY_D3D12_WARP=1: all pass but depth_bounds_pipeline_loads_and_filters_draws, which fails the same way on 0b0074e.
  • cargo clippy --workspace --all-targets -- -D warnings, with and without --all-features: only what 0b0074e already fails on (draw.rs sort_unstable_by_key, shadow.rs is_multiple_of, indirect.rs Rig::depth_written, and without the features placed_filler_twins); nothing in the changed lines.
  • cargo xtask policy.
  • In the title (RTX 4070, diagnostics build, the cell save, VICTORY_CAPTURE_WORLD=1 with VICTORY_CAPTURE_WORLD_ALSO=240,480,800, 9-minute runs, alternating):
Run Tree ms/frame Textures dumped at +240 / +480 / +800 (the cell-window shot)
1 0b0074e 241 238 / 245 / 242
2 this 215 255 / 257 / 254
3 0b0074e 216 66 / 55 / 144
4 this 231 265 / 257 / 254
  • The two runs with this change dump every texture the best 0b0074e dumps hold, and the same 12 more. The 12 are small targets (256x256, 192x108, 384x384 and 256x64 in fixed formats) that were lost even from those dumps.
  • Earlier frames (+2 to +80) are cutscene shots that differ from run to run, so their counts are not compared here.
  • Frame time is within the run-to-run noise.
<!-- greyfinch-sync:fxceless/victory-fork:issue:6606040984 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/962). Originally posted by [SantannaCarlos](https://github.com/SantannaCarlos) on 2026-11-25T13:52:09Z. --- ## Problem With `VICTORY_DUMP_TARGETS`, a frame listed for capture is meant to dump every texture it renders to or writes. `note_target` decided the frame when a draw was recorded: the frame after the last one presented. The title records a frame's lists while the frame before it is still on its way to the screen, so part of each frame's targets counted for the frame before, or for no listed frame. Two dumps of the same shot, from runs of the same tree, could hold 55 and 245 textures. ## Change - `note_target` takes the list. It keeps the texture's host copy in a host step of the list (`defer_host`). That step runs when the list is submitted (`Host::submit`, from both `execute` and `execute_late`) and decides the frame then, again as the frame after the last one presented. - Nothing is copied or scheduled unless one of the next two frames is listed, so frames that are not dumped pay nothing. - With `VICTORY_ASYNC_SUBMIT=1` the frame stays right: a present runs its queue's line before the frame count moves on. shortcut: with `VICTORY_ASYNC_PRESENT=1` a present goes behind its queue's line and the frame count moves on first, so notes from that line may count for the frame after. ## Tested - New test `capture::tests::a_list_counts_for_the_frame_it_is_submitted_in`: a step is recorded, a frame is presented, then the list is submitted, and the step sees the frame after the one it was recorded in. The old rule took the frame at recording. - `cargo test -p victory-gpu --lib`, run with `VICTORY_D3D12_WARP=1`: all pass but `depth_bounds_pipeline_loads_and_filters_draws`, which fails the same way on `0b0074e`. - `cargo clippy --workspace --all-targets -- -D warnings`, with and without `--all-features`: only what `0b0074e` already fails on (`draw.rs` `sort_unstable_by_key`, `shadow.rs` `is_multiple_of`, `indirect.rs` `Rig::depth_written`, and without the features `placed_filler_twins`); nothing in the changed lines. - `cargo xtask policy`. - In the title (RTX 4070, diagnostics build, the cell save, `VICTORY_CAPTURE_WORLD=1` with `VICTORY_CAPTURE_WORLD_ALSO=240,480,800`, 9-minute runs, alternating): | Run | Tree | ms/frame | Textures dumped at +240 / +480 / +800 (the cell-window shot) | |---|---|---:|---| | 1 | `0b0074e` | 241 | 238 / 245 / 242 | | 2 | this | 215 | 255 / 257 / 254 | | 3 | `0b0074e` | 216 | **66 / 55 / 144** | | 4 | this | 231 | 265 / 257 / 254 | - The two runs with this change dump every texture the best `0b0074e` dumps hold, and the same 12 more. The 12 are small targets (256x256, 192x108, 384x384 and 256x64 in fixed formats) that were lost even from those dumps. - Earlier frames (+2 to +80) are cutscene shots that differ from run to run, so their counts are not compared here. - Frame time is within the run-to-run noise.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/962:upstream-pr/962'
git switch 'upstream-pr/962'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/962'
git switch 'upstream-pr/962'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/962'
git switch 'upstream-pr/962'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/962'
git switch 'main'
git merge --squash 'upstream-pr/962'
git switch 'main'
git merge --ff-only 'upstream-pr/962'
git switch 'main'
git merge 'upstream-pr/962'
git push origin 'main'
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!961
No description provided.