A texture that once received a GPU copy ignores later writes to its memory #758

Open
opened 2026-11-26 04:13:55 +00:00 by github-bot · 13 comments
Owner

@⁠Conrage on GitHub · 2026-11-24 09:38 UTC · original

crates/victory-gpu/src/texture.rs:109-113: once a texture is in HOST_WRITTEN, upload() always returns early. CopyResource, CopyTextureRegion and resolves add textures to that set (list.rs:454, 550, 634), and it is cleared only when the resource is dropped (resource.rs:976). If the title later writes that texture's memory (for example by streaming new mips), the host copy keeps the old contents.

Suggestion: record the write-watch point when the host copy happens. If the title's memory changes after that, detile it again.

AI use: found and written with Claude from reading the code at 8e79c80; not run on hardware.

**@⁠Conrage** on GitHub · 2026-11-24 09:38 UTC · [original](https://github.com/Marvisak/VIctory/issues/758) `crates/victory-gpu/src/texture.rs:109-113`: once a texture is in `HOST_WRITTEN`, `upload()` always returns early. `CopyResource`, `CopyTextureRegion` and resolves add textures to that set (`list.rs:454`, `550`, `634`), and it is cleared only when the resource is dropped (`resource.rs:976`). If the title later writes that texture's memory (for example by streaming new mips), the host copy keeps the old contents. **Suggestion:** record the write-watch point when the host copy happens. If the title's memory changes after that, detile it again. _AI use: found and written with Claude from reading the code at `8e79c80`; not run on hardware._
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:13:56 +00:00
Author
Owner

@⁠DrDarkDK on GitHub · 2026-11-24 09:51 UTC · original

Reproduced on 8e79c80 with a synthetic 64×1 RGBA8 texture on native Windows 11, using both an RTX 4070 Ti (driver 621.01) and WARP.

The initial title-memory upload read back correctly. After CopyResource, a second upload attempt with unchanged title memory correctly preserved the GPU-copied pixels. After writing new pixels to the title memory and calling the same upload path again, both adapters still read back the GPU-copied [68, 85, 102, 255] instead of the new [119, 136, 153, 255].

The test is resource::tests::title_texture_write_after_gpu_copy_reaches_the_host. It uses a real D3D12 copy and readback with generated pixels. No game files used. AI-assisted test implementation and verification.

**@⁠DrDarkDK** on GitHub · 2026-11-24 09:51 UTC · [original](https://github.com/Marvisak/VIctory/issues/758#issuecomment-7127987785) Reproduced on `8e79c80` with a synthetic 64×1 RGBA8 texture on native Windows 11, using both an RTX 4070 Ti (driver 621.01) and WARP. The initial title-memory upload read back correctly. After `CopyResource`, a second upload attempt with unchanged title memory correctly preserved the GPU-copied pixels. After writing new pixels to the title memory and calling the same upload path again, both adapters still read back the GPU-copied `[68, 85, 102, 255]` instead of the new `[119, 136, 153, 255]`. The test is `resource::tests::title_texture_write_after_gpu_copy_reaches_the_host`. It uses a real D3D12 copy and readback with generated pixels. No game files used. AI-assisted test implementation and verification.
Author
Owner

@⁠BastienRodz on GitHub · 2026-11-24 09:57 UTC · original

I'm working on this, along the lines suggested: record the write-watch asking when the host copy is recorded, and in upload() leave the host-written state once a page of the texture's memory is written after it, so the next upload detiles title memory again. Memory without a write watch keeps the host's contents, as today. PR creation is limited to collaborators, so the fix will go on a branch of my fork, linked here, once it's tested. No game data used.

AI-assisted (Claude Code, Gemini).

**@⁠BastienRodz** on GitHub · 2026-11-24 09:57 UTC · [original](https://github.com/Marvisak/VIctory/issues/758#issuecomment-7128126293) I'm working on this, along the lines suggested: record the write-watch asking when the host copy is recorded, and in `upload()` leave the host-written state once a page of the texture's memory is written after it, so the next upload detiles title memory again. Memory without a write watch keeps the host's contents, as today. PR creation is limited to collaborators, so the fix will go on a branch of my fork, linked here, once it's tested. No game data used. AI-assisted (Claude Code, Gemini).
Author
Owner

@⁠AndyLatimer on GitHub · 2026-11-24 10:03 UTC · original

Branch ready on fork (PR creation is currently collaborators-only): https://github.com/AndyLatimer/VIctory/tree/fix/gpu-host-written-texture-refresh (commit d5344a8, based on 8e79c80).

Covers both memory paths in crates/victory-gpu/src/texture.rs:

  • Write-watched (MEM_WRITE_WATCH): records the watch::writes asking number at host_written() so writes before the GPU copy do not falsely invalidate it, while any write after it clears the entry and resumes detiling.
  • Unwatched / physical-page memory (noted as left sticky in the earlier comment above): hashes committed memory via host::copy_mapped (64 KiB chunks) at host_written() and clears the entry once the content hash changes (or pages become committed).
  • Non-title-written textures (render targets, depth, UAVs) and non-detileable layouts stay Sticky in O(1) without watch/hash overhead.
  • upload() checks !list.first_use(...) first so a host-written texture sampled multiple times in one command list is checked at most once per list, and clears entries with compare-and-remove against concurrent host_written() updates.

Verified on Windows 11 (rustc 1.98.1) with synthetic GPU + WARP readback tests (host_written_watched_texture_uploads_after_title_write, host_written_unwatched_texture_uploads_after_title_write, host_written_render_target_stays_sticky_until_forgotten):

  • cargo test -p victory-gpu (hardware GPU): 53 passed, 0 failed, 1 ignored
  • cargo test -p victory-gpu --features diagnostics (hardware GPU): 56 passed, 0 failed, 1 ignored
  • VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --features diagnostics (WARP): 56 passed, 0 failed, 1 ignored
  • cargo clippy -p victory-gpu --all-targets -- -D warnings (default and --features diagnostics): 0 warnings
  • cargo check -p victory --features diagnostics, rustfmt --edition 2024 --check crates/victory-gpu/src/texture.rs, cargo xtask policy (153 files ok): clean

No game data or console SDK used. AI-assisted (Google Antigravity).

**@⁠AndyLatimer** on GitHub · 2026-11-24 10:03 UTC · [original](https://github.com/Marvisak/VIctory/issues/758#issuecomment-7128243687) Branch ready on fork (PR creation is currently collaborators-only): https://github.com/AndyLatimer/VIctory/tree/fix/gpu-host-written-texture-refresh (commit `d5344a8`, based on `8e79c80`). Covers both memory paths in `crates/victory-gpu/src/texture.rs`: - **Write-watched (`MEM_WRITE_WATCH`)**: records the `watch::writes` asking number at `host_written()` so writes before the GPU copy do not falsely invalidate it, while any write after it clears the entry and resumes detiling. - **Unwatched / physical-page memory** (noted as left sticky in the earlier comment above): hashes committed memory via `host::copy_mapped` (64 KiB chunks) at `host_written()` and clears the entry once the content hash changes (or pages become committed). - **Non-title-written textures** (render targets, depth, UAVs) and non-detileable layouts stay `Sticky` in O(1) without watch/hash overhead. - `upload()` checks `!list.first_use(...)` first so a host-written texture sampled multiple times in one command list is checked at most once per list, and clears entries with compare-and-remove against concurrent `host_written()` updates. Verified on Windows 11 (`rustc 1.98.1`) with synthetic GPU + WARP readback tests (`host_written_watched_texture_uploads_after_title_write`, `host_written_unwatched_texture_uploads_after_title_write`, `host_written_render_target_stays_sticky_until_forgotten`): - `cargo test -p victory-gpu` (hardware GPU): 53 passed, 0 failed, 1 ignored - `cargo test -p victory-gpu --features diagnostics` (hardware GPU): 56 passed, 0 failed, 1 ignored - `VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --features diagnostics` (WARP): 56 passed, 0 failed, 1 ignored - `cargo clippy -p victory-gpu --all-targets -- -D warnings` (default and `--features diagnostics`): 0 warnings - `cargo check -p victory --features diagnostics`, `rustfmt --edition 2024 --check crates/victory-gpu/src/texture.rs`, `cargo xtask policy` (153 files ok): clean No game data or console SDK used. AI-assisted (Google Antigravity).
Author
Owner

@⁠BastienRodz on GitHub · 2026-11-24 10:12 UTC · original

A fix, on a branch of my fork since PR creation is limited to collaborators:
https://github.com/BastienRodz/VIctory/commits/gpu/texture-write-after-host-copy (7a2ea90)

The branch is based on c7a5f49, just before the CI commit (my token can't push a branch that contains .github/workflows). It merges cleanly into the current main. The change is three files in victory-gpu: texture.rs, plus test helpers in resource.rs and watch.rs.

What

  • HOST_WRITTEN now keeps, per texture, the write-watch asking current when the host copy (CopyResource, CopyTextureRegion, resolve) was recorded.
  • upload() asks the journal (watch::writes) for the texture's memory. If a page was written after that asking, the texture leaves the host-written state and its staging cursor is reset, so the upload detiles title memory again. A later host copy makes it host-written again.
  • Memory without a write watch keeps the host's contents, as before (shortcut: note).
  • A texture the host renders to or writes as a UAV is never uploaded from title memory, so it isn't recorded.
  • host_written runs when the copy is recorded, not when it executes. A title write between recording and submission gets a later asking, so the next upload takes the title's contents.

Tested

Linux, cross-built with cargo xwin for x86_64-pc-windows-msvc, run under Wine 10. GPU tests ran on vkd3d-proton 3.1 over lavapipe (a real D3D12 device).

  • cargo xwin test -p victory-gpu: 53 passed (plain Wine). On vkd3d-proton: 52 passed and 1 failed, the environment-only a_rejected_blob_gives_an_empty_library, which also fails on main there.
  • New tests:
    • written_since_detects_pages_written_after_asking: the rule itself.
    • host_written_yields_after_write_in_watched_memory: a write before the copy keeps host ownership; a write after it ends it; a new copy takes it again; unwatched memory keeps it.
    • title_write_after_host_copy_reaches_the_host_texture, the same shape as the repro above, run on the device: a 64x1 RGBA8 title texture in write-watched memory gets its initial upload, then a real CopyResource. The copied pixels are kept while nothing writes, and after a title write the next upload reads back the new pixels.
    • Mutation check: with the old rule (host contents always win), both texture tests fail, the last one at "title write after host copy".
  • cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features, as the CI runs it: clean. No new rustfmt diffs. cargo xtask policy: ok.

Not run: the title, and native Windows. @⁠DrDarkDK, if your title_texture_write_after_gpu_copy_reaches_the_host test is on a branch, it would be a good independent check against this one.

No game data used. AI-assisted: implemented with Gemini 4 Neon, reviewed and tested with Claude Code.

**@⁠BastienRodz** on GitHub · 2026-11-24 10:12 UTC · [original](https://github.com/Marvisak/VIctory/issues/758#issuecomment-7128467167) A fix, on a branch of my fork since PR creation is limited to collaborators: https://github.com/BastienRodz/VIctory/commits/gpu/texture-write-after-host-copy (`7a2ea90`) The branch is based on `c7a5f49`, just before the CI commit (my token can't push a branch that contains `.github/workflows`). It merges cleanly into the current `main`. The change is three files in `victory-gpu`: `texture.rs`, plus test helpers in `resource.rs` and `watch.rs`. ## What - `HOST_WRITTEN` now keeps, per texture, the write-watch asking current when the host copy (`CopyResource`, `CopyTextureRegion`, resolve) was recorded. - `upload()` asks the journal (`watch::writes`) for the texture's memory. If a page was written after that asking, the texture leaves the host-written state and its staging cursor is reset, so the upload detiles title memory again. A later host copy makes it host-written again. - Memory without a write watch keeps the host's contents, as before (`shortcut:` note). - A texture the host renders to or writes as a UAV is never uploaded from title memory, so it isn't recorded. - `host_written` runs when the copy is recorded, not when it executes. A title write between recording and submission gets a later asking, so the next upload takes the title's contents. ## Tested Linux, cross-built with `cargo xwin` for `x86_64-pc-windows-msvc`, run under Wine 10. GPU tests ran on vkd3d-proton 3.1 over lavapipe (a real D3D12 device). - `cargo xwin test -p victory-gpu`: 53 passed (plain Wine). On vkd3d-proton: 52 passed and 1 failed, the environment-only `a_rejected_blob_gives_an_empty_library`, which also fails on `main` there. - New tests: - `written_since_detects_pages_written_after_asking`: the rule itself. - `host_written_yields_after_write_in_watched_memory`: a write before the copy keeps host ownership; a write after it ends it; a new copy takes it again; unwatched memory keeps it. - `title_write_after_host_copy_reaches_the_host_texture`, the same shape as the repro above, run on the device: a 64x1 RGBA8 title texture in write-watched memory gets its initial upload, then a real `CopyResource`. The copied pixels are kept while nothing writes, and after a title write the next upload reads back the new pixels. - Mutation check: with the old rule (host contents always win), both texture tests fail, the last one at "title write after host copy". - `cargo clippy --workspace --all-targets --locked -- -D warnings`, with and without `--all-features`, as the CI runs it: clean. No new rustfmt diffs. `cargo xtask policy`: ok. Not run: the title, and native Windows. @⁠DrDarkDK, if your `title_texture_write_after_gpu_copy_reaches_the_host` test is on a branch, it would be a good independent check against this one. No game data used. AI-assisted: implemented with Gemini 4 Neon, reviewed and tested with Claude Code.
Author
Owner

@⁠AndyLatimer on GitHub · 2026-11-24 10:08 UTC · original · edited 2026-11-24 10:18 UTC

Withdrawn. The branch in the comment above, AndyLatimer:fix/gpu-host-written-texture-refresh (d5344a8), does the same for write-watched memory and also covers memory that is not watched (physical-page views, where streamed texture data lands). That is the one to use.

To measure in game: in unwatched memory it reads and hashes the whole texture at each host copy, and at each list that samples it while it keeps the host's contents.

**@⁠AndyLatimer** on GitHub · 2026-11-24 10:08 UTC · [original](https://github.com/Marvisak/VIctory/issues/758#issuecomment-7128371617) · edited 2026-11-24 10:18 UTC **Withdrawn.** The branch in the comment above, [`AndyLatimer:fix/gpu-host-written-texture-refresh`](https://github.com/AndyLatimer/VIctory/tree/fix/gpu-host-written-texture-refresh) (`d5344a8`), does the same for write-watched memory and also covers memory that is not watched (physical-page views, where streamed texture data lands). That is the one to use. To measure in game: in unwatched memory it reads and hashes the whole texture at each host copy, and at each list that samples it while it keeps the host's contents.
Author
Owner

@⁠DrDarkDK on GitHub · 2026-11-24 10:19 UTC · original

Ran the same synthetic CopyResource and pixel readback fixture against all three revisions on native Windows 11, with both RTX 4070 Ti and WARP. The fixture checks that VIctory recognizes the watched and unwatched allocations as intended.

Revision Write-watched Unwatched
7a2ea90 Pass Still reads the GPU-copied pixel
c0eb07d Pass Still reads the GPU-copied pixel
d5344a8 Pass Pass

Both adapters gave the same results. The initial upload and unchanged-memory controls passed in every case. The unwatched failures occurred only after the later title-memory write, as expected for the write-watch-only branches.

Synthetic tests only. AI-assisted test setup and reporting.

**@⁠DrDarkDK** on GitHub · 2026-11-24 10:19 UTC · [original](https://github.com/Marvisak/VIctory/issues/758#issuecomment-7128621503) Ran the same synthetic `CopyResource` and pixel readback fixture against all three revisions on native Windows 11, with both RTX 4070 Ti and WARP. The fixture checks that VIctory recognizes the watched and unwatched allocations as intended. | Revision | Write-watched | Unwatched | | --- | --- | --- | | `7a2ea90` | Pass | Still reads the GPU-copied pixel | | `c0eb07d` | Pass | Still reads the GPU-copied pixel | | `d5344a8` | Pass | Pass | Both adapters gave the same results. The initial upload and unchanged-memory controls passed in every case. The unwatched failures occurred only after the later title-memory write, as expected for the write-watch-only branches. Synthetic tests only. AI-assisted test setup and reporting.
Author
Owner

@⁠LAKSHYA-cmd-tech on GitHub · 2026-11-24 10:21 UTC · original

Fixed in commit github.com/LAKSHYA-cmd-tech/VIctory@223efb297b (branch ix/texture-host-written-streaming-invalidation): we record the watch asking tick when host GPU writes a resource. On subsequent uploads, if title memory writes occurred after that tick, the entry is invalidated from HOST_WRITTEN allowing newly streamed mips to be staged and uploaded.

**@⁠LAKSHYA-cmd-tech** on GitHub · 2026-11-24 10:21 UTC · [original](https://github.com/Marvisak/VIctory/issues/758#issuecomment-7128673219) Fixed in commit https://github.com/LAKSHYA-cmd-tech/VIctory/commit/223efb297bcfb9c6a7cf8df1f887fa58d43c2bd4 (branch ix/texture-host-written-streaming-invalidation): we record the watch asking tick when host GPU writes a resource. On subsequent uploads, if title memory writes occurred after that tick, the entry is invalidated from HOST_WRITTEN allowing newly streamed mips to be staged and uploaded.
Author
Owner

@⁠MichaelSmithAI on GitHub · 2026-11-24 10:27 UTC · original

On d5344a8, the executed-copy / later CPU write test passed here on an RTX 4090 through Wine/vkd3d. We also found a separate recording-order case with a 4×4 RGBA8 texture backed by ordinary CPU memory.

Both arms upload the original pixels, write new pixels in CPU memory, then do the same upload and readback. With no intervening recording, the new pixels reach the host (first byte 80). If we record and close a buffer-to-texture copy and release its command list without submitting it, the same readback returns the old pixels (first byte 16). The discarded copy never executes. The fixture calls the normal command-list entry point and changes only test code. Paired regression on d5344a8

The recording path calls host_written while building the list. This case is worth keeping alongside the existing executed-copy control when deciding when a texture becomes GPU-owned. We haven’t measured how often the game discards such recordings. AI-assisted testing on synthetic input.

**@⁠MichaelSmithAI** on GitHub · 2026-11-24 10:27 UTC · [original](https://github.com/Marvisak/VIctory/issues/758#issuecomment-7128811823) On `d5344a8`, the executed-copy / later CPU write test passed here on an RTX 4090 through Wine/vkd3d. We also found a separate recording-order case with a 4×4 RGBA8 texture backed by ordinary CPU memory. Both arms upload the original pixels, write new pixels in CPU memory, then do the same upload and readback. With no intervening recording, the new pixels reach the host (first byte 80). If we record and close a buffer-to-texture copy and release its command list **without submitting it**, the same readback returns the old pixels (first byte 16). The discarded copy never executes. The fixture calls the normal command-list entry point and changes only test code. [Paired regression on d5344a8](https://github.com/MichaelSmithAI/VIctory/commit/79709d3079655b845a22bb042ea9df30bf3e1c4d) The recording path calls `host_written` while building the list. This case is worth keeping alongside the existing executed-copy control when deciding when a texture becomes GPU-owned. We haven’t measured how often the game discards such recordings. AI-assisted testing on synthetic input.
Author
Owner

@⁠BastienRodz on GitHub · 2026-11-24 11:16 UTC · original

Update: the branch (https://github.com/BastienRodz/VIctory/commits/gpu/texture-write-after-host-copy) is now on current main (ffe310e, commit b3bc426). The upstream CI's checks pass on GitHub's windows-latest (clippy -D warnings with and without --all-features, then cargo test --workspace --locked): https://github.com/BastienRodz/VIctory/actions/runs/45382122283. victory-gpu there: 53 passed, 0 failed.

AI-assisted (Claude Code).

**@⁠BastienRodz** on GitHub · 2026-11-24 11:16 UTC · [original](https://github.com/Marvisak/VIctory/issues/758#issuecomment-7129881768) Update: the branch (https://github.com/BastienRodz/VIctory/commits/gpu/texture-write-after-host-copy) is now on current `main` (`ffe310e`, commit `b3bc426`). The upstream CI's checks pass on GitHub's `windows-latest` (clippy `-D warnings` with and without `--all-features`, then `cargo test --workspace --locked`): https://github.com/BastienRodz/VIctory/actions/runs/45382122283. `victory-gpu` there: 53 passed, 0 failed. AI-assisted (Claude Code).
Author
Owner

@⁠AndyLatimer on GitHub · 2026-11-24 11:17 UTC · original

Thanks @⁠DrDarkDK for verifying both watched and unwatched paths across the branches, and thanks @⁠MichaelSmithAI for catching the discarded-recording bug on d5344a8!

Fixed on AndyLatimer:fix/gpu-host-written-texture-refresh in commit github.com/AndyLatimer/VIctory@eb1b8d4 (merges cleanly onto main ffe310e):

  • texture::host_written(list, resource) now marks list.first_use(key) locally (so a later upload() inside the same command list still does not clobber the GPU copy), and defers updating the global HOST_WRITTEN map onto HostList until Host::execute actually runs that list.
  • Each pending write carries a per-resource liveness token cleared by texture::forget, so releasing a texture before submitting a recorded list neither touches freed memory nor leaves a stale HOST_WRITTEN entry on a reused address.
  • Added synthetic regression tests covering discarded and reset unsubmitted copies for both unwatched and write-watched memory (unsubmitted_texture_copy_does_not_suppress_title_upload), same-list copy-then-upload (same_list_upload_after_copy_keeps_gpu_copy), and release-before-submit (released_texture_pending_host_write_is_ignored_on_submit).

Verified on Windows 11 (rustc 1.98.1):

  • cargo test -p victory-gpu (hardware GPU): 56 passed, 0 failed, 1 ignored
  • cargo test -p victory-gpu --features diagnostics (hardware GPU and VICTORY_D3D12_WARP=1): 59 passed, 0 failed, 1 ignored
  • cargo clippy -p victory-gpu --all-targets -- -D warnings (default and --features diagnostics), cargo check -p victory --features diagnostics, rustfmt --edition 2024 --check crates/victory-gpu/src/texture.rs, cargo xtask policy (153 files ok): clean

Synthetic tests only (no game data). AI-assisted (Google Antigravity).

**@⁠AndyLatimer** on GitHub · 2026-11-24 11:17 UTC · [original](https://github.com/Marvisak/VIctory/issues/758#issuecomment-7129907923) Thanks @⁠DrDarkDK for verifying both watched and unwatched paths across the branches, and thanks @⁠MichaelSmithAI for catching the discarded-recording bug on `d5344a8`! Fixed on `AndyLatimer:fix/gpu-host-written-texture-refresh` in commit https://github.com/AndyLatimer/VIctory/commit/eb1b8d4 (merges cleanly onto `main` `ffe310e`): - `texture::host_written(list, resource)` now marks `list.first_use(key)` locally (so a later `upload()` inside the same command list still does not clobber the GPU copy), and defers updating the global `HOST_WRITTEN` map onto `HostList` until `Host::execute` actually runs that list. - Each pending write carries a per-resource liveness token cleared by `texture::forget`, so releasing a texture before submitting a recorded list neither touches freed memory nor leaves a stale `HOST_WRITTEN` entry on a reused address. - Added synthetic regression tests covering discarded and reset unsubmitted copies for both unwatched and write-watched memory (`unsubmitted_texture_copy_does_not_suppress_title_upload`), same-list copy-then-upload (`same_list_upload_after_copy_keeps_gpu_copy`), and release-before-submit (`released_texture_pending_host_write_is_ignored_on_submit`). Verified on Windows 11 (`rustc 1.98.1`): - `cargo test -p victory-gpu` (hardware GPU): 56 passed, 0 failed, 1 ignored - `cargo test -p victory-gpu --features diagnostics` (hardware GPU and `VICTORY_D3D12_WARP=1`): 59 passed, 0 failed, 1 ignored - `cargo clippy -p victory-gpu --all-targets -- -D warnings` (default and `--features diagnostics`), `cargo check -p victory --features diagnostics`, `rustfmt --edition 2024 --check crates/victory-gpu/src/texture.rs`, `cargo xtask policy` (153 files ok): clean Synthetic tests only (no game data). AI-assisted (Google Antigravity).
Author
Owner

@⁠MichaelSmithAI on GitHub · 2026-11-24 11:30 UTC · original · edited 2026-11-24 11:37 UTC

We verified the reset, discarded-list and release controls from eb1b8d4 on our Wine texture stack. Combining it with #641 also exposed a separate case in the unwatched-memory snapshot.

Melissa reserved two 64 KiB tiles, committed the first, and edited a byte in that resident tile. On the combined baseline, the second tile being uncommitted made hash_unwatched return None for the entire texture, so there was no snapshot with which to detect the edit. Reusing #641’s resident-range reader gives a stable snapshot before the edit, a changed digest after it, and another change when the second tile becomes resident. The digest includes the offsets of the readable ranges.

All 11 focused texture tests passed on Win64 under Wine/GE 3.2. The new regression measures snapshot behavior; the resulting pixels and any effect in-game remain unmeasured. This comparison includes the #641 dependency. Patch and regression test

Separate submissions on exact eb1b8d4. Donald tested a fully resident 4×4 RGBA8 texture on an RTX 4090 with Wine and vkd3d-proton 3.2. In both runs he submitted the writer, verified the GPU pixels, then submitted the reader. Recording the reader after the writer executed preserved every expected pixel (first byte 0x70). Recording the same reader before the writer executed restored the old CPU pattern (first byte 0x10). The discard/reset, same-list and release controls all passed in the same binary. This isolates the upload decision made while recording the reader. The test uses synthetic pixels and two separate submissions. Regression fixture on the author’s commit

**@⁠MichaelSmithAI** on GitHub · 2026-11-24 11:30 UTC · [original](https://github.com/Marvisak/VIctory/issues/758#issuecomment-7130192852) · edited 2026-11-24 11:37 UTC We verified the reset, discarded-list and release controls from `eb1b8d4` on our Wine texture stack. Combining it with #641 also exposed a separate case in the unwatched-memory snapshot. Melissa reserved two 64 KiB tiles, committed the first, and edited a byte in that resident tile. On the combined baseline, the second tile being uncommitted made `hash_unwatched` return `None` for the entire texture, so there was no snapshot with which to detect the edit. Reusing #641’s resident-range reader gives a stable snapshot before the edit, a changed digest after it, and another change when the second tile becomes resident. The digest includes the offsets of the readable ranges. All 11 focused texture tests passed on Win64 under Wine/GE 3.2. The new regression measures snapshot behavior; the resulting pixels and any effect in-game remain unmeasured. This comparison includes the #641 dependency. [Patch and regression test](https://github.com/MichaelSmithAI/VIctory/commit/3cee50b1394ea250f3a06bac61b0f47457dbd33b) **Separate submissions on exact `eb1b8d4`.** Donald tested a fully resident 4×4 RGBA8 texture on an RTX 4090 with Wine and vkd3d-proton 3.2. In both runs he submitted the writer, verified the GPU pixels, then submitted the reader. Recording the reader after the writer executed preserved every expected pixel (first byte `0x70`). Recording the same reader before the writer executed restored the old CPU pattern (first byte `0x10`). The discard/reset, same-list and release controls all passed in the same binary. This isolates the upload decision made while recording the reader. The test uses synthetic pixels and two separate submissions. [Regression fixture on the author’s commit](https://github.com/MichaelSmithAI/VIctory/commit/086445bb321938feefed4debb8fcdfa3e4ae1470)
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 03:50 UTC · original

Automated triage for the maintainers.

Confirmed on current main. In crates/victory-gpu/src/texture.rs, upload returns early for any texture in HOST_WRITTEN (is_host_written), and its own comment marks this as a shortcut: a texture the host copied into keeps the host's contents even if the title later writes its memory. DrDarkDK's synthetic readback reproduces it on an RTX 4070 Ti and on WARP.

Open PRs linked to this issue: #1210 and #1547. #1934 also moves host_written to submission time, which covers the discarded-recording and recording-order cases MichaelSmithAI found. The fork branches here (BastienRodz, AndyLatimer, LAKSHYA-cmd-tech) aren't PRs. Pull requests are open to everyone, so please compare with those PRs before opening another. Per DrDarkDK's table, a fix needs to cover unwatched memory as well as write-watched memory.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 03:50 UTC · [original](https://github.com/Marvisak/VIctory/issues/758#issuecomment-7152294998) <!-- victory-issue-triage v1 verdict=confirmed seen=2026-11-24T11:30:46Z at=2026-11-25T03:50:48Z --> Automated triage for the maintainers. Confirmed on current `main`. In `crates/victory-gpu/src/texture.rs`, `upload` returns early for any texture in `HOST_WRITTEN` (`is_host_written`), and its own comment marks this as a shortcut: a texture the host copied into keeps the host's contents even if the title later writes its memory. DrDarkDK's synthetic readback reproduces it on an RTX 4070 Ti and on WARP. Open PRs linked to this issue: **#1210** and **#1547**. #1934 also moves `host_written` to submission time, which covers the discarded-recording and recording-order cases MichaelSmithAI found. The fork branches here (BastienRodz, AndyLatimer, LAKSHYA-cmd-tech) aren't PRs. Pull requests are open to everyone, so please compare with those PRs before opening another. Per DrDarkDK's table, a fix needs to cover unwatched memory as well as write-watched memory. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 12:45 UTC · original

Rechecked the submitted CopyResource case on 63bcca43 with app-local Agility 1.620.2 and WARP 1.0.22. I used a synthetic 4×4 RGBA8 texture in write-watched title memory and read all 16 texels through a compute shader after separate submissions.

  • Initial title-memory upload read red in all 16 texels. A GPU copy made all 16 green.
  • A later CPU write of blue to the same texture made the tracker dirty. The read still returned 16 green texels and recorded zero uploads.
  • With no new CPU write, and after a CPU write to a different texture, the destination stayed green. The second texture read blue, and another CopyResource from it made the destination read blue in all 16 texels.

This reproduces the reported behavior on that revision. The flag set at submission still suppresses uploads after the later watched CPU write. Submission-order change f68442f

The victory-gpu diagnostics suite, including the temporary checks, had 249 passed, 0 failed and 1 ignored. This run used synthetic data and the software adapter. AI-assisted with Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 12:45 UTC · [original](https://github.com/Marvisak/VIctory/issues/758#issuecomment-7192418722) Rechecked the submitted `CopyResource` case on `63bcca43` with app-local Agility 1.620.2 and WARP 1.0.22. I used a synthetic 4×4 RGBA8 texture in write-watched title memory and read all 16 texels through a compute shader after separate submissions. - Initial title-memory upload read red in all 16 texels. A GPU copy made all 16 green. - A later CPU write of blue to the same texture made the tracker dirty. The read still returned 16 green texels and recorded zero uploads. - With no new CPU write, and after a CPU write to a different texture, the destination stayed green. The second texture read blue, and another `CopyResource` from it made the destination read blue in all 16 texels. This reproduces the reported behavior on that revision. The flag set at submission still suppresses uploads after the later watched CPU write. [Submission-order change `f68442f`](https://github.com/Marvisak/VIctory/commit/f68442ffe04caef6b9a52c67d74ed82a9dc17657) The `victory-gpu` diagnostics suite, including the temporary checks, had 249 passed, 0 failed and 1 ignored. This run used synthetic data and the software adapter. AI-assisted with Codex.
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/Marvisak--VIctory#758
No description provided.