Drop retired host objects on a thread of their own (VICTORY_REAPER=1) #247

Closed
CristianCiubancan wants to merge 534 commits from upstream-pr/247 into main
CristianCiubancan commented 2026-11-27 12:01:32 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by CristianCiubancan on 2026-11-27T12:01:32Z.


One commit on main at 63e2c98. Off by default.

What

What bury drops was dropped by the thread that had just landed a flight. With VICTORY_REAPER=1 the objects go to a list and a thread of ours (victory-reaper) drops them, handed over at the moment they were dropped before, never earlier. VICTORY_AB=<s>,VICTORY_REAPER does each in turn in one run. It follows the switch of the same name in fxceless/victory-fork, which this tree did not have; here it covers bury only.

Why

On an RTX 5070 Ti the first minutes in the world ran at 8 to 9 fps and then went to 17 to 20 by themselves, in every run. In the slow stretch the card was about 29 % busy and the submitting thread stood waiting for flights: 54 ms a frame in settles (lists in the air 29.5 ms, title memory read 24.8 ms), with the relay's line at 102 ms of landing a frame against 25 ms later in the same run.

A VICTORY_PROFILE window over that stretch put the relay thread 79 % of its samples in host::bury → drop<Vec<(u64, Retired)>> → D3D12Core → nvwgf2umx → win32u. While the world streams in the title lets go of thousands of objects a second, and each drop is a call into the driver on the thread everything else was waiting for. On the reaper the same drops cost about 1 µs each (1.17 million in 0.62 s of that thread in one run), so it is not the drops themselves that are slow there.

Measured

RTX 5070 Ti 16 GB (driver 32.0.16.1088), Ryzen 7 9850X3D, 32 GB, Windows 11. Diagnostics build of this branch, Series S, -Machine 4070 -Windowed with VICTORY_PIPELINE_WORKERS=8, shaders translated and pipelines warmed ahead. A self-driven run: the same copy of the saves each time, Enter through VICTORY_KEYS_FILE until the world draws, then a fixed route of scripted keys for 300 s. Runs alternated without, with, without, with. Figures are from the once-a-second frame lines over 1,000 draws, the first four left out.

without, run 1 without, run 2 with, run 1 with, run 2
fps median 18.2 14.6 19.5 19.2
fps p10 15.3 7.0 17.5 17.8
ms per frame, median 56.1 100.6 51.4 52.1
submitting thread's work, ms a frame 53.2 78.8 49.1 49.0
submitting thread waiting for the card, mean ms a frame 5.0 28.3 0.1 0.1
relay thread landing, mean ms a frame 26.6 57.5 15.5 15.2
game memory, peak private 21.8 GB 23.4 GB 21.4 GB 21.4 GB

The slow stretch lasted about 35 s in the first run without the switch and about 2.5 minutes in the second; neither run with it has one. On the base I first measured on (3da964a, two runs each way, same route) it lasted 3 to 4 minutes without the switch: medians 9.5 and 12.6 fps without, 18.1 and 19.2 with, and peak private memory 24.8 and 23.4 GB against 21.3 and 21.3 GB.

No errors and no device loss in any of the runs.

Limits

  • One PC, one card, two runs each way on each base. The length of the slow stretch varies from run to run without the switch, so the medians without it scatter widely.
  • The picture: one hand-played full-screen session of about ten minutes with the switch on looked normal. It was not recorded, so there is no video to go with this.
  • The card's memory comes back some milliseconds later than before. The reaper logs how many objects wait every 16,384 dropped; the most I saw waiting was about 40,000 for a moment while the world loaded, usually 0.
  • Off by default for those reasons. On this PC I would turn it on in the NVIDIA settings of play.ps1; that is left for you to judge from other cards.

Checks

cargo test -p victory-gpu --locked --lib reaper_tests passes (two tests: dropped here without the switch, and by the thread of that name with it). cargo clippy --workspace --all-targets --locked -- -D warnings and the same with --all-features are clean. cargo xtask policy passes.

Aside, not from this change: host::refresh_tests::raw_title_copy_keeps_write_watch_and_resends_equal_bytes failed in 4 of 8 runs of cargo test -p victory-gpu --lib on unmodified 3da964a here (default configuration, tests in parallel), and passes alone.

🤖 Generated with Claude Code

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5526269626 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/247). Originally posted by [CristianCiubancan](https://github.com/CristianCiubancan) on 2026-11-27T12:01:32Z. --- One commit on `main` at `63e2c98`. Off by default. ## What What `bury` drops was dropped by the thread that had just landed a flight. With `VICTORY_REAPER=1` the objects go to a list and a thread of ours (`victory-reaper`) drops them, handed over at the moment they were dropped before, never earlier. `VICTORY_AB=<s>,VICTORY_REAPER` does each in turn in one run. It follows the switch of the same name in fxceless/victory-fork, which this tree did not have; here it covers `bury` only. ## Why On an RTX 5070 Ti the first minutes in the world ran at 8 to 9 fps and then went to 17 to 20 by themselves, in every run. In the slow stretch the card was about 29 % busy and the submitting thread stood waiting for flights: 54 ms a frame in settles (`lists in the air` 29.5 ms, `title memory read` 24.8 ms), with the relay's line at 102 ms of landing a frame against 25 ms later in the same run. A `VICTORY_PROFILE` window over that stretch put the relay thread 79 % of its samples in `host::bury` → `drop<Vec<(u64, Retired)>>` → `D3D12Core` → `nvwgf2umx` → `win32u`. While the world streams in the title lets go of thousands of objects a second, and each drop is a call into the driver on the thread everything else was waiting for. On the reaper the same drops cost about 1 µs each (1.17 million in 0.62 s of that thread in one run), so it is not the drops themselves that are slow there. ## Measured RTX 5070 Ti 16 GB (driver 32.0.16.1088), Ryzen 7 9850X3D, 32 GB, Windows 11. Diagnostics build of this branch, Series S, `-Machine 4070 -Windowed` with `VICTORY_PIPELINE_WORKERS=8`, shaders translated and pipelines warmed ahead. A self-driven run: the same copy of the saves each time, `Enter` through `VICTORY_KEYS_FILE` until the world draws, then a fixed route of scripted keys for 300 s. Runs alternated without, with, without, with. Figures are from the once-a-second frame lines over 1,000 draws, the first four left out. | | without, run 1 | without, run 2 | with, run 1 | with, run 2 | |---|---|---|---|---| | fps median | 18.2 | 14.6 | 19.5 | 19.2 | | fps p10 | 15.3 | 7.0 | 17.5 | 17.8 | | ms per frame, median | 56.1 | 100.6 | 51.4 | 52.1 | | submitting thread's work, ms a frame | 53.2 | 78.8 | 49.1 | 49.0 | | submitting thread waiting for the card, mean ms a frame | 5.0 | 28.3 | 0.1 | 0.1 | | relay thread landing, mean ms a frame | 26.6 | 57.5 | 15.5 | 15.2 | | game memory, peak private | 21.8 GB | 23.4 GB | 21.4 GB | 21.4 GB | The slow stretch lasted about 35 s in the first run without the switch and about 2.5 minutes in the second; neither run with it has one. On the base I first measured on (`3da964a`, two runs each way, same route) it lasted 3 to 4 minutes without the switch: medians 9.5 and 12.6 fps without, 18.1 and 19.2 with, and peak private memory 24.8 and 23.4 GB against 21.3 and 21.3 GB. No errors and no device loss in any of the runs. ## Limits - One PC, one card, two runs each way on each base. The length of the slow stretch varies from run to run without the switch, so the medians without it scatter widely. - The picture: one hand-played full-screen session of about ten minutes with the switch on looked normal. It was not recorded, so there is no video to go with this. - The card's memory comes back some milliseconds later than before. The reaper logs how many objects wait every 16,384 dropped; the most I saw waiting was about 40,000 for a moment while the world loaded, usually 0. - Off by default for those reasons. On this PC I would turn it on in the NVIDIA settings of `play.ps1`; that is left for you to judge from other cards. ## Checks `cargo test -p victory-gpu --locked --lib reaper_tests` passes (two tests: dropped here without the switch, and by the thread of that name with it). `cargo clippy --workspace --all-targets --locked -- -D warnings` and the same with `--all-features` are clean. `cargo xtask policy` passes. Aside, not from this change: `host::refresh_tests::raw_title_copy_keeps_write_watch_and_resends_equal_bytes` failed in 4 of 8 runs of `cargo test -p victory-gpu --lib` on unmodified `3da964a` here (default configuration, tests in parallel), and passes alone. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
TaynanGT commented 2026-11-27 12:03:40 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T12:03:40Z.


@CristianCiubancan The reported p10 went from 15.3/7.0 to 17.5/17.8 FPS, and the mean relay landing time moved down in both pairs. I added 599ff9d to cap queued and in-progress releases at 16,384 objects. An excess batch releases on the caller after the same flight fence. Three isolated tests passed, and the Windows CI run is queued. The same-route FPS and shutdown drain checks are still open for this revision.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7217791324 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/247#issuecomment-7217791324). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T12:03:40Z. --- @CristianCiubancan The reported p10 went from 15.3/7.0 to 17.5/17.8 FPS, and the mean relay landing time moved down in both pairs. I added [`599ff9d`](https://github.com/CristianCiubancan/Vice-Tay/commit/599ff9d050613da5f19f161e2297789316cf853c) to cap queued and in-progress releases at 16,384 objects. An excess batch releases on the caller after the same flight fence. Three isolated tests passed, and the Windows CI run is queued. The same-route FPS and shutdown drain checks are still open for this revision.
TaynanGT commented 2026-11-30 17:15:07 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-30T17:15:07Z.


main has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current main and open a new PR; I'll review it there.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7285963284 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/247#issuecomment-7285963284). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-30T17:15:07Z. --- `main` has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current `main` and open a new PR; I'll review it there.

Pull request closed

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
TaynanGT/Vice-Tay!247
No description provided.