Project

General

Profile

Actions

Emulator Issues #11717

closed

Frequent JIT cache flushing in some games on AArch64

Added by Techjar almost 5 years ago. Updated about 2 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:
5.0-15524

Description

Game Name?

All Metroid Prime games
Donkey Kong Country Returns
True Crime: New York
Various other titles I don't remember

What's the problem? Describe what went wrong.

I'm making this issue as a way to encompass all the issue reports of game stuttering that are due to this, as well as have it properly documented for prospective devs.

Some games invalidate icache a lot which causes the JIT cache to fill up very quickly, resulting in frequent flushes which manifest as a very noticeable hitch in gameplay. This is due to our naive block allocator that simply places new blocks at the end of the buffer, and never reuses space from invalidated blocks until the cache is completely cleared. True Crime: New York is a particularly egregious offender, invalidating icache so much that the JIT cache is cleared every 2 seconds, making the game nearly unplayable. Even throwing that out as an outlier, many other titles experience stutters every few minutes that, while not making the game unplayable, are rather annoying and detract from the enjoyment.

What steps will reproduce the problem?

Play any of the listed games for some amount of time.

Is the issue present in the latest development version? For future reference, please also write down the version number of the latest development version.

Yes, 5.0-10151

Is the issue present in the latest stable version?

Presumably yes. The JIT cache has not changed in years, though it's slightly worse in dev builds due to some JIT changes generating more code.

If the issue isn't present in the latest stable version, which is the first broken version? (You can find the first broken version by bisecting. Windows users can use the tool https://forums.dolphin-emu.org/Thread-green-notice-development-thread-unofficial-dolphin-bisection-tool-for-finding-broken-builds and anyone who is building Dolphin on their own can use git bisect.)

N/A, been an issue since the dawn of time.

What are your PC specifications? (CPU, GPU, Operating System, more)

4.5GHz CPU Processor
24-bit Accelerated Video Graphics
Modern Operating System

Is there anything else that can help developers narrow down the issue? (e.g. logs, screenshots,
configuration files, savefiles, savestates)

Nope, but I will say that fixing this issue won't be easy. It's most likely going to require some pretty big changes to the whole JIT.


Related issues 3 (0 open3 closed)

Has duplicate Emulator - Emulator Issues #11998: Virtual Console Zelda OOT and MM StutterDuplicate

Actions
Has duplicate Emulator - Emulator Issues #11716: Donkey Kong Country Returns major stuttersDuplicate

Actions
Has duplicate Emulator - Emulator Issues #10014: Harry Potter: PoA freeze completely for several secondsDuplicate

Actions
Actions #1

Updated by markwest76 almost 5 years ago

Do you think this issue could be a duplicate of issue #11693 ?

Actions #2

Updated by Techjar almost 5 years ago

Yeah that's another game that experiences JIT flushing. Though, it would be an duplicate of this one, as this is meant to be the single place to document all the JIT flushing cases.

Actions #3

Updated by markwest76 almost 5 years ago

So you can confirm that 5-0-8007 is stutter-free with all the mentioned games?

Actions #4

Updated by Techjar almost 5 years ago

No, as stated older builds just stutter a bit less frequently. Why you experience "no" stuttering on that build we cannot explain, nor reproduce.

Actions #5

Updated by markwest76 over 4 years ago

Another game massively affected by this stuttering plague is Prince of Persia Forgotten Sands...

Actions #6

Updated by markwest76 about 4 years ago

I suggest to check if 5.0-11318 has fixed this issue...

Actions #7

Updated by Techjar about 4 years ago

It has not, only made the interval between flushes a bit longer depending on the game.

Actions #8

Updated by flacs about 4 years ago

Try 5.0-11590 (the PDEP issue fix, just in case someone has a Zen CPU) and compare it with 5.0-11537 (last build before double-to-float conversions were de-inlined).

Actions #9

Updated by Techjar about 4 years ago

That one probably also helps increase the interval further, but we still don't have a proper solution to more or less eliminate the flushing.

Actions #10

Updated by JosJuice over 3 years ago

Actions #11

Updated by JosJuice over 3 years ago

Actions #12

Updated by JosJuice over 3 years ago

Actions #13

Updated by Techjar over 3 years ago

5.0-12575 has significantly improved this issue. There are still problematic outliers, such as True Crime: New York, but for many games this issue is now practically non-existent. I wouldn't called it "fixed" yet, but it's a huge step forward.

https://dolphin-emu.org/download/dev/a31c204ca8784397928e75624e89e0ae6b733cc9/

Actions #14

Updated by JMC4789 over 3 years ago

  • Status changed from New to Fixed

I think we make an issue that details what is left to do down the line.

Actions #15

Updated by JosJuice over 3 years ago

  • Subject changed from Frequent JIT cache flushing in some games to Frequent JIT cache flushing in some games on AArch64
  • Status changed from Fixed to Accepted

5.0-12575 only applies to x64. Let's keep this open until we have the same fix on all platforms.

Actions #16

Updated by JosJuice over 2 years ago

  • Status changed from Accepted to Fix pending
Actions

Also available in: Atom PDF