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

Merged
TaynanGT merged 1 commit from upstream-pr/103 into main 2026-11-27 02:28:06 +00:00
TaynanGT commented 2026-11-27 01:30:39 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T01:30:39Z.


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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5519611742 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/103). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T01:30:39Z. --- ## 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).
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
TaynanGT/Vice-Tay!103
No description provided.