fix: slots that keep showing an older texture give it up when the card has no room (VICTORY_KEPT_VIEWS_YIELD) #381

Manually merged
github merged 2 commits from github-bot/gh-381 into main 2026-11-26 17:57:52 +00:00 AGit
Owner

@⁠Skyfrye on GitHub · 2026-11-26 14:22 UTC · original
Skyfrye:nep/kept-views-yield → main · +99 −2 · 3 files · 2 commits · merged 2026-11-26 17:55 UTC

Change

VICTORY_KEPT_VIEWS_YIELD=1 (off by default: unset runs today's code).

A slot written with a newer view of a texture, or a view of another texture, keeps showing the older one until the texture queue makes the newer one. That is what VICTORY_KEEP_VIEWS and VICTORY_KEEP_OTHER_VIEWS do, both on by default, so that the slot does not read as black meanwhile. For that time the slot holds the older host copy.

With the card full, the queue is refused, so the newer view is never made and the older copy is never let go. A full card stays full this way. In the world of the title this fork works on (RTX 5080, Series X), the ram line showed about 3 GB of the card as "filled idle but held" while uploads of the queue were refused ("the texture queue is refused, the card has no room").

With the switch:

  • the heap notes each slot that keeps showing an older view (HostHeap::keeping, cleared whenever the slot's held resource changes);
  • when the texture pass finds the card without room, those slots are made null (HostHeap::yield_kept_views);
  • nothing holds the older copies any more, so the idle sweep lets them go;
  • the newer views are still in the queue, and are made once there is room.

The frame log's placed-view line gains the slots keeping an older texture now and those made null so far.

Linked issue: none.

Verification

Windows 11 26300, Rust 1.98.1 (MSVC), on upstream main at b5a9d10 (no file of this PR changed up to 369bfa4), from third_party/victory:

cargo build --locked --release -p victory                                                     -> Finished; the 2 warnings main has, no new one
VICTORY_D3D12_WARP=1 cargo test --locked -p victory-gpu --lib slots_keeping_an_older           -> 1 passed

slots_keeping_an_older_texture_give_it_up_for_room covers three cases:

  • a noted slot that is made is made null and leaves the set;
  • a noted slot that is not made is not counted;
  • a slot outside the set is left as it is.

It does not build without the change.

In the world, my copy of the game, Series X, VICTORY_INDIRECT_RAW=3, runs of 600 s with screen captures every 15 s. The build stacks this PR with #354, the placed-view fix #382 and the open #278, #279, #291, #292, #307, #360-#362 on main at 8ed1109.

Run Slots made null Refused-queue lines "Filled idle but held" Median fps after 120 s
This switch alone 4,917 8 1.3-3.5 GB 12.5
With #354's VICTORY_TEXTURE_AUTO_MIP_CLAMP=auto, #382 and VICTORY_STAGE_POOL_MB=2048 1,214 2 2.0-4.0 GB 14.8
Earlier run without any of these n/a 2 in 300 s 3.0 GB 13.2
  • Picture: checked from the captures (the prison cutscene, the window, the corridor, the counselor's office). Textures are drawn; there was no exception and no device lost.
  • The card stays near its line in all runs: what the switch frees, newer textures take, which is the point.
  • The machine was 62-65 % loaded by other work. The runs are stacked, so this PR's own share of the frame rate is not measured apart.

Oracle and test data

No game file. The counts come from my own runs of my copy of the game.

Checklist

  • The PR covers a single reviewable behaviour: slots keeping an older texture give it up when the card has no room, behind a switch.
  • A test fails without this change and passes with it (the test does not build without it).
  • The commands and results of each check are given above.
  • An unimplemented function returns an error (E_NOTIMPL), never a fake success. (Nothing unimplemented here.)
  • README: not touched.
  • No game, console or SDK file, no key, no dump, no download link.
  • Findings drawn from a title: memory and slot counts; no title code.
  • Code taken from another project: none.

AI assistance: written with Claude Code (Claude Opus 5.5): the analysis of the card's memory, the change, its test, the game runs and this description.

🤖 Generated with Claude Code

**@⁠Skyfrye** on GitHub · 2026-11-26 14:22 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/381) `Skyfrye:nep/kept-views-yield` → `main` · +99 −2 · 3 files · 2 commits · merged 2026-11-26 17:55 UTC ## Change `VICTORY_KEPT_VIEWS_YIELD=1` (off by default: unset runs today's code). A slot written with a newer view of a texture, or a view of another texture, keeps showing the older one until the texture queue makes the newer one. That is what `VICTORY_KEEP_VIEWS` and `VICTORY_KEEP_OTHER_VIEWS` do, both on by default, so that the slot does not read as black meanwhile. For that time the slot holds the older host copy. With the card full, the queue is refused, so the newer view is never made and the older copy is never let go. A full card stays full this way. In the world of the title this fork works on (RTX 5080, Series X), the ram line showed about 3 GB of the card as "filled idle but held" while uploads of the queue were refused ("the texture queue is refused, the card has no room"). With the switch: - the heap notes each slot that keeps showing an older view (`HostHeap::keeping`, cleared whenever the slot's held resource changes); - when the texture pass finds the card without room, those slots are made null (`HostHeap::yield_kept_views`); - nothing holds the older copies any more, so the idle sweep lets them go; - the newer views are still in the queue, and are made once there is room. The frame log's placed-view line gains the slots keeping an older texture now and those made null so far. Linked issue: none. ## Verification Windows 11 26300, Rust 1.98.1 (MSVC), on upstream `main` at `b5a9d10` (no file of this PR changed up to `369bfa4`), from `third_party/victory`: ``` cargo build --locked --release -p victory -> Finished; the 2 warnings main has, no new one VICTORY_D3D12_WARP=1 cargo test --locked -p victory-gpu --lib slots_keeping_an_older -> 1 passed ``` `slots_keeping_an_older_texture_give_it_up_for_room` covers three cases: - a noted slot that is made is made null and leaves the set; - a noted slot that is not made is not counted; - a slot outside the set is left as it is. It does not build without the change. In the world, my copy of the game, Series X, `VICTORY_INDIRECT_RAW=3`, runs of 600 s with screen captures every 15 s. The build stacks this PR with #354, the placed-view fix #382 and the open #278, #279, #291, #292, #307, #360-#362 on `main` at `8ed1109`. | Run | Slots made null | Refused-queue lines | "Filled idle but held" | Median fps after 120 s | |---|---|---|---|---| | This switch alone | 4,917 | 8 | 1.3-3.5 GB | 12.5 | | With #354's `VICTORY_TEXTURE_AUTO_MIP_CLAMP=auto`, #382 and `VICTORY_STAGE_POOL_MB=2048` | 1,214 | 2 | 2.0-4.0 GB | 14.8 | | Earlier run without any of these | n/a | 2 in 300 s | 3.0 GB | 13.2 | - Picture: checked from the captures (the prison cutscene, the window, the corridor, the counselor's office). Textures are drawn; there was no exception and no device lost. - The card stays near its line in all runs: what the switch frees, newer textures take, which is the point. - The machine was 62-65 % loaded by other work. The runs are stacked, so this PR's own share of the frame rate is not measured apart. ## Oracle and test data No game file. The counts come from my own runs of my copy of the game. ## Checklist - [x] The PR covers a single reviewable behaviour: slots keeping an older texture give it up when the card has no room, behind a switch. - [x] A test fails without this change and passes with it (the test does not build without it). - [x] The commands and results of each check are given above. - [x] An unimplemented function returns an error (`E_NOTIMPL`), never a fake success. (Nothing unimplemented here.) - [x] README: not touched. - [x] No game, console or SDK file, no key, no dump, no download link. - [x] Findings drawn from a title: memory and slot counts; no title code. - [x] Code taken from another project: none. AI assistance: written with Claude Code (Claude Opus 5.5): the analysis of the card's memory, the change, its test, the game runs and this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A slot written with a newer view of a texture, or a view of another
texture, keeps showing the older one until the texture queue makes the
newer one (VICTORY_KEEP_VIEWS, VICTORY_KEEP_OTHER_VIEWS, both on by
default), so that it does not read as black meanwhile. The slot holds
the older host copy for that time. With the card full, the queue is
refused and the newer view is never made, so the older copy is never let
go either: in the world of the title this fork works on, about 3 GB of
the card stayed "filled idle but held" while some 3,500 uploads of the
queue were refused.

With VICTORY_KEPT_VIEWS_YIELD=1 the heap notes the slots that keep an
older view. When the texture pass finds the card without room, those
slots are made null: nothing holds the older copies any more, the sweep
lets them go, and the newer views, still in the queue, are made once
there is room. Off by default.

The frame log's placed-view line gains the slots keeping an older
texture now and those made null so far.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:23:01 +00:00
github manually merged commit c41c2243c1 into main 2026-11-26 17:57:52 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.