Performance notes from the Wine route on an M5 Pro: where a world frame goes, and a realistic ceiling #47

Open
opened 2026-11-26 14:43:49 +00:00 by github-bot · 4 comments
Owner

@⁠64bitMango on GitHub · 2026-11-26 11:18 UTC · original

Numbers from our Wine + D3DMetal port (same title build 1.0.2.1, Series X profile, prologue from one save) on an M5 Pro (48 GB), shared to help set expectations and priorities. Repo: https://github.com/64bitMango/VIctory-macOS.

A world frame today (release build, median of 97 samples at >3,000 draws): 308.7 ms (~3.2 fps) = preparing 121.8 + waiting on the GPU 125.2 + copying shader output back 52.8 ms, run one after another on one thread. Preparing and copy-back are the coherence work a separate-memory layer needs (write guards, shadow refreshes, copy-back); the zero-copy design in docs/native-host.md removes most of that, which is the native port's big advantage.

The GPU part stays. About 115-125 ms of GPU work per world frame on the M5 Pro through Apple's converter, after our shader fixes (it was ~150-158 ms). It is real work at full speed: during world frames powermetrics shows the GPU at a median 1,323 MHz (p90 1,517 of 1,620 MHz). Real shaders ran about 1.04x native through D3DMetal, so a native path won't shrink this much by itself. Most of the cost is the title's own passes. A few heavy indirect dispatches dominated (one went from 12.4 to 3.1 ms with four-dword loads, PR #35).

Realistic ceiling. With all CPU work hidden or removed, a world frame is bound by that GPU time: roughly 8-11 fps on an M5 Pro, more on Max/Ultra GPUs. For comparison, the Windows forks reach about 18-24 fps in the best world scenes on an RX 7900 XTX or RTX 5090. Their card is busy ~41 ms a frame; the title's own draws took 18.4 ms in a replay on the XTX. None reaches 30 fps in the world.

Tool that helped most. A frame recorder and replayer: record one world frame, then replay it alone with per-pass GPU times, shader variants compared turn by turn, and leave-one-pass-out costs (docs/replay.md in our repo). It is D3D12-specific, but the idea would carry over to a Metal backend and makes GPU work measurable without running the game.

Shader changes that cut GPU time or made more programs run are in PRs #33-#37.

**@⁠64bitMango** on GitHub · 2026-11-26 11:18 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/47) Numbers from our Wine + D3DMetal port (same title build 1.0.2.1, Series X profile, prologue from one save) on an M5 Pro (48 GB), shared to help set expectations and priorities. Repo: https://github.com/64bitMango/VIctory-macOS. **A world frame today** (release build, median of 97 samples at >3,000 draws): 308.7 ms (~3.2 fps) = preparing 121.8 + waiting on the GPU 125.2 + copying shader output back 52.8 ms, run one after another on one thread. Preparing and copy-back are the coherence work a separate-memory layer needs (write guards, shadow refreshes, copy-back); the zero-copy design in `docs/native-host.md` removes most of that, which is the native port's big advantage. **The GPU part stays.** About 115-125 ms of GPU work per world frame on the M5 Pro through Apple's converter, after our shader fixes (it was ~150-158 ms). It is real work at full speed: during world frames `powermetrics` shows the GPU at a median 1,323 MHz (p90 1,517 of 1,620 MHz). Real shaders ran about 1.04x native through D3DMetal, so a native path won't shrink this much by itself. Most of the cost is the title's own passes. A few heavy indirect dispatches dominated (one went from 12.4 to 3.1 ms with four-dword loads, PR #35). **Realistic ceiling.** With all CPU work hidden or removed, a world frame is bound by that GPU time: roughly 8-11 fps on an M5 Pro, more on Max/Ultra GPUs. For comparison, the Windows forks reach about 18-24 fps in the best world scenes on an RX 7900 XTX or RTX 5090. Their card is busy ~41 ms a frame; the title's own draws took 18.4 ms in a replay on the XTX. None reaches 30 fps in the world. **Tool that helped most.** A frame recorder and replayer: record one world frame, then replay it alone with per-pass GPU times, shader variants compared turn by turn, and leave-one-pass-out costs (`docs/replay.md` in our repo). It is D3D12-specific, but the idea would carry over to a Metal backend and makes GPU work measurable without running the game. Shader changes that cut GPU time or made more programs run are in PRs #33-#37.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:43:49 +00:00
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-26 13:28 UTC · original

Thanks for sharing these numbers and the frame-replayer write-up, @⁠64bitMango!

The breakdown (~115–125 ms GPU-bound on M5 Pro vs ~122 ms prepare + ~53 ms copy-back in Wine/D3DMetal) sets clear expectations: avoiding the separate-memory coherence/copy-back overhead is one of the main wins of the zero-copy native Metal host (docs/native-host.md), and a standalone Metal frame recorder/replayer will be a very useful profiling tool once 3D world frames are running.

Added the enhancement label.

**@⁠LakshanSivakumar** on GitHub · 2026-11-26 13:28 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/47#issuecomment-7193398717) Thanks for sharing these numbers and the frame-replayer write-up, @⁠64bitMango! The breakdown (~115–125 ms GPU-bound on M5 Pro vs ~122 ms prepare + ~53 ms copy-back in Wine/D3DMetal) sets clear expectations: avoiding the separate-memory coherence/copy-back overhead is one of the main wins of the zero-copy native Metal host (`docs/native-host.md`), and a standalone Metal frame recorder/replayer will be a very useful profiling tool once 3D world frames are running. Added the `enhancement` label.
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-26 15:57 UTC · original

Status: kept as the reference for the performance work. Nothing to do until the story load passes the prologue (#15).

**@⁠LakshanSivakumar** on GitHub · 2026-11-26 15:57 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/47#issuecomment-7196971138) Status: kept as the reference for the performance work. Nothing to do until the story load passes the prologue (#15).
Author
Owner

@⁠Tarraga on GitHub · 2026-11-27 16:43 UTC · original

/claim

The piece I'm taking: typed buffer views made again as new Metal textures each time a record is mirrored again (about 6,000 a world frame on main), on the submitting thread under the host's lock. A cache in the Metal backend, off with a switch.

**@⁠Tarraga** on GitHub · 2026-11-27 16:43 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/47#issuecomment-7223604226) /claim The piece I'm taking: typed buffer views made again as new Metal textures each time a record is mirrored again (about 6,000 a world frame on main), on the submitting thread under the host's lock. A cache in the Metal backend, off with a switch.
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-27 16:44 UTC · original

Claimed by @⁠Tarraga. Open a draft pull request with Refs #47 in its description within 24 hours, or the claim expires.

**@⁠github-actions[bot]** on GitHub · 2026-11-27 16:44 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/47#issuecomment-7223607944) Claimed by @⁠Tarraga. Open a draft pull request with `Refs #47` in its description within 24 hours, or the claim expires.
This discussion has been locked. Commenting is limited to contributors.
No description provided.