genhdc 0.1.0

Hyperdimensional Computing (HDC/VSA) engine with genetic operators — extracted from the production Mimer agent
Documentation

GenHDC — Genetic Hyperdimensional Computing

Crates.io Docs.rs License: MIT

GenHDC is a Rust library for Hyperdimensional Computing (HDC) / Vector Symbolic Architectures (VSA), plus genetic operators on concept genomes.

The HDC engine is battle-tested inside Mimer, a continuously running Rust agent: 10 000-dimensional bipolar vectors, bind / bundle / unbind, and permutation for sequence encoding. The genetic layer adds inheritance, mutation, CRISPR-like targeted editing, and epigenetic expression.

Install

[dependencies]
genhdc = "0.1"

Optional JSON serialization for genomes:

[dependencies]
genhdc = { version = "0.1", features = ["serde"] }

Quick start — HDC engine

use genhdc::{HdcEngine, DIMENSIONS};

fn main() {
    let mut hdc = HdcEngine::with_seed(DIMENSIONS, 42);
    let a = hdc.encode("apple");
    let b = hdc.encode("color");
    let bound = hdc.bind(&a, &b);
    let recovered = hdc.unbind(&bound, &b);
    println!("roundtrip sim = {:.3}", hdc.similarity(&recovered, &a));
}

Run the bundled demo:

cargo run --example demo

Quick start — genetic operators

use genhdc::ConceptGenome;

let snake = ConceptGenome::primordial("snake", 0);
let apple = ConceptGenome::primordial("apple", 0);
let eats = ConceptGenome::inherit(&snake, &apple, "eats", 1);
assert_eq!(eats.generation, 1);
Biology GenHDC
DNA ConceptGenome with features
Gene GenomeFeature { name, dominance, origin }
Sexual reproduction inherit() — two-parent blending
Random mutation mutate()
CRISPR/Cas9 crispr_edit() — error-guided edit
Epigenetics toggle_expression()

What is HDC / VSA?

Hyperdimensional computing represents symbols as high-dimensional random vectors (here bipolar {±1}^10000). Near-orthogonality makes accidental collisions rare. Algebraic operations compose structure:

  • Bind (element-wise multiply) — associate two symbols; self-inverse for bipolar vectors
  • Bundle (normalize-sum) — superpose a set into one vector
  • Permute — encode position / sequence order

Same seed + concept name → identical vector (deterministic).

Provenance

Extracted from Mimer / Gracestack production agent code paths. Source: github.com/GracestackAB/genhdc. Published August 2026 as a standalone MIT-licensed crate.

License

MIT © 2026 Kim Cedendahl / Gracestack AB