Textures: a prelude upload checks again at submission that the host has not written the texture (confetti faces) #33

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

@⁠Ahyildiz on GitHub · 2026-11-27 11:40 UTC · original
Ahyildiz:fix/prelude-host-written → main · +40 −1 · 1 files · 1 commits · open

What it fixes

In the diner cutscene the bartender's face is drawn as coloured specks (or once as a blue face with lines) for the
whole scene, in about half the runs (Series S, DLSS off, RTX 5080). Everything else on her is right. It looks like the
"coloured specks all over the waitress's face" that draw.rs already describes for run n01.

Cause

With VICTORY_PRELUDE_UPLOADS=1, upload_from checks host_written when the list is recorded, but the upload itself
is decided at submission in PreludeUpload::finish_refresh, and that check isn't repeated there. With lists recorded on
several threads (VICTORY_THIN), a list that samples a texture can be recorded just before the list whose copy writes
that texture, and then be submitted after it. Here the writing list is the title's decoration bake, which copies a
character's baked skin into a 1024x1024 BC3 texture.

The prelude then copies the title's memory over what the host wrote. The title never fills that memory (on the console
the GPU copy did), so it holds whatever was there before. After that, no list uploads a host-written texture again, so
the wrong contents stay.

Change

finish_refresh now leaves the upload out when the texture is host-written. It logs a warning with the texture's size
and format for the first eight and then at powers of two. VICTORY_PRELUDE_RECHECK=0 gives the old behaviour.

How it was checked

  • Unattended runs (VICTORY_KEYS), the launcher's settings, VICTORY_CAPTURE_FRAMES every 100 frames through the diner.
  • Before: broken in about 5 of 10 runs. The stock build was clean in 4 runs, which still fits a timing race.
  • After: clean in 5 of 5 runs, about 20 frames showing her. The new check fired about 10 times per run, including on
    1024x1024 textures of format 78.
  • Frame rate unchanged: 24–25 fps in that scene.
  • Rebased on current main (959dcaf) and checked again: clean in the valid runs. The check fired 9–10 times per
    run, with 0 errors logged, at 25.6–27.5 fps. One run shared the machine with a shader warm-up and doesn't count for
    speed.
  • Also tried with #30 on top: clean in 2 of 2 runs. One of those runs showed a character's grey hoodie much darker
    than usual, which I haven't seen in any run without #30. Two runs aren't enough to blame it on #30. I'm mentioning
    it in case it helps whoever reviews #30.
  • cargo clippy -p victory-gpu --all-targets gives the same warnings as main and adds none. Workspace tests not run.

🤖 Generated with Claude Code

**@⁠Ahyildiz** on GitHub · 2026-11-27 11:40 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/33) `Ahyildiz:fix/prelude-host-written` → `main` · +40 −1 · 1 files · 1 commits · open ## What it fixes In the diner cutscene the **bartender's face is drawn as coloured specks** (or once as a blue face with lines) for the whole scene, in about half the runs (Series S, DLSS off, RTX 5080). Everything else on her is right. It looks like the "coloured specks all over the waitress's face" that `draw.rs` already describes for run n01. ## Cause With `VICTORY_PRELUDE_UPLOADS=1`, `upload_from` checks `host_written` when the list is recorded, but the upload itself is decided at submission in `PreludeUpload::finish_refresh`, and that check isn't repeated there. With lists recorded on several threads (`VICTORY_THIN`), a list that samples a texture can be recorded just before the list whose copy writes that texture, and then be submitted after it. Here the writing list is the title's decoration bake, which copies a character's baked skin into a 1024x1024 BC3 texture. The prelude then copies the title's memory over what the host wrote. The title never fills that memory (on the console the GPU copy did), so it holds whatever was there before. After that, no list uploads a host-written texture again, so the wrong contents stay. ## Change `finish_refresh` now leaves the upload out when the texture is host-written. It logs a warning with the texture's size and format for the first eight and then at powers of two. `VICTORY_PRELUDE_RECHECK=0` gives the old behaviour. ## How it was checked - Unattended runs (`VICTORY_KEYS`), the launcher's settings, `VICTORY_CAPTURE_FRAMES` every 100 frames through the diner. - **Before:** broken in about 5 of 10 runs. The stock build was clean in 4 runs, which still fits a timing race. - **After:** clean in 5 of 5 runs, about 20 frames showing her. The new check fired about 10 times per run, including on 1024x1024 textures of format 78. - Frame rate unchanged: 24–25 fps in that scene. - **Rebased on current `main` (959dcaf) and checked again:** clean in the valid runs. The check fired 9–10 times per run, with 0 errors logged, at 25.6–27.5 fps. One run shared the machine with a shader warm-up and doesn't count for speed. - **Also tried with #30 on top:** clean in 2 of 2 runs. One of those runs showed a character's grey hoodie much darker than usual, which I haven't seen in any run without #30. Two runs aren't enough to blame it on #30. I'm mentioning it in case it helps whoever reviews #30. - `cargo clippy -p victory-gpu --all-targets` gives the same warnings as `main` and adds none. Workspace tests not run. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
With VICTORY_PRELUDE_UPLOADS=1, upload_from checks host_written when a list
is recorded, and the upload itself is decided at submission
(PreludeUpload::finish_refresh), which did not check again. With lists
recorded on several threads (VICTORY_THIN), a list that samples a texture can
be recorded just before the list whose copy writes it (the title's decoration
bake copying a character's baked skin into a 1024x1024 BC3 texture) and be
submitted after it. Its prelude then copied the title's memory, which the
title never filled (the console's GPU copy did), over the host's contents,
and nothing uploads a host-written texture again, so it stayed: the diner
bartender's face as coloured specks, or blue with lines, for the whole scene
in about half the runs.

finish_refresh now leaves the upload out when the texture is host-written,
with a warning (first eight, then powers of two) naming its size and format.
VICTORY_PRELUDE_RECHECK=0 restores the old behaviour.

Checked with VICTORY_CAPTURE_FRAMES every 100 frames through the diner
(Series S, DLSS off, RTX 5080): broken in about 5 of 10 runs before; clean
in 5 of 5 runs after, where the check fired ~10 times per run (including
1024x1024 format 78 textures). Frame rate unchanged (24-25 fps there).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 11:58:33 +00:00
Author
Owner

@⁠CaitoV4 on GitHub · 2026-11-27 18:06 UTC · original

I'm testing VIctory-NVIDIA with an RTX 5070 and a Ryzen 7 7800X3D.

I'm also experiencing texture-related graphical issues during gameplay.

Some textures do not appear to load or render correctly. Certain surfaces look visually broken or have incorrect appearance, affecting the visual quality of the game.

Performance and Frame Generation have improved significantly in the latest build, but texture rendering issues are still present.

Are these texture issues already known? Is there any diagnostic information or testing procedure that could help identify the cause?

I'm happy to provide screenshots, logs, and additional testing results.

Thanks for your work on this project!

**@⁠CaitoV4** on GitHub · 2026-11-27 18:06 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/33#issuecomment-7225140212) I'm testing VIctory-NVIDIA with an RTX 5070 and a Ryzen 7 7800X3D. I'm also experiencing texture-related graphical issues during gameplay. Some textures do not appear to load or render correctly. Certain surfaces look visually broken or have incorrect appearance, affecting the visual quality of the game. Performance and Frame Generation have improved significantly in the latest build, but texture rendering issues are still present. Are these texture issues already known? Is there any diagnostic information or testing procedure that could help identify the cause? I'm happy to provide screenshots, logs, and additional testing results. Thanks for your work on this project!
Author
Owner

@⁠dcastell1 on GitHub · 2026-11-27 18:42 UTC · original

Testing note & fix for black NPC faces caused by same-list self-cancellation

While testing this PR on Windows 11 (i9-12900K, 64 GB RAM, RTX 5090 32 GB, driver 621.40, Series X profile, --res 4k --dlss quality), we ran into a subtle interaction with CopyTextureRegion in crates/victory-gpu/src/list.rs that turns some NPC faces pitch black ((0, 0, 0)):

  1. In list.rs (CopyTextureRegion, around lines 1195–1215), when a partial copy writes onto a staged title-written texture dst (e.g. a small patch onto a character's BC1/BC3_SRGB/BC7_SRGB skin texture), line 1204 calls crate::texture::upload(list, dst.resource, to) first so the base texture is uploaded before the copy overwrites part of it. With VICTORY_PRELUDE_UPLOADS=1, that queues a PreludeUpload on that same list.
  2. Eleven lines later in the same CopyTextureRegion call (line 1215), crate::texture::host_written(dst.resource) inserts dst.resource into HOST_WRITTEN at recording time.
  3. When list itself is submitted, PreludeUpload::finish_refresh() checks is_host_written(self.resource), sees true (set by list itself 11 lines later during recording!), and cancels list's own prelude upload (WARN prelude upload left out: n=1..128, formats 71, 78, 99), leaving the uncopied texels of the fresh DEFAULT texture at zero (black face on the prison intake officer, while eyes/lips/hair render normally).

Fix: Separate recording-time HOST_WRITTEN from submission-time HOST_WRITTEN_SUBMITTED:

  • Record list.defer_host_written(dst as usize) on HostList during CopyResource / CopyTextureRegion / ResolveSubresource (mark_host_written_submitted immediately only for external::output_written).
  • In Host::submit, commit list.commit_host_written() into HOST_WRITTEN_SUBMITTED immediately after let uploads = list.prelude_uploads(&mut batch); (and clear on forget()).
  • Check HOST_WRITTEN_SUBMITTED in PreludeUpload::finish_refresh().

That way a list's own CopyTextureRegion never cancels the base-texture prelude upload queued in front of it, while any out-of-order sampling list submitted after the bake list still skips overwriting the GPU-written texture.

(Note: Made with AI assistance and reviewed, built, and tested by a human.)

**@⁠dcastell1** on GitHub · 2026-11-27 18:42 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/33#issuecomment-7225774605) ### Testing note & fix for black NPC faces caused by same-list self-cancellation While testing this PR on Windows 11 (i9-12900K, 64 GB RAM, RTX 5090 32 GB, driver 621.40, Series X profile, `--res 4k --dlss quality`), we ran into a subtle interaction with `CopyTextureRegion` in `crates/victory-gpu/src/list.rs` that turns some NPC faces pitch black (`(0, 0, 0)`): 1. In `list.rs` (`CopyTextureRegion`, around lines 1195–1215), when a partial copy writes onto a staged title-written texture `dst` (e.g. a small patch onto a character's `BC1`/`BC3_SRGB`/`BC7_SRGB` skin texture), line 1204 calls `crate::texture::upload(list, dst.resource, to)` first so the base texture is uploaded before the copy overwrites part of it. With `VICTORY_PRELUDE_UPLOADS=1`, that queues a `PreludeUpload` on **that same `list`**. 2. Eleven lines later in the **same** `CopyTextureRegion` call (line 1215), `crate::texture::host_written(dst.resource)` inserts `dst.resource` into `HOST_WRITTEN` at **recording time**. 3. When `list` itself is submitted, `PreludeUpload::finish_refresh()` checks `is_host_written(self.resource)`, sees `true` (set by `list` itself 11 lines later during recording!), and cancels `list`'s own prelude upload (`WARN prelude upload left out: n=1..128`, formats `71`, `78`, `99`), leaving the uncopied texels of the fresh `DEFAULT` texture at zero (black face on the prison intake officer, while eyes/lips/hair render normally). **Fix:** Separate recording-time `HOST_WRITTEN` from submission-time `HOST_WRITTEN_SUBMITTED`: - Record `list.defer_host_written(dst as usize)` on `HostList` during `CopyResource` / `CopyTextureRegion` / `ResolveSubresource` (`mark_host_written_submitted` immediately only for `external::output_written`). - In `Host::submit`, commit `list.commit_host_written()` into `HOST_WRITTEN_SUBMITTED` **immediately after** `let uploads = list.prelude_uploads(&mut batch);` (and clear on `forget()`). - Check `HOST_WRITTEN_SUBMITTED` in `PreludeUpload::finish_refresh()`. That way a list's own `CopyTextureRegion` never cancels the base-texture prelude upload queued in front of it, while any out-of-order sampling list submitted *after* the bake list still skips overwriting the GPU-written texture. *(Note: Made with AI assistance and reviewed, built, and tested by a human.)*
Author
Owner

@⁠bentsignal on GitHub · 2026-11-27 21:41 UTC · original

Confirmed on an RTX 5070 Ti (Series X, 1440p, DLSS Quality, launcher defaults with VICTORY_PRELUDE_UPLOADS=1 and VICTORY_THIN=1): the coloured specks on the waitress's face, and later on other characters' skin in the prison, showed up in play. With this branch merged, the new check fired at least 5 times in the first 100 s of the cutscene (2048x2048 format 78, 64x128 format 28, 5808x5808 format 71, 256x256 format 78). Merged in our fork; thanks.

**@⁠bentsignal** on GitHub · 2026-11-27 21:41 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/33#issuecomment-7228668885) Confirmed on an RTX 5070 Ti (Series X, 1440p, DLSS Quality, launcher defaults with VICTORY_PRELUDE_UPLOADS=1 and VICTORY_THIN=1): the coloured specks on the waitress's face, and later on other characters' skin in the prison, showed up in play. With this branch merged, the new check fired at least 5 times in the first 100 s of the cutscene (2048x2048 format 78, 64x128 format 28, 5808x5808 format 71, 256x256 format 78). Merged in our fork; thanks.
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/33/head:github-bot/gh-33'
git switch 'github-bot/gh-33'

Merge

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