Skip to content

GPU: a submission's texture checks run several at a time (VICTORY_WIDE_TEXTURES=1) - #768

Open
KyleS98 wants to merge 1 commit into
fxceless:mainfrom
KyleS98:perf/wide-texture-refresh
Open

KyleS98 wants to merge 1 commit into
fxceless:mainfrom
KyleS98:perf/wide-texture-refresh

Conversation

@KyleS98

@KyleS98 KyleS98 commented Nov 25, 2026

Copy link
Copy Markdown

While the world streams in, a submission checks hundreds of textures one after another on the submitting thread. Each one is read, hashed whole and, if it changed, detiled into its staging buffer. On the opening cutscene and the first world minutes, that's the frame line's "textures" at 100–1,400 ms per frame (250–930 MB), so the cutscene plays at 0.3–2 fps.

Change (opt-in, VICTORY_WIDE_TEXTURES=1)

  • Texture checks that come due in a batch are queued (Batch::textures_due) instead of being run inline.
  • The queue runs at the batch's next flush, which happens before a step that writes title memory and before the lists run. So the order against those steps is unchanged. It runs on the threads already kept for the snapshots (shadow::wide_run).
  • It's safe to parallelize. Each check reads its own texture's title memory and writes its own staging buffer and notes under its own lock. A texture is queued once per batch (Batch::texture_due), so no two threads check the same one. Read buffers are per-thread, and the remap guard is a shared lock.
  • The frame line's "textures" counts the time it took (wall clock), not the threads' sum.
  • Off by default; nothing changes without the switch.

Measurements

RTX 3090 Ti + Ryzen, Windows 11, diag build of this branch on 8dd30ab, retail title, Series X profile. One launch per configuration, average over the frames between the first world frame and the steady state:

configuration frame time "textures" steady state after streaming
default ≈1,030 ms ≈330 ms 4.1 fps
VICTORY_WIDE_TEXTURES=1 ≈826 ms ≈120 ms 4.1–4.3 fps
VICTORY_TEXTURE_NO_WAIT=1 ≈654 ms ≈44 ms 4.1–4.2 fps
both ≈518 ms ≈16 ms 4.0–4.2 fps
  • With this switch alone, the remaining texture time is mostly waiting for the runtime's remap lock ("1,299 of 1,667 ms waiting for title memory to hold still" on the texture-refresh line). That's what VICTORY_TEXTURE_NO_WAIT addresses, and the two complement each other: together the slow phase runs at about twice the default frame rate.
  • No crash or device loss in any of the four runs. Live screen grabs of the combined run show the cutscene and the cell rendering normally; the only white frame is the cutscene's own fade-in.
  • cargo test -p victory-gpu --lib batch: 4 passed (1 ignored benchmark). cargo clippy -p victory-gpu --all-targets: no new warnings.

If these numbers hold on other machines, both switches look like candidates to turn on by default. I've left that to you.

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

🤖 Generated with Claude Code

…E_TEXTURES=1)

While the world streams in, a submission checks hundreds of textures one
after another on the submitting thread: each is read, hashed whole and,
when it changed, detiled into its staging buffer. With the switch the
checks that come due in a batch are queued (Batch::textures_due) and run
at its next flush, before a step that writes title memory and before the
lists run, so their order against those steps is unchanged, on the
threads kept for the snapshots (shadow::wide_run). Each check reads its
texture's title memory and writes its own staging buffer and notes under
its own lock, and a texture is queued once per batch (texture_due), so no
two threads check the same texture. The frame line's "textures" counts
the time it took, not the threads' sum.

Measured on the opening cutscene and the first world minutes (RTX 3090
Ti, 8dd30ab, same binary, one launch each):

  default                        frame ~1,030 ms, textures ~330 ms
  VICTORY_WIDE_TEXTURES=1         frame   ~826 ms, textures ~120 ms
  VICTORY_TEXTURE_NO_WAIT=1       frame   ~654 ms, textures  ~44 ms
  both                           frame   ~518 ms, textures  ~16 ms

Steady state after streaming: 4.0-4.3 fps in all four.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KyleS98 added a commit to KyleS98/VIctory-Neo that referenced this pull request Nov 25, 2026
…0 turns each off)

Measured together on the opening cutscene and first world minutes: ~518 ms a frame against ~1,030 by default (textures ~16 ms against ~330), steady state unchanged (fxceless/victory-fork#768).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017rHNfuPpCyeMjHxWTEyhiQ
oceansde012 pushed a commit to oceansde012/victory-gta6 that referenced this pull request Nov 25, 2026
…E_TEXTURES=1)

Upstream: fxceless#768 (opt-in)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FLuVRkAEvF29hMbrBJw8os
oceansde012 pushed a commit to oceansde012/victory-gta6 that referenced this pull request Nov 25, 2026
…E_TEXTURES=1)

Upstream: fxceless#768 (opt-in)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FLuVRkAEvF29hMbrBJw8os
(cherry picked from commit c308a49)
oceansde012 pushed a commit to oceansde012/victory-gta6 that referenced this pull request Nov 25, 2026
…E_TEXTURES=1)

Upstream: fxceless#768 (opt-in)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FLuVRkAEvF29hMbrBJw8os
(cherry picked from commit c308a49)
(cherry picked from commit ef79c7b)
@KyleS98
KyleS98 force-pushed the perf/wide-texture-refresh branch from f51aae3 to 19546dd Compare November 25, 2026 08:47
KyleS98 added a commit to KyleS98/VIctory-Neo that referenced this pull request Nov 25, 2026
…0 turns each off)

Measured together on the opening cutscene and first world minutes: ~518 ms a frame against ~1,030 by default (textures ~16 ms against ~330), steady state unchanged (fxceless/victory-fork#768).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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