Skip to content

Releases: redstone-md/rava

Release list

rava v0.0.1-alpha

rava v0.0.1-alpha Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 16 Oct 03:21

rava v0.0.1-alpha: the first alpha of a Java virtual machine written from scratch in Rust.

alpha · Linux, macOS and Windows on x86-64 · Java 21 class library · drop-in java

Warning

An alpha: expect crashes and differences from HotSpot, and keep backups of any world you open
with it. Reports are welcome in Issues.

rava runs Java programs the way java does: same command line, same output, same exceptions,
same exit codes. Each archive carries its own copy of the Java class library, and rava
implements every native method itself, so you do not need to install anything else. It starts
a Paper 1.21 server and runs the Minecraft client, vanilla and modded, from the usual
launchers. Every start is cold. There is no class-data archive, no checkpoint/restore, no AOT
cache, and nothing is tuned for a particular program.

What is in it

  • A two-tier JIT to x86-64.
    • The baseline compiler emits machine code straight from bytecode.
    • The SSA optimizing tier inlines by type profile and class hierarchy analysis. It speculates
      with deoptimization, scalar-replaces allocations that do not escape, numbers loads, and
      removes redundant checks.
    • Running loops enter optimized code by on-stack replacement.
  • A generational garbage collector with bump allocation inline in compiled code, parallel
    marking, compressed references and a 32-bit class word.
  • Real JNI. Native libraries such as netty's epoll, LWJGL and OpenAL load and run as they do on
    HotSpot, at HotSpot's call cost.
  • The java command line, unchanged: -jar, -cp, modules, single source files, @argfiles,
    -D/-X/-XX, thread dumps on Ctrl+Break / kill -3.
  • Diagnostics: RAVA_SAMPLE (a sampling profiler), RAVA_MEM_LOG, RAVA_TRACE_JNI, perf
    maps of compiled code, and crash reports.

Performance

Steady-state microbenchmarks against HotSpot (OpenJDK 21.0.7, Microsoft build) on an
i5-14400F, with both pinned to the performance cores. Each figure is the best of interleaved
rounds, rava's time divided by HotSpot's. Below 1, rava is faster.

Benchmark What it runs rava / HotSpot
TextBench Minecraft's formatted-text walk (StringDecomposer) 0.74
ParticleBench billboard particle quads written to off-heap vertex buffers 0.90
CubicBench Minecraft's sky and fog colour sampling (CubicSampler) 1.00
JomlBench entity-part transforms with JOML (pose stack, quaternions) 1.00
FormatBench String.format with ints, doubles and strings 1.14
RegexBench java.util.regex matching 1.24

In the Minecraft client, frame rate on a frozen scene is about 0.9× HotSpot's.

The cause of the slower rows is known. The optimizing tier allocates values to 9 general
registers where C2 has about 13, so formatting and regex code with many live values spills
more. Fixing that is the next large piece of work.

Known limits

  • x86-64 only, and the Java 21 class library only.
  • rava does not produce helpful NullPointerException messages yet.
  • Some programs will crash or behave differently from HotSpot. Please report them with
    rava -version, the system, the command line and the full output.

Download

Platform Archive Size SHA-256
Linux x86-64 (glibc 2.35 or newer) rava-0.0.1-alpha-linux-x86_64.tar.gz 48 MiB 21d289db057f8f7d…
macOS x86-64 (Intel; Apple Silicon through Rosetta 2) rava-0.0.1-alpha-macos-x86_64.tar.gz 47 MiB 27db43d0fe4aa0e8…
Windows x86-64 (Windows 10 or newer) rava-0.0.1-alpha-windows-x86_64.zip 47 MiB e59918c1efbca6be…

Each archive is a complete Java runtime: the rava VM and the Java 21 class library it runs (OpenJDK, GPLv2 with the Classpath Exception, notices in legal/). No JDK needs to be installed. Full checksums are in the .sha256 files beside the archives.

# Linux (on a Mac, macos-x86_64)
tar xzf rava-0.0.1-alpha-linux-x86_64.tar.gz
rava-0.0.1-alpha-linux-x86_64/bin/rava -version
# Windows
Expand-Archive rava-0.0.1-alpha-windows-x86_64.zip .
.\rava-0.0.1-alpha-windows-x86_64\bin\rava.exe -version

Then wherever you would type java, type rava.

Changes

The first release: 830 commits.

Features (133)
  • sampler: RAVA_SAMPLE_WINDOW writes each ten seconds' samples on their own (ecb3305)
  • natives: Java thread priorities set the OS thread's, as HotSpot's do (8ab3232)
  • diag: RAVA_COUNT_CALLS, and native samples named by their Java caller (36ee316)
  • diag: RAVA_STDERR, and per-thread CPU and compilations over time (6ac7741)
  • diag: RAVA_SAMPLE names the Java caller of VM code (f125193)
  • diag: RAVA_INLINE_LOG= logs only the decisions that mention it (fbc6270)
  • diag: RAVA_SAMPLE_DETAIL counts samples per instruction offset (c2a6438)
  • diag: report heap corruption and fail-fast exceptions on Windows (8336340)
  • diag: RAVA_TRACE_JNI traces native calls, RAVA_NO_JNI_STUBS disables the stubs (d2dd108)
  • diag: RAVA_MEM_LOG counts inflated monitors and thin-lock sleeps (37ed183)
  • diag: RAVA_SAMPLE names who made a system call (f5508fe)
  • diag: RAVA_SAMPLE, a sampling profiler for Windows (918e5a6)
  • gc: age promoted objects before they are old for good (8b0a77f)
  • diag: RAVA_MEM_LOG breaks the process's memory down (0134737)
  • diag: RAVA_STDERR sends standard error to a file (6b24ec0)
  • management: report the CPU feature flags (14324c6)
  • jni: attach threads the VM did not start (a5c2653)
  • runtime: NoClassDefFoundError names why initialization failed (feb4ced)
  • natives: registry natives for preferences and content types (1a7f193)
  • natives: MappedByteBuffer load, isLoaded and force (236ba84)
  • natives: DNS configuration on Windows (9904768)
  • diag: RAVA_DUMP_FILE appends thread dumps to a file (fd028f2)
  • diag: crash reports with a filled-in issue link (00edec5)
  • diag: RAVA_FAULT_EAGER reports faults a library would swallow (dca5f64)
  • jit: RAVA_OPT_EXCLUDE keeps methods out of the optimizing tier (e679154)
  • jit: global value numbering of pure arithmetic (328b90d)
  • jit: read receiver fields in early returns (f795115)
  • jit: take early returns before the prologue (83fd824)
  • jit: pass register arguments on interface calls (54027cb)
  • jit: pass register arguments on vtable calls (9e9ce60)
  • jit: hint argument registers to the register allocator (dbd8a7b)
  • diag: report fatal memory faults with modules and frames (29103c6)
  • natives: run the Windows AWT toolkit headless (fd36eb7)
  • jit: pass register arguments on direct optimized calls (9e8fc78)
  • jit: give optimized code a register-argument entry (5a66866)
  • jit: add a multi-byte nop alignment helper to the assembler (1b2ae3e)
  • natives: process and system CPU load (4459783)
  • natives: ThreadMXBean thread information and dumps (8c52f04)
  • thread dumps while a collection holds the world (7b9729f)
  • natives: NTSystem, the current Windows user from the process token (ebb9e1f)
  • thread dumps on SIGQUIT, Ctrl+Break or a timer (3801954)
  • natives: IPv4 multicast and urgent data in sun.nio.ch.Net (a8e5533)
  • natives: asynchronous channels on Windows over I/O completion ports (3ee0681)
  • natives: child processes on Windows (9f5a213)
  • jni: the Win64 convention on Windows (8134924)
  • natives: networking on Windows (365a4d8)
  • natives: NIO files on Windows (182dd60)
  • natives: boot the Windows class library (64a2f23)
  • gc: the heap commits memory as it grows (ceb6e34)
  • os: Windows platform layer (d12ac14)
  • build and lay out memory on macOS (d58f27c)
  • natives: the macOS class library's natives (7935e63)
  • launcher: -Drava.opengl=vulkan routes OpenGL through Zink (d75d608)
  • jni: FromReflectedMethod and FromReflectedField (0ec0035)
  • jni: load native libraries and call their natives (ec4c96c)
  • opt: RAVA_JIT_DUMP_RAW dumps optimized code without trace labels (e549ee8)
  • patches: mod-fixes, starting with Iron Furnaces' explosion handler (6c3e0a8)
  • patches: game-events, no empty listener registries visited (4762efb)
  • patches: targeting, a search's own selector asked first (e8a41de)
  • patches: chunk-cache, the last chunk a level looked up (1fdd3ba)
  • jit: RAVA_PERF_MAP=inline names inlined methods' code after them (a7cbb73)
  • patch: add fields to the classes a patch edits (84568b2)
  • patches: explosions, a faster exposure ray walk (f834c5b)
  • bench: tick_sprint scenarios building a load before the sprint (c064681)
  • patch: redirect a call in every method of a class (8b3a262)
  • patches: parallel-levels, ticking NeoForge levels on several threads (8e9d176)
  • patch: define each patch class once, shared by every loader (f88b7d3)
  • patch: load patches from rava-patches/ next to the program (932d53c)
  • jit: a fatal SIGSEGV report gives the module offset of pc, for addr2line (7efb57d)
  • opt: RAVA_OPT_IR_STATES adds deoptimization states, aliases and virtual objects to the IR dump (06e49db)
  • RAVA_HASH_SEED fixes the identity hash sequence (a7a5b10)
  • jit: RAVA_PERF_MAP=exit writes the perf map once at exit (813894e)
  • launcher: rava names itself in -version and the runtime properties (cc59527)
  • opt: string and array intrinsics as direct leaf calls (d069710)
  • opt: unreached branches of OSR versions leave for the interpreter (64916e9)
  • opt: on-stack replacement into optimized code (f851396)
  • **nati...
Read more