Live data from Hacker News

Why is Rosetta 2 fast?

dougallj.wordpress.com

241–250 of 367 posts

Re: Why is Rosetta 2 fast?

#241
post #15

I remember years ago when Java adjacent research was all the rage, HP had a problem that was “Rosetta lite” if you will. They had a need to run old binaries on new hardware that wasn’t exactly backward compatible. They made a transpiler that worked on binaries. It might have even been a JIT but that part of the memory is fuzzy. What made it interesting here was that as a sanity check they made an A->A mode where they…

Outside of gaming, or hyper-CPU-critical workflows like video editing, I'm not really sure if people actually even care about that last 10% of performance. I know most of the time I get frustrated by everyday software, its doing something unnecessary in a long loop, and possibly forgetting to check for Windows messages too.

Performance also translates into better battery life and cheaper datacenters.

Re: Why is Rosetta 2 fast?

#242

Earlier quoted context omitted.

That’s really interesting. You might enjoy reading about the VM embedded into the Busicom calculator that used the Intel 4004 [1] They squeezed a virtual machine with 88 instructions into less than 1k of memory! [1] https://thechipletter.substack.com/p/bytecode-and-the-busico...

That is nifty! Sounds very similar to a Forth interpreter.

[deleted]

Re: Why is Rosetta 2 fast?

#243
post #12
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…

Rosetta 1 had a ticking time bomb. Apple was licensing it from a 3rd party. Rosetta 2 is all in house as far as we know. Different CEO as well. Jobs was more opinionated on “principles” - Cook is more than happy to sell what people will buy. I think Rosetta 2 will last.

[deleted]

Re: Why is Rosetta 2 fast?

#244

Earlier quoted context omitted.

> If so, does it affect the application startup times? It does, but only the very first time you run the application. The result of the transpilation is cached so it doesn't have to be computed again until the app is updated.

And deleting the cache is undocumented (it is not in the file system) so if you run Mac machines as CI runners they will trash and brick themselves running out of disk space over time.

Really? This SO question says it's stored in /var/db/oah/

https://apple.stackexchange.com/questions/427695/how-can-i-l...

Re: Why is Rosetta 2 fast?

#245

Rosetta 2 has become the poster child for "innovation without deprecation" where I work (not Apple).

Apple is the king of deprecation, just look at what happened to Rosetta 1 and 32-bit iOS apps.

Yes they are, and that makes Rosetta 2 even more special. Though Rosetta 1 got support for 5 years, which is pretty good.

Re: Why is Rosetta 2 fast?

#246
post #15

I remember years ago when Java adjacent research was all the rage, HP had a problem that was “Rosetta lite” if you will. They had a need to run old binaries on new hardware that wasn’t exactly backward compatible. They made a transpiler that worked on binaries. It might have even been a JIT but that part of the memory is fuzzy. What made it interesting here was that as a sanity check they made an A->A mode where they…

Is this for itanium

Re: Why is Rosetta 2 fast?

#248
post #236

Earlier quoted context omitted.

> 15? More than a quarter century. They were one of the original investors in ARM and have produced plenty of arm devices since then beyond the newton and the ipod. They didn't design their own chips for most of that time.

At the same time as the ARM investment they had a Cray for...chip design.

Yes and?

Apple invested in ARM and worked with ARM/Acorn on what would become ARM6, in the early 90s. The newton uses it (specifically the ARM610), it is a commercial failure, later models use updated ARM CPUs to which AFAIK Apple didn't contribute (DEC's StrongARM, and ARM's ARM710).

Apple starts working on bespoke designs again around the time they start working on the iPhone, or possibly after they realise it's succeeding.

That doesn't mean they stopped using ARM in the meantime (they certainly didn't).

The iPod's SoC was not even designed internally (it was contracted out to PortalPlayer, later generations were provided by Samsung). 15 times and the revolution of Jobs' return (and his immediate killing of the Newton) is a long time for an internal team of silicon designers.

Re: Why is Rosetta 2 fast?

#250
post #146

Earlier quoted context omitted.

> Anyone know how they implemented PPC-to-x86 translation? They licensed Transitive's retargettable binary translator, and renamed it Rosetta; very Apple. It was originally a startup, but had been bought by IBM by the time Apple was interested.

> It was originally a startup, but had been bought by IBM by the time Apple was interested. Rosetta shipped in 2005. IBM bought Transitive in 2008. The last version of OS X that supported Rosetta shipped in 2009. I always wondered if the issue was that IBM tried to alter the terms of deal too much for Steve's taste.

A lesser known bit of trivia about this is that IBM would go on to use Transitive's technology for the exact opposite of Rosetta -- x86 to PowerPC translation, in the form of "PowerVM Lx86", released that year (2008).

It's very fascinating to me, since IBM appears to have extended the PowerPC spec with this application specifically in mind. Up until POWER10, the Power/PowerPC ISA specified an optional feature called "SAO", allowing individual pages of memory to be forced to use an x86-style strong memory model, comparable to the proprietary extension in Apple's CPUs, but much more granular (page level and enforced in L1/L2 cache as opposed to the entire core).

As far as I can tell, Transitive's technology was the only application to ever use this feature, though it's mainlined in the Linux kernel, and documented in the mprotect(2) man page. IBM ditched the extension for POWER10, which makes sense, since Lx86 only ever worked on big endian releases of RHEL and SLES which are long out of support now.

One mystery to me, though, is IBM added support for this page marker to the new radix-style MMU in POWER9. It's documented in the CPU manual, but Linux has no code to use it -- unless I've missed it, Linux only has code to set the appropriate bits in HPT mode, and no reference to the new method for marking radix pages SAO as the manual describes. I can't imagine there was any application on AIX which used this mode (it only decreases performance), and unless you backported a modern kernel to a RHEL 5 userland, you couldn't use Lx86 with the new radix mode. Much strangeness...

Post reply on HN