Skip to main content

Crate rvm_types

Crate rvm_types 

Source
Expand description

§RVM Core Types

Foundation types for the RVM (RuVix Virtual Machine) coherence-native microhypervisor, as specified in ADR-132, ADR-133, and ADR-134. This crate has minimal external dependencies and provides the type vocabulary shared by all RVM crates.

§First-Class Objects (ADR-132)

TypePurpose
PartitionIdCoherence domain container; unit of scheduling, isolation, and migration
CapabilityUnforgeable authority token; grants specific rights over specific objects
WitnessRecord64-byte audit record emitted by every privileged action
MemoryRegionTyped, tiered, owned memory range with explicit lifetime
CommEdgeInter-partition communication channel; weighted edge in the coherence graph
DeviceLeaseTime-bounded, revocable access grant to a hardware device
CoherenceScoreLocality and coupling metric derived from the coherence graph
CutPressureGraph-derived isolation signal; high pressure triggers migration or split
RecoveryCheckpointState snapshot for rollback and reconstruction

§Design Constraints

  • #![no_std] with zero heap allocation in the default configuration
  • #![forbid(unsafe_code)] – all types are safe Rust
  • All identifiers are Copy + Clone + Eq + Hash-compatible newtypes

Structs§

CapRights
Access rights bitmap carried by a capability (ADR-132, DC-3/DC-8).
CapToken
An unforgeable capability token.
Capability
Unforgeable capability with full delegation metadata.
CapabilityId
Unique identifier for a capability in the system-wide capability space.
CoherenceScore
A coherence score in the range [0.0, 1.0].
CommEdge
A weighted communication edge between two partitions.
CommEdgeId
Unique identifier for a communication edge in the coherence graph.
CutPressure
Cut pressure: graph-derived isolation signal (ADR-132, DC-2).
DeviceLease
A time-bounded, revocable device lease.
DeviceLeaseId
Unique identifier for a device lease.
EpochConfig
Configuration for a scheduler epoch.
EpochSummary
Summary of a scheduler epoch for witness logging.
GuestPhysAddr
A guest physical address, scoped to a partition.
MemoryRegion
A typed, tiered, owned memory region.
OwnedRegionId
Unique identifier for an owned memory region.
PartitionConfig
Partition creation configuration.
PartitionId
Unique identifier for a coherence partition.
PhiValue
An integrated-information (Phi) value used as a coherence input signal.
PhysAddr
A host physical address.
Priority
Priority level for scheduling.
ProofToken
A proof token that attests to a verified proof.
ReconstructionReceipt
A receipt for reconstructing a hibernated partition.
RecoveryCheckpoint
A recovery checkpoint (state snapshot).
RegionPlacementWeights
Placement weights for region assignment during split.
RegionPolicy
Access policy for a memory region.
RvmConfig
Top-level RVM configuration.
VcpuId
Virtual CPU identifier within a partition.
VirtAddr
A host virtual address.
WitnessHash
A 256-bit witness commitment hash.
WitnessRecord
A single witness record. Exactly 64 bytes, cache-line aligned.

Enums§

ActionKind
Privileged actions that produce witness records (ADR-134, Section 2).
CapType
The type of resource a capability refers to.
DeviceClass
Classification of device types.
FailureClass
Classification of failure severity.
GpuMemoryType
GPU memory type classification.
GpuQueuePriority
GPU command queue priority.
MemoryTier
Memory tier classification (hot/warm/cold).
PartitionState
Partition lifecycle state.
PartitionType
Partition type classification.
ProofResult
Result of a proof verification.
ProofTier
Proof tier (P1, P2, P3).
RvmError
The unified error type for RVM operations.
SchedulerMode
Scheduler operating mode.

Constants§

MAX_DELEGATION_DEPTH
Maximum delegation depth for capabilities (ADR-132).
MAX_DEVICES_PER_PARTITION
Maximum device leases per partition.
MAX_EDGES_PER_PARTITION
Maximum communication edges per partition.
MAX_PARTITIONS
Maximum partitions per RVM instance.
WITNESS_RECORD_SIZE
Witness record size in bytes.
WITNESS_RING_CAPACITY
Default witness ring buffer capacity in records.

Functions§

fnv1a_32
FNV-1a hash truncated to 32 bits.
fnv1a_64
FNV-1a hash over a byte slice.

Type Aliases§

RvmResult
Shorthand result type for RVM operations.