Skip to content

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
Dathinel wants to merge 1 commit into
fxceless:mainfrom
Dathinel:gpu/texture-floor-by-budget
Open

Dathinel wants to merge 1 commit into
fxceless:mainfrom
Dathinel:gpu/texture-floor-by-budget

Conversation

@Dathinel

Copy link
Copy Markdown
Contributor

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 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
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.

HAL9000RELOADED pushed a commit to HAL9000RELOADED/victory-fork that referenced this pull request Nov 25, 2026
…rites counted; levels on demand (off); warm-up; card memory numbers

Memory sync:
- The guard over every view of a physical page (code by myokex, victory-amd
  c6dc4d8, after pull request fxceless#115 by Spexivus, its correction by joroyt and
  a part of VIctory fxceless#1122 by tightfall): the title shows one page at several
  addresses and a copy was guarded at one only. 0.8 to 1.0 million writes
  through another view in a five-minute run on the test machine.
  VICTORY_VIEW_GUARD=0 turns it off.
- Kernel reads into title memory are read beside and copied in (Joshua Odom,
  10ea38e).
- Writes of the storage layer into physical pages are counted where the
  title has the pages mapped and can open the guards there
  (VICTORY_PAGE_WRITES, off: counted only). Failed page-destination reads
  are retried.

Card memory:
- Levels on demand, off unless VICTORY_LEVELS_ON_DEMAND=1: a texture the
  title fills takes card memory for the levels the title holds; held levels
  get memory only while the card has room and are asked for again. Its test
  runs on the software adapter; not run on a card yet.
- Refused texture slots are held back so a pass reaches the slots behind
  them; room can be kept for card copies of title buffers (off).

Tools: translate --warm all; the shader cache is keyed on the translator's
source; counters for copy-back races, page writes and the copies the
texture sweep never lets go; a walls trace.

Game runs of these changes on an RTX 4070: five five-minute runs without a
device loss or a failed request. This merged tree was built; its test
suites were run on the tree the changes come from (gpu 129, hle 97).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@Dathinel

Copy link
Copy Markdown
Contributor Author

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.

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.

1 participant