GPU: the floor of texture copies is a third of the card's budget at most (4 GB card: 370 to 160 ms a frame in the prologue) #1122

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

@⁠Dathinel on GitHub · 2026-11-25 20:29 UTC · original
Dathinel:gpu/texture-floor-by-budget → main · +13 −2 · 1 files · 1 commits · open

What

resource::room always allows 2 GiB of copies of the textures the title fills (FLOOR) before it looks at the card's budget. On a card with 4 GB of memory the whole budget is about 3.2 GB, so that floor, beside the render targets and the buffer copies, puts the card about a gigabyte over its budget from the first world frame, and the system moves card memory into the PC's.

This makes the floor a third of the card's budget, at most the 2 GiB it was (+13 −2 in crates/victory-gpu/src/resource.rs). It is read once. Cards with 6 GiB of budget or more are unchanged; VICTORY_TEXTURE_BUDGET_MB still overrides everything, as before.

Measured

RTX 3050 Laptop 4 GB (driver 610.62), Ryzen 7 7435HS, 16 GB RAM, Windows 11 26200, --console series-s, diag build, 085ee7c + #1081 + #798 + #1002 + #592 + #1104, the run 253 switch set from the README. One 345 s launch each, stopped by me, same scripted keys. Last 30 frame-rate lines of each run (the prologue cutscene, about 4,400 draws a frame):

Run Floor Median frame The card's own memory, in use / budget Host textures alive
D 2 GiB (as on main) 370 ms 4.32 / 3.27 GB 3.34 GB
E VICTORY_TEXTURE_BUDGET_MB=1024 154 ms 3.71 / 3.18 GB 2.31 GB
F this change, no budget switch 160 ms 3.72 / 3.31 GB 2.35 GB

Run D's last lines are at 1,700 to 3,200 draws, E's and F's at about 4,400, so the gap is not smaller than the table says. No device loss and no out-of-memory in any of the three; the desktop screenshot at 320 s of E and F shows the scene.

Not tested

  • A card with a budget between 3.3 and 6 GiB (6 and 8 GB cards): there the floor drops from 2 GiB to a third of the budget, and I have no such card. A measurement from one would say whether a third is the right share or whether the change should only apply below some size.
  • What the smaller floor leaves unloaded: I compared frame rate and memory, not the pictures texture by texture.
  • Runs longer than 345 s, and the Series X profile.

AI-assisted (Claude Code). No game data attached.

**@⁠Dathinel** on GitHub · 2026-11-25 20:29 UTC · [original](https://github.com/fxceless/victory-fork/pull/1122) `Dathinel:gpu/texture-floor-by-budget` → `main` · +13 −2 · 1 files · 1 commits · open ## What `resource::room` always allows 2 GiB of copies of the textures the title fills (`FLOOR`) before it looks at the card's budget. On a card with 4 GB of memory the whole budget is about 3.2 GB, so that floor, beside the render targets and the buffer copies, puts the card about a gigabyte over its budget from the first world frame, and the system moves card memory into the PC's. This makes the floor **a third of the card's budget, at most the 2 GiB it was** (+13 −2 in `crates/victory-gpu/src/resource.rs`). It is read once. Cards with 6 GiB of budget or more are unchanged; `VICTORY_TEXTURE_BUDGET_MB` still overrides everything, as before. ## Measured RTX 3050 Laptop 4 GB (driver 610.62), Ryzen 7 7435HS, 16 GB RAM, Windows 11 26200, `--console series-s`, `diag` build, 085ee7c + #1081 + #798 + #1002 + #592 + #1104, the run 253 switch set from the README. One 345 s launch each, stopped by me, same scripted keys. Last 30 frame-rate lines of each run (the prologue cutscene, about 4,400 draws a frame): | Run | Floor | Median frame | The card's own memory, in use / budget | Host textures alive | |---|---|---|---|---| | D | 2 GiB (as on `main`) | 370 ms | 4.32 / 3.27 GB | 3.34 GB | | E | `VICTORY_TEXTURE_BUDGET_MB=1024` | 154 ms | 3.71 / 3.18 GB | 2.31 GB | | F | **this change, no budget switch** | **160 ms** | 3.72 / 3.31 GB | 2.35 GB | Run D's last lines are at 1,700 to 3,200 draws, E's and F's at about 4,400, so the gap is not smaller than the table says. No device loss and no out-of-memory in any of the three; the desktop screenshot at 320 s of E and F shows the scene. ## Not tested - A card with a budget between 3.3 and 6 GiB (6 and 8 GB cards): there the floor drops from 2 GiB to a third of the budget, and I have no such card. A measurement from one would say whether a third is the right share or whether the change should only apply below some size. - What the smaller floor leaves unloaded: I compared frame rate and memory, not the pictures texture by texture. - Runs longer than 345 s, and the Series X profile. AI-assisted (Claude Code). No game data attached.
On a card whose whole budget is about 3.2 GB (4 GB of memory) the fixed
2 GiB floor put the card a gigabyte over its budget from the first world
frame. Cards with 6 GiB of budget or more keep the 2 GiB.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:57:53 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-25 20:29 UTC · original · edited 2026-11-25 20:32 UTC

Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T20:32:07.305252Z a360025 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review" or "@⁠codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-25 20:29 UTC · [original](https://github.com/fxceless/victory-fork/pull/1122#issuecomment-7173742803) · edited 2026-11-25 20:32 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"a360025758c240435bc881fc1e55b7de63ebdb0d","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-25T20:32:07.305252Z">2026-11-25T20:32:07.305252Z</relative-time> | `a360025` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review" or "@⁠codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
Author
Owner

@⁠Dathinel on GitHub · 2026-11-25 21:30 UTC · original

An independent measurement of the same effect, from the thread of #1113: an RTX 3050 Ti Laptop 4 GB (i7-11800H, 16 GB) on the same tree went from a median world frame of 1,045 ms to 176 ms, and from 4,483 ms to 891 ms at the 90th percentile, with VICTORY_TEXTURE_BUDGET_MB=1024, which is the cap this change gives a card of that size by default. Its author notes the pipeline library was cold in the first run and warm in the second, so not all of that gain is the budget's. This PR itself has not been run on that machine.

**@⁠Dathinel** on GitHub · 2026-11-25 21:30 UTC · [original](https://github.com/fxceless/victory-fork/pull/1122#issuecomment-7175171989) An independent measurement of the same effect, from the thread of #1113: an RTX 3050 Ti Laptop 4 GB (i7-11800H, 16 GB) on the same tree went from a median world frame of 1,045 ms to 176 ms, and from 4,483 ms to 891 ms at the 90th percentile, with `VICTORY_TEXTURE_BUDGET_MB=1024`, which is the cap this change gives a card of that size by default. Its author notes the pipeline library was cold in the first run and warm in the second, so not all of that gain is the budget's. This PR itself has not been run on that machine.
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/1122/head:github-bot/gh-1122'
git switch 'github-bot/gh-1122'

Merge

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