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) #1119

Closed
Dathinel wants to merge 1 commit from upstream-pr/1122 into main
Dathinel commented 2026-11-25 20:29:06 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Dathinel on 2026-11-25T20:29:06Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:issue:5498652139 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1122). Originally posted by [Dathinel](https://github.com/Dathinel) on 2026-11-25T20:29:06Z. --- ## 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.
chatgpt-codex-connector[bot commented 2026-11-25 21:05:55 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T20:29:16Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7173742803 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1122#issuecomment-7173742803). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T20:29:16Z. --- <!-- 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>
Dathinel commented 2026-11-25 22:07:23 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Dathinel on 2026-11-25T21:30:38Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7175171989 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1122#issuecomment-7175171989). Originally posted by [Dathinel](https://github.com/Dathinel) on 2026-11-25T21:30:38Z. --- 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 commented 2026-11-28 01:07:59 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Dathinel on 2026-11-28T01:07:59Z.


Closing as superseded: main now has texture_floor_bytes, which caps the floor at a quarter of the card's budget, tighter than the third this proposed, so nothing is left to merge here. For anyone on a 4 GB card: with that floor an RTX 3050 Laptop 4 GB (3,367 MB budget) holds about 840 MB of title textures, and what fits in that is measured, with the switches used, at https://github.com/Dathinel/victory-4gb (issues there have the numbers). Written with AI assistance (Claude Code).

<!-- greyfinch-sync:fxceless/victory-fork:comment:7231444202 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1122#issuecomment-7231444202). Originally posted by [Dathinel](https://github.com/Dathinel) on 2026-11-28T01:07:59Z. --- Closing as superseded: `main` now has `texture_floor_bytes`, which caps the floor at a quarter of the card's budget, tighter than the third this proposed, so nothing is left to merge here. For anyone on a 4 GB card: with that floor an RTX 3050 Laptop 4 GB (3,367 MB budget) holds about 840 MB of title textures, and what fits in that is measured, with the switches used, at https://github.com/Dathinel/victory-4gb (issues there have the numbers). Written with AI assistance (Claude Code).

Pull request closed

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!1119
No description provided.