Skip to content
CAI
Software that uses CAICheck a score

copy/v86

38.9

Weak · 1 October 2026

68.7k

lines of production code

JavaScript

with Rust

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is v86, a browser-based x86 emulator that runs operating systems directly in the web environment. It features a high-performance core rewritten in Rust and compiled to WebAssembly, utilizing a Just-In-Time compiler to translate x86 instructions for efficient execution. The emulator supports a wide range of guest OS capabilities, including VirtIO networking, 9P filesystem sharing, and various storage controllers, while providing extensive tooling for building, testing, and snapshotting virtual machine images.

How it got here

2013–2014 — Rust backend and browser consolidation

9 changes.

The project transitioned to a Rust-based WebAssembly backend and ES6 module structure, consolidating efforts around the browser environment by removing the legacy Node.js port. This period also introduced significant architectural improvements, including a bus-based asynchronous communication system and expanded hardware support such as VirtIO 9P filesystems and modernized BIOS configurations.

2015–2024 — Rust migration and test expansion

24 changes.

The project undertook a major migration of the core CPU emulation and JIT engine from C to Rust, introducing a new WebAssembly code generation module. This period also saw the extensive expansion of the test suite, adding comprehensive integration, regression, and benchmark tests for x86 instruction emulation, virtual devices, and system performance.

Features

Add Debian XFCE Docker build and state-generation tools

This change introduces a new set of build scripts and configuration files in tools/docker/debian to create a Debian-based virtual machine image with the XFCE desktop environment. It includes a Dockerfile that sets up a 32-bit Debian Bookworm environment with X11, XFCE, and necessary drivers, along with shell scripts (build-9p.sh, build-raw-disk.sh) to build the Docker image and export the filesystem into formats suitable for v86 (9p filesystem or raw disk image). Additionally, JavaScript scripts (build-state-9p.js, build-state-raw-disk.js) are provided to boot the VM using v86, wait for the GUI to be ready, and save the emulator state for faster subsequent loads. A README.md documents the usage for both 9p and raw disk modes.

tools/docker/debian · high confidence

Add Docker build support for v86

Users can now build and run the v86 emulator inside a Docker container. A new Dockerfile and build script in tools/docker/exec allow building the v86 assets using an Alpine-based builder and serving them via a Python HTTP server, configurable via a PORT argument.

tools/docker/exec · high confidence

Add VirtIO 9P filesystem support

The emulator now supports mounting host directories into the guest OS using the VirtIO 9P protocol. This new capability is implemented in lib/9p.js (the VirtIO 9P device driver), lib/filesystem.js (the in-memory filesystem abstraction), and lib/marshall.js (binary data serialization helpers). Users can now share files between the host and the guest environment, enabling read/write access to host resources from within the emulated system.

lib · high confidence

Add softfloat library for x87 FPU support

The softfloat library (Release 3e) has been added to the codebase to provide IEEE floating-point arithmetic support. This change introduces the core softfloat implementation, including platform-specific configurations for little-endian systems and GCC inline optimizations, enabling software-based floating-point operations.

lib/softfloat · high confidence

Add standalone Zstandard decompressor library

The project now includes a standalone, single-file Zstandard (zstd) decompressor implementation (zstddeclib.c). This addition enables users to decompress zstd-compressed data without requiring the full zstd compression library or external system headers, as the code is self-contained with custom memory allocation hooks and disabled compression features.

lib/zstd · high confidence

Add tooling to build and snapshot an Alpine Linux 9p rootfs for v86

New scripts and configuration in tools/docker/alpine allow users to build an Alpine Linux 3.21 rootfs optimized for v86 emulation. The Dockerfile sets up a minimal environment with virtio-net and 9p support, while build.sh automates the creation of the rootfs archive and metadata. Additionally, build-state.js provides a mechanism to boot the emulator, wait for initialization, and save a compressed state snapshot (using zstd) to speed up subsequent loads.

tools/docker/alpine · high confidence

Introduction of Rust-based WebAssembly code generation module

A new \wasmgen\ module has been added to the Rust codebase, providing a \WasmBuilder\ and opcode definitions for generating WebAssembly binaries. This component introduces the infrastructure for JIT compilation by handling WASM module structure, including type, import, function, and code sections, as well as direct control flow generation using WASM blocks and loops.

src/rust/wasmgen · high confidence

New and updated browser examples for v86

The examples directory now includes a comprehensive set of new demonstration pages and scripts, such as Alpine, Arch, Debian (9p and raw disk), sectorc, Lua, and TCP Terminal, alongside updated examples for save/restore, async loading, and worker-based execution. These additions provide users with ready-to-run templates for various operating systems, networking configurations (including Broadcast Channel and fetch-based TCP), and state management features.

examples · high confidence

New code generation scripts for analyzer, interpreter, and JIT backends

The \gen\ directory now includes new JavaScript scripts (\generate\_analyzer.js\, \generate\_interpreter.js\, \generate\_jit.js\) that use the \x86\_table.js\ definition to produce Rust source code for the CPU emulator's three execution modes. These scripts parse the x86 instruction encoding table and generate the corresponding dispatch logic, allowing the analyzer, interpreter, and JIT compiler to be built from a single source of truth.

gen · high confidence

New filesystem and image processing tools with Zstandard compression support

Added several new utility scripts in the tools directory to support building and managing v86 images. fs2json.py now generates filesystem JSON structures and supports Zstandard compression via the --zstd flag. copy-to-sha256.py copies files or tar archives to a destination, naming them by their SHA-256 hash prefix (truncated to 10 characters) and optionally compressing them with Zstandard. split-image.py allows splitting large images into fixed-size chunks, with optional Zstandard or gzip compression. A new mkisofs.js tool generates ISO9660 images from files for testing, and rust-lld-wrapper provides a configurable linker wrapper that handles debug stripping and stack-first arguments. Additionally, fetch\_network\_harness.mjs was added to facilitate network testing via UDP datagrams.

tools · high confidence

New screen adapters, network adapters, and file storage interfaces

The browser module now includes new screen adapters (ANSIScreenAdapter, DummyScreenAdapter) for text-mode output, new network adapters (InBrowserNetworkAdapter, NetworkAdapter, FetchNetworkAdapter) for various connectivity options, and a new file storage interface (FileStorageInterface) with implementations (MemoryFileStorage, ServerFileStorageWrapper) for managing disk images and files. These changes provide more flexibility in how the emulator handles display, networking, and file I/O.

src/browser · high confidence

Rust JIT and interpreter modules exposed in gen crate

The \src/rust/gen\ module now exposes the Rust implementations of the JIT compiler, interpreter, and their 0f-specific variants, along with the analyzer. This change makes these core execution components available for use within the Rust codebase, replacing or supplementing previous implementations.

src/rust/gen · high confidence

Removals

Removal of the Node.js emulator port

The Node.js-based emulator implementation has been removed from the project. This change deletes the entry point (src/node/main.js) and all associated platform-specific adapters for input and output, including keyboard handling via SDL and TTY, as well as screen rendering for both graphical and text modes. Users can no longer run the emulator using Node.js.

src/node · high confidence

Architecture

Introduce Bus-based asynchronous communication between emulated devices and the browser

A new asynchronous messaging system (Bus) has been added to decouple emulated hardware devices from the browser implementation. This change replaces direct function calls with a publish-subscribe model, allowing device events to be emitted and handled asynchronously. This architectural shift prepares the emulator for future Web Worker integration and improves separation of concerns between the emulation core and the host environment.

src · high confidence

Behavioural changes

Modernized build tooling and added PWA support

The project has replaced JSHint with ESLint for JavaScript linting, introducing a comprehensive configuration with strict rules and global definitions. A new .editorconfig file enforces consistent coding styles (UTF-8, 4-space indentation). Additionally, a manifest.json file has been added to support Progressive Web App (PWA) features, allowing the application to be installed on mobile devices. The legacy loader.js script for uncompiled browser loading has been removed.

(repo-wide) · high confidence

Port x86 JIT engine and core CPU emulation to Rust

The x86 Just-In-Time (JIT) compilation engine and core CPU emulation logic have been ported from C to Rust. This change introduces new modules for instruction analysis, code generation, and control flow graph management, while replacing the previous C-based implementation. The port includes support for SSE, MMX, and FPU instructions, and utilizes WebAssembly features like direct control flow and multi-value returns to optimize the generated code. Configuration options such as \LOG\_PAGE\_FAULTS\ and \VMWARE\_HYPERVISOR\_PORT\ are now defined in Rust, and the profiler is toggled via Cargo features.

src/rust · high confidence

Ported APIC, IOAPIC, and core CPU emulation to Rust

The x86 CPU emulation core, including the Advanced Programmable Interrupt Controller (APIC), I/O APIC, arithmetic logic, FPU, and instruction decoding, has been rewritten in Rust. This migration introduces a new memory layout for global CPU state pointers, implements hardware task switching and SSE3 support, and adds runtime configuration for ACPI/APIC. The change also includes a JIT cache optimization and fixes for 32-bit wrap-around in profiling and operation statistics.

src/rust/cpu · high confidence

Updated SeaBIOS configuration and build process

The BIOS build system has been updated to fetch and compile SeaBIOS version 1.16.2, replacing the previous build script and configuration files. The new default configuration enables features such as the boot menu, ACPI, and various storage controllers (SATA, AHCI, VirtIO, SCSI), while switching the VGA ROM to Bochs standard VGA. A separate debug configuration is now provided with increased debug logging levels.

bios · high confidence

Test coverage

Add full integration test suite for v86; Added JIT paging tests for protected mode; Added benchmark scripts for Linux boot, snapshot, network, and application performance; Added expect tests for x86 instruction emulation; Added expect-based code generation tests for the JIT compiler; Added integration tests for network, filesystem, and virtio devices; Added manual test for emulator garbage collection; Added test for Rust WASM generation dummy output; Expanded API test coverage for V86 emulator features; Expanded NASM test suite for x86 instruction emulation; Expanded QEMU-based x86 test coverage and infrastructure; Import kvm-unit-tests test suite and C++ API; Import x86 kvm-unit-tests suite; Removed obsolete x86 performance benchmark suite.

Dependencies

Initial release of v86 with Rust backend and ES6 module support

This change introduces the v86 package (version 0.5) for distribution via npm, featuring a new Rust-based implementation (Cargo.toml) that compiles to a WebAssembly cdylib. The package is configured as an ES6 module (type: module) with TypeScript definitions (v86.d.ts) and includes build artifacts for the browser-based x86 emulator and JIT. The release also removes the legacy Node.js port and its dependencies (node-sdl), consolidating the project around the new Rust/WASM architecture.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 40 → 39 (-0.6)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 31 → 31 (-0.1)
  • Architecture 78 → 79 (+0.9)
  • Maturity 64 → 64 (+0.0)
  • Readiness 37 → 36 (-1.0)
  • Security 67 → 70 (+3.3)
  • Accessibility 38 → 38 (+0.0)
  • Performance 70 (new)

Resolved (70)

  • Check (cognitive 27) (lib/filesystem.js)
  • Coverage not measured — no coverage collector is wired up
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no installation or build instructions (docs/how-it-works.md)
  • Documentation: no installation or build instructions (docs/linux-9p-image.md)
  • Documentation: no installation or build instructions (docs/modem.md)
  • Documentation: no licence statement (README.md)
  • Duplicated block (12 lines × 2) (src/rust/cpu/instructions_0f.rs)
  • Hotspot: src/browser/fetch_network.js (src/browser/fetch_network.js)
  • Hotspot: src/browser/main.js (src/browser/main.js)
  • Hotspot: src/ps2.js (src/ps2.js)
  • Hotspot: src/rust/codegen.rs (src/rust/codegen.rs)
  • Hotspot: src/rust/cpu/cpu.rs (src/rust/cpu/cpu.rs)
  • Hotspot: src/rust/cpu/instructions_0f.rs (src/rust/cpu/instructions_0f.rs)
  • Hotspot: src/rust/jit.rs (src/rust/jit.rs)
  • Hotspot: src/rust/jit_instructions.rs (src/rust/jit_instructions.rs)
  • Hotspot: src/vga.js (src/vga.js)
  • Hotspot: src/vmware.js (src/vmware.js)
  • Hotspot: tests/full/run.js (tests/full/run.js)
  • Lock (cognitive 46) (lib/filesystem.js)
  • …and 50 more

New (57)

  • 9p.Virtio9p.ReceiveRequest (cognitive 98) (lib/9p.js)
  • 9p.Virtio9p.ReceiveRequest (cyclomatic 72) (lib/9p.js)
  • FileTooLong: gen/x86_table.js (gen/x86_table.js)
  • Hotspot: src/browser/screen.js (src/browser/screen.js)
  • Low cohesion: F80 (LCOM4 18) (src/rust/softfloat.rs)
  • Members sharing a duplicated core (4 members, 50+ identical tokens) (src/rust/jit_instructions.rs)
  • Off-boarding risk: anonymized user #1
  • buffer.AsyncXHRPartfileBuffer.get (cognitive 27) (src/buffer.js)
  • cpu.CPU.dump_gdt_ldt (cognitive 22) (src/cpu.js)
  • cpu.CPU.dump_page_directory (cyclomatic 26) (src/cpu.js)
  • cpu.CPU.init (cognitive 63) (src/cpu.js)
  • cpu.CPU.init (cyclomatic 43) (src/cpu.js)
  • cpu.CPU.load_multiboot_option_rom (cyclomatic 39) (src/cpu.js)
  • cpu.CPU.set_state (cyclomatic 41) (src/cpu.js)
  • fake_network.TCPConnection.process (cognitive 48) (src/browser/fake_network.js)
  • fake_network.TCPConnection.process (cyclomatic 31) (src/browser/fake_network.js)
  • filesystem.FS.Check (cognitive 27) (lib/filesystem.js)
  • filesystem.FS.Lock (cognitive 46) (lib/filesystem.js)
  • filesystem.FS.Lock (cyclomatic 29) (lib/filesystem.js)
  • filesystem.FS.Rename (cognitive 36) (lib/filesystem.js)
  • …and 37 more

Changes since last survey

  • 5 commits — 3 feature/other, 2 fixes

By area

  • (root) — 1 commit
  • src/browser — 1 commit
  • src/ide.js — 1 commit
  • src/rust — 1 commit
  • tests/devices — 1 commit

Notable commits

  • fix: fix file locking test again again
  • fix: fix use_graphical_text in release builds (#1640)
  • change: Fix typo in Readme
  • change: Implement ATA_CMD_READ_LOG_EXT (#1639)
  • change: Implement IA32_PAT MSR and CLFLUSH

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

copy/v86 was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 1 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 1f1414addb68bf676b5ca7618b8a3835a8ff0f79 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.