Expand description
.hmc — a transparent container-of-files bundle for shipping a set of
sealed assets (.10d / .q42 / .p64) as one attestable unit. Available to
both native and WASM builds (native adds the zero-copy BundleMmap).
.hmc — the hyper-media-container: a transparent container-of-files
bundle for shipping a set of sealed Qualia assets (.emf spectral media,
.10d meshes, .q42 graph volumes, .p64 weights, …)
as one attestable unit (a release artefact, a downloadable pack, a signed
asset set).
§Why a bundle, and why transparent
The Qualia container family (.10d / .q42 / .p64) are all internally
navigable — you can pull a segment (a mesh section, a subgraph, a weight
shard) without reading the whole file, ideally mmap zero-copy. A bundle
must not destroy that. So a .hmc bundle only concatenates intact files,
page-aligned, with an index of absolute offsets — it never compresses,
re-chunks, or reframes an entry. Consequences:
reader.get(key)returns a zero-copy slice that is a byte-identical standalone file — feed it straight to the existing.q42/.10d/.p64reader; its interior offsets resolve unchanged.reader.segment(key, off, len)reaches an interior segment of an entry directly — the bundle does not interfere with segment-level access.- HTTP range-fetching one interior segment works:
entry.offset + seg.off.
It lives in qualia-core-db so it is one reader for both channels —
native (BundleMmap, zero-copy) and WASM (parse fetched/ranged bytes).
See format for the on-disk layout.
Structs§
- Bundle
Entry - One row of the bundle index (the CBOR footer). Describes one intact embedded
file: its logical key, its format
kind, where it lives (absolute, aligned), its length, a SHA-256 of the exact bytes, and opaque per-entrymeta(a nested CBOR blob whose schema is agreed by the producer/consumer of a given bundlekind— e.g. an anatomy pack stores each organ’s body-system, position and default colour there). The bundle format itself stays domain- agnostic: it moves intact files;metacarries any domain semantics. - Bundle
Mmap - Open a
.hmcbundle from disk viammapfor zero-copy access (native). - Bundle
Reader - A parsed, integrity-checked view over a
.hmcbundle’s bytes. Borrows the input;get/segmentreturn slices into it (zero copy). - Bundle
Writer - Accumulates intact files and serialises them into a
.hmcbundle.
Enums§
- Bundle
Error - An error building or reading a
.hmcbundle.
Constants§
- BUNDLE_
ENTRY_ ALIGN - Alignment (bytes) applied to every entry payload and the index footer.
Page alignment (64) preserves the interior page-alignment of embedded
.q42/.p64/.10dfiles, so their own segment offsets stay aligned andmmap/ zero-copy segment access into an entry is unaffected. This matches thePagealignment tier of thecontainer_10dwriter andp64_weight. - BUNDLE_
HEADER_ SIZE - Fixed header size in bytes. Payloads begin at (or after) this offset.
- BUNDLE_
MAGIC - Magic bytes at the start of every
.hmc(hyper-media-container) bundle:QBDL. The 4-byte on-disk format tag is retained across the.qualia→.hmcrename (extension ≠ magic, as with most formats), so bundles already built keep parsing; only the file extension and human-facing name changed. - BUNDLE_
VERSION - Current bundle format version.
- SHA256_
LEN - Length of a SHA-256 digest in bytes.