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

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

@⁠laptopnotebook on GitHub · 2026-11-25 04:35 UTC · original
laptopnotebook:perf/window-grid-1mib → main · +27 −19 · 1 files · 1 commits · open

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.

**@⁠laptopnotebook** on GitHub · 2026-11-25 04:35 UTC · [original](https://github.com/fxceless/victory-fork/pull/691) `laptopnotebook:perf/window-grid-1mib` → `main` · +27 −19 · 1 files · 1 commits · open 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.
Windows over title memory outside buffers were cut on a 4 MiB grid, and
the comment kept that default until a run with the memory line's window
counts showed what the finer grids give. Measured in the first room on
an 8 GB card (diagnostics build, warm shader cache, 312 s in the world
each), the 1 MiB grid with tails against the old default:

                       1 MiB (env)  1 MiB (default)  4 MiB
  windows alive        3,072 MB     2,689 MB         3,440 MB
  shared with the card 4,734 MB     4,364 MB         5,096 MB
  private bytes        20,819 MB    20,343 MB        21,164 MB
  frames a second      1.4          1.5              1.7

About 350-750 MB less of the PC's memory, at some cost in frame rate
(windows are made and let go about seven times as often). Draw counts
moved with where the camera was and are not compared. Issue #580 saw a
similar saving on another 8 GB card.

VICTORY_WINDOW_KB=4096 VICTORY_WINDOW_TAILS=0 brings back the old windows.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:49:04 +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/691/head:github-bot/gh-691'
git switch 'github-bot/gh-691'

Merge

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