gpu: log Metal's recommended working set and the title's budget at startup #149

Merged
m0rff merged 2 commits from upstream-pr/149 into main 2026-11-26 22:38:47 +00:00
m0rff commented 2026-11-26 21:07:36 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-26T21:07:36Z.


Issue #8: 16 GB Macs still run the title out of GPU memory. I first tried a loud warning when the title's own declared budget was within 10% of what Metal recommends keeping resident, but checked it against this M2 Pro 16 GB's own real numbers before opening this PR: Metal here reports recommendedMaxWorkingSet: 12,124 MiB, and Series S's 7,776 MiB budget (the default #12 steers 16 GB Macs to) is only 64% of that, even before any host overhead. A fixed threshold like that would stay silent exactly on the configuration the issue is about, so I dropped it.

Instead, this logs the numbers unconditionally in the existing native host: Metal line: the console name, its declared title_memory, and Metal's own recommendedMaxWorkingSetSize. No behaviour change, no switch needed — it's a log line, following the existing "dropped work is logged loudly" convention. Every tester's log now carries the numbers needed to work out a real threshold later (or to compare against a run's actual peak Metal memory), instead of a guessed one that doesn't fire where it should.

  • cargo test -p victory-hle -p victory -p victory-gpu -p xtask -p victory-metal: pass (includes a new test on real hardware: Metal::recommended_working_set is nonzero)
  • cargo clippy --workspace --all-targets --target x86_64-pc-windows-gnullvm -- -D warnings: clean
  • cargo xtask policy: pass
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5517155599 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/149). Originally posted by [m0rff](https://github.com/m0rff) on 2026-11-26T21:07:36Z. --- Issue #8: 16 GB Macs still run the title out of GPU memory. I first tried a loud warning when the title's own declared budget was within 10% of what Metal recommends keeping resident, but checked it against this M2 Pro 16 GB's own real numbers before opening this PR: `Metal` here reports `recommendedMaxWorkingSet: 12,124 MiB`, and Series S's 7,776 MiB budget (the default #12 steers 16 GB Macs to) is only 64% of that, even before any host overhead. A fixed threshold like that would stay silent exactly on the configuration the issue is about, so I dropped it. Instead, this logs the numbers unconditionally in the existing `native host: Metal` line: the console name, its declared `title_memory`, and Metal's own `recommendedMaxWorkingSetSize`. No behaviour change, no switch needed — it's a log line, following the existing "dropped work is logged loudly" convention. Every tester's log now carries the numbers needed to work out a real threshold later (or to compare against a run's actual peak Metal memory), instead of a guessed one that doesn't fire where it should. - `cargo test -p victory-hle -p victory -p victory-gpu -p xtask -p victory-metal`: pass (includes a new test on real hardware: `Metal::recommended_working_set` is nonzero) - `cargo clippy --workspace --all-targets --target x86_64-pc-windows-gnullvm -- -D warnings`: clean - `cargo xtask policy`: pass
LakshanSivakumar commented 2026-11-26 22:38:26 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T22:38:26Z.

Review: DISMISSED


Reviewed and tested together with the other open PRs on main (macOS x86_64 workspace tests, the setup shell tests, and Windows clippy). Thanks!

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:review:6081183897 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/149#pullrequestreview-6081183897). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-26T22:38:26Z. **Review:** DISMISSED --- Reviewed and tested together with the other open PRs on main (macOS x86_64 workspace tests, the setup shell tests, and Windows clippy). Thanks!
LakshanSivakumar commented 2026-11-26 22:38:44 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T22:38:44Z.

Review: APPROVED


I merged main into this branch and resolved the conflict with the PR merged before it (both changes kept). Reviewed and tested together with the other open PRs on main (macOS x86_64 workspace tests, the setup shell tests, and Windows clippy). Thanks!

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:review:6081185621 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/149#pullrequestreview-6081185621). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-26T22:38:44Z. **Review:** APPROVED --- I merged main into this branch and resolved the conflict with the PR merged before it (both changes kept). Reviewed and tested together with the other open PRs on main (macOS x86_64 workspace tests, the setup shell tests, and Windows clippy). Thanks!
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
LakshanSivakumar/Native-Victory-macOS!149
No description provided.