[pr-performance] play: keep the card buffers' 64 KiB floor under 24 GB of RAM #483

Open
github-bot wants to merge 1 commit from github-bot/gh-483 into main AGit
Owner

@⁠Indy2l on GitHub · 2026-11-30 22:40 UTC · original
Indy2l:launcher/keep-card-buffer-floor-16gb → main · +8 −6 · 1 files · 1 commits · open

Related: #474 (settings sized to the PC), 6265cec2

What it changes

Under 24 GB of RAM, machine_settings in apps/vice-tay/src/play.rs unsets VICE_TAY_CARD_BUFFERS_MIN_KB. The engine then uses its own 512 KiB floor (the log says card_buffers_min_kb=512), so every title buffer of 64 to 512 KiB stays in RAM, and the card reads it across the bus each frame. On a 16 GB PC this made the card the limit.

This keeps play's 64 KiB floor under 24 GB, like the small-memory profile already does since 6265cec2 (measured there on an RTX 4090: 6.2 fps with the floor, 2.2 without). docs/small-memory.md already says play keeps it, so this makes the code match the doc. The other 16 GB settings (VICE_TAY_INPLACE=2, VICE_TAY_WINDOW_KB=64, VICE_TAY_WINDOW_TAILS=1) stay as they are. On a small card, what bounds the copies is still their total (VICE_TAY_CARD_BUFFERS_MB, 256 MB under 8 GB).

How it was tested

  • Graphics card, RAM, and profile: RTX 3060 12 GB (driver 621.40, Resizable BAR on), 16 GB RAM, i5-12400F. Series X, --res 1080to1440 --dlss off (1920x1080 scene, 2560x1440 output), no frame generation, ray tracing off (--set VICE_TAY_BVH_BUILDER=). Diagnostics build of main at 206e07b4, the same warm shader and pipeline cache for both runs, no F1-menu settings, the prison prologue from the same save to the crowded room, recorded with OBS.
  • Before (main as it is, so card_buffers_min_kb=512): median 3.7 fps over 96 five-second windows in the world (92 under 5 fps). Card time a frame from the layer's card meter: median 250 ms; the submitting thread waited for the card a median 156 ms a frame. Card memory 8.4 GB own + 4.1 GB shared (median), peak system commit 46.3 GB, page-ins a median 4,400/s.
  • After (only --set VICE_TAY_CARD_BUFFERS_MIN_KB=64, the value this PR keeps; the layer's switches line differs from the run before in that one switch): median 6.7 fps over 52 windows (18 under 5 fps). Card time a frame: median 81 ms; the submitting thread waited a median 14 ms. Card memory 8.7 GB own + 4.3 GB shared, peak commit 46.6 GB, page-ins a median 12,000/s. The game closed normally.
  • The routes weren't identical (a shorter stand at the first window in the run after), so on the same stretch, the last 90 s of each run (the corridor and the crowded room): card time 265 ms a frame against 98, frame time 273 ms against 104.
  • Recordings, whole run each, reviewed at one frame every 10 s: no new artifacts. In the run after, the opening cutscene started before its scene had loaded (blocky untextured shapes for its first seconds, then the right scene). The run before passed through that cutscene at about 2 fps, so it had more time to load. This looks like the existing late loading on 16 GB showing up once the frames are faster, together with the higher page-in rate, but it is not proven.
  • cargo test --locked -p vice-tay, with and without --all-features --test-threads=1: all pass (default: 93 unit tests and 11 more in the integration tests; --all-features: 94 and 11). The two tests on the 16 GB settings (each_pc_gets_its_tier, sixteen_gb_or_less_stays_on_series_x) now check that the floor is kept.
  • cargo clippy --locked -p vice-tay --all-targets -- -D warnings, with and without --all-features: clean. cargo run --locked -p xtask -- policy: 676 files ok. git diff --check: clean.

Not measured: Series S (it now runs its own build), other cards or RAM sizes, or ray tracing on. One run each way; the difference in card time (about 3x on the same stretch) is far outside what these runs vary by.

The cost is RAM traffic: page-ins went up from about 4,400 to 12,000 a second. With every 16 GB setting turned off as well (INPLACE, WINDOW_KB, WINDOW_TAILS unset), the card filled up (10.5 GB) and closing the game made system commit jump by about 26 GB to the limit and froze the PC, so those settings matter on a 16 GB PC; this PR leaves them on.

Has this been tried here before?

The floor's effect was measured in 6265cec2 (kept in the small-memory profile); this is the same floor for play's own 16 GB settings, which still dropped it. Two open pull requests touch play.rs (#479, #428), neither of them machine_settings or this switch.

  • I searched the open pull requests for the same issue and for the files this touches. Related: #474

AI-assisted: yes

🤖 Generated with Claude Code

**@⁠Indy2l** on GitHub · 2026-11-30 22:40 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/483) `Indy2l:launcher/keep-card-buffer-floor-16gb` → `main` · +8 −6 · 1 files · 1 commits · open Related: #474 (settings sized to the PC), 6265cec2 ## What it changes Under 24 GB of RAM, `machine_settings` in `apps/vice-tay/src/play.rs` unsets `VICE_TAY_CARD_BUFFERS_MIN_KB`. The engine then uses its own 512 KiB floor (the log says `card_buffers_min_kb=512`), so every title buffer of 64 to 512 KiB stays in RAM, and the card reads it across the bus each frame. On a 16 GB PC this made the card the limit. This keeps `play`'s 64 KiB floor under 24 GB, like the small-memory profile already does since 6265cec2 (measured there on an RTX 4090: 6.2 fps with the floor, 2.2 without). `docs/small-memory.md` already says `play` keeps it, so this makes the code match the doc. The other 16 GB settings (`VICE_TAY_INPLACE=2`, `VICE_TAY_WINDOW_KB=64`, `VICE_TAY_WINDOW_TAILS=1`) stay as they are. On a small card, what bounds the copies is still their total (`VICE_TAY_CARD_BUFFERS_MB`, 256 MB under 8 GB). ## How it was tested - Graphics card, RAM, and profile: RTX 3060 12 GB (driver 621.40, Resizable BAR on), 16 GB RAM, i5-12400F. Series X, `--res 1080to1440 --dlss off` (1920x1080 scene, 2560x1440 output), no frame generation, ray tracing off (`--set VICE_TAY_BVH_BUILDER=`). Diagnostics build of `main` at 206e07b4, the same warm shader and pipeline cache for both runs, no F1-menu settings, the prison prologue from the same save to the crowded room, recorded with OBS. - Before (`main` as it is, so `card_buffers_min_kb=512`): median 3.7 fps over 96 five-second windows in the world (92 under 5 fps). Card time a frame from the layer's card meter: median 250 ms; the submitting thread waited for the card a median 156 ms a frame. Card memory 8.4 GB own + 4.1 GB shared (median), peak system commit 46.3 GB, page-ins a median 4,400/s. - After (only `--set VICE_TAY_CARD_BUFFERS_MIN_KB=64`, the value this PR keeps; the layer's switches line differs from the run before in that one switch): median 6.7 fps over 52 windows (18 under 5 fps). Card time a frame: median 81 ms; the submitting thread waited a median 14 ms. Card memory 8.7 GB own + 4.3 GB shared, peak commit 46.6 GB, page-ins a median 12,000/s. The game closed normally. - The routes weren't identical (a shorter stand at the first window in the run after), so on the same stretch, the last 90 s of each run (the corridor and the crowded room): card time 265 ms a frame against 98, frame time 273 ms against 104. - Recordings, whole run each, reviewed at one frame every 10 s: no new artifacts. In the run after, the opening cutscene started before its scene had loaded (blocky untextured shapes for its first seconds, then the right scene). The run before passed through that cutscene at about 2 fps, so it had more time to load. This looks like the existing late loading on 16 GB showing up once the frames are faster, together with the higher page-in rate, but it is not proven. - `cargo test --locked -p vice-tay`, with and without `--all-features --test-threads=1`: all pass (default: 93 unit tests and 11 more in the integration tests; `--all-features`: 94 and 11). The two tests on the 16 GB settings (`each_pc_gets_its_tier`, `sixteen_gb_or_less_stays_on_series_x`) now check that the floor is kept. - `cargo clippy --locked -p vice-tay --all-targets -- -D warnings`, with and without `--all-features`: clean. `cargo run --locked -p xtask -- policy`: 676 files ok. `git diff --check`: clean. Not measured: Series S (it now runs its own build), other cards or RAM sizes, or ray tracing on. One run each way; the difference in card time (about 3x on the same stretch) is far outside what these runs vary by. The cost is RAM traffic: page-ins went up from about 4,400 to 12,000 a second. With every 16 GB setting turned off as well (`INPLACE`, `WINDOW_KB`, `WINDOW_TAILS` unset), the card filled up (10.5 GB) and closing the game made system commit jump by about 26 GB to the limit and froze the PC, so those settings matter on a 16 GB PC; this PR leaves them on. ## Has this been tried here before? The floor's effect was measured in 6265cec2 (kept in the small-memory profile); this is the same floor for `play`'s own 16 GB settings, which still dropped it. Two open pull requests touch `play.rs` (#479, #428), neither of them `machine_settings` or this switch. - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #474 AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Under 24 GB of RAM the machine settings unset VICE_TAY_CARD_BUFFERS_MIN_KB,
so the engine's 512 KiB took over and title buffers of 64 to 512 KiB stayed
in RAM, where the card reads them across the bus every frame. On an RTX 3060
12 GB with 16 GB of RAM (Series X, 1080to1440, ray tracing off) that held the
prologue at a median 3.7 fps with the card 250 ms a frame; with the floor
back at 64 KiB and nothing else changed it ran 6.7 fps with the card at 81
ms, at the same commit peak (46.3 against 46.6 GB). The small-memory profile
already keeps this floor (6265cec2, measured on an RTX 4090) and
docs/small-memory.md says play keeps it; this makes play do so too.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 22:45:09 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-483'
git switch 'github-bot/gh-483'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-483'
git switch 'github-bot/gh-483'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-483'
git switch 'main'
git merge --squash 'github-bot/gh-483'
git switch 'main'
git merge --ff-only 'github-bot/gh-483'
git switch 'main'
git merge 'github-bot/gh-483'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.