Count held title-window copies against the memory budget #103

Manually merged
github merged 1 commit from github-bot/gh-103 into main 2026-11-27 02:43:07 +00:00 AGit
Owner

@⁠TaynanGT on GitHub · 2026-11-27 01:30 UTC · original
TaynanGT:fix/count-held-loose-windows → main · +87 −27 · 1 files · 1 commits · merged 2026-11-27 02:28 UTC

Why

On cc9ed86, the optional VICTORY_WINDOW_BUDGET_MB limit compares the budget with only the windows that can already be evicted. With 3,072 MiB held by slots or lists and 1,536 MiB idle, a 2,048 MiB budget selects nothing to free.

The sweep now counts every unique copied window against the limit in the Watch and High RAM bands. It releases eligible windows oldest first, up to the amount it can safely retire. A window that views the title's memory directly contributes zero copied bytes. Windows that have already reached the ordinary idle timeout remain eligible even when the total fits. The setting remains opt-in.

Validation

  • Verified the source and destination shadow.rs blobs matched before the port. The resulting blob matches KainanP's exact GPL patch.
  • Ran the original and patched Rust eviction functions with the same synthetic inputs. The original selected no windows at 2,048 MiB. The patch selected all three idle windows at 2,048 MiB, the oldest one at 4,096 MiB, and none at 8,192 MiB.
  • Windows Clippy, default tests and diagnostics tests passed on the GitHub workflow.
  • A gameplay comparison on a low-RAM machine is pending. The synthetic test measures the eviction decision only.

Related to #97. Thanks to KainanP for the fix and to FunWithFlagsDev for the original analysis.

**@⁠TaynanGT** on GitHub · 2026-11-27 01:30 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/103) `TaynanGT:fix/count-held-loose-windows` → `main` · +87 −27 · 1 files · 1 commits · merged 2026-11-27 02:28 UTC ## Why On `cc9ed86`, the optional `VICTORY_WINDOW_BUDGET_MB` limit compares the budget with only the windows that can already be evicted. With 3,072 MiB held by slots or lists and 1,536 MiB idle, a 2,048 MiB budget selects nothing to free. The sweep now counts every unique copied window against the limit in the Watch and High RAM bands. It releases eligible windows oldest first, up to the amount it can safely retire. A window that views the title's memory directly contributes zero copied bytes. Windows that have already reached the ordinary idle timeout remain eligible even when the total fits. The setting remains opt-in. ## Validation - Verified the source and destination `shadow.rs` blobs matched before the port. The resulting blob matches [KainanP's exact GPL patch](https://github.com/LooperSalty/AnyXboxX/commit/02bc88444ba29bfe47d44b2c76537839117ab2aa). - Ran the original and patched Rust eviction functions with the same synthetic inputs. The original selected no windows at 2,048 MiB. The patch selected all three idle windows at 2,048 MiB, the oldest one at 4,096 MiB, and none at 8,192 MiB. - Windows Clippy, default tests and diagnostics tests passed on the [GitHub workflow](https://github.com/TaynanGT/Vice-Tay/actions/runs/45922969237). - A gameplay comparison on a low-RAM machine is pending. The synthetic test measures the eviction decision only. Related to #97. Thanks to KainanP for the fix and to FunWithFlagsDev for the [original analysis](https://github.com/LooperSalty/AnyXboxX/issues/450).
Include unique loose window copies in the Watch and High RAM budgets.
The sweep keeps windows held by a list or descriptor and retires only
eligible copies. In-place windows contribute zero copied bytes.

Bring over KainanP's AnyXboxX fix from LooperSalty/AnyXboxX#466
(02bc88444ba29bfe47d44b2c76537839117ab2aa). FunWithFlagsDev reported
and analyzed the original issue in LooperSalty/AnyXboxX#450.

Related to TaynanGT/Vice-Tay#97.

Co-authored-by: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 02:10:56 +00:00
github manually merged commit cdfd5a7011 into main 2026-11-27 02:43:07 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.