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

Open
NotADonky43 wants to merge 1 commit from upstream-pr/1958 into main
NotADonky43 commented 2026-11-29 04:16:03 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by NotADonky43 on 2026-11-29T04:16:03Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5547470611 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1958). Originally posted by [NotADonky43](https://github.com/NotADonky43) on 2026-11-29T04:16:03Z. --- 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 commented 2026-11-29 04:29:54 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by NotADonky43 on 2026-11-29T04:29:54Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7250687491 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1958#issuecomment-7250687491). Originally posted by [NotADonky43](https://github.com/NotADonky43) on 2026-11-29T04:29:54Z. --- 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 cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1958:upstream-pr/1958'
git switch 'upstream-pr/1958'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1958'
git switch 'upstream-pr/1958'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1958'
git switch 'upstream-pr/1958'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1958'
git switch 'main'
git merge --squash 'upstream-pr/1958'
git switch 'main'
git merge --ff-only 'upstream-pr/1958'
git switch 'main'
git merge 'upstream-pr/1958'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
trustno1-coder/VIctory-NVIDIA!1958
No description provided.