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

Manually merged
github merged 1 commit from github-bot/gh-149 into main 2026-11-27 00:51:19 +00:00 AGit
Owner

@⁠m0rff on GitHub · 2026-11-26 21:07 UTC · original
m0rff:fix/gpu-memory-ceiling-log → main · +45 −2 · 4 files · 2 commits · merged 2026-11-26 22:38 UTC

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
**@⁠m0rff** on GitHub · 2026-11-26 21:07 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/149) `m0rff:fix/gpu-memory-ceiling-log` → `main` · +45 −2 · 4 files · 2 commits · merged 2026-11-26 22:38 UTC 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
Issue #8: 16 GB Macs still run the title out of GPU memory. An
earlier attempt at this logged a loud warning when the title's own
declared budget was within 10% of what Metal recommends keeping
resident, but worked out against this M2 Pro 16 GB's own real
numbers (recommendedMaxWorkingSet: 12,124 MiB), that threshold is
silent exactly on the Series S default #12 steers 16 GB Macs to
(7,776 MiB is 64% of that, before any host overhead), so it never
fires where it matters.

Rather than guess a threshold with no real OOM data to check it
against, this logs the numbers unconditionally in the existing
'native host: Metal' line: the console name, its declared
title_memory, and Metal's own recommendedMaxWorkingSetSize. Every
tester's log now carries what's needed to work out a real threshold
later, or to compare against a run's actual peak Metal memory.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:12:29 +00:00
github manually merged commit d225359a7c into main 2026-11-27 00:51:19 +00:00
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-26 22:38 UTC · original · 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** on GitHub · 2026-11-26 22:38 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/149#pullrequestreview-6081183897) · **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!
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-26 22:38 UTC · original · approved these changes

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!

**@⁠LakshanSivakumar** on GitHub · 2026-11-26 22:38 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/149#pullrequestreview-6081185621) · **approved these changes** 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!
This discussion has been locked. Commenting is limited to contributors.
No description provided.