Skip to content

Launcher: finer host-copy windows on PCs with 16 GB of RAM or less (6.0 -> 5.2 GB of the PC's memory held by the card) - #321

Open
bihanikeshav wants to merge 1 commit into
trustno1-coder:mainfrom
bihanikeshav:lowspec-windows
Open

bihanikeshav wants to merge 1 commit into
trustno1-coder:mainfrom
bihanikeshav:lowspec-windows

Conversation

@bihanikeshav

Copy link
Copy Markdown

What

scripts/play-foxhound.ps1 sets VICTORY_WINDOW_KB=1024 and VICTORY_WINDOW_TAILS=1 when the PC has 16 GB of RAM or less. Both switches are already in main (shadow.rs); no Rust changes. -More @{VICTORY_WINDOW_KB='4096'} gives back the 4 MiB grid.

Why

On a 16 GB PC the host copies of title memory are the biggest part of the PC's memory the card holds, and Windows pages the rest of the process out. Most of those copies are windows on the 4 MiB grid, and most of those are asks without a length (root views), which keep the whole 4 MiB cell from its start. With 1 MiB windows and tails, a root view's window begins at its own 256 KiB step.

Measured

RTX 5060 Laptop (8 GB, 32-lane waves), Core Ultra 7 255HX, 16 GB RAM, Windows 11. main 0cef07e plus #76, #81, #88, #63, #69. play-foxhound.ps1 -SeriesS -Dlss off, the same scripted menu input in every run, the prison's day room.

Diagnostics build, memory line, about five minutes in:

before after
windows outside buffers 3,400 MB 2,598 MB
of them asked for without a length 2,732 MB 980 MB
host copies of title memory 4,206 MB 3,404 MB
the card's share of the PC's memory 6.0 GB 5.2 GB
private memory 20.9 GB 19.9 GB
fps, median / slowest tenth of seconds 14.0 / 3.7 14.4 / 11.9

Release build: median 16.0 -> 16.4 fps, private memory 20.3 -> 19.3 GB. No visual change seen.

The finer grid costs more copies per frame on bigger machines (a 256 KiB grid doubled copies on another tree), so the launcher sets it only at 16 GB or less, where paging costs more than the copies.

🤖 Generated with Claude Code

VICTORY_WINDOW_KB=1024 and VICTORY_WINDOW_TAILS=1 when the PC has 16 GB of
RAM or less. Measured on an RTX 5060 Laptop (8 GB) with 16 GB of RAM: the
windows 3,400 -> 2,598 MB, the card's share of the PC's memory 6.0 -> 5.2 GB,
slowest tenth of seconds 3.7 -> 11.9 fps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@harrisotiropoulos-jpg

Copy link
Copy Markdown
Contributor

A data point from a different configuration, with the same two switches (VICTORY_WINDOW_KB=1024, VICTORY_WINDOW_TAILS=1), set by hand through -More (this PR's launcher change would not set them here, since this PC has 32 GB).

Setup: RTX 4080 (16 GB), 32 GB RAM, Windows 11, driver 621.x. main 29d8dbf plus #76, #81, #86, #25, #33, #34, #39, #58, #63, #84, #101. Diagnostics build, Series X at 1440p, DLSS Quality (preset K), DLSS Frame Generation 2x, 30 fps cap, open-world gameplay. One run of about 5 minutes with each setting, in the same area.

What happened with the switches on: textures did not load correctly, and some objects flickered with random colours. With the default 4 MiB grid, the same build and route looked right.

Memory line, about five minutes in (12 one-second fps samples each):

4 MiB grid (default) 1 MiB + tails
windows outside buffers 785, 3,260 MB 2,280, 3,376 MB
host copies of title memory 4,236 MB 4,353 MB
private memory 28,473 MB 27,284 MB
of it in memory 22,126 MB 22,484 MB
copies per frame 14.5 ms, 61 MB 13.6 ms, 63 MB
fps 22.5 20.9

So on this configuration the windows did not shrink. There were about 3x as many windows, holding slightly more memory, and the picture broke. This is one pair of runs in moving gameplay, so the private-memory difference is within run-to-run noise. The broken textures and coloured flicker were not subtle, though.

The corruption suggests that, with finer windows, some copies are not brought up to date (the same title memory asked for with different ranges then lies in more than one window, as the window() comment in shadow.rs notes). Your measurements were on Series S with DLSS off, in one room, so it may only show up with Series X, DLSS or frame generation, or outdoors. It would be worth a check on those before this goes on by default, even for 16 GB PCs only.

🤖 Generated with Claude Code

@bihanikeshav

Copy link
Copy Markdown
Author

Thanks, that's a very useful data point. On our 16 GB / RTX 5060 laptop we've also been seeing texture flicker since these switches went on, and hadn't tied it to them. We're re-running with the 4 MiB grid to confirm. If it's the cause, I'll put this PR back to draft until the copies of memory that lies in more than one window are kept up to date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants