GPU: windows outside buffers default to the 1 MiB grid with tails #691

Open
laptopnotebook wants to merge 1 commit from upstream-pr/691 into main
laptopnotebook commented 2026-11-25 04:35:10 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by laptopnotebook on 2026-11-25T04:35:10Z.


Windows over title memory outside buffers were cut on a 4 MiB grid. The comment on window() kept that default "until a run with the memory line's window counts has shown what the finer grids give", so here are those runs. This makes VICTORY_WINDOW_KB=1024 and VICTORY_WINDOW_TAILS=1 the defaults; VICTORY_WINDOW_KB=4096 VICTORY_WINDOW_TAILS=0 brings back the old windows.

Measured in the first room on an 8 GB card, Windows 11, diagnostics build of 310c6eb, warm shader cache, 312 s in the world each, numbers from the memory line at the end of each run:

1 MiB + tails (env) 1 MiB + tails (new default) 4 MiB (old default)
windows alive 3,072 MB 2,689 MB 3,440 MB
PC memory shared with the card 4,734 MB 4,364 MB 5,096 MB
private bytes 20,819 MB 20,343 MB 21,164 MB
card memory in use 6,979 MB 6,880 MB 6,958 MB
frames a second (median) 1.4 1.5 1.7

So about 350-750 MB less of the PC's memory, and no real change on the card. The cost is some frame rate: windows are made and let go about seven times as often (3,368 against 522 over the run). On this machine the PC had about 1 GB of commit left with the old default, so the saving matters here; on a machine with plenty of RAM the old default may be the better trade.

Draw counts differed between runs, but they followed where the camera was pointing rather than the setting, so I'm not claiming anything about the room's geometry. Issue #580 saw a similar saving (~650 MB shared) on another 8 GB card.

The default is checked in the log (grid 1024 KiB with no environment set). cargo test --workspace --locked passes; the grid test now expects 1 MiB as the default. Clippy currently fails on main in draw.rs and indirect.rs, which this PR doesn't touch.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6597291918 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/691). Originally posted by [laptopnotebook](https://github.com/laptopnotebook) on 2026-11-25T04:35:10Z. --- Windows over title memory outside buffers were cut on a 4 MiB grid. The comment on `window()` kept that default "until a run with the memory line's window counts has shown what the finer grids give", so here are those runs. This makes `VICTORY_WINDOW_KB=1024` and `VICTORY_WINDOW_TAILS=1` the defaults; `VICTORY_WINDOW_KB=4096 VICTORY_WINDOW_TAILS=0` brings back the old windows. Measured in the first room on an 8 GB card, Windows 11, diagnostics build of `310c6eb`, warm shader cache, 312 s in the world each, numbers from the memory line at the end of each run: | | 1 MiB + tails (env) | 1 MiB + tails (new default) | 4 MiB (old default) | |---|---:|---:|---:| | windows alive | 3,072 MB | 2,689 MB | 3,440 MB | | PC memory shared with the card | 4,734 MB | 4,364 MB | 5,096 MB | | private bytes | 20,819 MB | 20,343 MB | 21,164 MB | | card memory in use | 6,979 MB | 6,880 MB | 6,958 MB | | frames a second (median) | 1.4 | 1.5 | 1.7 | So about 350-750 MB less of the PC's memory, and no real change on the card. The cost is some frame rate: windows are made and let go about seven times as often (3,368 against 522 over the run). On this machine the PC had about 1 GB of commit left with the old default, so the saving matters here; on a machine with plenty of RAM the old default may be the better trade. Draw counts differed between runs, but they followed where the camera was pointing rather than the setting, so I'm not claiming anything about the room's geometry. Issue #580 saw a similar saving (~650 MB shared) on another 8 GB card. The default is checked in the log (`grid 1024 KiB` with no environment set). `cargo test --workspace --locked` passes; the grid test now expects 1 MiB as the default. Clippy currently fails on `main` in `draw.rs` and `indirect.rs`, which this PR doesn't touch.
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/691:upstream-pr/691'
git switch 'upstream-pr/691'

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/691'
git switch 'upstream-pr/691'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/691'
git switch 'upstream-pr/691'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/691'
git switch 'main'
git merge --squash 'upstream-pr/691'
git switch 'main'
git merge --ff-only 'upstream-pr/691'
git switch 'main'
git merge 'upstream-pr/691'
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
fxceless/victory-fork!691
No description provided.