Perf/opt 01 card reserve #242
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/242"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from DexNom/VIctory. Originally posted by El-Biiscuit on 2026-11-30T09:57:20Z.
OPT-01: card reserve for title buffer copies (off by default)
Stacked on
perf/card-room-pct(CARD-ROOM,c56fb6d). One commit,shadow: a card reserve for title buffer copies, off by default (VICTORY_CARD_RESERVE_MB).Why
The room rule keeps a title buffer copy in the PC's memory whenever the card is past its line at the moment the copy is made. In this title the large shader-written buffers are made after the textures have filled the card (3.2 → 9.0 GB in 13 s before them in a diagnostic capture), so 8 of 9 stayed in PC memory at 80 %, and their shader writes were searched for on the CPU (about 700 MiB compared and 85 ms of snapshots per frame).
What
VICTORY_CARD_RESERVE_MBasks for a reserve; unset or 0 is the previous rule exactly. Default: off.VICTORY_CARD_RESERVE_MAX_PCTof the card's current budget (10 unless set, 1 to 25).VICTORY_CARD_ROOM_PCT), then PC memory, as before.resource::room) leaves the unused part of the reserve free, so the order in which textures and buffers are made no longer decides.Tests
cargo test --profile diag -p victory-gpu -p victory-hle -p xtask --features victory-hle/diagnostics: victory-gpu 269, victory-hle 118, xtask 49 (perf-log message patterns included), all passing on this branch. New unit tests: cap, footprint, placement (reserve, short reserve, budget ceiling, off equals the old rule, 90 % case). Clippy clean on the validated build.Measurements
One session, three runs of one diagnostics build, RX 6700 XT, Series X,
--1080p-to-1440p, same save and path, fresh copies of the same state and shader cache, 60 s window marked by the player. Medians per frame (p95):Textures deferred by the VRAM budget: 0 in all runs. The reserve held 896 of 1,024 MB (109 copies); none found it short.
Limits of the comparison
af668d0,90fdcb1), which earlier measurements found to have no measurable cost. This branch is the same change onc56fb6dwithout them, rebuilt and re-tested but not re-measured in game.late.waitmore than doubles; this is the next item (OPT-02).Imported from DexNom/VIctory. Originally posted by Zippp69 on 2026-11-30T16:08:43Z.
Review of
d44a0f8Count reserve placements as VRAM. The runtime emits
on the card (from the reserve), butLargeCopy::on_card()matches onlyon the card. I ranperf-logon two synthetic logs that differed only in the placement label. The reserve label produced one 174 MiB copy in PC memory, while the ordinary label produced one 174 MiB copy in VRAM. Recognize both VRAM labels and cover the reserve label in the summary test. parse.rsThe explicit texture budget and the first 2 GiB of tracked textures bypass the shared video-memory check. The texture queue does not hold back the reserve in those cases. Document those exceptions if the early returns are intentional. resource.rs
Imported from DexNom/VIctory. Originally posted by Zippp69 on 2026-11-30T16:50:50Z.
Tested patch for the reserve classification. Follow-up to the perf-log review at
d44a0f8. The classifier accepts both VRAM labels. The regression test changes the placement label in the synthetic run and verifies that the summary keeps 174 MiB in VRAM and 90 MiB in PC memory. Theperflogsuite returned 46 passed, 0 failed and 1 ignored.In
xtask/src/perflog/parse.rs:In
xtask/src/perflog/tests.rs:Imported from DexNom/VIctory. Originally posted by El-Biiscuit on 2026-12-01T14:44:15Z.
Thanks @Zippp69 for both reviews and for the tested patch. Both points are addressed in
a6eac73(pushed to this branch):1. Reserve placements count as card memory (
xtask/src/perflog/parse.rs)LargeCopy::on_card()now accepts bothon the cardandon the card (from the reserve). This is your fix; the commit message credits your review.reserve_placements_are_counted_as_card_memory(xtask/src/perflog/tests.rs), adapted from your patch. It relabels the placement in the synthetic run, checks that the line still parses, and checks that the summary reports1 on the card (174 MiB), 1 kept in the PC's memory (90 MiB).cargo test -p xtask perflog: 46 passed, 0 failed, 1 ignored. The new test fails with the fix reverted and passes with it.2. Texture-queue exceptions (
crates/victory-gpu/src/resource.rs,room())VICTORY_TEXTURE_BUDGET_MBlimit and the firstFLOOR(2 GiB) of tracked textures both return before the shared video-memory check, so the reserve is not held back in those cases.Performance
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.