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 11:18:08 +00:00 by 64bitMango · 4 comments
64bitMango commented 2026-11-26 11:18:08 +00:00 (Migrated from github.com)
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by 64bitMango on 2026-11-26T11:18:08Z.


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.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6625507781 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/47). Originally posted by [64bitMango](https://github.com/64bitMango) on 2026-11-26T11:18:08Z. --- 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.
LakshanSivakumar commented 2026-11-26 13:28:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T13:28:24Z.


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.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7193398717 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/47#issuecomment-7193398717). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-26T13:28:24Z. --- 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 commented 2026-11-26 15:57:01 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T15:57:01Z.


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

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7196971138 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/47#issuecomment-7196971138). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-26T15:57:01Z. --- Status: kept as the reference for the performance work. Nothing to do until the story load passes the prologue (#15).
Tarraga commented 2026-11-27 16:43:54 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Tarraga on 2026-11-27T16:43:54Z.


/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.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7223604226 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/47#issuecomment-7223604226). Originally posted by [Tarraga](https://github.com/Tarraga) on 2026-11-27T16:43:54Z. --- /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.
github-actions[bot] commented 2026-11-27 16:44:06 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T16:44:06Z.


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

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7223607944 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/47#issuecomment-7223607944). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-27T16:44:06Z. --- Claimed by @Tarraga. Open a draft pull request with `Refs #47` in its description within 24 hours, or the claim expires.
Sign in to join this conversation.
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#47
No description provided.