Restart the idle texture sweep when its cursor passes the last texture #198

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

@⁠feanorsun on GitHub · 2026-11-26 11:21 UTC · original
feanorsun:fix/restart-idle-texture-sweep → main · +27 −1 · 1 files · 1 commits · open

Refs #182

The idle texture sweep visits up to 8,192 addresses per pass when the runtime is keeping textures for minutes. If a full batch ends at the last address, the next cursor is past the end. The old loop only reset the cursor while visiting a texture, so subsequent passes could stay empty indefinitely. Releasing the remaining textures between passes has the same effect.

When the saved cursor has no remaining addresses, restart the batch at the first address. A cursor with a nonempty tail continues from that tail. The age, reference-count and memory-budget checks still govern which resources can be released.

Verified on Windows against 0dec5dcc228b, using ordered sets with three or four integer addresses and a batch size of two. Both regression assertions returned an empty batch before the fix and [1, 3] afterwards.

cargo test --offline --locked -j 1 -p victory-gpu --lib resource::tests::idle_sweep_ -- --list
cargo test --offline --locked -j 1 -p victory-gpu --lib resource::tests::idle_sweep_ -- --test-threads=1

Both cases ran on the CPU, with zero GPU allocations. The same cursor loop exists in the reporter's source revision. Their log does not show that the sweep reached this boundary, and the high-pressure eviction path uses a different traversal.

**@⁠feanorsun** on GitHub · 2026-11-26 11:21 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/198) `feanorsun:fix/restart-idle-texture-sweep` → `main` · +27 −1 · 1 files · 1 commits · open Refs #182 The idle texture sweep visits up to 8,192 addresses per pass when the runtime is keeping textures for minutes. If a full batch ends at the last address, the next cursor is past the end. The old loop only reset the cursor while visiting a texture, so subsequent passes could stay empty indefinitely. Releasing the remaining textures between passes has the same effect. When the saved cursor has no remaining addresses, restart the batch at the first address. A cursor with a nonempty tail continues from that tail. The age, reference-count and memory-budget checks still govern which resources can be released. Verified on Windows against `0dec5dcc228b`, using ordered sets with three or four integer addresses and a batch size of two. Both regression assertions returned an empty batch before the fix and `[1, 3]` afterwards. ```text cargo test --offline --locked -j 1 -p victory-gpu --lib resource::tests::idle_sweep_ -- --list cargo test --offline --locked -j 1 -p victory-gpu --lib resource::tests::idle_sweep_ -- --test-threads=1 ``` Both cases ran on the CPU, with zero GPU allocations. The same cursor loop exists in the reporter's source revision. Their log does not show that the sweep reached this boundary, and the high-pressure eviction path uses a different traversal.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:30:43 +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/198/head:github-bot/gh-198'
git switch 'github-bot/gh-198'

Merge

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