A list holds the host copy of a texture it reads when the staging was up to date (VICTORY_TEXTURE_HOLD_READS) #1218

Open
github-bot wants to merge 1 commit from github-bot/gh-1218 into main AGit
Owner

@⁠Steenax6 on GitHub · 2026-11-26 00:26 UTC · original
Steenax6:pr/texture-hold-reads → main · +12 −0 · 1 files · 1 commits · open

What

texture.rs upload returns early when a texture's staging is uploaded and not dirty. A list that uploads a texture holds its host copy through the transition it records; a list that takes the early return records nothing that holds it, although it reads the texture all the same (through a table copied as it is recorded). Between the recording and the moment the list runs, only the sweep's idle time keeps that host copy alive, and with VICTORY_ASYNC_SUBMIT a list is sent later than it is recorded. A host copy let go under a list not yet sent is a read of memory that is gone when the list runs.

The list now keeps the texture until it is reset (list.keep), 12 lines. VICTORY_TEXTURE_HOLD_READS=0: not held, as before.

Where it comes from

Steenax6/VIctory-NVID (a tree for an RTX 4070 Ti 12 GB, branched from this fork at f85101b) lost the device in the opening cutscene, 102 to 108 s after the start, in 3 of about 30 runs. The System event log (provider nvlddmkm, id 13) says "MMU Fault": a shader read an address that was not there.

Two things were closed there in one commit (0d45621):

  1. this one: a counter saw 570,000 texture reads in a run of 185 s that no list held;
  2. view slots of textures made level by level rewritten while lists in flight read them. That one only exists with reserved textures (VICTORY_LEVELS_ON_DEMAND=1 here, off by default), so it is not in this pull request; it comes with the one for textures made without their top levels.

Which of the two faulted is not known. After both: nine runs through the fault point, no loss, no driver event, frame times unchanged (first room 88 ms before and after).

What I can and cannot say for this tree

  • Compiled and linted on 4aa6e8c: cargo clippy --workspace --all-targets --locked and the same with --all-features give exactly the warnings main gives (11 there, none new). cargo test --workspace --locked: the tests of the modules touched pass; indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields fails here on main as well, and two WARP tests in watch.rs / inplace.rs failed once in a full run and pass when run by name (other builds were running on the machine).
  • Not run with the title on this base. The numbers above are from our tree, which differs from this one in host.rs, watch.rs and shadow.rs.
  • I do not claim this is the loss the README describes after 30 to 50 minutes. It is one way a list can read a released texture, and it is cheap to rule out: the switch gives the A/B.
  • Cost: one IUnknown kept per such read until the list is reset, about 3,000 a second in the cutscene. No change in frame time was measurable in our tree.

🤖 Generated with Claude Code

**@⁠Steenax6** on GitHub · 2026-11-26 00:26 UTC · [original](https://github.com/fxceless/victory-fork/pull/1218) `Steenax6:pr/texture-hold-reads` → `main` · +12 −0 · 1 files · 1 commits · open ## What `texture.rs` `upload` returns early when a texture's staging is uploaded and not dirty. A list that uploads a texture holds its host copy through the transition it records; a list that takes the early return records nothing that holds it, although it reads the texture all the same (through a table copied as it is recorded). Between the recording and the moment the list runs, only the sweep's idle time keeps that host copy alive, and with `VICTORY_ASYNC_SUBMIT` a list is sent later than it is recorded. A host copy let go under a list not yet sent is a read of memory that is gone when the list runs. The list now keeps the texture until it is reset (`list.keep`), 12 lines. `VICTORY_TEXTURE_HOLD_READS=0`: not held, as before. ## Where it comes from Steenax6/VIctory-NVID (a tree for an RTX 4070 Ti 12 GB, branched from this fork at f85101b) lost the device in the opening cutscene, 102 to 108 s after the start, in 3 of about 30 runs. The System event log (provider `nvlddmkm`, id 13) says "MMU Fault": a shader read an address that was not there. Two things were closed there in one commit ([0d45621](https://github.com/Steenax6/VIctory-NVID/commit/0d45621)): 1. this one: a counter saw 570,000 texture reads in a run of 185 s that no list held; 2. view slots of textures made level by level rewritten while lists in flight read them. That one only exists with reserved textures (`VICTORY_LEVELS_ON_DEMAND=1` here, off by default), so it is not in this pull request; it comes with the one for textures made without their top levels. Which of the two faulted is not known. After both: nine runs through the fault point, no loss, no driver event, frame times unchanged (first room 88 ms before and after). ## What I can and cannot say for this tree - Compiled and linted on 4aa6e8c: `cargo clippy --workspace --all-targets --locked` and the same with `--all-features` give exactly the warnings `main` gives (11 there, none new). `cargo test --workspace --locked`: the tests of the modules touched pass; `indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields` fails here on `main` as well, and two WARP tests in `watch.rs` / `inplace.rs` failed once in a full run and pass when run by name (other builds were running on the machine). - **Not run with the title on this base.** The numbers above are from our tree, which differs from this one in `host.rs`, `watch.rs` and `shadow.rs`. - I do not claim this is the loss the README describes after 30 to 50 minutes. It is one way a list can read a released texture, and it is cheap to rule out: the switch gives the A/B. - Cost: one `IUnknown` kept per such read until the list is reset, about 3,000 a second in the cutscene. No change in frame time was measurable in our tree. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
texture.rs `upload` returns early when a texture's staging is uploaded and
not dirty. A list that uploads a texture holds its host copy through the
transition it records; a list that takes the early return recorded nothing
that holds it, though it reads the texture all the same (through a table
copied as it is recorded). Nothing but the sweep's idle time then kept the
host copy alive between the recording and the moment the list runs, and
with VICTORY_ASYNC_SUBMIT a list is sent later than it is recorded. A host
copy released under a list not yet sent is a read of memory that is gone
when the list runs.

The list now keeps the texture until it is reset. VICTORY_TEXTURE_HOLD_READS=0:
not held, as before.

Where this comes from: Steenax6/VIctory-NVID lost the device in the opening
cutscene, 102 to 108 s after the start, in 3 of about 30 runs on an
RTX 4070 Ti (the System event log, nvlddmkm id 13: "MMU Fault"). Two things
were closed there in one commit (0d45621), this one and a rewrite of view
slots under lists in flight that only textures made level by level have;
which of the two faulted is not known. A counter there saw 570,000 reads a
run of 185 s that no list held. Nine runs through the fault point after it
without a loss, frame times unchanged.

On this base: compiled, linted and tested (clippy with and without
diagnostics, cargo test), not run with the title.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:59:44 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1218/head:github-bot/gh-1218'
git switch 'github-bot/gh-1218'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1218'
git switch 'github-bot/gh-1218'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1218'
git switch 'github-bot/gh-1218'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1218'
git switch 'main'
git merge --squash 'github-bot/gh-1218'
git switch 'main'
git merge --ff-only 'github-bot/gh-1218'
git switch 'main'
git merge 'github-bot/gh-1218'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.