Textures flash black on a small PC: 98,064 slots "found unmapped and made null" in one 13-minute run. Is keeping the last view (with a grace period) wanted? #1284

Open
opened 2026-11-26 11:19:47 +00:00 by github-bot · 1 comment
Owner

@⁠FluffyCyanNova on GitHub · 2026-11-26 10:11 UTC · original

Machine: RTX 3060 12 GB, Core i3-12100F (4 cores), 32 GB RAM, game on an HDD, Series S profile (--console series-s), 1280x720. Fork 9376fd60 + our ports, 13.4 min in the world.

Symptom: surfaces such as door and window frames show their texture, go black, then come back. Faces are black in some frames. It is the same family as the black faces reported in fork #1211 and #1246.

What the log says (one run):

  • 98,064 texture slots "found unmapped and made null" (up to 1,464 in a single stats line).
  • 5,357 of 10,810 indexed-texture slots waiting for their memory; the oldest has waited 4,212 frames.
  • 224 "a texture picked by index changed after its upload with nothing to tell of it" warnings.
  • On an HDD the title's streaming is slow, so a slot spends many frames without memory.

Where it comes from (our reading of the code): in draw.rs, when a texture picked by index has no mapped memory, texture_slot_gone ("Streamed out") hands the slot to descriptor/host.rs, which makes the slot's view null so that let_go_idle can free the host copy. The sampler then reads a zero texture until the title maps the memory again (black in the colour G-buffer; normals stay fine). Nothing keeps the last good view.

What we tried / plan: a local, off-by-default switch VICTORY_KEEP_GONE=1 that keeps the slot's last view while its memory is away, about 25 lines. Our next run (the same scene, one change) will measure the count of made-null slots, the black frames and VRAM use. We will post the result here. We have not run it yet, so we have no evidence that it helps.

What we found already exists, none of which does this: fork #1246 (looked-at and fresh slots in turns), #1031 and #1210 (resident mips), #1097 (placeholder fast path), upstream #2597/#2598 (a different path: giving up a texture nulls the dynamic slots of earlier lists).

Questions

  1. Is keeping the last view on "streamed out" something the fork wants (grace period, then null when over the VRAM budget)? Or is the null view intended?
  2. Does anyone see the same black flicker with a low "made null" count? That would mean a different cause.
  3. If a switch like this is acceptable, which behaviour would you prefer when VRAM is full: drop the view anyway, or keep it for N frames?
**@⁠FluffyCyanNova** on GitHub · 2026-11-26 10:11 UTC · [original](https://github.com/fxceless/victory-fork/issues/1284) **Machine:** RTX 3060 12 GB, Core i3-12100F (4 cores), 32 GB RAM, game on an HDD, Series S profile (`--console series-s`), 1280x720. Fork 9376fd60 + our ports, 13.4 min in the world. **Symptom:** surfaces such as door and window frames show their texture, go black, then come back. Faces are black in some frames. It is the same family as the black faces reported in fork #1211 and #1246. **What the log says (one run):** - 98,064 texture slots "found unmapped and made null" (up to 1,464 in a single stats line). - 5,357 of 10,810 indexed-texture slots waiting for their memory; the oldest has waited 4,212 frames. - 224 "a texture picked by index changed after its upload with nothing to tell of it" warnings. - On an HDD the title's streaming is slow, so a slot spends many frames without memory. **Where it comes from (our reading of the code):** in `draw.rs`, when a texture picked by index has no mapped memory, `texture_slot_gone` ("Streamed out") hands the slot to `descriptor/host.rs`, which makes the slot's view null so that `let_go_idle` can free the host copy. The sampler then reads a zero texture until the title maps the memory again (black in the colour G-buffer; normals stay fine). Nothing keeps the last good view. **What we tried / plan:** a local, off-by-default switch `VICTORY_KEEP_GONE=1` that keeps the slot's last view while its memory is away, about 25 lines. Our next run (the same scene, one change) will measure the count of made-null slots, the black frames and VRAM use. We will post the result here. We have not run it yet, so we have no evidence that it helps. **What we found already exists, none of which does this:** fork #1246 (looked-at and fresh slots in turns), #1031 and #1210 (resident mips), #1097 (placeholder fast path), upstream #2597/#2598 (a different path: giving up a texture nulls the dynamic slots of earlier lists). **Questions** 1. Is keeping the last view on "streamed out" something the fork wants (grace period, then null when over the VRAM budget)? Or is the null view intended? 2. Does anyone see the same black flicker with a low "made null" count? That would mean a different cause. 3. If a switch like this is acceptable, which behaviour would you prefer when VRAM is full: drop the view anyway, or keep it for N frames?
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:19:47 +00:00
Author
Owner

@⁠HLVM04 on GitHub · 2026-11-26 10:27 UTC · original

For Q2: we found two other paths that give the same G-buffer picture (colour black, normals fine). Both are on an RTX 5070 Ti, Series S profile, fork main plus open PRs. Both fixes are local changes of ours, not PRs.

  1. A no-wait refresh on a partly mapped texture. With VICTORY_TEXTURE_NO_WAIT=1, a refresh that lands while the title remaps the texture's pages reads title memory through the kernel. For a partly mapped texture that read fails, so the staging buffer stays empty. A texture picked by index gets no later refresh, so its host copy is uploaded as all zeros and stays that way. The hero's skin colour and normal textures (BC7 sRGB / BC5) hit this. Our fallback reads through the partly-mapped copy path instead when the kernel read fails on a never-filled staging buffer. With it the neck was lit in 4 of 4 runs, against 1 of 4 before. That was scored on the base-colour G-buffer target only (details in #923).
  2. Rule::Start in descriptor/host.rs. It treated any placed view written within 4 KiB of an older view's start as replacing it. The title packs tiny tint palettes (256 B to 4 KiB) a few hundred bytes apart, so each new palette view made its neighbours stale, and their host views went null for good. Capping the head block at the texture's own size lit the face in 2 of 2 runs. It did not fix every black part.

Both leave a texture black for good rather than flickering, so they fit "black and stays black" better than your "black, then comes back". We did not count "found unmapped and made null" slots in those runs, so we can't give the low-count comparison directly.

**@⁠HLVM04** on GitHub · 2026-11-26 10:27 UTC · [original](https://github.com/fxceless/victory-fork/issues/1284#issuecomment-7189393563) For Q2: we found two other paths that give the same G-buffer picture (colour black, normals fine). Both are on an RTX 5070 Ti, Series S profile, fork main plus open PRs. Both fixes are local changes of ours, not PRs. 1. **A no-wait refresh on a partly mapped texture.** With `VICTORY_TEXTURE_NO_WAIT=1`, a refresh that lands while the title remaps the texture's pages reads title memory through the kernel. For a partly mapped texture that read fails, so the staging buffer stays empty. A texture picked by index gets no later refresh, so its host copy is uploaded as all zeros and stays that way. The hero's skin colour and normal textures (BC7 sRGB / BC5) hit this. Our fallback reads through the partly-mapped copy path instead when the kernel read fails on a never-filled staging buffer. With it the neck was lit in 4 of 4 runs, against 1 of 4 before. That was scored on the base-colour G-buffer target only (details in #923). 2. **`Rule::Start` in `descriptor/host.rs`.** It treated any placed view written within 4 KiB of an older view's start as replacing it. The title packs tiny tint palettes (256 B to 4 KiB) a few hundred bytes apart, so each new palette view made its neighbours stale, and their host views went null for good. Capping the head block at the texture's own size lit the face in 2 of 2 runs. It did not fix every black part. Both leave a texture black for good rather than flickering, so they fit "black and stays black" better than your "black, then comes back". We did not count "found unmapped and made null" slots in those runs, so we can't give the low-count comparison directly.
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#1284
No description provided.