Series S: drop retired objects on a thread of their own (prologue 8.7 to 12.6 fps) #493

Open
kozzy-bit wants to merge 2 commits from upstream-pr/493 into main
kozzy-bit commented 2026-12-01 16:58:38 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by kozzy-bit on 2026-12-01T16:58:38Z.


bury() released the retired D3D12 objects on the thread that lands flights, while the submitting thread waited for that landing ("waiting for landings: title memory read"). In the Series S prologue that is some 20,000 resources a frame (the descriptor slots' Retired::Resource), one driver Release each.

Where it showed (VICTORY_TIMELINE, 5 frames in the prologue): "landing: read-backs, telling the title" took 595 ms of 645. In its longest occurrence (142.8 ms) the read-backs, writes and fence signals were done after 1.1 ms; the other 141.8 ms were bury(last), and the submitting thread stood the whole time.

What changed (series-s/crates/victory-gpu/src/host.rs): bury takes what is due as before and hands it to a victory-grave thread, which drops it. The objects were due two frames earlier already (bury_lag), so dropping them a little later changes nothing for the card. VICTORY_GRAVE=0 drops them where they are found, as before.

Measured (prologue, 44 intervals of 5 s from the first with over 100 draws; RTX 5070 12 GB, Ryzen 7 5700X, 32 GB; vice-tay play --series-s settings plus VICTORY_CARD_BUFFERS_MB=1536 VICTORY_CARD_WINDOWS_MB=1024; warm cache; the same diag binary, runs alternating):

Run VICTORY_GRAVE fps
1 0 8.3
2 on 13.1
3 0 9.1
4 on 12.1

The submitting thread's wait for the card in the frame line went from 35-44 ms a frame to 0-1. Dropped draws are unchanged (221 against 229 a frame line).

Release build, recorded (ffmpeg, costs about 15 %): 7.4 fps against 6.1 with the earlier build in the same start. The whole recording was reviewed (frames every 15 s): title screen, the night car scenes, credits graphics, the apartment; light, textures and subtitles as before, no black or broken areas. In the same time the run gets further into the prologue.

Second step: keep up to 512 MiB of spare scratch chunks

With the grave in place, a stack profile of the list threads showed 41% of their samples in take_chunk -> upload_buffer (CreateCommittedResource, MakeResident, Map): the spare pool (128 MiB) was full during gameplay, so about 550 upload buffers of 4 MiB were made and freed every second. SPARE_MOST is now 512 MiB (VICTORY_SPARE_MB overrides it); the sweep still trims the pool under memory pressure.

run (diag build, no recording, same start) spare cap fps upload buffers made lowest free RAM
S37 512 MiB 14.7 498 5.1 GB
S38 128 MiB 11.8 159,839 8.3 GB
S39 512 MiB 14.7 508 5.5 GB
S40 128 MiB 11.8 154,854 8.4 GB

The cost is about 3 GB less free RAM on a 32 GB PC, from 8.3 GB to 5.1 GB free. Note: earlier recorded runs (S30-S36) had a leftover desktop recording running in parallel, so their absolute numbers are too low; comparisons within each batch are still fair.

Testing: cargo test -p victory-gpu (361 passed), cargo check --locked -p victory; no clippy finding in the changed lines.

🤖 Generated with Claude Code

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5590429267 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/493). Originally posted by [kozzy-bit](https://github.com/kozzy-bit) on 2026-12-01T16:58:38Z. --- `bury()` released the retired D3D12 objects on the thread that lands flights, while the submitting thread waited for that landing ("waiting for landings: title memory read"). In the Series S prologue that is some 20,000 resources a frame (the descriptor slots' `Retired::Resource`), one driver `Release` each. **Where it showed** (`VICTORY_TIMELINE`, 5 frames in the prologue): "landing: read-backs, telling the title" took 595 ms of 645. In its longest occurrence (142.8 ms) the read-backs, writes and fence signals were done after 1.1 ms; the other 141.8 ms were `bury(last)`, and the submitting thread stood the whole time. **What changed** (`series-s/crates/victory-gpu/src/host.rs`): `bury` takes what is due as before and hands it to a `victory-grave` thread, which drops it. The objects were due two frames earlier already (`bury_lag`), so dropping them a little later changes nothing for the card. `VICTORY_GRAVE=0` drops them where they are found, as before. **Measured** (prologue, 44 intervals of 5 s from the first with over 100 draws; RTX 5070 12 GB, Ryzen 7 5700X, 32 GB; `vice-tay play --series-s` settings plus `VICTORY_CARD_BUFFERS_MB=1536 VICTORY_CARD_WINDOWS_MB=1024`; warm cache; the same diag binary, runs alternating): | Run | `VICTORY_GRAVE` | fps | |---|---|---| | 1 | 0 | 8.3 | | 2 | on | 13.1 | | 3 | 0 | 9.1 | | 4 | on | 12.1 | The submitting thread's wait for the card in the frame line went from 35-44 ms a frame to 0-1. Dropped draws are unchanged (221 against 229 a frame line). Release build, recorded (ffmpeg, costs about 15 %): 7.4 fps against 6.1 with the earlier build in the same start. The whole recording was reviewed (frames every 15 s): title screen, the night car scenes, credits graphics, the apartment; light, textures and subtitles as before, no black or broken areas. In the same time the run gets further into the prologue. ## Second step: keep up to 512 MiB of spare scratch chunks With the grave in place, a stack profile of the list threads showed 41% of their samples in `take_chunk` -> `upload_buffer` (CreateCommittedResource, MakeResident, Map): the spare pool (128 MiB) was full during gameplay, so about 550 upload buffers of 4 MiB were made and freed every second. `SPARE_MOST` is now 512 MiB (`VICTORY_SPARE_MB` overrides it); the sweep still trims the pool under memory pressure. | run (diag build, no recording, same start) | spare cap | fps | upload buffers made | lowest free RAM | |---|---|---|---|---| | S37 | 512 MiB | 14.7 | 498 | 5.1 GB | | S38 | 128 MiB | 11.8 | 159,839 | 8.3 GB | | S39 | 512 MiB | 14.7 | 508 | 5.5 GB | | S40 | 128 MiB | 11.8 | 154,854 | 8.4 GB | The cost is about 3 GB less free RAM on a 32 GB PC, from 8.3 GB to 5.1 GB free. Note: earlier recorded runs (S30-S36) had a leftover desktop recording running in parallel, so their absolute numbers are too low; comparisons within each batch are still fair. Testing: `cargo test -p victory-gpu` (361 passed), `cargo check --locked -p victory`; no clippy finding in the changed lines. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Aniseto commented 2026-12-01 17:32:03 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by Aniseto on 2026-12-01T17:32:03Z.


Ran the full vice-tay-gpu test suite at b78ddaa3 on an NVIDIA Blackwell desktop part with 16 GB of VRAM, with a control on main 65b9beaa in a separate target directory. No title was run.

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.98.1 (48a229cea 2026-09-01), MSVC 14.44.35207, debug build, detached worktree at the exact PR head, own CARGO_TARGET_DIR, no local patches.

cargo test -q -p vice-tay-gpu -- --test-threads=1
  PR head b78ddaa3: 924 passed; 1 failed; 65 ignored     (exit 101)
  main    65b9beaa: 924 passed; 1 failed; 65 ignored     (exit 101)

The single failure is host::packed_present_tests::packed_float_single_planes_are_presented, at host.rs:15396 on both trees, so it is not introduced by this PR. The description's 361-test run and its Series S prologue A/B (8.7 to 12.6 fps on an RTX 5070) were not repeated here: no title was run, and this adapter has 16 GB rather than the 12 GB card of the report.

Not tested: a retail title, the Series S prologue, the VICTORY_GRAVE=0 comparison, Wine, AMD adapters, release profile, game data.

AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out both commits in detached worktrees, built them, ran the suites, wrote this report; neither worktree was modified; no game data was used.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7319449813 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/493#issuecomment-7319449813). Originally posted by [Aniseto](https://github.com/Aniseto) on 2026-12-01T17:32:03Z. --- Ran the full `vice-tay-gpu` test suite at `b78ddaa3` on an NVIDIA Blackwell desktop part with 16 GB of VRAM, with a control on `main` `65b9beaa` in a separate target directory. No title was run. Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.98.1 (48a229cea 2026-09-01), MSVC 14.44.35207, debug build, detached worktree at the exact PR head, own `CARGO_TARGET_DIR`, no local patches. ``` cargo test -q -p vice-tay-gpu -- --test-threads=1 PR head b78ddaa3: 924 passed; 1 failed; 65 ignored (exit 101) main 65b9beaa: 924 passed; 1 failed; 65 ignored (exit 101) ``` The single failure is `host::packed_present_tests::packed_float_single_planes_are_presented`, at `host.rs:15396` on both trees, so it is not introduced by this PR. The description's 361-test run and its Series S prologue A/B (8.7 to 12.6 fps on an RTX 5070) were not repeated here: no title was run, and this adapter has 16 GB rather than the 12 GB card of the report. Not tested: a retail title, the Series S prologue, the `VICTORY_GRAVE=0` comparison, Wine, AMD adapters, release profile, game data. AI-assisted (OpenCode), model: **MiMo-V2.6-Flash Free** - checked out both commits in detached worktrees, built them, ran the suites, wrote this report; neither worktree was modified; no game data was used.
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/493:upstream-pr/493'
git switch 'upstream-pr/493'

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/493'
git switch 'upstream-pr/493'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/493'
git switch 'upstream-pr/493'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/493'
git switch 'main'
git merge --squash 'upstream-pr/493'
git switch 'main'
git merge --ff-only 'upstream-pr/493'
git switch 'main'
git merge 'upstream-pr/493'
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
TaynanGT/Vice-Tay!493
No description provided.