Repository navigation
Replies: 48 comments 44 replies
|
Measured answers from our Ocarina of Time work. Two machines: Mac = M4 Pro (20-core GPU), iPad = iPad Pro M5. All runs Docked 1536x864, Kokiri Forest. Results
Mesh shaders: why the vertex stage is expensive
Pitfalls if you build the pre-pass
Upscaler (fixed cost)
Compute: float atomics
iPad specifics
Profiling that worked
BranchesEach change is a commit on our tree ( |
|
Two things from an M4 Pro MacBook Pro (Mac16,8, 24 GB, macOS 27.0.1) that may affect how the fps figures read:
I'll post fps with Dynamic resolution on and off once I've rebuilt on 04419bc. |
|
your Mac model and memory: the frame rate and whether Dynamic resolution was on: c78d7375bea9c862679ec294a6a69ff3e22e18d0.mp4//EDIT: Actually have to correct myself. With these settings after playing more than a minute the game starts eventually stuttering badly. If you pause the game and then contiue the FPS recover and the same scene runs smoothly again. Perhaps some memory issue. However, if I use
the game runs pretty great. Very good frame pacing and no longer stutters or slowdown even after playing for a few minutes. Example: c78d7375bea9c862679ec294a6a69ff3e22e18d0_30fps_nodyn.mp4 |
|
Mac: MacBook Pro 14", M1 Pro, 16 GB, macOS 26.6.1. Fullscreen on the built-in ProMotion screen (the host switched it to 120 Hz). Build: main 04419bc plus #1331, #1453, #1377, #1379 and an SDK guard; chain 89f44f9b6bb0, all 42,848 shaders. v131072, Handheld, Settings: 60 fps target, hold frames on, Dynamic resolution off (full 1536x864), Metal 4 pipelines off. Frame rate: about 30 fps most of the time, smooth to play.
Two sessions, 111 min in all, both ended by quitting:
Dynamic resolution on (a third session, same build): no gain here.
I can send a |
|
Update: the flickering dark specks in the mist are fixed (877c7ec) The ground mist tests each pixel against a depth its own earlier pass stored for the same surface. On the Switch's NVIDIA GPU those two values are always equal. Apple's GPU sometimes stores the depth one rounding step lower, at 0.2–3.8% of pixels, so the mist rejected its own surface there. The fix is general, in the shader translator: a shader comparing a pixel's depth with a depth it read treats them as equal when they're within that gap. It touches 39 of Ocarina's shaders (the mist and some foliage). The shaders rebuild on your next build (new chain). If you still see specks or anything new in the mist or grass, please post a screenshot and your Mac's chip. |
|
Why dynamic resolution is off by default now Since 04419bc the launcher's Dynamic resolution setting ( The game's controller got stuck at its lowest resolution (683x384) on the Mac and never climbed, even with GPU time to spare. Two host bugs made its timer read high: a stale frame-start timestamp, and event waits that idled the GPU. Those are fixed, and it still stayed at the bottom. The rest is in the game's own cost model:
Since the low resolution saved only about 0.4 ms and looked much worse, full resolution is the better default. A controller that steps one level at a time on the measured load, instead of the extrapolation, is being worked on but isn't on main yet. |
|
MacBook Pro M2 Pro (19-core GPU, 32 GB), macOS 27.2: Kokiri Forest on main Frame rate, on my own build. It is not plain main: main
Hangs on this build: 1 of 6 full runs (no overlay, from 119 s, GPU access revoked), plus a 200 s run that hung at 193 s. Details on #1326: #1326 (comment) |
|
MacBook Pro 14" (M4 Pro, 20-core GPU), 48 GB, macOS 26.7.2, Xcode 27.2 Build: main at Window (Composited), Dynamic resolution on: 60 fps, GPU 11.8–13.5 ms. The resolution drops on every short hitch, so the picture is low resolution most of the time, although the GPU has room to spare. Fullscreen (Direct), Dynamic resolution off:
Full resolution in fullscreen feels smooth and is the setup preferred here. No visual errors and no crashes in this session; saves load fine. Screenshots below. |
|
M5 MacBook Air (10-core GPU, 24 GB), a 45,300-frame run, zero hangs Adding the first M5 laptop data point to the thread. It is not a full-resolution run: this build predates Machine: MacBook Air Build: main Session: one continuous run, 45,300 frames, about 24 minutes of play after start-up. Route: Kokiri Forest → Lost Woods → Sacred Forest Meadow (beat the Wolfos there), then quit normally ( Frame timing151 reports of 300 frames each:
Memory
Flat. It settles by about frame 18,000 and does not creep after that, which I hope is useful next to #1831 (a 16 GB M4 Air reaching a 15 GB GPU allocation on a full-resolution build). 12.2 GB resident on 24 GB was never under pressure here, so this build does not reproduce that climb. Stability
That is one run, so it is not evidence that the hangs in #1326 / #1690 / #1830 are gone, only that a 45,300-frame session through the Lost Woods did not hit one. Audio
Two notesResolution. I cannot state the main-view scale from this log, so please read the GPU figure with that in mind. The log shows a 1536x864 attachment sampled in a feedback pass and a Start-up. Time to frame 58 was 586 s; frame 169, 772 s; frame 1031, 851 s. So about 14 minutes before the route starts, which is well past the ~5 minutes in #1747. On this app the shader library came from a partial build and the host says so twice at start: 288 distinct keys then failed to load at runtime ( |
|
Hey, I’m edge inference expert and this project nerd sniped me. In this PR: I have re-implemented NVDE movie network in pure metal kernels. This takes the title screen to 36ms a frame to 10ms a frame on an M1 Pro. The output of the reimplemented network is exact to the original network run on CPU. |
|
Dynamic resolution update (7de11da) and a request for tests on other Macs Thanks for the reports. @PaulEins, what you saw with Dynamic resolution on (low resolution most of the time with GPU to spare) was the game's own controller. It predicts each resolution's cost from the pixel count, which on a Mac overstates full resolution four to five times. The launcher's Dynamic resolution setting is still off by default (full resolution). Turned on, the game's controller is now replaced by one that climbs on what it measures. It tries each higher resolution, keeps it while the measured GPU load fits the game's own budget, and drops a level only when the load stays over for 8 frames. On an M4 Pro it reaches 1536x864 within seconds and holds 60 fps. One weakness is still open. On an M4 Pro the GPU time in heavier scenes hardly depends on resolution: at 683x384 the load was about the same as at full size. Even so, the controller still steps all the way down, and the picture goes soft for no gain. The next change will make it step down only to a resolution that measured cheaper. Until then, full resolution stays the default. Could you test it? Slower Macs are what this is for. @Amost-, your M2 Pro (30 fps at full resolution, GPU 21–23 ms) is exactly the case. On a build from current main:
A base M4 or an M1–M3 would help as well. If it brings a slower Mac from about 30–45 fps up to 60, it can become the default there. |
|
Bright band on Deku Tree walls / pale patch at the Kokiri exit: cause found, fix in #1844 M4 Pro (20-core GPU), 24 GB, macOS 27.2; v131072, Docked, 1536x864 (tested on penis6's In Gohma's room one section of the dark wall is lit brightly, and a pale patch sits on the ground at the Kokiri Forest exit; both shimmer while the camera moves and settle when it stops. Both are task/mesh-shader models; the vertex-shader models next to them are fine. The mesh shaders decode packed 16-bit vertex data by hand, and mesh #1844 adds |
|
iPad Pro 11" M5 (iPad17,1, 12 GB, iPadOS 27.2): measured data, Ocarina of Time v131072 Setup. Engine pin 1. TBDR on this iPad (Encode thread off in both runs; fresh launch each, same save, Link standing still, the first 5,400 frames after the title discarded; 24 and 25 windows):
A slightly different cut (fixed frames >= 5,400) gives 48.9 -> 51.8 fps and GPU 18.4 -> 15.6 ms, so about +3 to +4 fps. No crash. The README says TBDR did not help on the M4 Pro; here it did. One eyes-on observation, not measured: with TBDR on there is a water transparency glitch. In every water area I have looked at, the water is not transparent and the bottom is not visible. I did not compare screenshots. 2. Encode thread on iOS (#1664). 39,600 frames (~20 min) on 3. Memory limit. Without 4. Cold vs warm caches (same app, same settings, same scene):
GPU and submit time did not change; the lost frames are compile time. This fits #1368's description (mesh pipelines are not in the prewarm lists). 5. Time before the first frame, on iOS.
That reproduces #1735 on an iPad (engine without 6. Panics. Besides the one above, a Not measured: resolution on this iPad (no controlled A/B), Dynamic resolution, the 1.3.0 engine, the grass pre-pass. I can run any A/B or Drafted with Claude; reviewed by me. |
|
The 1536x864 main pass that main calls full resolution is the top of the game's own level list, and that list is data, so the game can render above it without a host change. The file is
With every level set to 1.0 in a copy of that file, loaded through In a 13.6-minute play session at 2048x1152 (Kakariko, its graveyard and Death Mountain Trail, HDR on) it held 100 % in every window, GPU p50 12.2 ms, frame p95 19.1 ms (median of the 300-frame windows). I haven't separated GPU from CPU in the slower windows; the longest stalls were first-sight mesh pipeline builds. Scaling the levels instead (×1.333, so the top is 1.0 and the rest keep their ratios) lets the game's controller move between 100 % and about 71 % under load (headless, with a larger output from our own render-size change), which might suit the climbing controller in 7de11da: as it stands its top is the game's 0.75. This was on our own build (main of 7 November plus later fixes from main), not current main. The overlay is made with a small BYML editor adapted from our Tears of the Kingdom work; happy to share it. |
|
iPad Pro 11" M5 (12 GB): history of my Ocarina of Time sessions, in one table Follow-up to my earlier comment. Same iPad, always Kokiri Forest, from autosaves of the same playthrough. Every row is one session, from the host log:
What can and cannot be read from it
Not measured on this iPad: resolution (no controlled A/B), Dynamic resolution, and anything built on the 1.3.0 engine. I will add the next build as a new row. Drafted with Claude from the host logs. |
|
Sorry to report more things, but I got a hard crash after some more playtime, after claiming Epona in Hyrule Field. Total system crash in Hyrule Field on M1 Pro 16G. Frame rates sucked for ~30 seconds, then restarted. Was okay for ~20s, then big lag spike and crash on Epona in Hyrule Field. save.zip EDIT: Explicitly went through Activity Monitor and killed every other non-essential process before this gameplay. Did not run out of memory due to other activity on my machine, not sure what caused it. |
M3 Max progress: Water Temple completed, generally smooth evening sessionsI completed the Water Temple on my MacBook Pro M3 Max during the evening of November 11, 2026 (Europe/Madrid), with few noticeable FPS drops and no notable graphical errors. I previously completed the Forest Temple, defeated Phantom Ganon and obtained Epona. The transparent ground and large vertical black artifacts seen in my older build have not been apparent in recent gameplay. This is an observed improvement, not a claim that every area is correct or the whole game can be completed. Environment
What the retained logs show
These are counts of windows, not percentages of play time or a locked-60-fps claim. The logs have no Water Temple or completion markers, so the measurements cover the full evening sessions rather than that dungeon alone. Some low-rate windows remain, including approximately 20 fps. Individual compilation-associated stalls reached about 4.75 s and 3.94 s. Texture-type mismatch warnings remain in both application logs, and the first also records a missing uniform buffer; I did not notice corresponding graphical problems. No explicit GPU hang, shader compilation failure or fatal allocation error was found in these application logs, and both runs exited normally. This is not an evening Metal-trace or unified-log audit. Separate unresolved performance observation Earlier that day, hunting Poes while riding Epona in Hyrule Field caused severe slowdown that prevented normal play. That recording contains approximately 19–20 fps periods and three-vsync holds, but the initiating cause remains unconfirmed. The successful evening playthrough does not establish that the earlier problem is fixed. There is no controlled restart, frame-hold or settings comparison yet; notably, the earlier recorded session was windowed and these evening sessions were fullscreen. I have prepared sanitized full evening logs with their timing summary. No game files, saves, keys, extracted resources or compiled shaders are included. I can provide a separate targeted recording if useful for investigating the remaining pacing problem. |
|
A data point on render scale and 60 fps, for anyone tuning the resolution overlay on a Mac. Result: lowering the render scale does not reach 60 fps on an M2 Pro. About 17 ms of GPU time per frame does not depend on the resolution, and 60 fps allows 16.7 ms. Setup: MacBook Pro M2 Pro, macOS 27.2, built-in screen, window, HDR on. Ocarina of Time v131072, docked, frame rate setting 60,
So on this machine the fixed cost per frame is what keeps the game at 30, not the pixel count. I have not looked at what that fixed part is made of. |
|
iPhone 17 Pro Max (iPhone18,2): Ocarina of Time runs very slowly from the start, phone restarted after closing it No iPhone results in this thread yet, so here is a first one. Build: main What happened:
I removed the app after that, so I have no host log from this run. Build note: |
|
I got native 1.33x-2x rendering to work with a small PR off main [a780d2c] :D Native 3840x2160 looks beautiful especially with metal upscaling on my 5K monitor.
|
|
Hitting what looks like the same thing @kartur reported: Mac mini M4, 16 GB, base 10-core GPU. Build Symptom: FPS crashes to single digits in a specific zone and doesn't recover for minutes, while GPU time and new-pipeline counts sit near zero — CPU-bound, not a shader-compile spike. The background loader thread
Happy to share the full session log if it helps narrow it down. |
|
Sharing measurements from a base M1 (8-core GPU, 16 GB), in case they help others on 16 GB machines. Setup (all numbers below are for this, not for 720p or handheld):
Result of a 62-minute play session: 19.1 fps average (68,100 frames), GPU p50 49.9 ms a frame (44–61 ms depending on the area).
Happy to share logs or run A/B tests on this machine. |
|
Huge thanks to all the contributors and PR authors! I built a custom IPA based on mainline While some of my local experiments were AI-assisted and I haven't isolated every single commit to verify if 100% of them yield positive gains, resolving the RAM & flash I/O bottleneck turned out to be the absolute key to making an 8GB device playable. Here is the exact build breakdown for anyone else testing on 8GB hardware: 1. Upstream Base
2. Cherry-Picked Unmerged Upstream PRs
3. Experimental Local Additions (8GB RAM / Flash Bottleneck Mitigation)(Note: Prototyped with AI assistance specifically to tackle memory exhaustion and flash thrashing on 8GB iOS devices)
【nxnative 时之笛重制 森林-城堡-火山 M1 基本稳定30FPS】 https://www.bilibili.com/video/BV1NxsG63Eya/Again, massive respect and gratitude to every contributor behind |
|
A per-pass GPU profile on an M2 Pro: the frame is about 15 ms that does not follow the render resolution plus about 10 ms that does, and no single pass holds the fixed part. Setup: MacBook Pro M2 Pro (19-core GPU, 32 GB), macOS 27.2, window, SDR, docked. Engine: main
Three things that may be useful beyond this Mac:
For comparison with the M4 Pro and M5 Max numbers above: this Mac sits at 22-26 ms where those sit at about 13 ms, so it runs at 30 fps and the fixed part alone is close to a 60 fps frame. |
|
Two pull requests came out of the measurements in this thread, and I am pointing at them here because this is where the Ocarina numbers are being compared. @seedds, the second one is about the whole NVN surface rather than this game, so it may be worth a look on its own. Setup for every number below: MacBook Pro M1 (base, 8 GPU cores, 16 GB), macOS 26.6.2; Ocarina of Time 1. #2672:
|
| docked | handheld | handheld, DM_DYNAMIC_RESOLUTION=1 (scene at its floor, 854x480) |
|
|---|---|---|---|
| sum of encoder GPU times | 44.5 ms | 30.1 ms | 19.2 ms |
| first encoder start to last end | 61.6 ms | 42.2 ms | 29.8 ms |
| GPU idle inside the frame | 17.1 ms | 12.1 ms | 10.6 ms |
| frame time p50 | 61.9 ms | 49.9 ms | 33.3 ms |
So on a base M1 the GPU sits idle 10 to 17 ms of every frame waiting for commands, at any resolution, and that idle time is what the game's resolution controller reads as load: with the scene at 480p the span is still about 30 ms. This agrees with the seam and late-first-commit breakdown @dpadr posted above for an M2 Air; the map is a way to get the same picture per encoder on any machine.
Two negative results from the same scene, in case they save someone the time (both on the base above, so treat them as one data point, not a verdict):
- Letting the game's
SyncWaiton its newest fence return early (a local switch, not in any PR): handheld frame p50 unchanged at 49.9 ms; docked 62-67 → 58 ms, with p95 going from 66-74 to 80-85 ms. Not worth it here. - nvn/barrier: image heaps take the alias flush once a submission and after memory writes (OoT −1.3 ms a frame on an M1) #2525, nvn/submit: commit a submission's first segment after 8 draws even while earlier work runs (OoT −0.85 ms a frame on an M1) #2526, Deferred pass merge without TBDR fusion (DM_NVN_PASS_DEFER): OoT's Kokiri Forest on an M1, GPU 38.5 -> 35.6 ms a frame #2441 and Compute moves ahead of scene passes past occlusion queries and conditional rendering; clears wait across dispatches #1952 carried together by hand onto
0c078130(five conflicts innvn_mtl.m, resolved keeping both sides; this is not how their authors tested them): handheld frame p50 unchanged at 49.8-49.9 ms, docked 62-67 → 57-62 ms, pictures correct in the captures I checked.
2. #2685: a generated, CI-checked coverage map of the NVN / NVN2 API
One cell per entry point in names.txt (743): 421 translated (immediate or recorded), 19 partial, 55 stubs the code itself says are safe, 17 stubs that may not be, 231 missing. It is generated from the sources (hle_nvn.c handlers, the OP_* enum, the case OP_* labels of mtl_exec) and checked by a tool test the way docs/env_switches.tsv is, so it cannot go stale silently; only the judgments the code cannot give (is this stub safe, what does this partial handler leave out) live in a small hand-kept table, each with the phrase from the code it rests on. The idea is to be able to say what a new game is likely to hit before running it, instead of finding it one [RED] NVN unimplemented function called at a time. The stub judgments are a reading of the code and would benefit from a second pair of eyes, nine of them are marked "not verified".
Nothing in either PR changes the host's behaviour with the switches off, and neither contains game-derived files.
|
Follow-up on my earlier reports (Mac mini M4, 16 GB, base 10-core GPU) with the data I said I'd capture: a The memory ceiling is hit at second 0, not "after a while"
The controller disconnect I mentioned is the same bottleneck, not a separate issue Found the cause: at one point there's a 375 ms frame (305 ms of it in submit+present), and the application log shows the Xbox controller disconnecting and reconnecting in that exact window. The stall is long enough to blow through the Bluetooth supervision timeout — it's a symptom of the stall, not a controller/Bluetooth bug. A disk-space gotcha that may be worth documenting, since it affects anyone trying I had On the Mac this needs
So Happy to share the raw |
|
Follow-up from the M2 Air (10-core GPU, 16 GB): the "slow until restart" state has a likely fix in #2715 Several reports in this thread describe the same thing on 16–18 GB Macs: after a heavy load, a launch drops to a low frame rate and stays there until a restart, while pausing brings it back for a moment. We see the same on this Air. Some launches fall into it from early on, others never do. While it lasts, the submit thread spends most of its time waiting, and the GPU sits mostly idle. It matches what #2715 describes: with guest files on, the GPU driver ends up re-wiring memory on every submit. We tested #2715 on main at a 30 fps cap, handheld 1440x810, with MetalFX and guest files on. With If you saw this state on a 16 GB Mac, #2715 is worth trying. One more tip from this thread: guest files turn themselves off when the disk has less than about 10 GB free. The only sign is a This also follows up on my M2 profile earlier in the thread. 🤖 Generated with Claude Code |
|
Hi! From observing the gameplay, I've noticed that: Has anyone identified the vertex/mesh shaders, buffers, or techniques responsible for these interactions? lay clip to illustrate what I'm referring to. Thanks! zelda_plantes_ralenti.mp4 |
|
Another follow-up (Mac mini M4, 16 GB, base 10-core GPU), now with 60 fps held for the whole session, no regression from disabling dynamic resolution 75 minutes, ~269k frames: frame time p50 stayed at 16.6-16.8 ms the entire time, start to finish, no drift. So on this GPU tier, OoT's own dynamic resolution wasn't doing anything for me either way — same ceiling ( The remaining hitches are first-time shader pipeline compiles, not memory 17 frames in this session spiked to 1-2.6 seconds. Picked the worst one apart (frame 83127): Mentioning it mainly because I noticed |
M2 Max (30-core GPU): 30 fps docked, ~60 fps in handheld mode with MetalFXSetup
Results
DetailsDocked (defaults). The menu holds 60 fps, then in game the counter goes down to a locked 30. Probes back to hold 1 fail every time: At hold 2 the GPU time reads about 3× its time at hold 1 (p50 up to ~29.5 ms in some windows), so the GPU clock seems to drop once the game sits at 30. Turning Dynamic resolution on made no visible difference, which fits the note (the cost hardly follows the internal resolution here). Handheld + MetalFX, hold off. Held 1 vsync for every frame of each 30 s window, with real-time game speed: One long frame of 256 ms around frame 900 (an area load, I think). Otherwise frame p95 16.8–19 ms. Handheld + MetalFX, hold on. Mostly 60 fps, but when GPU time reaches ~15–16.5 ms it goes to 30 for a second or two and then probes back. On screen this is more noticeable than the late frames with hold off: TakeawayOn an M2 Max (30-core), docked mode costs about 19.5 ms of GPU a frame, a little too much for 60 fps. Handheld mode + MetalFX brings it to about 14–15 ms. With |













Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The Legend of Zelda: Ocarina of Time (
0400486024DEC000, the Switch 2 release, update v131072): where it stands onmainas of 04419bc (2026-11-08).Status
89f44f9b6bb0): rebuild the game's shader libraries (run the NSP script again) to get the fixes below.What's new in 04419bc
Full resolution by default. The game renders its 3D view at 1536x864. A new launcher setting, Dynamic resolution (
DM_DYNAMIC_RESOLUTION=1), hands the choice back to the game's own controller. That runs at 60 fps on more Macs, at a lower resolution that follows the load.The resolution no longer stays at its lowest after a loading screen. Two host bugs made the game's frame timer read more GPU time than the frame took:
With them fixed, the game's own dynamic resolution climbs back to full size.
Less GPU work per frame. The mesh shaders' 128-bit memory loads are now one load instead of four, and occlusion-culled draws are skipped once their query result has landed.
Measured on an M4 Pro (20-core GPU), Kokiri Forest:
At full size the GPU needs almost a whole 60 Hz frame on that Mac, so it often holds 30 for stretches. On slower GPUs, turn Dynamic resolution on.
Fixed earlier
Known open reports
Ideas wanted: performance
At full resolution the GPU needs about 15 ms a frame on an M4 Pro, just short of 60 fps, and slower Macs fall well below. Suggestions are welcome: Metal techniques, profiling approaches, or things you've seen work in other translation layers.
Where the time goes (M4 Pro, Kokiri Forest, Metal System Trace; measured at 683x384 before the latest fixes, so the shares shift at full size):
Already tried, no gain:
DM_NVN_TBDR=1Open questions:
If you want to dig in:
scripts/bench.pyruns a fixed route (kokiri-deckin the profile'sbench.tsv).DM_NVN_GPUPROF=<first>-<last>logs every encoder's GPU start and duration over those frames.How to help
If you play on the latest build, reply with:
log.txtand, if you can, the save from just before itAll reactions