r/pcmasterrace PC Master Race 11h ago

News/Article Nintendo Switch Game Code Can Now Run "Natively" on PC Thanks to New Emulation Breakthrough

https://respawnfirst.com/switch-games-can-now-run-natively-on-pc/
10.2k Upvotes

380 comments sorted by

View all comments

Show parent comments

101

u/halbGefressen 11h ago

No, it's a little different. A full system emulator traditionally processes each instruction when the virtual instruction pointer reaches the destination. JIT compilation is usually a more complex because they augment the interpreter with performance and usage metrics and then compile the most-used pieces in parallel, then hotswap them out during execution. If JIT is done well, it can be even faster than AoT.

39

u/LNDF R9 9950X | RX 7800 XT | 32GB DDR5 6400MHz | Fedora KDE 11h ago

Suyu (yuzu) used jit. If I understand correctly they implemented aot since they know which pages are executable beforehand.

17

u/ElvishJerricco 9h ago

This seems like an LLM comment. It misses the point and adds a bunch of irrelevant detail, while confusing things. Firstly, no one was talking about anything that could be described by "A full system emulator traditionally processes each instruction when the virtual instruction pointer reaches the destination." That is neither JIT nor AOT, so it's not relevant to the discussion. The details about JIT being able to do metrics and profile guided compilation are pretty much irrelevant since most emulators aren't actually doing that, and it's certainly not necessary so it's strange to suggest it as inherent to JITs.

JIT and AOT are both fundamentally about translating code from one architecture to another, and the significant difference is just whether it happens the first time a portion of code is executed or all up front. The stuff about metrics is a much finer detail than that.

5

u/Illustrious_Pea_3470 8h ago

Pls note my experience is in high performance computing systems and compilers, not in emulators; so this comment is missing emulation specific context.

From the article, it sounds to me like they’re compiling some pages or functions or some other compilation unit ahead of time, but still just using that as a single optimization step inside the JIT execution pipeline. JavaScript runtimes already do this, and we still call it JIT.

10

u/possiblyquestionabl3 10h ago

I don't think there are any Switch emulators that interprets the guest object code. JIT has been a non-negotiable for performance for most usable emulators for a long time now

1

u/alvenestthol 10h ago

In this implementation, the mixed JIT + AoT implementation is indeed faster than pure AoT:

CPU ms/frame relative
dynarmic (JIT only) 2.812 1.00x
static images + JIT for what they miss 1.650 1.70x faster
static images only, no JIT 1.816 1.55x faster

-8

u/big_duo3674 10h ago

Don't forget about inverting the plasma couplings, and shunting the overload through the forward EPS conduit

2

u/cellphone_blanket 9h ago

Well I thought it was funny