Do not evict placed textures on the assumption that unmapped ends mean an empty range #1958

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

@⁠NotADonky43 on GitHub · 2026-11-29 04:16 UTC · original
NotADonky43:fix/sweep-sparse-placed-texture → main · +113 −16 · 2 files · 1 commits · open

Two reclaim paths need evidence that the whole placed texture is absent. The host-pressure sweep uses the streaming estimate (which can return zero for an interior-only Windows mapping), and the periodic dead RT/UAV pass looks only at byte zero. This can classify a partly mapped resource as an unmapped eviction candidate even if a middle page remains. The streaming estimator remains unchanged for its intended callers.

After the existing age and ownership checks, try the title mapping read guard without waiting. Decline to reclaim on any tracked physical/soft view, committed region (including PAGE_NOACCESS), incomplete Windows query, invalid extent, or active remap. Walk by VirtualQuery region, not page. Keep the guard only through detachment, not resource destruction. No change to ordinary age/VRAM eviction policy.

Native Windows regression: reserve three 64 KiB regions, commit only a non-block-aligned interior page, then change its protection and decommit it. Both ends stay uncommitted. The old host-pressure predicate failed the regression; the new check passes and declines reclamation while remapping. Optimized test on main 568c5e5d plus this source change: cargo test --release --locked -p victory-gpu --lib pressure_sweep_keeps_an_interior_page_between_unmapped_ends. This is an eligibility/correctness fix, not an FPS claim or proof that the opening produced this particular sparse layout.

**@⁠NotADonky43** on GitHub · 2026-11-29 04:16 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1958) `NotADonky43:fix/sweep-sparse-placed-texture` → `main` · +113 −16 · 2 files · 1 commits · open Two reclaim paths need evidence that the *whole* placed texture is absent. The host-pressure sweep uses the streaming estimate (which can return zero for an interior-only Windows mapping), and the periodic dead RT/UAV pass looks only at byte zero. This can classify a partly mapped resource as an unmapped eviction candidate even if a middle page remains. The streaming estimator remains unchanged for its intended callers. After the existing age and ownership checks, try the title mapping read guard without waiting. Decline to reclaim on any tracked physical/soft view, committed region (including PAGE_NOACCESS), incomplete Windows query, invalid extent, or active remap. Walk by VirtualQuery region, not page. Keep the guard only through detachment, not resource destruction. No change to ordinary age/VRAM eviction policy. Native Windows regression: reserve three 64 KiB regions, commit only a non-block-aligned interior page, then change its protection and decommit it. Both ends stay uncommitted. The old host-pressure predicate failed the regression; the new check passes and declines reclamation while remapping. Optimized test on main 568c5e5d plus this source change: `cargo test --release --locked -p victory-gpu --lib pressure_sweep_keeps_an_interior_page_between_unmapped_ends`. This is an eligibility/correctness fix, not an FPS claim or proof that the opening produced this particular sparse layout.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 04:16:13 +00:00
Author
Owner

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

Integration check: this exact source change on our cumulative renderer (901559a4, based on d1486134) passed the full optimized workspace test suite with diagnostics, the explicit fenced D3D12 texture readback, and a warmed RTX 5070 Ti Series X opening through six heavy render reports. The Windows sparse-range regression also ran separately on main 568c5e5d plus the patch. Main has since advanced to e1f2eb60 with a README-only change. This validates the eligibility fix and combined boot, not a claim that the title reproduced an interior-only mapping or a performance A/B.

**@⁠NotADonky43** on GitHub · 2026-11-29 04:29 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1958#issuecomment-7250687491) Integration check: this exact source change on our cumulative renderer (901559a4, based on d1486134) passed the full optimized workspace test suite with diagnostics, the explicit fenced D3D12 texture readback, and a warmed RTX 5070 Ti Series X opening through six heavy render reports. The Windows sparse-range regression also ran separately on main 568c5e5d plus the patch. Main has since advanced to e1f2eb60 with a README-only change. This validates the eligibility fix and combined boot, not a claim that the title reproduced an interior-only mapping or a performance A/B.
This pull request has changes conflicting with the target branch.
  • 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/1958/head:github-bot/gh-1958'
git switch 'github-bot/gh-1958'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1958'
git switch 'github-bot/gh-1958'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1958'
git switch 'github-bot/gh-1958'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1958'
git switch 'main'
git merge --squash 'github-bot/gh-1958'
git switch 'main'
git merge --ff-only 'github-bot/gh-1958'
git switch 'main'
git merge 'github-bot/gh-1958'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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/trustno1-coder--VIctory-NVIDIA!1958
No description provided.