Startup screens and intro flicker / show repeated frames – caused by VICTORY_TEXTURE_GUARD #269

Open
opened 2026-11-26 03:39:33 +00:00 by github-bot · 14 comments
Owner

@⁠PatrickSantoZZ on GitHub · 2026-11-24 23:05 UTC · original

The flicker mentioned in the README ("startup screens flicker, stale vertex
data on alternate frames") goes away completely with VICTORY_TEXTURE_GUARD=0.

Setup: RTX 5060 Ti (NVIDIA, 32-lane waves), Windows Sandbox with vGPU,
build of 4e17478 (via Geckomacabre/vx-layer a856125), diagnostics build.

How it was narrowed down: all 35 default-on switches of the fork set to 0
→ startup screens and intro are clean. Bisected from there
(data → data-b → b1 → b1b → TEXTURE_GUARD/TEXTURE_SWEEP → TEXTURE_GUARD).
Only VICTORY_TEXTURE_GUARD=0 is needed; everything else can stay on.
It is not VICTORY_PIPELINE_WAIT_MS (1000 ms flickers too) and not the
vx-play.ps1 speed switches.

Likely cause: in texture.rs (refresh), textures in view memory are only
re-hashed every 8th frame while the guard reports no writes. As the
comment says, a write through another view is not seen by the guard, so
those textures stay stale for up to 8 frames. The startup screens and the
intro (video frames?) seem to be written that way.

Workaround: VICTORY_TEXTURE_GUARD=0 (costs the ~51 ms/frame hashing you
measured in run 58). A possible fix: hash every frame for textures that
changed recently, or fall back to hashing when a texture was rewritten
within the last few frames.

**@⁠PatrickSantoZZ** on GitHub · 2026-11-24 23:05 UTC · [original](https://github.com/fxceless/victory-fork/issues/269) The flicker mentioned in the README ("startup screens flicker, stale vertex data on alternate frames") goes away completely with VICTORY_TEXTURE_GUARD=0. Setup: RTX 5060 Ti (NVIDIA, 32-lane waves), Windows Sandbox with vGPU, build of 4e17478 (via Geckomacabre/vx-layer a856125), diagnostics build. How it was narrowed down: all 35 default-on switches of the fork set to 0 → startup screens and intro are clean. Bisected from there (data → data-b → b1 → b1b → TEXTURE_GUARD/TEXTURE_SWEEP → TEXTURE_GUARD). Only VICTORY_TEXTURE_GUARD=0 is needed; everything else can stay on. It is not VICTORY_PIPELINE_WAIT_MS (1000 ms flickers too) and not the vx-play.ps1 speed switches. Likely cause: in texture.rs (refresh), textures in view memory are only re-hashed every 8th frame while the guard reports no writes. As the comment says, a write through another view is not seen by the guard, so those textures stay stale for up to 8 frames. The startup screens and the intro (video frames?) seem to be written that way. Workaround: VICTORY_TEXTURE_GUARD=0 (costs the ~51 ms/frame hashing you measured in run 58). A possible fix: hash every frame for textures that changed recently, or fall back to hashing when a texture was rewritten within the last few frames.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:39:33 +00:00
Author
Owner

@⁠iceyfromdiscord on GitHub · 2026-11-24 23:19 UTC · original

setting VICTORY_TEXTURE_GUARD=0 worked for me as well. thank you!

Specs:
Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
16GB RAM
NVIDIA GeForce RTX 5060 Ti (8gb variant)

**@⁠iceyfromdiscord** on GitHub · 2026-11-24 23:19 UTC · [original](https://github.com/fxceless/victory-fork/issues/269#issuecomment-7147269175) setting `VICTORY_TEXTURE_GUARD=0` worked for me as well. thank you! **Specs:** Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz 16GB RAM NVIDIA GeForce RTX 5060 Ti (8gb variant)
Author
Owner

@⁠PatrickSantoZZ on GitHub · 2026-11-24 23:23 UTC · original

can we confirm this is a nvidia only issue or does the same happens on AMD?
CPU: R7 5800x
GPU: 5060 TI 16GB
RAM: 64GB DDR4

**@⁠PatrickSantoZZ** on GitHub · 2026-11-24 23:23 UTC · [original](https://github.com/fxceless/victory-fork/issues/269#issuecomment-7147347610) can we confirm this is a nvidia only issue or does the same happens on AMD? CPU: R7 5800x GPU: 5060 TI 16GB RAM: 64GB DDR4
Author
Owner

@⁠twaalfkraaien on GitHub · 2026-11-24 23:23 UTC · original · edited 2026-11-24 23:25 UTC

just asking for the sake of it because i feel like im missunderstanding how to pass along arguments/switches
how exactly are you setting those?

im running on an NVIDIA card getting the same issue
GPU: 4070 12GB
RAM: 32GB DDR5 5600MT
CPU: Ryzen 7 7700X

**@⁠twaalfkraaien** on GitHub · 2026-11-24 23:23 UTC · [original](https://github.com/fxceless/victory-fork/issues/269#issuecomment-7147339027) · edited 2026-11-24 23:25 UTC just asking for the sake of it because i feel like im missunderstanding how to pass along arguments/switches how exactly are you setting those? im running on an NVIDIA card getting the same issue GPU: 4070 12GB RAM: 32GB DDR5 5600MT CPU: Ryzen 7 7700X
Author
Owner

@⁠Fush911 on GitHub · 2026-11-24 23:26 UTC · original

Same issue
CPU: Ryzen 5600
GPU: 5070 TI 16GB
RAM: 32GB DDR4

**@⁠Fush911** on GitHub · 2026-11-24 23:26 UTC · [original](https://github.com/fxceless/victory-fork/issues/269#issuecomment-7147409925) Same issue CPU: Ryzen 5600 GPU: 5070 TI 16GB RAM: 32GB DDR4
Author
Owner

@⁠iceyfromdiscord on GitHub · 2026-11-24 23:28 UTC · original

@⁠twaalfkraaien

how exactly are you setting those?

before you run victory.exe run C:\path\to\game.exe --execute, just run: set VICTORY_TEXTURE_GUARD=0
for example:

C:\files\emulator\victory-fork>set VICTORY_TEXTURE_GUARD=0

C:\files\emulator\victory-fork>target\release\victory.exe run C:\path\to\game.exe --execute

**@⁠iceyfromdiscord** on GitHub · 2026-11-24 23:28 UTC · [original](https://github.com/fxceless/victory-fork/issues/269#issuecomment-7147434024) @⁠twaalfkraaien > how exactly are you setting those? before you run `victory.exe run C:\path\to\game.exe --execute`, just run: `set VICTORY_TEXTURE_GUARD=0` for example: `C:\files\emulator\victory-fork>set VICTORY_TEXTURE_GUARD=0` `C:\files\emulator\victory-fork>target\release\victory.exe run C:\path\to\game.exe --execute`
Author
Owner

@⁠twaalfkraaien on GitHub · 2026-11-24 23:30 UTC · original

gotcha, also, yeah, this fixed the flickering on my end

**@⁠twaalfkraaien** on GitHub · 2026-11-24 23:30 UTC · [original](https://github.com/fxceless/victory-fork/issues/269#issuecomment-7147482280) gotcha, also, yeah, this fixed the flickering on my end
Author
Owner

@⁠JFIREonFIRE on GitHub · 2026-11-25 02:15 UTC · original

A data point against VICTORY_TEXTURE_GUARD=0 as the whole fix, at least on newer trees. On 2119b0e (diag build, RTX 3090, driver 621.01, Windows 11), the startup screens and the intro still flicker with VICTORY_TEXTURE_GUARD=0. Someone watched a 6-minute run from boot into the world, and the flicker looked the same as with the guard on.

  • The switch was read: texture.rs takes it at line 650 in this tree. The texture refresh cost in the world rose from ~16 to ~42 ms/frame with it off, so the guard really was off.
  • The startup screens ran at a steady 30 fps (33.3 ms) both ways. So what's seen is stale or repeated content, not frame-time stutter.
  • Other switches: VICTORY_LATE_WAIT=3 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024. One of these may bring back what the guard used to cause, but I haven't checked which.

So on this tree something else causes it, or something as well as the guard. The original report bisected on 4e17478. The README's other explanation ("stale vertex data on alternate frames") may be what is left. A rerun of the same bisection on a current tree would show it.

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

**@⁠JFIREonFIRE** on GitHub · 2026-11-25 02:15 UTC · [original](https://github.com/fxceless/victory-fork/issues/269#issuecomment-7150509161) A data point against `VICTORY_TEXTURE_GUARD=0` as the whole fix, at least on newer trees. On `2119b0e` (diag build, RTX 3090, driver 621.01, Windows 11), **the startup screens and the intro still flicker with `VICTORY_TEXTURE_GUARD=0`**. Someone watched a 6-minute run from boot into the world, and the flicker looked the same as with the guard on. - The switch was read: `texture.rs` takes it at line 650 in this tree. The texture refresh cost in the world rose from ~16 to ~42 ms/frame with it off, so the guard really was off. - The startup screens ran at a steady 30 fps (33.3 ms) both ways. So what's seen is stale or repeated content, not frame-time stutter. - Other switches: `VICTORY_LATE_WAIT=3 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024`. One of these may bring back what the guard used to cause, but I haven't checked which. So on this tree something else causes it, or something as well as the guard. The original report bisected on `4e17478`. The README's other explanation ("stale vertex data on alternate frames") may be what is left. A rerun of the same bisection on a current tree would show it. AI-assisted (Claude Code). No game data or screenshots attached.
Author
Owner

@⁠Fush911 on GitHub · 2026-11-25 03:01 UTC · original

set VICTORY_TEXTURE_GUARD=0 works, checked 11/25/2026

**@⁠Fush911** on GitHub · 2026-11-25 03:01 UTC · [original](https://github.com/fxceless/victory-fork/issues/269#issuecomment-7151522543) set VICTORY_TEXTURE_GUARD=0 works, checked 11/25/2026
Author
Owner

@⁠tikD1337 on GitHub · 2026-11-25 15:01 UTC · original

Data point on current main (a253706), NVIDIA RTX 4070 Ti SUPER (driver 621.01), Windows 11: the startup screens and the opening video no longer flicker with the default settings, without VICTORY_TEXTURE_GUARD=0. The fix from 8dd30ab ("a write through one view of a page is seen at its other views") seems to cover it here.

For anyone still running with VICTORY_TEXTURE_GUARD=0: on this machine, on an older commit, it cost 1.5–8 s per frame of texture hashing in the world. It may be worth dropping it after updating.

**@⁠tikD1337** on GitHub · 2026-11-25 15:01 UTC · [original](https://github.com/fxceless/victory-fork/issues/269#issuecomment-7166174450) Data point on current `main` (`a253706`), NVIDIA RTX 4070 Ti SUPER (driver 621.01), Windows 11: the startup screens and the opening video no longer flicker with the default settings, without `VICTORY_TEXTURE_GUARD=0`. The fix from 8dd30ab ("a write through one view of a page is seen at its other views") seems to cover it here. For anyone still running with `VICTORY_TEXTURE_GUARD=0`: on this machine, on an older commit, it cost 1.5–8 s per frame of texture hashing in the world. It may be worth dropping it after updating.
Author
Owner

@⁠superboynick on GitHub · 2026-11-25 19:01 UTC · original

Independent confirmation on current main (␀b0074e), plus a separate residual finding.

Flicker looks gone here too. RTX 5070 Ti Laptop + iGPU, Windows 11, complete archive set, no switches. Sampling the backbuffer every 0.5 s through the startup screens and the prologue, consecutive frames are pixel-identical where nothing is supposed to move:

80.0 s mean luminance 29.4 diff vs previous - 80.5 s mean luminance 29.3 diff 0.2 81.0 s mean luminance 29.3 diff 0 82.5 s mean luminance 6.0 diff 0

A stale-texture symptom would show up as alternating frames with different content. I do not see that, which is consistent with the fix from 8dd30ab being in place.

What is still there is hitching, not flicker. Recording the interval of every present over 1500 presents (72.8 s, keys pressed to enter the prologue):

p50 33.4 ms p95 105.4 ms p99 370.8 ms worst 3527 ms stalls over 100 ms: 77

Steady screens hold the 30 fps cap tightly (p50 33.3 ms, p99 34.2 ms over 1500 presents when sitting in the menus), so the long stalls are concentrated where content streams in.

One candidate for the worst of them. The 1.3 s stall at 58.6 s lines up with this line in the same log:

host pipeline library saved bytes=490022754 early=2282 made=1 loaded=...

A ~490 MB library write on the present thread would look exactly like that. I have not proven the link - the log does not timestamp the write's duration, only its size - but if the save is synchronous it is worth moving off the present thread or deferring to exit.

The interval recording is in #1087 if anyone wants the same numbers on their machine.

**@⁠superboynick** on GitHub · 2026-11-25 19:01 UTC · [original](https://github.com/fxceless/victory-fork/issues/269#issuecomment-7171713773) Independent confirmation on current main (␀b0074e), plus a separate residual finding. **Flicker looks gone here too.** RTX 5070 Ti Laptop + iGPU, Windows 11, complete archive set, no switches. Sampling the backbuffer every 0.5 s through the startup screens and the prologue, consecutive frames are pixel-identical where nothing is supposed to move: ` 80.0 s mean luminance 29.4 diff vs previous - 80.5 s mean luminance 29.3 diff 0.2 81.0 s mean luminance 29.3 diff 0 82.5 s mean luminance 6.0 diff 0 ` A stale-texture symptom would show up as alternating frames with different content. I do not see that, which is consistent with the fix from 8dd30ab being in place. **What is still there is hitching, not flicker.** Recording the interval of every present over 1500 presents (72.8 s, keys pressed to enter the prologue): ` p50 33.4 ms p95 105.4 ms p99 370.8 ms worst 3527 ms stalls over 100 ms: 77 ` Steady screens hold the 30 fps cap tightly (p50 33.3 ms, p99 34.2 ms over 1500 presents when sitting in the menus), so the long stalls are concentrated where content streams in. **One candidate for the worst of them.** The 1.3 s stall at 58.6 s lines up with this line in the same log: ` host pipeline library saved bytes=490022754 early=2282 made=1 loaded=... ` A ~490 MB library write on the present thread would look exactly like that. I have not proven the link - the log does not timestamp the write's duration, only its size - but if the save is synchronous it is worth moving off the present thread or deferring to exit. The interval recording is in #1087 if anyone wants the same numbers on their machine.
Author
Owner

@⁠superboynick on GitHub · 2026-11-25 19:28 UTC · original

Follow-up on the hitching half of my previous comment, with attribution.

I added a switch that prints what a long frame was doing. Over 120 s of the prologue, 91 presents exceeded 100 ms, and 81 of them carried a non-zero texture upload count. The worst frame - 1472 ms - carried 1159 texture uploads with zero shaders translated:

Present stall interval_ms=1471.9 pipelines_created=0 shaders_translated=0 texture_uploads=1159 Present stall interval_ms=399.2 pipelines_created=0 shaders_translated=34 texture_uploads=19

Shader translation shows up in a handful of stalls, not most of them. So the upload path is the better suspect than compilation - with the caveat that these are counters accumulated during the frame, which is a correlation, not a cause.

I also tested the pipeline-library theory from my previous message and it did not hold: forcing saves to happen only at exit made things slightly worse (p95 288 to 370 ms, worst 3.6 to 5.7 s across two 120 s runs), so the 490 MB write is not what produces these stalls.

Both switches are in #1087. Happy to try a specific upload-path change if you have one in mind; otherwise this is the data I can contribute.

**@⁠superboynick** on GitHub · 2026-11-25 19:28 UTC · [original](https://github.com/fxceless/victory-fork/issues/269#issuecomment-7172355526) Follow-up on the hitching half of my previous comment, with attribution. I added a switch that prints what a long frame was doing. Over 120 s of the prologue, 91 presents exceeded 100 ms, and 81 of them carried a non-zero texture upload count. The worst frame - 1472 ms - carried 1159 texture uploads with zero shaders translated: ` Present stall interval_ms=1471.9 pipelines_created=0 shaders_translated=0 texture_uploads=1159 Present stall interval_ms=399.2 pipelines_created=0 shaders_translated=34 texture_uploads=19 ` Shader translation shows up in a handful of stalls, not most of them. So the upload path is the better suspect than compilation - with the caveat that these are counters accumulated during the frame, which is a correlation, not a cause. I also tested the pipeline-library theory from my previous message and it did not hold: forcing saves to happen only at exit made things slightly worse (p95 288 to 370 ms, worst 3.6 to 5.7 s across two 120 s runs), so the 490 MB write is not what produces these stalls. Both switches are in #1087. Happy to try a specific upload-path change if you have one in mind; otherwise this is the data I can contribute.
Author
Owner

@⁠superboynick on GitHub · 2026-11-25 19:49 UTC · original

Cross-machine result that narrows where this comes from: the same build and the same key sequence on a desktop is clean, while the laptop is not.

RTX 5070 Ti laptop RTX 3080 Ti desktop (iGPU + dGPU, hybrid) (discrete only) frames / window 1500 / ~72 s 3600 / ~122 s p50 33.3 ms 33.3 ms p95 105-377 ms 33.7 ms p99 371-932 ms 34.0 ms worst 2784-5706 ms 970 ms presents over 100 ms 77-156 3 texture uploads 81 of 91 stalls carried it not seen

Same binary, same archive set, same switches, same inputs. The steady state is identical on both - 33.3 ms, the 30 fps cap - so this is not about how heavy the content is. It is about the machine.

What differs here is the laptop's hybrid path (frame produced on the dGPU, composed on the iGPU, single xHCI shared with storage) and its storage and CPU class. Given the upload correlation only shows up on the machine that stalls, I would now look at the upload path on that machine: whether the staging writes cross the PCIe link twice in hybrid mode, and whether the CPU remap/alloc that the earlier analysis suspected is bounded by something machine-specific.

Two things I can rule out from the same runs: it is not the pipeline library write (forcing saves to exit made the laptop slightly worse, and the desktop barely touched it), and it is not shader translation (present in a handful of stalls, absent in most).

If it helps, both machines can run this measurement in two minutes with the switches in #1087.

**@⁠superboynick** on GitHub · 2026-11-25 19:49 UTC · [original](https://github.com/fxceless/victory-fork/issues/269#issuecomment-7172816177) Cross-machine result that narrows where this comes from: the same build and the same key sequence on a desktop is clean, while the laptop is not. ` RTX 5070 Ti laptop RTX 3080 Ti desktop (iGPU + dGPU, hybrid) (discrete only) frames / window 1500 / ~72 s 3600 / ~122 s p50 33.3 ms 33.3 ms p95 105-377 ms 33.7 ms p99 371-932 ms 34.0 ms worst 2784-5706 ms 970 ms presents over 100 ms 77-156 3 texture uploads 81 of 91 stalls carried it not seen ` Same binary, same archive set, same switches, same inputs. The steady state is identical on both - 33.3 ms, the 30 fps cap - so this is not about how heavy the content is. It is about the machine. What differs here is the laptop's hybrid path (frame produced on the dGPU, composed on the iGPU, single xHCI shared with storage) and its storage and CPU class. Given the upload correlation only shows up on the machine that stalls, I would now look at the upload path *on that machine*: whether the staging writes cross the PCIe link twice in hybrid mode, and whether the CPU remap/alloc that the earlier analysis suspected is bounded by something machine-specific. Two things I can rule out from the same runs: it is not the pipeline library write (forcing saves to exit made the laptop slightly worse, and the desktop barely touched it), and it is not shader translation (present in a handful of stalls, absent in most). If it helps, both machines can run this measurement in two minutes with the switches in #1087.
Author
Owner

@⁠superboynick on GitHub · 2026-11-25 19:53 UTC · original

Two more laptop runs, this time flipping the adapter preference so the title is produced on the integrated GPU and then on the discrete one. Both stall.

adapter preference p95 p99 worst stalls >100 ms with uploads power saving (iGPU) 44.2 ms 228.4 ms 2168 ms 82 74 high performance (dGPU) 34.0 ms 37.7 ms 1217 ms 74 65

So producing frames on the integrated adapter does not remove the stalls, and producing them on the discrete one does not either. That weakens the "hybrid composition" guess I made in my previous message.

I should also flag the noise: repeated runs on this laptop land anywhere between 74 and 156 stalls over a similar window, and p99 between 38 and 932 ms, depending on how quickly the run reaches the same point. The stable signal across runs is the gap to the desktop machine, which sat at 3 stalls over a longer window, not the exact laptop numbers.

Uploads accompany roughly 90% of stalls in every laptop run, so that correlation survives the noise. What does not survive is any claim that switching adapters or the present effect changes it.

**@⁠superboynick** on GitHub · 2026-11-25 19:53 UTC · [original](https://github.com/fxceless/victory-fork/issues/269#issuecomment-7172915340) Two more laptop runs, this time flipping the adapter preference so the title is produced on the integrated GPU and then on the discrete one. Both stall. ` adapter preference p95 p99 worst stalls >100 ms with uploads power saving (iGPU) 44.2 ms 228.4 ms 2168 ms 82 74 high performance (dGPU) 34.0 ms 37.7 ms 1217 ms 74 65 ` So producing frames on the integrated adapter does not remove the stalls, and producing them on the discrete one does not either. That weakens the "hybrid composition" guess I made in my previous message. I should also flag the noise: repeated runs on this laptop land anywhere between 74 and 156 stalls over a similar window, and p99 between 38 and 932 ms, depending on how quickly the run reaches the same point. The stable signal across runs is the gap to the desktop machine, which sat at 3 stalls over a longer window, not the exact laptop numbers. Uploads accompany roughly 90% of stalls in every laptop run, so that correlation survives the noise. What does not survive is any claim that switching adapters or the present effect changes it.
Author
Owner

@⁠superboynick on GitHub · 2026-11-25 20:19 UTC · original

For anyone following this thread and wanting the same numbers on their own machine, I wrote up the measurements behind my comments here - in #1119, a docs-only change:

  • interval recording and windowed summaries, so two runs with different pacing can be compared
  • per-stall attribution (pipelines, shaders, uploads), and the two explanations I tested and had to drop: pipeline-library writes and upload batching
  • the caution that a dark title card reads 31-35 by design, so luminance alone is not a finding

It also covers the other switches that came out of this work: tracing which file the title is probing when a startup int3 fires, paired colour and depth captures for the geometry-versus-colour split, and the audio submission trace.

Written as observation rather than API documentation, so it stays readable if the switches get renamed.

**@⁠superboynick** on GitHub · 2026-11-25 20:19 UTC · [original](https://github.com/fxceless/victory-fork/issues/269#issuecomment-7173506295) For anyone following this thread and wanting the same numbers on their own machine, I wrote up the measurements behind my comments here - in #1119, a docs-only change: - interval recording and windowed summaries, so two runs with different pacing can be compared - per-stall attribution (pipelines, shaders, uploads), and the two explanations I tested and had to drop: pipeline-library writes and upload batching - the caution that a dark title card reads 31-35 by design, so luminance alone is not a finding It also covers the other switches that came out of this work: tracing which file the title is probing when a startup int3 fires, paired colour and depth captures for the geometry-versus-colour split, and the audio submission trace. Written as observation rather than API documentation, so it stays readable if the switches get renamed.
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/fxceless--victory-fork#269
No description provided.