fix: count every loose window copy against VICTORY_WINDOW_BUDGET_MB #466
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!466
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-466"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@KainanP on GitHub · 2026-11-27 00:11 UTC · original
KainanP:fix/window-budget-total→main· +87 −27 · 1 files · 1 commits · openFixes #450.
The bug, on the Vice-Tay base (
b6d86cf8)#454 brought the window budget back (
VICTORY_WINDOW_BUDGET_MB, inshadow.rs), and the problem FunWithFlagsDev found on the combined base is there too.let_go_idle()filtersLOOSEdown to the copies that can go (strong count 1, idle foridle_msand 4 frames, COM references 1).window_victims()then compared the budget with the bytes of those copies alone. Copies held by a list or a slot, or used recently, never counted. In the issue's row (3,072 MiB held plus 1,536 MiB idle against a 2,048 MiB budget), nothing went.Both are confirmed against main's
window_victims. The issue's row gives[]where all three idle copies should go, and two due copies under a budget they fit in give[]where the sweep without a budget releases both.The change
loose_bytes, deduplicated by copy identity like the diagnosticmemory()). The oldest eligible copies go until that total fits or none are left. Copies that can't go stay; the target isn't always reachable, and that's accepted.crate::inplace) hold no copy of their own, so they count as 0 bytes (copy_bytes). They're never chosen to meet the budget, but they still go once due.ram_idle_ms) are markeddueand go whatever the budget, so a budget never keeps more than no budget would. The band's shorter idle time (10 s in Watch, 2 s in High) only adds candidates for meeting the budget.strong_count == 1filter keeps such a copy out of the eligible list, but the accounting now matches what it frees.Behaviour changes
VICTORY_WINDOW_BUDGET_MBunset, or the Calm band: unchanged.window_mapped_for, card memory the CPU writes) count as copies, the same as before. Only in-place ones are excluded.Tests (rule 5)
shadow::window_tests:window_budget_counts_the_copies_that_cannot_go: the issue's row. 3,072 held + 1,536 idle against 2,048 MiB means all idle copies go; against 4,096 MiB only the oldest goes; under the budget nothing goes.window_budget_never_keeps_what_the_sweep_lets_go_without_one: due copies go even when everything fits; over the budget the rest go oldest first.window_budget_passes_over_copies_in_place.window_budget_counts_one_copy_under_several_keys_oncenow expects the shared copy under both of its keys ([0, 1]instead of[0]), for the reason above.The first two encode cases that main's
window_victimsgets wrong (checked with a throwaway test on main:[]for both).Run here (RTX 4060 Laptop GPU, Intel UHD iGPU, WARP):
cargo test -p victory-gpu --lib --release --features diagnostics, RTXwatch.rswrite-watch timing test (what_is_put_in_beside_the_guards_is_told_at_every_view,no_write_is_lost_with_port_7), and both passed on rerun.watch.rsisn't touched here; main shows the same kind of failure (nothing_is_guarded_between_our_forgetting_it_and_its_unmapping, 1 in 112 runs)VICTORY_D3D12_ADAPTER=IntelVICTORY_D3D12_WARP=1cargo clippy -p victory-gpu --lib --testsoverlay.rsone as main)cargo xtask policycargo build --release --workspace --exclude anyxboxx-launcherNo launcher-visible change: the launcher sets no window budget.
Asking for an A/B
The budget only acts in the Watch and High RAM bands, so the useful run is on a machine that gets there. That means 16 GB of RAM, or an 8 GB card where Windows spills into shared memory. If you have one, please run with
VICTORY_WINDOW_BUDGET_MBset (for example 2048) onmainand on this branch, and compare private bytes and commit, how many window copies go and are made again (sweep:trail lines, the memory line), and frame times (VICTORY_FRAMETIME_DUMP=1).Credit: FunWithFlagsDev for the analysis and the test row in #450. Thanks to akimfomin for the review of the memory work on #449.
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
@akimfomin on GitHub · 2026-11-27 01:17 UTC · original
PortBridge checked this head against the pinned receiving main
5a08a334ef216eff98d2c7d9a9166f94c9ef70ed: Git reports a clean merge, withshadow.rsas the only changed file. For the one-change A/B I kept your merge baseb6d86cf8separate from that later receiving commit.PortBridge Lab #109 now has your synthetic test and the Watch/High-only acceptance criteria. I shared it with a Vice-Tay reporter who already measured the separate 16 GB RAM throttle. There is no new hardware result yet. If a volunteer submits one, I'll return the aggregates here with their attribution.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.