Skip to main content

Module store

Module store 

Source
Expand description

Block-based storage engine for temporal tensor compression (ADR-018).

Provides tiered quantized storage with CRC32 integrity checking, access-pattern tracking, and eviction support. Each block of tensor data is quantized at the bit width appropriate for its storage tier and tracked with rich metadata for tier-promotion/demotion decisions.

§Storage Tiers

TierBitsDescription
Tier00Evicted: metadata only, no payload
Tier18Hot: full fidelity quantization
Tier27Warm: moderate compression
Tier33Cold: aggressive compression

§Example

use ruvector_temporal_tensor::store::{BlockKey, Tier, TieredStore, ReconstructPolicy};

let mut store = TieredStore::new(4096);
let key = BlockKey { tensor_id: 1, block_index: 0 };
let data = vec![1.0f32; 64];

store.put(key, &data, Tier::Tier1, 0).unwrap();
assert_eq!(store.block_count(), 1);

let mut out = vec![0.0f32; 64];
let n = store.get(key, &mut out, 1).unwrap();
assert_eq!(n, 64);

Structs§

BlockKey
Unique identifier for a tensor block.
BlockMeta
Complete metadata for a single block.
TickResult
Summary of actions taken during a budgeted maintenance tick.
TieredStore
In-memory tiered storage engine for quantized tensor blocks.

Enums§

DType
Data type of the original tensor.
ReconstructPolicy
Reconstruction policy for evicted (Tier0) blocks.
StoreError
Errors produced by the storage engine.
Tier
Storage tier for a block.

Traits§

BlockIO
Block I/O for reading and writing raw quantized data.
Clock
Clock abstraction for deterministic time in tests and production.
MetaLog
Metadata log for append-only persistence of block metadata.

Functions§

crc32
Compute CRC32 using the standard reflected polynomial (0xEDB88320).