Module vm_nyx

Module vm_nyx 

Source
Expand description

High-performance VM-backed AIXI environment using nyx-lite (Firecracker).

This module provides a VM environment implementation built on top of nyx-lite, enabling high-frequency snapshot-based resets for fast experimentation (hardware and guest behavior dependent).

§Architecture

The environment uses Firecracker’s KVM-based microVM with nyx-lite’s incremental snapshot and reset capabilities. Communication with the guest occurs via:

  1. Shared Memory: Zero-copy data transfer between host and guest
  2. Hypercalls: Control plane communication (snapshot, done, etc.)
  3. Serial PTY: Optional console I/O for simpler protocols

§Design Principles

  • Universal: Not biased towards any specific use case (fuzzing, etc.)
  • High Performance: Leverages incremental snapshots and dirty page tracking
  • Configurable: Pluggable reward policies, action sources, observation modes
  • Information-Theoretic: Built-in support for entropy-based metrics

Structs§

NyxActionFilter
Information-theoretic action filtering.
NyxActionSpec
A single action specification.
NyxFuzzConfig
Fuzzing configuration for action generation.
NyxProtocolConfig
Protocol configuration for structured communication.
NyxSnapshot
NyxStepResult
Result of a single environment step.
NyxTraceConfig
Configuration for trace collection and analysis.
NyxVM
NyxVmConfig
Complete configuration for the nyx-lite VM environment.
NyxVmEnvironment
High-performance VM environment using nyx-lite.
SharedMemoryRegion
A contiguous guest memory region exposed for sharing with the host.

Enums§

ExitReason
FuzzMutator
Fuzzing mutator types.
NyxActionSource
Source of actions for the environment.
NyxExitKind
Simplified exit reason categories.
NyxObservationPolicy
How observations are derived from guest output.
NyxObservationStreamMode
Stream normalization mode.
NyxRewardPolicy
How rewards are computed.
NyxRewardShaping
Optional reward shaping (additive to base reward).
PayloadEncoding
Payload encoding for wire protocol.
SharedMemoryPolicy
Control whether shared memory pages are snapshotted or preserved across resets.

Constants§

HYPERCALL_DBGPRINT
HYPERCALL_EXECDONE
Hypercall identifiers (must match guest implementation). These are exported for use by custom guest programs.
HYPERCALL_NYX_LITE
HYPERCALL_SHAREMEM
HYPERCALL_SNAPSHOT