Skip to content

DM_ITV_LATCH=1 (opt-in, not yet measured): hold present interval 2 while the game oscillates between 1 and 2 - #1701

Closed
oliverames wants to merge 1 commit into
seedds:mainfrom
oliverames:itv-latch
Closed

oliverames wants to merge 1 commit into
seedds:mainfrom
oliverames:itv-latch

Conversation

@oliverames

@oliverames oliverames commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Not fully tested; opt-in. Filed for review while the measurement is open.

What and why

Mario Kart World 1.8.0 (#1383's build) on a physical iPhone flips its present interval between 1 and 2 every few frames after late frames. Presentation follows each flip, so the screen alternates 16.7 and 33.3 ms periods, which looks like judder, and the display link follows each one too.

DM_ITV_LATCH=1 holds interval 2 until the game has asked for 1 continuously for DM_ITV_LATCH_MS (default 3000 ms), so the screen runs one steady 30 fps instead. The cost to check: the game's own logic sees the interval it asked for and keeps its step while the screen runs slower. DM_PRESENT_INTERVAL=display is the opposite approach (one frame per tick, ignoring the interval). Off by default: with the variable unset the code runs as before.

Checked

  • Tests: hle_nvn.c compiles on this base with a generated profile header (clang syntax-only); dm/tools/tests/test_docs.py passes; the new switches are in docs/env_switches.tsv with their meanings (env_switches.py --check still reports DM_NVN_BC_ALIAS, which is missing from the table on main too).
  • Games run, with title ID and version: Mario Kart World (0400C3F00006E000) 1.8.0, built from WIP: Mario Kart World 1.8.0 on iOS - rendering, memory and presentation #1383's tree, on the phone: one 1,800-frame run with it.
  • Devices and OS: iPhone 19,4 (2 Performance + 4 Efficiency cores), iOS 27.3; Apple-silicon Mac, macOS 27.3
  • scripts/regress.py check --games: not run: off by default, so every game runs as before without the variable.
  • Measurements before and after: interval flips: 12 in 1,800 frames with the latch against 58 in 2,100 frames without it (a different run each; the screen still held about 30 fps in both once the GPU slowed).
  • Not checked: whether the judder is gone (only the flip count was measured), whether the game's simulation stays right under it, and the GPU slowdown it does not touch. No unit test, no Mac run.

Front ends

None: no front end has to act on this.

Docs

  • The mechanism is in docs/development.md and the switches in docs/env_switches.tsv
  • A chain tool changed: dmsh_chain.py --header was run and dm/gfx/nvn/dmsh_chain.h is part of the change. Not applicable: no chain tool changed.
  • No game files, keys or data extracted from a game in the change or the attachments

@github-actions github-actions Bot added nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) docs Documentation labels Nov 7, 2026
@oliverames

Copy link
Copy Markdown
Contributor Author

Device result, not fully tested: the interval flip-flop is a symptom, not the cause. Runs with DM_ITV_LATCH, DM_RT60 and DM_PRESENT_INTERVAL=display all still reach the GPU slowdown (see the canary result on #1709). A forced DM_PRESENT_HZ=30 run also showed that capping the present tick below the game's own rate makes the whole game run in slow motion, because MKW's simulation advances once per game interval, so a present cap is not a usable workaround. Leaving these as opt-in switches with no default change.

…lates between 1 and 2

Off by default and not yet measured. Mario Kart World on an iPhone flips its present interval about 350 times in
20 s after a late frame, which shows the screen at alternating 16.7 / 33.3 ms periods. The latch holds interval 2 until
the game has asked for 1 for DM_ITV_LATCH_MS (3000), so the screen runs one steady 30 fps.
@oliverames

Copy link
Copy Markdown
Contributor Author

Combined into #1713 with the other two pacing switches; same commit, same tests. Closing this one.

@oliverames oliverames closed this Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant