Skip to content

Frame workgroup: the threads that make a frame join an os_workgroup interval (opt-in Deadline boost; Xipzer's) - #2495

Open
oliverames wants to merge 4 commits into
seedds:mainfrom
oliverames:frame-workgroup
Open

oliverames wants to merge 4 commits into
seedds:mainfrom
oliverames:frame-workgroup

Conversation

@oliverames

@oliverames oliverames commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What and why

These are @Xipzer's two commits, opened here with their authorship kept, plus one commit of docs from me. Xipzer, if you'd rather open this yourself or change anything, say so and I'll close this one.

The time-constraint policy covers one thread, the one that acquires the window. The performance controller doesn't know that the encode thread and the threads that record command buffers work to the same deadline. On an iPad Pro M4, Breath of the Wild ran mostly on efficiency cores while playing (14–55 % of its CPU time on performance cores), with the translation thread 60–70 % slower and frames dropped, at thermal state 0.

With DM_FRAME_WG=1 (the launcher's Performance › Deadline boost), the acquiring thread, the encode thread and every thread that records command buffers join one os_workgroup interval made with AudioWorkIntervalCreate (looked up at run time). Each frame is an interval whose deadline is the present period. A guest thread leaves the workgroup when it exits (hle_thread.c), since a thread still joined at exit crashes in libdispatch. It's off by default: Xipzer measured it holding the translation thread at 3.8 GHz (3.3 ms a frame against 4.75 ms at 2.6 GHz) for 27 % more CPU power, with no dropped frames either way in that test. Whether it keeps a game off the efficiency cores in real play is what the toggle is for.

How it got here: Xipzer's commits 1873ca4 and 90276c0 were carried in HookLink's engine (the hooklink branch of dsi-hub/nxnative, which ships it as Deadline boost from 1.8.5). I cherry-picked those copies onto main. The only changes are mine, in the third commit: the launcher description said "Experimental in HookLink" and now says "Experimental", plus a reference entry and the symptom index.

Related: #1573 (Xipzer's iPad Pro M4 findings), #2484 (the presenting thread's own time-constraint deadline).

Checked

  • Up to date with main: 0c078130f merged in on 2026-11-12 (a merge, not a rebase). On that tree I ran again the host build, the iOS compile check (263 files, 0 failed), test_env_switches.py, test_docs.py, test_launcher_settings.py and test_patches.py, and lint_c.py tidy on the changed C files (nothing over the baseline); all pass. Upstream CI is queued behind a long backlog.
  • Tests: make -C dm/host GAME=0400486024DEC000 builds; GAME=0400486024DEC000 python3 dm/ios/tools/compile_check.py reports 263 files, 0 failed; test_launcher_settings.py, test_env_switches.py and test_docs.py pass; lint_c.py tidy has nothing over the baseline in hle_nvn.c and hle_thread.c.
  • Games run: none on this branch by me. The measurements above are Xipzer's, on an iPad Pro M4.

Docs

  • The finding is in docs/reference/frame-rate.md, and python3 dm/tools/docs_symptoms.py was run
  • No chain tool changed
  • No game files, keys or data extracted from a game in the change or the attachments
  • docs/env_switches.tsv has a row for DM_FRAME_WG; dm/games/settings.tsv has the launcher row.

Xipzer and others added 3 commits November 12, 2026 11:50
…nterval with the present period as deadline

The acquiring thread marks each frame as an interval (AudioWorkIntervalCreate, looked up at run time);
the encode thread and every thread that records command buffers join it; a guest thread leaves it at
exit (hle_thread.c). An iPad Pro M4 ran BotW mostly on efficiency cores while playing (14-55% of its
CPU time on performance cores), translation 60-70% slower, frames dropped, at thermal state 0. On the
Mac the translation thread's CPU time per frame fell 5.7 -> 2.8 ms (same cycles, higher clock).
DM_FRAME_WG=0 turns it off.

Discord: https://discord.com/channels/1491224015434678394/1524915513606803549
(cherry picked from commit 1873ca4)
(cherry picked from commit d4cf31c)
…ine boost)

iPad Pro M4, BotW at 120%, camera turning, thermal state 0, runs alternated on / off / on / off: with
it the translation thread ran at 3.8 GHz (3.3 ms a frame against 4.75 ms at 2.6 GHz) for 27% more CPU
power (1.94 against 1.52 W), no dropped frames either way. The efficiency-core episodes it is meant for
came in play, which the player tests with the toggle.

Discord: https://discord.com/channels/1491224015434678394/1524915513606803549
(cherry picked from commit 90276c0)
(cherry picked from commit df05416)
…out HookLink's name

The reference entry in frame-rate.md ("The frame's threads run on efficiency cores while the device is cool") and the symptom index. The Deadline boost description in settings.tsv came through HookLink's copy of these commits with "Experimental in HookLink"; it now reads "Experimental" and says device, not phone.

Checked: host build (GAME=0400486024DEC000), iOS compile check 263 files, 0 failed; test_launcher_settings, test_env_switches, test_docs pass; clang-tidy nothing over the baseline in hle_nvn.c and hle_thread.c. Not run in a game here.
@github-actions github-actions Bot added host The Horizon host: SVCs, services, threads, memory (dm/host) nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) tools Tools and scripts (dm/tools, scripts) docs Documentation labels Nov 12, 2026
@oliverames
oliverames marked this pull request as ready for review November 12, 2026 18:45
@Xipzer

Xipzer commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for opening this and for keeping the authorship, and for the docs. Happy for it to go in from here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation host The Horizon host: SVCs, services, threads, memory (dm/host) nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) tools Tools and scripts (dm/tools, scripts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants