Live data from Hacker News

Why is Rosetta 2 fast?

dougallj.wordpress.com

51–60 of 367 posts

Re: Why is Rosetta 2 fast?

#51
post #28
post #8

Apple is doing some really interesting but really quiet work in the area of VMs. I feel like we don’t give them enough credit but maybe they’ve put themselves in that position by not bragging enough about what they do. As a somewhat related aside, I have been watching Bun (low startup time Node-like on top of Safari’s JavaScript engine) with enough interest that I started trying to fix a bug, which is somewhat unusua…

> feel like we don’t give them enough credit but maybe they’ve put themselves in that position by not bragging enough about what they do. And maybe also by keeping the technology closed and Apple-specific. Many people who could be interested in using it don't have access to it.

WebKit B3 is open source: https://webkit.org/docs/b3/

Re: Why is Rosetta 2 fast?

#52
Apple's historically been pretty good at making this stuff. Their first 68k -> PPC emulator (Davidian's) was so good that for some things the PPC Mac was the fastest 68k mac you could buy. The next-gen DR emulator (and SpeedDoubler etc) made things even faster.

I suspect the ppc->x86 stuff was slower because x86 just doesn't have the registers. There's only so much you can do.

Re: Why is Rosetta 2 fast?

#53
post #6

I hope Rosetta is here to stay and continues developement. And I hope what is learned from it can be used to make a RISC-V version of it. translating native ARM to RISC-V should be much easier than x86 to ARM as I understand it, so one could conceivably do x86 -> ARM -> RISC-V.

> I hope Rosetta is here to stay and continues developement. It almost certainly is not. Odds are Apple will eventually remove Rosetta II, as they did Rosetta back in the days, once they consider the need for that bridge to be over (Rosetta was added in 2006 in 10.4, and removed in 2011 from 10.7). > And I hope what is learned from it can be used to make a RISC-V version of it. translating native ARM to RISC-V should…

> Odds are Apple will eventually remove Rosetta II, as they did Rosetta back in the days, once they consider the need for that bridge to be over (Rosetta was added in 2006 in 10.4, and removed in 2011 from 10.7).

The difference is that Rosetta 1 was PPC → x86, so its purpose ended once PPC was a fond memory.

Today's Rosetta is a generalized x86 → ARM translation environment that isn't just for macOS apps. For example, it works with Apple's new virtualization framework to support running x86_64 Linux apps in ARM Linux VMs.

https://developer.apple.com/documentation/virtualization/run...

Re: Why is Rosetta 2 fast?

#54
Vertical integration. My understanding was it's because the Apple silicon ARM has special support to make it fast. Apple has had enough experience to know that some hardware support can go a long way to making the binary emulation situation better.

Re: Why is Rosetta 2 fast?

#55
post #6

Earlier quoted context omitted.

> I hope Rosetta is here to stay and continues developement. It almost certainly is not. Odds are Apple will eventually remove Rosetta II, as they did Rosetta back in the days, once they consider the need for that bridge to be over (Rosetta was added in 2006 in 10.4, and removed in 2011 from 10.7). > And I hope what is learned from it can be used to make a RISC-V version of it. translating native ARM to RISC-V should…

>That's not going to happen unless Apple decides to switch from ARM to RISC-V, and... why would they? They've got 15 years experience and essentially full control on ARM. Two points here. • First off, Apple developers are not binded to Apple. The knkwledge gained can be used elsewhere. See Rivos and Nuvia for example. • Second, Apple reportedly has already ported many of it's secondary cores to RISC-V. It's not unrea…

Apple reportedly has already ported many of it's secondary cores to RISC-V

Really? In current hardware or is this speculation?

Re: Why is Rosetta 2 fast?

#56
post #25

Earlier quoted context omitted.

https://www.hpl.hp.com/techreports/1999/HPL-1999-78.html

It was particularly poignant at the time because JITed languages were looked down on by the “static compilation makes us faster” crowd. So it was a sort of “wait a minute Watson!” moment in that particular tech debate. No one cares as much now days, we’ve moved our overrated opinion battlegrounds to other portions of what we do.

I eventually changed my opinion into JIT being the only way to make dynamic languages faster, while strong typed ones can benefit from having both AOT/JIT for different kinds of deployment scenarios, and development workflows.

Re: Why is Rosetta 2 fast?

#58
post #9

Not having any particular domain experience here, I've idly wondered whether or not there's any role for neural net models in translating code for other architectures. We have giant corpuses of source code, compiled x86_64 binaries, and compiled arm64 binaries. I assume the compiled binaries represent approximately our best compiler technology. It seems predicting an arm binary from an x86_64 binary would not be insa…

Many branch predictors have traditionally used perceptrons, which are sort of NN like. And I think there's a lot of research into involving incorporating deep learning models into doing chip routings.

Re: Why is Rosetta 2 fast?

#59
post #35

Earlier quoted context omitted.

having total control on the hardware and the software didn't hurt for sure

Qualcomm (and Broadcomm) has total control on the hardware and software side of a lot of stuff and their stuff is shit. It's not about control, it's about good engineering.

It's about both control and engineering in Apple's case.
Post reply on HN