GPU: textures the host refused for lack of memory are tried again, a bounded number of times #241

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

@⁠fffluffy-dev on GitHub · 2026-11-24 22:58 UTC · original
fffluffy-dev:gpu/retry-refused-textures → main · +179 −21 · 2 files · 1 commits · open

When host_texture failed, the texture was marked refused for good, and a failed slot still counted as made, so it read zeros (black) for the rest of the run even after memory freed. Marvisak/VIctory#1226 shows E_OUTOFMEMORY (0x8007000E) on ordinary textures under commit pressure; #109 shows an 8 GB card at its budget.

  • Only E_OUTOFMEMORY is retried: after 1 s, doubling, at most 8 more tries (the last about 4 minutes after the first), then given up as before. Every other failure (E_INVALIDARG, any DXGI_ERROR_DEVICE_*, no code) keeps today's behaviour, and a device removal on a later try ends the retries.
  • At most one attempt per texture per back-off window, decided under its own lock; no driver call on the per-draw path until the window opens.
  • A slot made null while its texture waits for a retry counts as not made (refused_for_now in descriptor/host.rs): it is remade when the texture is made, read through a table, or looked at again by the picked-by-index pass 16 frames later.
  • REFUSALS counts refusals, permanent refusals, late successes and give-ups (not printed yet); "host texture made on a later try" is logged once per recovery.

Not covered: depth twins, and slots picked by index with VICTORY_LAZY_TEXTURES=0.

Validation (cargo-xwin, tests under Wine): cargo test -p victory-gpu 111 passed, 1 ignored, new test only_a_lack_of_memory_is_tried_again_and_not_for_ever; clippy clean both ways; policy ok. Not run on a card under memory pressure.

AI use: written with Claude Code (Claude Opus 5.5); reviewed and posted with my approval. No game files were used.

**@⁠fffluffy-dev** on GitHub · 2026-11-24 22:58 UTC · [original](https://github.com/fxceless/victory-fork/pull/241) `fffluffy-dev:gpu/retry-refused-textures` → `main` · +179 −21 · 2 files · 1 commits · open When `host_texture` failed, the texture was marked refused for good, and a failed slot still counted as made, so it read zeros (black) for the rest of the run even after memory freed. Marvisak/VIctory#1226 shows `E_OUTOFMEMORY` (0x8007000E) on ordinary textures under commit pressure; #109 shows an 8 GB card at its budget. - Only `E_OUTOFMEMORY` is retried: after 1 s, doubling, at most 8 more tries (the last about 4 minutes after the first), then given up as before. Every other failure (`E_INVALIDARG`, any `DXGI_ERROR_DEVICE_*`, no code) keeps today's behaviour, and a device removal on a later try ends the retries. - At most one attempt per texture per back-off window, decided under its own lock; no driver call on the per-draw path until the window opens. - A slot made null while its texture waits for a retry counts as not made (`refused_for_now` in descriptor/host.rs): it is remade when the texture is made, read through a table, or looked at again by the picked-by-index pass 16 frames later. - `REFUSALS` counts refusals, permanent refusals, late successes and give-ups (not printed yet); "host texture made on a later try" is logged once per recovery. Not covered: depth twins, and slots picked by index with `VICTORY_LAZY_TEXTURES=0`. Validation (cargo-xwin, tests under Wine): `cargo test -p victory-gpu` 111 passed, 1 ignored, new test `only_a_lack_of_memory_is_tried_again_and_not_for_ever`; clippy clean both ways; policy ok. Not run on a card under memory pressure. **AI use:** written with Claude Code (Claude Opus 5.5); reviewed and posted with my approval. No game files were used.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:39:11 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/descriptor/host.rs
  • crates/victory-gpu/src/resource.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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