Repository navigation
Conversation
48eeda6 to
3f053c0
Compare
|
A finding after merging this with current main: |
3f053c0 to
81ae214
Compare
Co-authored-by: relay4 <255982243+relay4@users.noreply.github.com>
81ae214 to
0179010
Compare
|
@Xipzer thank you for reporting this. I think this should be fixed in the newest commit. |
|
A data point for this: on Donkey Kong Bananza, building the host with just These are the second world's dialog close-ups, with 21,000+ draws a frame, on a Mac M5 Pro in fullscreen, measured with the host profiler (#1041). The frame-rate controller patch from #1765 and the encode thread were on in both runs.
No |
…g Bananza's heaviest close-ups go from 55.6 to 58.6 fps (PR #556) The host was the only native code still at -O1 (libvpx, dav1d and the launcher build at -O2; the iOS host at Xcode Release's -Os). Its per-draw path (encode_args_, draw_) runs some 21,000 times a frame in Donkey Kong Bananza's second-world dialogue close-ups; there, on an M5 Pro, moretti measured host CPU 13.1 -> 11.7 ms a frame (0.588 -> 0.526 ms per 1,000 draws), 55.6 -> 58.6 fps, and 2 of 34 s under 57 fps instead of 25 of 46. On Mario Wonder's opening scene, held at the 60 fps cap, relay4 measured 5% fewer submit instructions (at -O3 + LTO). Not -O3: no measurement shows a gain over -O2. Not -flto: it separates hle_bigstack.c's inline-assembly entry from its return path (Xipzer: SIGBUS in dm_bigstack_enter on Breath of the Wild 1.9.0, every run). libvpx, the launcher and the Metal pipeline keep their levels: no measured symptom. The Makefile is now a prerequisite of dmhost, so a change to CFLAGS rebuilds the host. Checked: the host builds with no new warnings; the host unit tests, test_lint_c and test_docs pass. regress.py check on OCTOPATH TRAVELER II (M4 Pro, macOS 27.2): fps 59.8 -> 59.8, p99 18.27 -> 18.21 ms, screenshots within baseline noise, no new RED, first frame 21.0 -> 18.5 s; its prebuild 20.5 -> 59.4 s was taken while other sessions' Metal compiles ran (the harness marked the Mac busy) and is Apple's compiler, not host code; not re-measured idle. Mario Kart World did not run (its shader package and map come from different splits, on main too). Co-authored-by: relay4 <255982243+relay4@users.noreply.github.com>
|
Landed the host part only, as c4ffb9d: the Mac host now builds at Thanks to @moretti for the Donkey Kong Bananza numbers (55.6 → 58.6 fps, host CPU 13.1 → 11.7 ms a frame in the close-ups), which are what this lands on, and to @Xipzer for finding the LTO crash in Left out:
Checked: OCTOPATH TRAVELER II through |
|
Thanks for merging the I still think there's potential in |
…g Bananza's heaviest close-ups go from 55.6 to 58.6 fps (PR seedds#556) The host was the only native code still at -O1 (libvpx, dav1d and the launcher build at -O2; the iOS host at Xcode Release's -Os). Its per-draw path (encode_args_, draw_) runs some 21,000 times a frame in Donkey Kong Bananza's second-world dialogue close-ups; there, on an M5 Pro, moretti measured host CPU 13.1 -> 11.7 ms a frame (0.588 -> 0.526 ms per 1,000 draws), 55.6 -> 58.6 fps, and 2 of 34 s under 57 fps instead of 25 of 46. On Mario Wonder's opening scene, held at the 60 fps cap, relay4 measured 5% fewer submit instructions (at -O3 + LTO). Not -O3: no measurement shows a gain over -O2. Not -flto: it separates hle_bigstack.c's inline-assembly entry from its return path (Xipzer: SIGBUS in dm_bigstack_enter on Breath of the Wild 1.9.0, every run). libvpx, the launcher and the Metal pipeline keep their levels: no measured symptom. The Makefile is now a prerequisite of dmhost, so a change to CFLAGS rebuilds the host. Checked: the host builds with no new warnings; the host unit tests, test_lint_c and test_docs pass. regress.py check on OCTOPATH TRAVELER II (M4 Pro, macOS 27.2): fps 59.8 -> 59.8, p99 18.27 -> 18.21 ms, screenshots within baseline noise, no new RED, first frame 21.0 -> 18.5 s; its prebuild 20.5 -> 59.4 s was taken while other sessions' Metal compiles ran (the harness marked the Mac busy) and is Apple's compiler, not host code; not re-measured idle. Mario Kart World did not run (its shader package and map come from different splits, on main too). Co-authored-by: relay4 <255982243+relay4@users.noreply.github.com> (cherry picked from commit c4ffb9d)
What and why
Enable speed optimization and full link-time optimization for the macOS host, libvpx and app launcher. The host previously used
-O1without LTO, while libvpx and the launcher's C code used-O2.-O3 -flto=full.NATIVE_OPTcontrols the host flags;VPX_OPTinherits them and can be overridden independently.-O3 -flto=full, and Swift with-O -whole-module-optimization -lto=llvm-full.These flags optimize host code; games continue executing their existing ARM64 instructions natively. Offline Metal shaders retain their existing
-O1policy.Checked
-O3 -flto=full; 47 targeted Python tests pass. Python lint reports zero new findings against the baseline.010015100B514000), version 1.2.1. Compared the opening Flower Kingdom dialogue with a frozen save, scripted Blue Toad selection, matching shaders and matching draw/pass counts. This covers a stationary rendered scene, not a full gameplay playthrough.scripts/regress.py check --gamesfor Wonder, Tears of the Kingdom, Cuphead, Hades and Balatro, covering Nintendo/Unity NVN, Vulkan and OpenGL paths. The harness stopped because only Wonder had a local Mac build; the other four games remain unchecked. The full GPU suite and iOS runtime were not validated.Host measurements
Both comparisons isolate host flags:
-O1versus-O3 -flto=full, with identical game code and shaders. The live-game comparison also holds the libvpx archive at the same-O2build.Live game, capped at 60 FPS: four AB/BA pairs, 1,200 measured frames per run (4,800 per build), handheld mode. Values below are medians of run means.
Instruction reduction was consistent, but CPU timings varied with recorded clock estimates; this run does not establish a repeatable timing gain. Both builds stayed near the 60 FPS cap, with GPU p95 below 8 ms.
Headless frame replay: eight AB/BA pairs, 10 discarded warm-up iterations and 40 measured iterations per process (320 measured replays per build). Metal encoding and uniform copies run on the measured thread at the same QoS. Values below are geometric means of run means.
All eight pairs favored the optimized build. The paired run-level bootstrap 95% interval for CPU-time reduction is 0.72–1.59%. Clock estimates stayed near 3.22 GHz. All 800 replays, including warm-ups, matched the captured image bit for bit: 435 draws, 59 passes, no RED diagnostics.
The CPU region excludes state restoration, explicit GPU completion waits and image verification; measured internal waits were zero. However, restoring captured memory marks texture storage dirty and causes extra uploads inside the measured region. This is a repeatable improvement for the replay workload, not an estimate of a whole-game speedup. Its absolute costs and instruction counts are not directly comparable to the live-game run. Neither comparison demonstrates an FPS improvement.
libvpx measurements
Compared native
-O2objects against-O3/full-LTO bitcode with the same benchmark caller: 60 synthetic 1280×720 motion frames per codec, eight timed decodes after a validation/warm-up decode, four process samples per setting in balanced order.Decoded-plane checksums match between builds. These small fixture-specific differences do not establish faster in-game movies. Launcher performance was not measured.
Docs
docs/development.mdwith the host, codec and launcher compiler settings and their scope.