Textures picked by index flash black: the sweep lets go of copies needed again moments later (75,053 let go, 19,054 made again in 600 s) #1080

Open
opened 2026-11-26 03:57:08 +00:00 by github-bot · 3 comments
Owner

@⁠tippythetaidum on GitHub · 2026-11-25 18:40 UTC · original

What is seen

Surfaces that were textured go black for a moment and come back: "normal to begin with, then it flickers black, then goes back to normal". Seen through the prison opening on an RTX 5080 16 GB (Series X profile), with VICTORY_LEVELS_ON_DEMAND=1 and #1031, after the textures that stayed black for good were fixed (#1031). It was also there before that change: the cell door was textured, then black, then textured again in saved frames of one run.

What the counters say

resource::let_go_idle lets go of a host copy of a texture the title fills when no list and no slot holds it and nothing has asked for it for vram_idle_ms and 4 frames. That's 5 s below 75 % of the card's budget, 2.5 s from 75 %, and 1 s from 85 %. In one 600-second release run, adding up the "since the line before" parts of the VICTORY_CARD_ACCOUNTING=1 lines:

  • 75,053 host copies let go and 19,054 made again, about 9 a frame at 5.6 fps;
  • the card had room (resource::room) in 89 of 92 lines, at 9.7 to 11.4 GB in use of a 13.0 to 15.2 GB budget, so mostly in the 2.5 s and 1 s steps;
  • for comparison, 1,416 slots were made null because the title unmapped their memory.

At these frame rates 2.5 s is 12 to 15 frames. A texture the camera turns away from for a moment loses its copy. When the title writes a slot with a view of it again, the slot has nothing to show until the copy is made and uploaded again; with VICTORY_HEAP_WORKER=1 the slot shows only once the upload is submitted. That window is the black flash, for textures picked by index. A texture read through a table is made and uploaded before the draw, so it doesn't flash.

What I'm trying

  1. A switch, to measure: VICTORY_TEXTURE_IDLE_MS sets the first step (5,000 unless set), and the two steps above it are a half and a fifth of it, never under a second. A run at 30,000 against the same run at the default, comparing "made again", the card's room and the flashes in saved frames.
  2. If longer times hold: let go by the budget rather than by a fixed time. Only while the card is over a line, and the copies idle longest first, so that with room to spare a copy stays until the room is needed.

I'll open a PR with the numbers from the A/B. If someone already works on the sweep, say so and I'll test that instead.

Setup

RTX 5080 16 GB, driver 621.14, Windows 11, Ryzen 7 9800X3D, Series X profile. Release build of main ca8829f with #24, #927, #823, #606, #1002, #907, #834, #1007, #1031 and #917. Switches: the frame-rate set, VICTORY_HEAP_WORKER=1, VICTORY_LEVELS_ON_DEMAND=1, VICTORY_CARD_ACCOUNTING=1.

AI-assisted (Claude Code, Claude Opus 5.5). Counts and descriptions only, nothing from the game attached.

**@⁠tippythetaidum** on GitHub · 2026-11-25 18:40 UTC · [original](https://github.com/fxceless/victory-fork/issues/1080) ## What is seen Surfaces that were textured go black for a moment and come back: "normal to begin with, then it flickers black, then goes back to normal". Seen through the prison opening on an RTX 5080 16 GB (Series X profile), with `VICTORY_LEVELS_ON_DEMAND=1` and #1031, after the textures that stayed black for good were fixed (#1031). It was also there before that change: the cell door was textured, then black, then textured again in saved frames of one run. ## What the counters say `resource::let_go_idle` lets go of a host copy of a texture the title fills when no list and no slot holds it and nothing has asked for it for `vram_idle_ms` and 4 frames. That's 5 s below 75 % of the card's budget, 2.5 s from 75 %, and 1 s from 85 %. In one 600-second release run, adding up the "since the line before" parts of the `VICTORY_CARD_ACCOUNTING=1` lines: - **75,053** host copies let go and **19,054** made again, about 9 a frame at 5.6 fps; - the card had room (`resource::room`) in 89 of 92 lines, at 9.7 to 11.4 GB in use of a 13.0 to 15.2 GB budget, so mostly in the 2.5 s and 1 s steps; - for comparison, **1,416** slots were made null because the title unmapped their memory. At these frame rates 2.5 s is 12 to 15 frames. A texture the camera turns away from for a moment loses its copy. When the title writes a slot with a view of it again, the slot has nothing to show until the copy is made and uploaded again; with `VICTORY_HEAP_WORKER=1` the slot shows only once the upload is submitted. That window is the black flash, for textures picked by index. A texture read through a table is made and uploaded before the draw, so it doesn't flash. ## What I'm trying 1. **A switch, to measure:** `VICTORY_TEXTURE_IDLE_MS` sets the first step (5,000 unless set), and the two steps above it are a half and a fifth of it, never under a second. A run at 30,000 against the same run at the default, comparing "made again", the card's room and the flashes in saved frames. 2. **If longer times hold:** let go by the budget rather than by a fixed time. Only while the card is over a line, and the copies idle longest first, so that with room to spare a copy stays until the room is needed. I'll open a PR with the numbers from the A/B. If someone already works on the sweep, say so and I'll test that instead. ## Setup RTX 5080 16 GB, driver 621.14, Windows 11, Ryzen 7 9800X3D, Series X profile. Release build of `main` `ca8829f` with #24, #927, #823, #606, #1002, #907, #834, #1007, #1031 and #917. Switches: the frame-rate set, `VICTORY_HEAP_WORKER=1`, `VICTORY_LEVELS_ON_DEMAND=1`, `VICTORY_CARD_ACCOUNTING=1`. AI-assisted (Claude Code, Claude Opus 5.5). Counts and descriptions only, nothing from the game attached.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:57:08 +00:00
Author
Owner

@⁠tippythetaidum on GitHub · 2026-11-25 19:32 UTC · original

Update after three more 600-second runs, same machine and settings, with VICTORY_LEVELS_ON_DEMAND=1 and #917 (totals of the VICTORY_CARD_ACCOUNTING=1 lines' "since the line before" parts):

run change let go made again
base none 137,594 36,255
R5 VICTORY_TEXTURE_IDLE_MS=30000 130,990 34,089
R6 the sweep measures idle time from when nothing held the copy (below) 130,784 34,746
R7 both 118,292 31,028

Two things came out of it:

  1. The idle time was measured from the wrong moment. let_go_idle compares the time since the copy was last asked for, but a slot that views a copy holds it without asking. When the title moved a texture to another slot, its copy had often been "idle" for minutes and went at the next sweep. The fix is a clock per texture that the first sweep finding the copy unheld starts, and one finding it held stops; a copy goes only when both times are past the idle time. The change is small and has a test. It is in my test build, but on its own it barely moved the totals (R6).
  2. Even with both, the totals fall by only 14 %. So most of these let-gos are of copies nothing held for more than 6 to 15 seconds, and "made again" counts revisits minutes later as well as the quick flashes. These counters don't separate the visible black flash from harmless churn.

The flashes are rarer in R7 by eye, but not gone. Next I'll catch one: save every frame for a short window, and log which slots show nothing in those frames and why (copy let go, upload not yet submitted, or memory unmapped). Then the fix can target the actual cause. I'll post the result here.

AI-assisted (Claude Code, Claude Opus 5.5). Counts and descriptions only, nothing from the game attached.

**@⁠tippythetaidum** on GitHub · 2026-11-25 19:32 UTC · [original](https://github.com/fxceless/victory-fork/issues/1080#issuecomment-7172448507) Update after three more 600-second runs, same machine and settings, with `VICTORY_LEVELS_ON_DEMAND=1` and #917 (totals of the `VICTORY_CARD_ACCOUNTING=1` lines' "since the line before" parts): | run | change | let go | made again | |---|---|---:|---:| | base | none | 137,594 | 36,255 | | R5 | `VICTORY_TEXTURE_IDLE_MS=30000` | 130,990 | 34,089 | | R6 | the sweep measures idle time from when nothing held the copy (below) | 130,784 | 34,746 | | R7 | both | 118,292 | 31,028 | Two things came out of it: 1. The idle time was measured from the wrong moment. `let_go_idle` compares the time since the copy was last *asked for*, but a slot that views a copy holds it without asking. When the title moved a texture to another slot, its copy had often been "idle" for minutes and went at the next sweep. The fix is a clock per texture that the first sweep finding the copy unheld starts, and one finding it held stops; a copy goes only when both times are past the idle time. The change is small and has a test. It is in my test build, but on its own it barely moved the totals (R6). 2. Even with both, the totals fall by only 14 %. So most of these let-gos are of copies nothing held for more than 6 to 15 seconds, and "made again" counts revisits minutes later as well as the quick flashes. These counters don't separate the visible black flash from harmless churn. The flashes are rarer in R7 by eye, but not gone. Next I'll catch one: save every frame for a short window, and log which slots show nothing in those frames and why (copy let go, upload not yet submitted, or memory unmapped). Then the fix can target the actual cause. I'll post the result here. AI-assisted (Claude Code, Claude Opus 5.5). Counts and descriptions only, nothing from the game attached.
Author
Owner

@⁠CuteBooty on GitHub · 2026-11-25 19:56 UTC · original

With VICTORY_ASYNC_SUBMIT=1, in town at 6,000-10,000 draws: the road surface there in one frame and gone in the next, stretched polygons for single frames, exposure jumping

Seen on an RTX 3070 8 GB in Series S during the drive at the end of the first mission, at 200-1,100 ms a frame;
not seen in light scenes (open water, 140 ms) with the same switches. In the same intervals the log shows about
1,200 indirect draws a frame dropped at recording and, in our tree, about 1,600 dynamic descriptor tables refused
for fragmentation, so part of the missing geometry may be ours. The stretched polygons look like vertex data read
after the title had moved on. I have phone video, no captures. Not yet tried with the submit thread off in the same
scene; I will add that.

Setup: RTX 3070 8 GB (driver 621.24, 32-lane waves), Ryzen 5 3600, 32 GB, Windows 11, Series S mode (PR #188), 1920x1080, a diagnostics build of a tree at main 310c6eb6 with a number of open PRs picked and ports of fork main's copy queue re-fetch and submit thread. Switches unless the comment says otherwise: VICTORY_QUEUE2=1 VICTORY_INDIRECT_WINDOW=1 VICTORY_ASYNC_SUBMIT=1 VICTORY_BAKE_TEXTURES_MS=0 VICTORY_TEXTURE_DROP_MIPS=1, plus wide card hashing (our tree's form of PRs #1014 / #997). One run per configuration.

**@⁠CuteBooty** on GitHub · 2026-11-25 19:56 UTC · [original](https://github.com/fxceless/victory-fork/issues/1080#issuecomment-7172970001) **With `VICTORY_ASYNC_SUBMIT=1`, in town at 6,000-10,000 draws: the road surface there in one frame and gone in the next, stretched polygons for single frames, exposure jumping** Seen on an RTX 3070 8 GB in Series S during the drive at the end of the first mission, at 200-1,100 ms a frame; not seen in light scenes (open water, 140 ms) with the same switches. In the same intervals the log shows about 1,200 indirect draws a frame dropped at recording and, in our tree, about 1,600 dynamic descriptor tables refused for fragmentation, so part of the missing geometry may be ours. The stretched polygons look like vertex data read after the title had moved on. I have phone video, no captures. Not yet tried with the submit thread off in the same scene; I will add that. Setup: RTX 3070 8 GB (driver 621.24, 32-lane waves), Ryzen 5 3600, 32 GB, Windows 11, Series S mode (PR #188), 1920x1080, a diagnostics build of a tree at main 310c6eb6 with a number of open PRs picked and ports of fork main's copy queue re-fetch and submit thread. Switches unless the comment says otherwise: `VICTORY_QUEUE2=1 VICTORY_INDIRECT_WINDOW=1 VICTORY_ASYNC_SUBMIT=1 VICTORY_BAKE_TEXTURES_MS=0 VICTORY_TEXTURE_DROP_MIPS=1`, plus wide card hashing (our tree's form of PRs #1014 / #997). One run per configuration.
Author
Owner

@⁠tippythetaidum on GitHub · 2026-11-25 20:06 UTC · original

Thanks, useful. VICTORY_ASYNC_SUBMIT=1 has been on in every run of mine, so here's how it looks from this side, to help separate the switch from the drops.

RTX 5080 16 GB (driver 621.14, 32-lane waves), Series X profile, release build, VICTORY_QUEUE2=1 VICTORY_INDIRECT_WINDOW=1 VICTORY_INDIRECT_GATHER=1 VICTORY_ASYNC_SUBMIT=1 VICTORY_LEVELS_ON_DEMAND=1. The last run was 600 s from the opening cutscene through the prison to the counselor scene and the flashback after it, up to 11,830 draws a frame (median 3,480):

  • Indirect draws dropped at recording: 0 in every frame-rate line of that run. Over the two runs before it, 36 and 310 in total.
  • Descriptor tables refused: none logged.
  • I haven't seen roads or other geometry vanish for a frame, stretched polygons or exposure jumps in these scenes. The flashes in this issue are textures going black and coming back, which the sweep counts above line up with.

So with the switch on and no indirect drops or refused tables, this card doesn't show the geometry flashes. That makes your ~1,200 dropped indirect draws and ~1,600 refused tables a likely part of it, though I haven't reached the town drive, so it isn't the same scene. I'll run the same route once with VICTORY_ASYNC_SUBMIT off and post whether the texture flashes change.

AI-assisted (Claude Code, Claude Opus 5.5): run logs, counts and this text.

**@⁠tippythetaidum** on GitHub · 2026-11-25 20:06 UTC · [original](https://github.com/fxceless/victory-fork/issues/1080#issuecomment-7173192007) Thanks, useful. `VICTORY_ASYNC_SUBMIT=1` has been on in every run of mine, so here's how it looks from this side, to help separate the switch from the drops. RTX 5080 16 GB (driver 621.14, 32-lane waves), Series X profile, release build, `VICTORY_QUEUE2=1 VICTORY_INDIRECT_WINDOW=1 VICTORY_INDIRECT_GATHER=1 VICTORY_ASYNC_SUBMIT=1 VICTORY_LEVELS_ON_DEMAND=1`. The last run was 600 s from the opening cutscene through the prison to the counselor scene and the flashback after it, up to 11,830 draws a frame (median 3,480): - Indirect draws dropped at recording: **0** in every frame-rate line of that run. Over the two runs before it, 36 and 310 in total. - Descriptor tables refused: none logged. - I haven't seen roads or other geometry vanish for a frame, stretched polygons or exposure jumps in these scenes. The flashes in this issue are textures going black and coming back, which the sweep counts above line up with. So with the switch on and no indirect drops or refused tables, this card doesn't show the geometry flashes. That makes your ~1,200 dropped indirect draws and ~1,600 refused tables a likely part of it, though I haven't reached the town drive, so it isn't the same scene. I'll run the same route once with `VICTORY_ASYNC_SUBMIT` off and post whether the texture flashes change. AI-assisted (Claude Code, Claude Opus 5.5): run logs, counts and this text.
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#1080
No description provided.