Texture streaming: test retaining the last valid mip after a transient short read #118

Open
opened 2026-11-26 05:24:49 +00:00 by github-bot · 0 comments
Owner

@⁠npalissi on GitHub · 2026-11-26 04:29 UTC · original

Symptom

A prop can stay in place while its surface flashes black or loses detail during texture streaming. The fork documents a capture in which 137 of 787 repeated uploads put zeros over a previously filled level. Whole objects disappearing and driver resets need separate evidence. Existing capture notes

What I verified

With TEXTURE_NO_WAIT=1, a refresh can read while title memory is being remapped. When the full read fails and this staging buffer has no previous contents, the fallback reads the accessible pages. Missing bytes remain zero. After the bounded retries, a nonzero partial result can still be detiled into staging, and the short read is recorded for a later retry. Refresh and fill

A standalone Rust harness exercised the fork's fill and read_there logic with synthetic pages and a simulated read failure. With both pages readable, both patterns reached staging. With the second page unreadable through the retry window, the first pattern reached staging and the second page was zero. This verifies the staging result. GPU sampling and gameplay were outside the test.

The title's storage batch reports completion through DirectStorage. I have not tied that status to the publication of a particular mip view, so I would test this using VIctory's own read completeness and upload completion signals first. The existing descriptor deferral merge delays a view switch while earlier GPU work can still use the old view. The short read happens before the copy.

Change to test

When a replacement mip is only partially read during a transient remap, keep the last valid contents and defer that mip's upload. Retry when the mapping settles, then expose the update after the copy completes. In the in-place update case, the old descriptor alone cannot preserve the pixels, so the short upload itself must be deferred. If the allocation has changed identity or has been intentionally unmapped, keep the existing invalidation and fallback behavior. Keep the render thread moving while the retry is pending.

Before and after

  • Current behavior: A texture update can stage zeros for temporarily unreadable pages, potentially producing a flash or loss of detail.
  • Expected with the change: The previous valid mip stays visible, possibly at lower detail. The new mip appears when its bytes are ready and its copy has completed.

Validation

  1. Upload a known synthetic texture, then make one page of a replacement temporarily unreadable. Read back the texture and confirm the previous pixels stay intact.
  2. Restore the page with a different pattern and verify the retry publishes the complete replacement after the copy fence. Include an intentionally unmapped mip as a control so sparse textures can still make progress.
  3. In a repeatable scene, keep other settings fixed and compare flicker, short reads, retry counts and frame-time spikes. Track any device removal separately from visual corruption. Related driver reset report #51

AI-assisted source review and synthetic test. No game data attached.

**@⁠npalissi** on GitHub · 2026-11-26 04:29 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/issues/118) ## Symptom A prop can stay in place while its surface flashes black or loses detail during texture streaming. The fork documents a capture in which 137 of 787 repeated uploads put zeros over a previously filled level. Whole objects disappearing and driver resets need separate evidence. [Existing capture notes](https://github.com/avatarmanz/VIctory-7900XTX/blob/85d564167324056381327ff50f52da85048c84e3/crates/victory-gpu/src/texture.rs#L373-L388) ## What I verified With TEXTURE_NO_WAIT=1, a refresh can read while title memory is being remapped. When the full read fails and this staging buffer has no previous contents, the fallback reads the accessible pages. Missing bytes remain zero. After the bounded retries, a nonzero partial result can still be detiled into staging, and the short read is recorded for a later retry. [Refresh and fill](https://github.com/avatarmanz/VIctory-7900XTX/blob/85d564167324056381327ff50f52da85048c84e3/crates/victory-gpu/src/texture.rs#L1337-L1400) A standalone Rust harness exercised the fork's fill and read_there logic with synthetic pages and a simulated read failure. With both pages readable, both patterns reached staging. With the second page unreadable through the retry window, the first pattern reached staging and the second page was zero. This verifies the staging result. GPU sampling and gameplay were outside the test. The title's storage batch reports completion through DirectStorage. I have not tied that status to the publication of a particular mip view, so I would test this using VIctory's own read completeness and upload completion signals first. The existing [descriptor deferral merge](https://github.com/avatarmanz/VIctory-7900XTX/commit/cf9ba08) delays a view switch while earlier GPU work can still use the old view. The short read happens before the copy. ## Change to test When a replacement mip is only partially read during a transient remap, keep the last valid contents and defer that mip's upload. Retry when the mapping settles, then expose the update after the copy completes. In the in-place update case, the old descriptor alone cannot preserve the pixels, so the short upload itself must be deferred. If the allocation has changed identity or has been intentionally unmapped, keep the existing invalidation and fallback behavior. Keep the render thread moving while the retry is pending. ## Before and after - **Current behavior:** A texture update can stage zeros for temporarily unreadable pages, potentially producing a flash or loss of detail. - **Expected with the change:** The previous valid mip stays visible, possibly at lower detail. The new mip appears when its bytes are ready and its copy has completed. ## Validation 1. Upload a known synthetic texture, then make one page of a replacement temporarily unreadable. Read back the texture and confirm the previous pixels stay intact. 2. Restore the page with a different pattern and verify the retry publishes the complete replacement after the copy fence. Include an intentionally unmapped mip as a control so sparse textures can still make progress. 3. In a repeatable scene, keep other settings fixed and compare flicker, short reads, retry counts and frame-time spikes. Track any device removal separately from visual corruption. [Related driver reset report #51](https://git.gtahub.st/github/avatarmanz--VIctory-7900XTX/issues/51) AI-assisted source review and synthetic test. No game data attached.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:24:49 +00:00
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/avatarmanz--VIctory-7900XTX#118
No description provided.