fix: let idle textures go from the texture queue's share (8 GB preset gap) #465

Open
github-bot wants to merge 2 commits from github-bot/gh-465 into main AGit
Owner

@⁠KainanP on GitHub · 2026-11-27 00:11 UTC · original
KainanP:fix/vram-evict-room-percent → main · +180 −63 · 5 files · 2 commits · open

Fixes #449.

The bug, on the Vice-Tay base (b6d86cf8)

akimfomin re-checked it on #454's base and it is still there. resource::room() refuses new host copies of textures once the card's use (the same card_use count in both places) reaches VICTORY_TEXTURE_ROOM_PERCENT of the budget. That is 85 % with the 8 GB preset. host::vram_keep() keeps idle copies for 600 s until a fixed 88 %. Between 85 and 88 % every new texture was refused while idle copies stayed for ten minutes.

The change

  • vram_keep(budget, used, room_percent): letting go starts at min(room_percent, 88) and comes down to 3 points below that start (the old 88 → 85 gap). The 95 % short-time line (1.5 s) stays.
  • room() and let_go_idle() now share one card_use() count and one under_share() test, so admission and reclamation can't drift apart again.
  • The sweep loop is split out of let_go_idle() as let_go(all, idle_ms, most) with no change in behaviour, so a test can run it on one texture.

Behaviour changes

VICTORY_TEXTURE_ROOM_PERCENT Sweep before Sweep now
unset (90), or 88 to 97 from 88 %, down to 85 % unchanged
85 (8 GB preset) from 88 %, down to 85 % from 85 %, down to 82 %
n < 88 from 88 %, down to 85 % from n %, down to n−3 %

Only the 8 GB preset (and anyone who sets a share below 88 by hand) behaves differently. On those setups idle copies of textures now go after 5 s from the moment the queue is refused. The cost is that a copy which goes and is needed again gets made and uploaded again. That trade is what needs measuring (below).

The 8 GB preset's 1024 texel cap (second commit)

akimfomin noted that Vice-Tay doesn't read the preset's VICTORY_TEXTURE_MAX_SIZE=1024 cap. I checked: nothing in third_party/victory reads VICTORY_TEXTURE_MAX_SIZE or has a max_size. The cap came with the Neptune base (9e878913) and only worked through VICTORY_LEVELS_ON_DEMAND=1, which Vice-Tay's tuned set doesn't set. Wiring it back would mean porting that feature and changing image quality on a base where nobody has measured it. I chose the honest option instead: the 8 GB and 12 GB presets no longer set the variable, and their descriptions and docs/launcher.md (plus the French page) no longer promise capped textures. every_variable_an_option_names_exists_in_victorys_sources now runs without its UNREAD_BY_VICE_TAY exception. This changes no runtime behaviour, because the variable was unread. The doc line also dropped the stale "256 MB list pool" (Vice-Tay reads no list pool variable, and the preset doesn't set one).

Tests (rule 5)

  • resource::tests::an_idle_copy_goes_once_the_texture_queue_is_refused follows akimfomin's suggestion and runs on the host device. It makes a 256×256 BC7 host copy that its title texture alone holds: no list, no slot, never submitted, so its fence is done. Its last use is backdated past 5 s and 4 frames. Only the usage row changes (card_use fixed by construction, 6,823 MiB budget as in #396, share 85):
    • 84 %: admitted, kept (the ten-minute rule);
    • 86 %: refused, and the idle copy goes;
    • 88 %: refused and goes (positive control, true before the change as well).
  • resource::tests::a_refused_queue_never_keeps_idle_copies_for_minutes: for every share from 50 to 97 and every use from 0 to 110 %, if room refuses, the sweep lets idle copies go within 5 s.
  • host::batch::textures_go_from_where_the_queue_is_refused: vram_keep rows at shares 85 and 50. textures_are_kept_while_the_card_has_room now checks the old rows at 88, 90 and 97 to show nothing changed there.
  • They fail on main's policy. With vram_keep forced back to the fixed 88 % start, the three new tests fail. The device test gets (false, true) at 86 %: refused, and the copy is kept.

Run here (RTX 4060 Laptop GPU, Intel UHD iGPU, WARP):

result
cargo test -p victory-gpu --lib --release --features diagnostics, RTX 480 passed in most runs. Over 41 full runs, 3 had one failure in a watch.rs write-watch timing test (no_write_is_lost_with_port_7, what_the_kernel_writes_through_is_not_guarded_for_another_view), each passing on rerun. One run hung and was killed after 9 minutes; 25 later runs with a 90 s timeout didn't reproduce it. watch.rs isn't touched here, and main shows the same kind of failure (nothing_is_guarded_between_our_forgetting_it_and_its_unmapping, 1 in 112 runs), but the rate here was higher, so I'm flagging it rather than calling it noise
same, VICTORY_D3D12_ADAPTER=Intel 480 passed
same, VICTORY_D3D12_WARP=1 480 passed
device test alone, per adapter runs on all three (about 5 s each; it returns at once without a host)
cargo test -p anyxboxx-launcher --release 211 passed, 1 ignored
cargo clippy victory-gpu (lib + tests) / launcher no new warnings (victory-gpu: the same overlay.rs is_multiple_of one as main)
cargo xtask policy 285 files ok
cargo build --release --workspace --exclude anyxboxx-launcher (CI step) ok
ruff (W605,F,E9), pytest test_launcher, test_site, test_readme_sync, test_launch, test_lanceur_victory clean; 25 passed, 17 skipped

Asking for an A/B on an 8 GB card

I don't have an 8 GB card. Could someone who owns one (an RTX 5060 8 GB like #396's, or similar) run the 8 GB preset on main and on this branch? The useful numbers are the ones listed in #449's "done when": texture refusals, local and non-local memory in use, how many textures are let go and made again (sweep: trail lines, card accounting), and frame times (VICTORY_FRAMETIME_DUMP=1). The risk to watch for is a let-go/re-upload cycle between 82 and 85 %.

Credit: FunWithFlagsDev for the analysis in #449, and akimfomin for re-checking it on the Vice-Tay base, spotting the unread cap and proposing the test.

AI use: code, tests and this description written with Claude Code; tests run locally on RTX, Intel UHD and WARP; nothing was run in game.

🤖 Generated with Claude Code

**@⁠KainanP** on GitHub · 2026-11-27 00:11 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/465) `KainanP:fix/vram-evict-room-percent` → `main` · +180 −63 · 5 files · 2 commits · open Fixes #449. ## The bug, on the Vice-Tay base (`b6d86cf8`) akimfomin re-checked it on #454's base and it is still there. `resource::room()` refuses new host copies of textures once the card's use (the same `card_use` count in both places) reaches `VICTORY_TEXTURE_ROOM_PERCENT` of the budget. That is 85 % with the 8 GB preset. `host::vram_keep()` keeps idle copies for 600 s until a fixed 88 %. Between 85 and 88 % every new texture was refused while idle copies stayed for ten minutes. ## The change - `vram_keep(budget, used, room_percent)`: letting go starts at `min(room_percent, 88)` and comes down to 3 points below that start (the old 88 → 85 gap). The 95 % short-time line (1.5 s) stays. - `room()` and `let_go_idle()` now share one `card_use()` count and one `under_share()` test, so admission and reclamation can't drift apart again. - The sweep loop is split out of `let_go_idle()` as `let_go(all, idle_ms, most)` with no change in behaviour, so a test can run it on one texture. ### Behaviour changes | `VICTORY_TEXTURE_ROOM_PERCENT` | Sweep before | Sweep now | |---|---|---| | unset (90), or 88 to 97 | from 88 %, down to 85 % | **unchanged** | | 85 (8 GB preset) | from 88 %, down to 85 % | from 85 %, down to 82 % | | n < 88 | from 88 %, down to 85 % | from n %, down to n−3 % | Only the 8 GB preset (and anyone who sets a share below 88 by hand) behaves differently. On those setups idle copies of textures now go after 5 s from the moment the queue is refused. The cost is that a copy which goes and is needed again gets made and uploaded again. That trade is what needs measuring (below). ### The 8 GB preset's 1024 texel cap (second commit) akimfomin noted that Vice-Tay doesn't read the preset's `VICTORY_TEXTURE_MAX_SIZE=1024` cap. I checked: nothing in `third_party/victory` reads `VICTORY_TEXTURE_MAX_SIZE` or has a `max_size`. The cap came with the Neptune base (9e878913) and only worked through `VICTORY_LEVELS_ON_DEMAND=1`, which Vice-Tay's tuned set doesn't set. Wiring it back would mean porting that feature and changing image quality on a base where nobody has measured it. I chose the honest option instead: the 8 GB and 12 GB presets no longer set the variable, and their descriptions and `docs/launcher.md` (plus the French page) no longer promise capped textures. `every_variable_an_option_names_exists_in_victorys_sources` now runs without its `UNREAD_BY_VICE_TAY` exception. This changes no runtime behaviour, because the variable was unread. The doc line also dropped the stale "256 MB list pool" (Vice-Tay reads no list pool variable, and the preset doesn't set one). ## Tests (rule 5) - `resource::tests::an_idle_copy_goes_once_the_texture_queue_is_refused` follows akimfomin's suggestion and runs on the host device. It makes a 256×256 BC7 host copy that its title texture alone holds: no list, no slot, never submitted, so its fence is done. Its last use is backdated past 5 s and 4 frames. Only the usage row changes (`card_use` fixed by construction, 6,823 MiB budget as in #396, share 85): - 84 %: admitted, kept (the ten-minute rule); - **86 %: refused, and the idle copy goes**; - 88 %: refused and goes (positive control, true before the change as well). - `resource::tests::a_refused_queue_never_keeps_idle_copies_for_minutes`: for every share from 50 to 97 and every use from 0 to 110 %, if `room` refuses, the sweep lets idle copies go within 5 s. - `host::batch::textures_go_from_where_the_queue_is_refused`: `vram_keep` rows at shares 85 and 50. `textures_are_kept_while_the_card_has_room` now checks the old rows at 88, 90 and 97 to show nothing changed there. - **They fail on main's policy.** With `vram_keep` forced back to the fixed 88 % start, the three new tests fail. The device test gets `(false, true)` at 86 %: refused, and the copy is kept. Run here (RTX 4060 Laptop GPU, Intel UHD iGPU, WARP): | | result | |---|---| | `cargo test -p victory-gpu --lib --release --features diagnostics`, RTX | 480 passed in most runs. Over 41 full runs, 3 had one failure in a `watch.rs` write-watch timing test (`no_write_is_lost_with_port_7`, `what_the_kernel_writes_through_is_not_guarded_for_another_view`), each passing on rerun. One run hung and was killed after 9 minutes; 25 later runs with a 90 s timeout didn't reproduce it. `watch.rs` isn't touched here, and main shows the same kind of failure (`nothing_is_guarded_between_our_forgetting_it_and_its_unmapping`, 1 in 112 runs), but the rate here was higher, so I'm flagging it rather than calling it noise | | same, `VICTORY_D3D12_ADAPTER=Intel` | 480 passed | | same, `VICTORY_D3D12_WARP=1` | 480 passed | | device test alone, per adapter | runs on all three (about 5 s each; it returns at once without a host) | | `cargo test -p anyxboxx-launcher --release` | 211 passed, 1 ignored | | `cargo clippy` victory-gpu (lib + tests) / launcher | no new warnings (victory-gpu: the same `overlay.rs` `is_multiple_of` one as main) | | `cargo xtask policy` | 285 files ok | | `cargo build --release --workspace --exclude anyxboxx-launcher` (CI step) | ok | | ruff (`W605,F,E9`), pytest `test_launcher`, `test_site`, `test_readme_sync`, `test_launch`, `test_lanceur_victory` | clean; 25 passed, 17 skipped | ## Asking for an A/B on an 8 GB card I don't have an 8 GB card. Could someone who owns one (an RTX 5060 8 GB like #396's, or similar) run the 8 GB preset on `main` and on this branch? The useful numbers are the ones listed in #449's "done when": texture refusals, local and non-local memory in use, how many textures are let go and made again (`sweep:` trail lines, card accounting), and frame times (`VICTORY_FRAMETIME_DUMP=1`). The risk to watch for is a let-go/re-upload cycle between 82 and 85 %. Credit: FunWithFlagsDev for the analysis in #449, and akimfomin for re-checking it on the Vice-Tay base, spotting the unread cap and proposing the test. _AI use: code, tests and this description written with Claude Code; tests run locally on RTX, Intel UHD and WARP; nothing was run in game._ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The texture queue (resource::room) stops making host copies at
VICTORY_TEXTURE_ROOM_PERCENT of the card's budget (85 with the 8 GB
preset), but the sweep (host::vram_keep) kept idle copies for ten minutes
until 88 %. From 85 to 88 % every new texture was refused while idle ones
stayed.

vram_keep now takes the queue's share: letting go starts at
min(room_percent, 88) and comes down to 3 points below that start. The
95 % short-time line is unchanged. With the default share (90) or anything
from 88 up, the policy is unchanged. room() and let_go_idle() now share one
card_use() count and one under_share() test, and the sweep loop is split
out as let_go() so a test can run it on one texture.

Tests: the policy table for every share from 50 to 97 (refused => idle
copies go within 5 s), vram_keep rows for 85 and 50, and on a host device
a 256x256 BC7 copy idle for over 5 s and 4 frames with the 8 GB preset's
85 %: kept at 84 %, refused and let go at 86 %, let go at 88 % (control).
With the old fixed 88 % start the three new tests fail.

Analysis by FunWithFlagsDev (#449), re-checked on the Vice-Tay base by
akimfomin, whose test row the device test follows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The 8 GB and 12 GB presets set VICTORY_TEXTURE_MAX_SIZE (1024 and 2048),
which only the Neptune base read (through VICTORY_LEVELS_ON_DEMAND=1).
Nothing in third_party/victory reads it now, so the presets promised
capped textures and did nothing. The presets no longer set it, their
descriptions and docs/launcher.md (and the French page) no longer claim a
cap, and the test that every preset variable is read by VIctory runs
without its exception list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:35:38 +00:00
Author
Owner

@⁠akimfomin on GitHub · 2026-11-27 01:01 UTC · original

Your 84/86/88 regression now gives the receiving team a runnable 86% failure case, and the unread cap is no longer advertised. I checked the exact #465 head f9e4260 against current main 4340aac; the Git merge is clean.

For the 8 GB A/B you asked for, PortBridge Test Lab #107 has the exact pair, the host synthetic control, and the eviction/recreation counters needed to check the 82–85% churn risk. A volunteer can give the link to their agent and send aggregates. We can return the attributed result here. The report distinguishes your existing test coverage from this outstanding timing question.

**@⁠akimfomin** on GitHub · 2026-11-27 01:01 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/465#issuecomment-7206944934) Your 84/86/88 regression now gives the receiving team a runnable 86% failure case, and the unread cap is no longer advertised. I checked the exact #465 head `f9e4260` against [current main `4340aac`](https://github.com/LooperSalty/AnyXboxX/commit/4340aac1a494b9649c00e0e1ad2c6fbe6ea00e80); the Git merge is clean. For the 8 GB A/B you asked for, [PortBridge Test Lab #107](https://github.com/akimfomin/PortBridge/issues/107) has the exact pair, the host synthetic control, and the eviction/recreation counters needed to check the 82–85% churn risk. A volunteer can give the link to their agent and send aggregates. We can return the attributed result here. The report distinguishes your existing test coverage from this outstanding timing question.
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/465/head:github-bot/gh-465'
git switch 'github-bot/gh-465'

Merge

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