Horon

Geodineum

Horon

The file is the database. The layout is the index.

Crates.io Documentation License: Apache-2.0

Built by Niels Erik Toren · part of the Geodineum ecosystem.

The idea

Persist a deterministic hierarchical store to one .htt file: a documented binary snapshot plus a write-ahead log, every mutation logged before it takes effect. The file survives crashes and power loss and recovers itself on open. Copy the file and you have copied the database, its history, and its indexes.

Why the layout is the index

The engine gives structure a location in space: trees embed into hyperbolic geometry, where exponential volume matches exponential branching (horon-engine). Horon extends that to a location in the file: with the meaning-addressed layout (format v3), a node's byte position becomes a function of its semantic coordinates through a space-filling curve over fixed bounds — comparable data becomes byte-adjacent on disk. Readers memory-map the file, so N processes share one physical copy through the page cache, and the working set is the pages a query touches rather than the dataset.

Determinism

All arithmetic is gMath fixed point. A file written on one platform replays to bit-identical state on any other. That property is what lets the WAL double as a replication protocol. CI runs the determinism gate on x86-64 and arm64.

Public build surface

The supported API is what horon re-exports at the crate root:

Everything else (format, header, snapshot, wal, partial, hilbert, quant internals) is format plumbing: stable through the binary specification, not through its Rust signatures. Per-symbol truth lives in the docblocks (cargo doc --open).

The htt CLI

Built with feature import, this is the no-code surface: import-csv, import-fs, import-json (nested JSON/YAML), import-sqlite (foreign keys become the hierarchy), import-vec (JSONL embedding exports), plus inspect and query.

Capabilities

Each line is a shipped capability and the thing it makes possible:

Contract

The binary format is the integration contract: docs/HTT_FORMAT.md. Any language can read or write .htt from that document alone. Design deep-dives: docs/TEMPORAL_EPOCHS.md (epochs and history sidecars), docs/QUANTIZED_SEMANTIC.md (quantized tails, including the honest limits).

Quick start

Create, use, modify, reopen. The lifecycle example runs this sequence with assertions: GMATH_PROFILE=embedded cargo run --example lifecycle.

use horon::{Horon, HoronConfig};

// CREATE: a server fleet. Hierarchy in the path, telemetry in the dims
// (16 reserved + 2 user). Every write is WAL-logged before it takes effect.
let htt = Horon::open_with_config("fleet.htt", HoronConfig {
    semantic_dims: 18,
    ..Default::default()
})?;
htt.put("/fleet/eu/web-01", b"nginx 1.27")?;
htt.set_meta("/fleet/eu/web-01", "role", "edge")?;
htt.set_semantic("/fleet/eu/web-01", coords)?; // raw Q64.64, 16 bytes/dim, dims 16+ are yours

// USE: retrieval, hierarchy, "which machines behave like this one?"
let data = htt.get("/fleet/eu/web-01")?;
let machines = htt.children("/fleet/eu")?;
let similar = htt.neighbors_semantic("/fleet/eu/web-01", 5, 16..18)?;

// MODIFY: put is upsert; coordinates and metadata replace in place.
htt.put("/fleet/eu/web-01", b"nginx 1.28")?;      // redeploy
htt.set_semantic("/fleet/eu/web-01", new_coords)?; // load profile shifted
htt.remove("/fleet/eu/batch-01")?;                 // decommissioned
htt.compact()?; // fold the WAL into a fresh snapshot

// REOPEN: drop the handle; the next open replays to identical state.
drop(htt);
let htt = Horon::open("fleet.htt")?;

The same shape fits course catalogs, sensor networks, and document corpora: hierarchy in the path, meaning in the dims.

Or without code:

cargo build --release --features import
htt import-csv courses.csv courses.htt --path-cols category --dim-cols x,y
htt query courses.htt /category/some-course 5

Build with GMATH_PROFILE=embedded; the determinism contract is defined on that profile. For an idiomatic thread-safe wrapper, see examples/geostore.rs.

Limits worth knowing

Collaborate

Contributions are welcome. Open issues and pick up work on the ecosystem board at geodineum.com; issues tagged good-first-issue are a good place to start.

Author & support

Built by Niels Erik Toren.

If you want to support the work:

Currency Address
Bitcoin (BTC) bc1qwf78fjgapt2gcts4mwf3gnfkclvqgtlg4gpu4d
Ethereum (ETH) 0xf38b517Dd2005d93E0BDc1e9807665074c5eC731 / nierto.eth
Monero (XMR) 8BPaSoq1pEJH4LgbGNQ92kFJA3oi2frE4igHvdP9Lz2giwhFo2VnNvGT8XABYasjtoVY2Qb3LVHv6CP3qwcJ8UnyRtjWRZ5

Disclaimer

This software is provided "as is", without warranty of any kind, express or implied. Use of this software is entirely at your own risk. In no event shall the author or contributors be held liable for any damages arising from the use or inability to use this software.

License

Apache-2.0 (see LICENSE).