The primary interface is defined in the cortex module (Aggregation Engine).
The core behavior interface for mesh nodes.
fn predict(&self, history: &[u8]) -> u8: Deterministic prediction hot-path.fn adapt(&mut self, signals: &[SpikeEvent]): Adaptive update based on peer signals.fn export_gene(&self) -> Vec<u8>: Serializes the current model bytecode.
Interface for model bytecode persistence. Replaces deprecated GeneStorage (v20.2.0).
fn save_gene(&mut self, id: u32, gene: &[u8]) -> bool: Persist model bytecode to flash/disk.fn load_gene(&self, id: u32) -> Option<Vec<u8>>: Recover model bytecode on reboot.
Terminology Note (v20.2.0):
GeneStorageis deprecated in favor ofModelPersistence. See TECHNICAL_DEBT.md for migration timeline.
The primary interface for QRES is the Rust crate. It is no_std compatible and powers all other bindings.
pub fn compress(data: &[u8], config: CompressionConfig) -> Result<Vec<u8>, QresError>Compresses a byte slice with deterministic behavior.
- data: Input byte slice.
- config: Struct containing
mode(Standard/Tensor),threshold(0.0-1.0), andwindow_size. - Returns:
Vec<u8>containing the compressed bitstream.
pub fn decompress(data: &[u8]) -> Result<Vec<u8>, QresError>Decompresses a QRES stream.
The Python API wraps the Rust core for high-performance usage in scripts and ML pipelines.
- data: Bytes to compress.
- mode:
"standard"(Linear/LZ77) or"tensor"(Tensor/SNN).
- data: Compressed QRES bytes.
The WebAssembly target allows running QRES in the browser.
Sync compression running on the main thread (or worker).
Sync decompression.
For file operations, use the qres_daemon CLI or the QRESFile wrapper (if using the legacy Python helper).
qres_daemon compress <INPUT> [OUTPUT]
qres_daemon decompress <INPUT> [OUTPUT]