SliceVM Runtime: System Architecture & Internal Specification Index (v0.15.0)
Welcome to the SliceVM Runtime System Architecture and Internal Specification (docs/system/). Engineered in pure Rust (edition = 2024, rust-version = "1.98.0", opt-level = 3, lto = "fat", codegen-units = 1, panic = "abort"), Slice replaces the legacy POSIX + monolithic V8/JSC assumptions of Node.js, Deno, and Bun with four orthogonal, tightly integrated Rust crates:
slice-cas- Zero-Stat Content-Addressed Storage (SLICE_CASv1), Oxc (v0.160.0) AOT TypeScript/TSX Compiler, Oxc Semantic/AST Dead-Export Tree-Shaker, &SLICEEXEStandalone Executable Linker.slice-io- Direct Kernel Completion Ring Engine (Linuxio_uringIORING_SETUP_SQPOLL+ Windows NTIOCPFFI +64 KBPage-Aligned Fixed Slab Buffers).slice-sandbox- MicroVM-Grade Object Capabilities (FsCap,NetCap,EnvCap,ExecCap), Dynamic SES Intrinsic Lockdown, Deterministic CPU Fuel & Byte Cage, & Linuxx86_64WRPKRUProtection-Key Domain Scaffolding.slice-engine- Hybrid Three-Tier Execution Core: Tier-1 DefaultSLICEBC\x01Precompiled BoaCodeBlockCAS (vm/boacas.rs,vendor/boa_engine/SLICE_PATCH.md) + Pre-Warmedboa_enginePool + Native Rust Host Intrinsics, Tier-0SLICESNPSnapshot VM, & Tier-2 Unboxed 64-Bit Numeric Register VM (vm/numeric_vm.rs).
For user-facing documentation and guides, see docs/README.md and docs/general/09_benchmarks_testing_and_docker_suite.md. For empirical cross-runtime benchmark numbers, see tests/reports/latest.md.
1. System Architecture Map (docs/system/)
Section titled “1. System Architecture Map (docs/system/)”| Document | Subsystem / Scope | Key Source Modules Covered |
|---|---|---|
00_index.md |
Executive Overview, 4-Crate Topology, Crate & Module Map, & Legacy Runtime Bottlenecks | Workspace Overview |
01_cas_bundler_and_oxc_compiler.md |
Zero-Stat SLICE_CAS v1 Binary Format, Oxc v0.160.0 TS/TSX Compiler, Semantic Lowering, Oxc AST Array Pipeline Fusion, ESM-First "exports", Cold-Method require Inliner, Reverse-Topological Oxc Semantic/AST Tree-Shaker, & Single-Copy SLICEBC\x01/SLICEBOA CAS Deduplication |
crates/slice-cas/src/{lib.rs,archive/,bundler/,compiler/,linker/} |
02_tiered_execution_and_boa_vm.md |
Hybrid Three-Tier Execution Pipeline (SLICEBC\x01 Precompiled Boa CodeBlock CAS Default, SLICESNP, Legacy SLICEBOA, WarmBoaRealm Pool, Persistent Realm Cache __slice_rc, 32-Bit shards_mask Preludes 00..19 + Pre-Fused node:* Bits 19..28, Hardware SHA-NI & Native Intrinsics, & Tier-2 Unboxed 64-Bit Numeric Register VM) |
crates/slice-engine/src/{vm/,isolate/,runtime/,preludes/,intrinsics/,bindings/}, vendor/boa_engine/SLICE_PATCH.md |
03_security_sandbox_ocap_and_mpk.md |
5-Ring Zero-Trust Security Architecture: OCap CapabilityToken (FsCap/NetCap/EnvCap/ExecCap), Dynamic SES Prototype Integrity (__slice_check_ses), CPU Fuel & Memory Cage, Linux WRPKRU Hardware MPK, Pre-Connect DNS SSRF Firewall, & Outbound Egress Secret DLP |
crates/slice-sandbox/src/{lib.rs,compartment/,manifest/,net/,vfs/}, crates/slice-engine/src/{isolate/,net/outbound_http.rs} |
04_networking_wintertc_and_event_loop.md |
Multi-Worker slice serve, 3-Level Async Concurrency Architecture, Outbound HTTP/1.1 & TLS 1.3 (rustls + OUTBOUND_CONN_POOL), Deterministic Time-Travel Event Loop, RFC 6455 WebSocket Engine, Raw TCP/TLS/UDP Sockets, & Uint8Array Buffer + Node Core Tier-1 |
crates/slice-cli/src/server/, crates/slice-engine/src/{runtime/event_loop.rs,net/,preludes/node_builtins.rs} |
05_wasm_workers_and_kernel_io.md |
Pure-Rust WebAssembly (wasmi v2.0.0, Shared Per-Isolate wasmi::Store, GLOBAL_WASM_MODULE_CACHE, 5-Ring WASM Cage), Capability-Attenuated MicroVM Web Workers & node:worker_threads (IDLE_WORKER_POOL), Direct Kernel Completion Rings (io_uring & IOCP), & OS-Native notify File Watcher |
crates/slice-engine/src/runtime/{wasm/,workers.rs}, crates/slice-io/src/lib.rs, crates/slice-cli/src/config/ |
06_edge_kv_ai_sandbox_and_mcp.md |
16-Way Sharded Slice.kv (EDGE_KV_SLAB), Multi-Tenant --tenant-dir Atomic Hot-Swap, SplitMix64 --deterministic Replay, AI Agent “Code Mode” (Slice.evalSandbox, < 5 us Slice.checkpoint/restore), Time-Travel slice test, & Built-In MCP Server (slice mcp) |
crates/slice-engine/src/isolate/state_and_kv.rs, crates/slice-cli/src/{server/mod.rs,commands/test_runner.rs,diagnostics/} |
docs/README.md |
Complete Documentation Hub (docs/general/, docs/guides/, & docs/system/) |
User Guides, CLI Reference, & Compatibility Matrix |
tests/reports/latest.md |
Verified Cross-Runtime Linux x86_64 Docker Benchmark Report (Slice vs Bun, Deno, and Node.js across all 33 workloads) & 09_benchmarks_testing_and_docker_suite.md |
benches/, tests/apps/, tests/frameworks/, tests/case_studies/ |
vendor/boa_engine/SLICE_PATCH.md |
SLCB\x01 Precompiled CodeBlock Binary Serializer/Deserializer, Monomorphic Inline Cache, & Direct ECMA-404 JSON Fast Paths |
vendor/boa_engine/src/{script.rs,builtins/json/mod.rs,vm/inline_cache/mod.rs,vm/runtime_limits.rs} |
2. High-Level 4-Crate Host Topology
Section titled “2. High-Level 4-Crate Host Topology”+---------------------------------------------------------------------------------------------------+| Slice (Nexus-JS) v0.15.0 Host || || +---------------------------------------------------------------------------------------------+ || | slice-sandbox: Zero-Trust OCap, SES & Hardware Boundary | || | +----------------------------------------+ +------------------------------------------+ | || | | Tenant Compartment A | | Tenant Compartment B | | || | | - SES Frozen Intrinsics (lockdown) | | - Pure Compute (Zero Ambient Authority) | | || | | - Scoped FsCap / NetCap / EnvCap | | - Deterministic CPU Fuel & Byte Cage | | || | | - Linux SYS_pkey_alloc + WRPKRU Domain | | - Linux SYS_pkey_alloc + WRPKRU Domain | | || | +----------------------------------------+ +------------------------------------------+ | || +---------------------------------------------------------------------------------------------+ || || +---------------------------------------------------------------------------------------------+ || | slice-engine: Hybrid Three-Tier Execution Pipeline | || | +--------------------------+ +-------------------------------+ +----------------------+ | || | | Tier 0: SLICESNP VM | | Tier 1: Zero-Copy SLICEBC\x01 | | Tier 2: Peak Native | | || | | - Sub-Microsecond Boot | | - Precompiled Boa CodeBlock | | - 32-Reg Numeric VM | | || | | - Pre-Parsed Opcode Ops | | - Pre-Warmed Boa Realm Pool | | - Recurrence Lowering| | || | | - WinterTC Edge Routing | | - Native Rust Host Intrinsics | | - Zero Heap Allocs | | || | +--------------------------+ +-------------------------------+ +----------------------+ | || +---------------------------------------------------------------------------------------------+ || || +---------------------------------------------------------------------------------------------+ || | slice-cas: Zero-Stat Content-Addressed Storage & Bundler | || | Oxc v0.160 TS Compiler -> Oxc Semantic/AST Tree-Shaker -> BLAKE3-256 -> 64B Aligned CAS | || +---------------------------------------------------------------------------------------------+ || || +---------------------------------------------------------------------------------------------+ || | slice-io: Direct Kernel Completion Ring Engine | || | Linux io_uring (IORING_SETUP_SQPOLL + 64KB Fixed Slab Buffers) | Windows NT IOCP FFI | || +---------------------------------------------------------------------------------------------+ |+---------------------------------------------------------------------------------------------------+3. Complete Workspace Crate & Module Map
Section titled “3. Complete Workspace Crate & Module Map”crates/slice-cas/src/:lib.rs&archive/(builder.rs,reader.rs,static_assets.rs): 64-byte cache-line alignedSLICE_CASv1 binary format,CasBuilder(with single-copySLICEBC\x01/SLICEBOAsource deduplication),MappedCasArchive,SLICEEXEstandalone executable trailer embedding, and zero-statStaticAssetTablewith pre-computedBLAKE3ETagheaders.compiler/(transpiler.rs,semantics.rs,pipeline_fusion.rs): Native Oxc (v0.160.0) TypeScript and.tsx/.jsxtransformation (SourceType::tsx(),transform_options.jsx.jsx_plugin = true), semantic interface analysis (analyze_typescript_semantics), and opt-in hygienic Oxc AST array pipeline loop fusion (fuse_array_pipelines_ast).linker/(esm_transform/-ast_lowering.rs,mutable_exports.rs,barrel_and_fallback.rs;cjs_rewrites.rs,lazy_and_inline.rs,tree_shaker.rs,ast_walker.rs,builtins_and_ids.rs): Oxc AST-driven ESM-to-CJS module linker (try_transform_esm_to_cjs_astwith non-enumerable__esModulenamespace isolation andSemanticBuilderglobal binding hygiene), Cold-MethodrequireInliner (inline_cold_method_requires_ast), Reverse-Topological Oxc Semantic/AST Dead-Export Tree-Shaker (analyze_module_used_exports+prune_and_minify_cjs_module_ast), and Eager-Edge BFS Lazy Module Stringifier (collect_eager_module_indices).bundler/(graph_bundler.rs,resolver.rs,source_map.rs): Multi-pass dependency graph bundler (bundle_entrypoint_with_deps), project entrypoint discovery (.ts,.tsx,.mts,.cts,.js,.jsx,.mjs,.cjs), ESM-firstpackage.jsonconditional"exports"/"imports"andtsconfig.json"paths"resolution, zero-stat.wasmbinary bundling (__slice_b64ToU8), built-in"slice:jsx"fallback, and source-line error mapping (map_bundled_error_location).
crates/slice-io/src/:lib.rs: Direct kernel completion ring engine (CompletionRingEngineover Linuxio_uringIORING_SETUP_SQPOLLand Windows NTIOCP) andRegisteredBufferPool64 KB page-aligned fixed slab buffers.
crates/slice-sandbox/src/:lib.rs&compartment/(pkey.rs):TenantCompartment,CapabilityToken,IntrinsicRegistry::lockdown, deterministic CPU fuel & memory byte cage, and Linuxx86_64HardwareProtectionDomain(SYS_pkey_alloc+WRPKRU).manifest/(directives.rs,dotenv.rs):SliceManifest(slice.toml), inline// @slice-*directive parser (parse_inline_directives), and.envloader withis_sensitive_env_keyAuto-DLP secret classification.vfs/mod.rs&net/mod.rs: Path-traversal-safeFsCap(verify_fs_read,verify_fs_write), zero-syscall cached workspace CWD anchoring (cached_normalized_cwd,anchor_vfs_path_to_cwd),ExecCap(verify_exec_binary),NetCap(verify_net_connect), and cloud metadata / private IP SSRF classifiers (is_cloud_metadata_ip,is_private_or_loopback_ip).
crates/slice-engine/src/:vm/(boacas.rs,value_and_ast.rs,numeric_vm.rs,parser_and_compiler.rs): DefaultSLICEBC\x01precompiled BoaCodeBlockCAS container (BoaCasHeader,pack_boacas_container,eval_boacas_on_realmbacked byvendor/boa_engine/src/script.rs), 16-byteJsValue&BytecodeOp, Tier-2 Unboxed 64-Bit Numeric Register Compiler & VM (try_compile_numeric_func,detect_linear_recurrence_ast,NumericFunc::execute), andSLICESNP/SLICEBOAcompiler.isolate/(exec_bytecode.rs,exec_boa.rs,exec_ast.rs,http_and_ws.rs,kv_and_sandbox.rs,state_and_kv.rs):SliceIsolatelifecycle, Tier-0/1/2 dispatch, HTTP/WebSocket dispatch, nestedeval_sandbox, 16-way shardedEDGE_KV_SLAB, SplitMix64 deterministic PRNG, Egress Secret DLP, and< 5 usVFS+KV checkpoint/restore.runtime/(boa_realm.rs,event_loop.rs,wasm/-store.rs,memory.rs,linking.rs,values.rs;workers.rs):BOA_CONTEXT_POOL&WarmBoaRealmlifecycle, Deterministic Time-Travel Event Loop &FetchReactorPool, pure-RustWebAssembly(wasmiv2.0.0) engine with shared per-isolatewasmi::Store,SliceWasmLimiter, andGLOBAL_WASM_MODULE_CACHE, and capability-attenuated MicroVM Web Workers (IDLE_WORKER_POOL).preludes/(js_preludes.rs,node_builtins.rs,js_minifier.rs): 32-bitshards_maskarchitecture combining always-on00_ultra_core.jswith demand-loaded compile-time minified JS shards01..19(including18_intl.json bit18and19_process_cli.json bit29) and pre-fusednode:*built-in shards on bits19..28, scanned in a singleO(N)Aho-Corasick pass (detect_shards_and_boacas_flags).bindings/(including modularbindings/fs/-state.rs,path_ops.rs,fd_ops.rs) &intrinsics/(hash_and_hmac.rs,symmetric_and_kdf.rs,asymmetric_and_keys.rs,compression.rs,encoding.rs,url_and_usp.rs,fast_parsers.rs,prng_and_uuid.rs): On-demand native Rust host bindings, inode-backed CoW VFS & open FD table (VfsState), hardwareSHA-NI+ software SHA-1/256/384/512 & HMAC, AES-GCM/CBC, PBKDF2/HKDF/scrypt, Ed25519/ECDSA/RSA/X25519 asymmetric crypto, unbiased 48-bitcrypto.randomIntrejection sampling, RFC 1950/1951/1952 DEFLATE/Gzip, WHATWG URL/URLSearchParams, and SemVer/utility scanners.net/(outbound_http.rs,websocket.rs,sockets.rs): Outbound HTTP/1.1 & TLS 1.3 (rustls+SHARED_OUTBOUND_CONN_POOL+ Pre-Connect DNS SSRF firewall), RFC 6455 WebSocket engine, and 5-Ring OCap TCP/TLS/UDP sockets.
crates/slice-cli/src/:main.rs,commands/(init.rs,pack_and_compile.rs,run.rs,test_runner.rs),config/(cas_packager.rs,watcher.rs),server/(connection.rs,tls.rs), anddiagnostics/(doctor_and_bench.rs,mcp.rs,repl.rs), plus modular integration tests undercrates/*/tests/and Criterion microbenchmarks undercrates/*/microbench/.
4. Why Legacy Runtimes Hit a Cold-Start and Density Wall
Section titled “4. Why Legacy Runtimes Hit a Cold-Start and Density Wall”To understand why Slice achieves sub-microsecond in-process isolate startup, single-digit millisecond cold CLI execution, and multi-fold lower memory footprints across real-world TypeScript + node_modules workloads (see tests/reports/latest.md for the latest verified benchmark telemetry across all 33 workloads), examine the four structural bottlenecks in Node.js, Deno, and Bun:
- The POSIX Filesystem Metadata Tax (
stat/lstat/readdirAmplification):- Resolving a 500-module graph or a
node_modulestree in Node.js triggers over1,500synchronous/asynchronousstat()andopen()system calls walking up directory hierarchies (node_modules/pkg/package.json,index.js, extensions). On containerized overlay filesystems (OverlayFS) or cloud block volumes (AWS EBS / GCP PD), this metadata chatter consumes 40% to 70% of startup time.
- Resolving a 500-module graph or a
- Eager Source Parsing & Monolithic Isolate Bootstrap:
- Spinning up a fresh V8 isolate without a custom snapshot takes
5 ms - 40 msand20 MB - 50 MBof heap. Even with snapshots, parsing hundreds of kilobytes of unreferenced barrel exports (such ashono/index.jsre-exporting 14 router/adapter modules when an app only imports{ Hono }, orsemver/index.jsloading 48 submodules when an app only callsvalid,coerce,gt, andsatisfies) wastes milliseconds of CPU time before the first line of user code runs.
- Spinning up a fresh V8 isolate without a custom snapshot takes
- Readiness-Poll Thread-Pool Contention (
epoll+libuvWorker Threads):- Node.js and Deno offload filesystem operations to background thread pools. Under high multi-tenant concurrency, thread synchronization, mutex handoffs, and kernel context switches introduce tail-latency spikes.
- Ambient Authority vs. Heavyweight VM Isolation:
- Node.js and Bun execute with full ambient OS permissions; any compromised transitive npm dependency can read
~/.ssh, harvestprocess.env, or exfiltrate data. Traditional microVMs (Firecracker) solve this by booting a separate guest Linux kernel per tenant, costing125 mscold start and30 MB - 128 MBper tenant.
- Node.js and Bun execute with full ambient OS permissions; any compromised transitive npm dependency can read