Live data from Hacker News

RVVM – The RISC-V Virtual Machine

github.com

51–60 of 69 posts

Re: RVVM – The RISC-V Virtual Machine

#51
post #42
post #38

Earlier quoted context omitted.

>Of course, bot x86 and Arm started like that as well - but after 20+ years of evolution, they have to drag along a lot of history. (and one never really takes things away from an ISA, you only add new features, and at best deprecate old ones). Feature-wise, RISC-V is already about on par and has managed not to become a mess. Furthermore, unlike x86, ARM has broken binary compatibility several times in the past, and…

Pretty sure ARM has never broken binary compatibility, even across ISA expansions (16→32 bit, 32→64 bit).

ARMv8 aarch32 is backwards compatible with v5-v7 but aarch64 mode cannot run aarch32 code of any kind. ARMv8 makes supporting aarch32 mode optional too and so it really is a hard break.

Re: RVVM – The RISC-V Virtual Machine

#52
post #38

Earlier quoted context omitted.

The RISC-V isa is specifically designed to be nice and regular and easy to decode, and work with, which definitely shows here (also in the RTL code if you look at some of the well designed RISC-V cores) Of course, bot x86 and Arm started like that as well - but after 20+ years of evolution, they have to drag along a lot of history. (and one never really takes things away from an ISA, you only add new features, and at…

>Of course, bot x86 and Arm started like that as well - but after 20+ years of evolution, they have to drag along a lot of history. (and one never really takes things away from an ISA, you only add new features, and at best deprecate old ones). Feature-wise, RISC-V is already about on par and has managed not to become a mess. Furthermore, unlike x86, ARM has broken binary compatibility several times in the past, and…

ARMv8 AArch64 is pretty different from earlier ARMs and is probably more performant than the overly academic RISC-V.

Re: RVVM – The RISC-V Virtual Machine

#53

Earlier quoted context omitted.

"cancelled" by xiphias2 deleting the repository on github using magic? HN can't even tell the difference with asking and imposing?

There doesn't have to be a direct tangible threat for people to act on impulses they were taught through a direct tangible threat (see: learned helplessness [0]). That's the way reinforcement learning works on humans, otherwise there would be no concept of ethics - ethics itself is based on generalizing a basic set of rules learned through punishment and reward. The power is there, because it had an effect on reality…

> My theory is that the ratio between the learned "threat" and required effort to avoid the "threat" was low enough to warrant the action.

We can also take the more charitable interpretation: the repo owner saw the post asking for it to be removed, thought "yeah, wow, you're right, cigarettes do suck, and having it there is unnecessary and doesn't actually add anything valuable, so I might as well change it to something else".

Or, hell, we could even go out on a limb: "oh wow, I didn't realize someone might be offended by that, but I'll change it because I have no feelings about it being there whatsoever, and I don't want my project to make someone feel bad". Cuz, y'know, empathy is a thing.

(The cigarette emoji was in front of the "Tell me more..." heading; I'm having a hard time coming up with a reason for it to be there in the first place.)

I do agree with you that cancel culture has gotten out of hand, and some people will make the calculus you describe in some situations, but that seems a bit too much here. I doubt anyone is going to get cancelled over a cigarette emoji in a README, and it seems overblown to assume the repo owner made the change out of fear. (Famous last words, I know, but I stand by that.)

Re: RVVM – The RISC-V Virtual Machine

#54

Earlier quoted context omitted.

This may be new in the last 10-15 years, but let's not forget why that icon appeared there: because of the huge marketing budget spend created by tobacco companies to make smoking look cool instead of something that kills millions of people slowly.

[flagged]

That's... not what the parent poster said.

Re: RVVM – The RISC-V Virtual Machine

#55

Instruction interpreter is nicely human-readable: https://github.com/LekKit/RVVM/blob/staging/src/cpu/riscv_i....

That's quite copious way to implement it.

I agree a lot, but RVVM implements an API to register new instructions at runtime, so I wanted to leave the core sources as much understandable and macro-free. Plus I don't see how other switch-based approaches in QEMU, or near-mentioned mini-rv32ima are better, so there is no really any ground I could compare upon. I guess about 1K lines for a hugely-performant, readable and extendable interpreter, which itself does calls into a tracing JIT is a fine trade-off to change it at this point)

Re: RVVM – The RISC-V Virtual Machine

#56

Earlier quoted context omitted.

There doesn't have to be a direct tangible threat for people to act on impulses they were taught through a direct tangible threat (see: learned helplessness [0]). That's the way reinforcement learning works on humans, otherwise there would be no concept of ethics - ethics itself is based on generalizing a basic set of rules learned through punishment and reward. The power is there, because it had an effect on reality…

Alternatively, maybe the project authors decided that the cigarette imagery was (1) bothering somebody, and (2) did not matter to the identity of the project and was easily removed, so they decided to honor the request. It's probably what I would have done. Conversely, I was the author of a project whose namesake and mascot was an animal considered unclean by several world religions. Nobody ever asked me to change it…

This is exactly what happened. I never though much about the imagery, it was a 5-min commit to "make README look nicer", and I actually have asthma as well (Never been much around smokers so maybe I don't have such terrible associations). So it's much more of a, heh let's honor this random person request since I don't care much in the first place, and even if it's a little weird to trigger at the icon, I can kind of see why.

Re: RVVM – The RISC-V Virtual Machine

#57

How is this different from QEMU which also supports RISC-V 32|64 fairly well.

Basically there are few design choices where it's substantially different to QEMU.

Performance-wise:

- Instead of a static translate-and-run flow like in QEMU, RVVM has an interpret-trace-run execution loop which is remotely similar to JVM, and allows to collect some data like branch probabilities and hot loops, and optimize better

- Using a hardware host FPU instead of softfp emulation. This is like, 10x faster with some synthetic FPU benchmarks

- Conscious decisions for beneficial trade-offs, like fast-path JIT trace cache, JIT IR is more streamlined to "Big ISA Triad" (RISC-V, ARM64, x86-64), etc

Infrastructure-wise:

- A public library API for a lot of things: Machine management (Construct and run 'em in any program), device integration, registering new CPU instructions, userspace emulation

- Subjectively, a more lean and clean codebase, in places where it wasn't harmed by either 1) performance decisions to copy-paste or restructure things 2) complexity of related things like JIT backend arches

- Portability. RVVM officially runs in WASM, runs on Haiku, SerenityOS, KolibriOS, even DOS!

So yeah, while I can't say for sure it's the fastest RISC-V VM, but if we had a bunch more contributors and a bit more popularity it could definitely take a part of the QEMU crown (For things like distro building and god knows what else).

There are a few other differences here & there, but they aren't as much worth mentioning. Do you believe I should make some kind of QEMU/RVVM comparison anywhere in the repo? It seems kind of selfish to present it like that...

Re: RVVM – The RISC-V Virtual Machine

#58

How is this different from QEMU which also supports RISC-V 32|64 fairly well.

I had the exact same question. I do like this - it's nice and ambitious to build something like this from the ground up. Looking at the todo list though, they still have quite some work to get to parity with qemu...

See my nearby post on this thread, hope it'll explain stuff

Re: RVVM – The RISC-V Virtual Machine

#59
post #54

Earlier quoted context omitted.

[flagged]

That's... not what the parent poster said.

Oh, I know.

The OP put an icon of cigarette because big evil corporations brainwashed him into liking cigarettes, not because he wanted to.

But he removed it because he wanted to, not because big evil mobs brainwashed him into fearing cancellation.

That's totally how it happened.

Re: RVVM – The RISC-V Virtual Machine

#60

Instruction interpreter is nicely human-readable: https://github.com/LekKit/RVVM/blob/staging/src/cpu/riscv_i....

So is this, even more so in my taste: https://github.com/cnlohr/mini-rv32ima/blob/master/mini-rv32... A RISC-V emulator in one include file.

That's a cool achievement, but I imagine the single-switch decoder is a bit of a limiting design factor if this project grows (disabling/enabling instructions will introduce branches everywhere, and that's needed for proper FPU conformance). Also a bit jealous of how it is so popular by just presenting that Doom runs on a minimal ISA subset, while the VM that literally outperforms QEMU was around for much longer. I definitely should time-travel back and tell myself from 2021 to just show off people Doom, since I was doing the same in my communication circles back then xD
Post reply on HN