tbcresearch.
Menu
← Back to the research index
F-012 / Tool

HALO: lossless vaults for model weights, human genomics and live agent queries

A zero-dependency, pure-integer C++20 binary that packs BF16 and Q4_K_M model families to 2.0–2.7×, human VCF/GTF/BAM up to 253× with no reference FASTA, and serves live MCP and genomic region queries without unpacking.

Normalized lossless vault sizes on five official BF16 Qwen3-8B and DeepSeek-R1 models (80.66 GB raw to 39.97 GB HALO, 2.02x lossless vs 63.34 GB tar+zstd and 53.74 GB DFloat11) and three Q4_K_M Inkling-2-Mini GGUFs (52.52 GB raw to 19.31 GB HALO, 2.72x lossless vs 48.99 GB tar+zstd). Bottom strip shows SmolLM2-135M four-model lineage (1.35 GB to 627.4 MB, DPO delta 68.59x) read in ~3 ms with zero bytes decoded. Open full-size figure. Normalized lossless vault sizes on five official BF16 Qwen3-8B and DeepSeek-R1 models (80.66 GB raw to 39.97 GB HALO, 2.02x lossless vs 63.34 GB tar+zstd and 53.74 GB DFloat11) and three Q4_K_M Inkling-2-Mini GGUFs (52.52 GB raw to 19.31 GB HALO, 2.72x lossless vs 48.99 GB tar+zstd). Bottom strip shows SmolLM2-135M four-model lineage (1.35 GB to 627.4 MB, DPO delta 68.59x) read in ~3 ms with zero bytes decoded. Open full-size figure.
Unmodified HuggingFace checkpoints packed and restored 100% SHA-256 bit-identically with zero Python. Select any figure to open it at full size.

Classical archives (.tar.gz, .tar.xz, .zip) treat every file as an opaque byte stream: generic compressors barely dent quantized model weights or binary .bam alignments, and asking a single question forces a full unpack. HALO starts from the opposite premise — storage is a typed, cryptographically verified object that stays queryable while compressed.

One sectioned .halo container routes each modality to a pure-integer codec lane that must reproduce the input bytes bit for bit: AI model-weight vaults (Safetensors and GGUF), human sequencing and genomics (FASTQ, paired-end R1+R2, VCF, GTF/GFF3/BED/PAF, and SAM/BAM), exact container recompression (.tar.gz, .zip, .png), context-mixed code and text, and an opt-in zero-float neural lane. Everything — every codec, SHA-256/512, AES-256-GCM, Ed25519, LRC(16,12,6) erasure parity, full-text and Move-r indexes, genomic interval directories, and the read-only stdio MCP server — ships in one dependency-free C++20 tree under the MIT licence.

Model-weight vaults

Model families share almost all of their structure across base checkpoints, SFT/DPO stages, embeddings, and reasoning distills, yet are routinely stored as independent multi-gigabyte copies. HALO discovers the lineage tree automatically across shard boundaries and canonical tensor prefix differences (layers.* ↔ model.layers.* ↔ language_model.*), encoding monotone ULP deltas (HSN3) on top of bijective DFloat11 BF16/FP16/FP32 exponent bit-plane rANS (HSN2). For quantized GGUFs — where tar + zstd -3 saves only 6.7% — HALO deinterleaves super-blocks (HGN2) and codes nibble-level ZigZag4/8 deltas against the discovered parent (HGD2), including extensionless Ollama sha256-* blobs.

Unmodified HuggingFace family Lane Raw tar + zstd -3 HALO Lossless ratio
Qwen3-8B + DeepSeek-R1-0528 (5 BF16 models, 21 shards) HSN2+HSN3 80.66 GB 63.34 GB 39.97 GB 2.02× (−50.44%, 40.69 GB saved)
Inkling-2-Mini (3× Q4_K_M GGUF fine-tunes) HGN2+HGD2 52.52 GB 48.99 GB 19.31 GB 2.72× (−63.24%, 9.4× more savings)
SmolLM2-135M (4 models, BF16 + FP32 TLDR) HSN2+HSN3 1.35 GB 1.05 GB 627.4 MB 2.14× (DPO stage: 269.1 → 3.9 MB, 68.6×)
Qwen2.5-0.5B (4 BF16 models: Base, Instruct, Coder) HSN2+HSN3 3.95 GB 3.08 GB 2.41 GB 1.64× (1.54 GB saved)
Local Ollama extensionless sha256-* GGUF derived blob HGD2 144.8 MB — 1.3 MB 107.8×

New fine-tunes append incrementally via halo append without repacking existing chunks (a duplicate checkpoint adds +38 B in 0.97 s), and halo lineage vault.halo prints the full DAG and per-model savings in ~3 ms with zero bytes decoded. Every shard restores byte-identically and passes halo verify.

Human genomics without sidecar indexes

Normalized lossless compression on five unmodified public sequencing datasets: 1000G chr22 diploid VCF (0.80 MB HALO HVC1 vs 3.24 MB gzip and 1.37 MB xz), GENCODE v47 human GTF (15.71 MB HALO HBG1 vs 36.23 MB gzip and 23.61 MB zstd), 1000G HG00105 exome .bam (75.96 MB HALO HBM1 vs 119.16 MB .bam with no reference FASTA), ERR18005721 paired-end R1+R2 (18.55 MB HALO HFQ1-PE vs 44.76 MB gzip and 28.16 MB SPRING -l), and ERR2025963 Oxford Nanopore (12.31 MB HALO HFQ1 HPC vs 16.09 MB gzip and 13.90 MB xz). Open full-size figure. Normalized lossless compression on five unmodified public sequencing datasets: 1000G chr22 diploid VCF (0.80 MB HALO HVC1 vs 3.24 MB gzip and 1.37 MB xz), GENCODE v47 human GTF (15.71 MB HALO HBG1 vs 36.23 MB gzip and 23.61 MB zstd), 1000G HG00105 exome .bam (75.96 MB HALO HBM1 vs 119.16 MB .bam with no reference FASTA), ERR18005721 paired-end R1+R2 (18.55 MB HALO HFQ1-PE vs 44.76 MB gzip and 28.16 MB SPRING -l), and ERR2025963 Oxford Nanopore (12.31 MB HALO HFQ1 HPC vs 16.09 MB gzip and 13.90 MB xz). Open full-size figure.
Public ENA, 1000 Genomes and GENCODE v47 inputs packed and restored 100% SHA-256 bit-identically (including exact BGZF .bam, .vcf.gz and .fastq.gz replay). Bars are scaled to gzip -6 (or native .bam) on each dataset.

Bioinformatics pipelines routinely ship .fastq.gz, .vcf.gz, .gtf.gz, .bam, and separate .tbi/.bai sidecars because gzip ignores sequencing structure. HALO auto-routes biological formats across five zero-float native lanes:

  • HFQ1 & HFQ1-PE (FASTQ/FASTA & paired-end R1+R2): structured read-header tokenization, Open-Closed Syncmer consensus DNA coding, homopolymer-conditioned Phred quality coding for Oxford Nanopore long reads, cross-file R1 → R2 permutation inheritance (0 permutation bytes for R2), and byte-exact .fastq.gz DEFLATE replay.
  • HVC1 (Dual-PBWT VCF / .vcf.gz): pure-integer Durbin Positional Burrows–Wheeler Transform over allele and missingness bitplanes plus template-tokenized INFO columns and exact BGZF replay.
  • HBG1 (GTF / GFF3 / BED / PAF): columnar coordinate coding with per-key carryover over gene/transcript attributes.
  • HBM1 (Reference-free Sliding-Pileup SAM / .bam): builds a local sliding consensus across coordinate-sorted reads to code aligned DNA at 0.377 bpb with no external reference FASTA, while restoring the exact BGZF .bam file bit for bit.
Public dataset Raw gzip -6 zstd -19 xz -6 HALO Unpack / Query
1000G chr22 Diploid VCF (2,504 samples, 20k variants) 203.43 MB 3.24 MB 1.38 MB 1.37 MB 0.80 MB (253.3×) 1,017 MB/s · 29.6 ms query
1000G ALL.chrY Haploid VCF (1,233 samples, 62k variants) 171.36 MB 5.24 MB 3.41 MB 3.29 MB 2.93 MB (58.6×) 871 MB/s · 36.2 ms query
GENCODE v47 Human GTF (2.23M intervals) 1,050.85 MB 36.23 MB 23.61 MB 23.75 MB 15.71 MB (66.9×) 1,186 MB/s · 29.0 ms query
GENCODE v47 Human BED6 (2.23M intervals) 154.77 MB 13.53 MB 9.14 MB 8.69 MB 6.15 MB (25.2×) 632 MB/s · 68.6 ms query
1000G HG00105 Human Exome .bam (1.16M reads, BGZF) 119.16 MB 119.16 MB 119.16 MB 119.17 MB 75.96 MB (1.57× < .bam) 0.377 bpb · 47 µs dir · 182 ms query
1000G HG00105 Human Exome .sam (200k reads, 14 tags) 89.05 MB 18.97 MB 16.40 MB 15.68 MB 13.12 MB (6.79×) 231 MB/s · 5 µs dir · 155 ms query
ERR18005721 Paired-End R1+R2 (NovaSeq E. coli WGS) 297.36 MB 44.76 MB 32.18 MB 31.98 MB 18.55 MB (16.0×) 76.8 MB/s (vs SPRING -l 28.16 MB)
ERR10000012 Paired-End R1+R2 (NovaSeq SARS-CoV-2) 62.71 MB 6.12 MB 4.79 MB 4.70 MB 2.60 MB (24.1×) 110.0 MB/s (vs SPRING -l 2.75 MB)
ERR2025963 Oxford Nanopore MinION (reads ≤280 kb) 33.72 MB 16.09 MB 14.40 MB 13.90 MB 12.31 MB (2.74×) 66.0 MB/s (−11.4% vs xz -6)
ERR10000012_{1,2}.fastq.gz (byte-exact .gz replay) 6.12 MB 6.12 MB 6.12 MB 6.12 MB 2.60 MB (2.35× < .gz) R2.gz: 2.72× · SHA-256 exact
1000G ALL.chrY.vcf.gz (byte-exact BGZF replay) 5.66 MB 5.66 MB 5.66 MB 5.66 MB 2.96 MB (1.91× < .gz) 64 µs dir · 34.8 ms query

Querying storage without unpacking

Left: 126-block ring of the 1.05 GB GENCODE v47 GTF stored in 15.71 MB where a region query decodes 1 of 126 blocks (99.2% skipped) in 29.0 ms with no .tbi file, and a 119 MB .bam streams SAM decoding 1 of 51 blocks (98.0% skipped) with no .bai or samtools. Right: halo mcp read-only stdio surface exposing search (HIDX4+ZOR, 0.84% bytes read), substring_search (Move-r 0B decode), bio_query, read_file (span_sha256 + halo:/// URI) and verify, backed by 14/14 cross-hardware SHA-256 parity between Linux x86_64 and Apple M4. Open full-size figure. Left: 126-block ring of the 1.05 GB GENCODE v47 GTF stored in 15.71 MB where a region query decodes 1 of 126 blocks (99.2% skipped) in 29.0 ms with no .tbi file, and a 119 MB .bam streams SAM decoding 1 of 51 blocks (98.0% skipped) with no .bai or samtools. Right: halo mcp read-only stdio surface exposing search (HIDX4+ZOR, 0.84% bytes read), substring_search (Move-r 0B decode), bio_query, read_file (span_sha256 + halo:/// URI) and verify, backed by 14/14 cross-hardware SHA-256 parity between Linux x86_64 and Apple M4. Open full-size figure.
Every HVC1, HBG1 and HBM1 archive embeds an 8 MiB genomic interval directory (5–64 µs, 0 B decoded), while halo mcp mounts any vault read-only over stdio with bounded decode budgets.

Every genomics lane embeds its own interval directory, eliminating external .tbi and .bai files. A halo bio-query on GENCODE v47 decodes 1/126 blocks (99.2% skipped) in 29.0 ms; on the 119 MB HG00105 .bam, it decodes 1/51 blocks (98.0% skipped) and streams SAM records directly without samtools; on 1000G chr22 VCF it skips 95.9% of blocks and supports inline --samples projection.

For codebases, logs, and FASTQ k-mers, --index attaches HIDX4 postings guarded by ZOR / BinaryFuse8 membership filters (0.84% of bytes read in 9.4 ms on a 130.7 MB corpus), and --substr-index attaches a length-capped Move-r RLBWT index (HMVR1) that counts and locates exact arbitrary substrings with zero payload bytes decoded. halo mcp archive.halo exposes the full surface read-only over stdio to Claude Code, Codex, Cursor, Windsurf, or any MCP client, returning span_sha256 and halo:///path#L10-L40 citations on every read.

MCP tool What the agent gets Payload decoded
archive_info / list_files Manifest stats, codec lanes, SHA-256 hashes, glob/prefix filters Footer only (0 B)
search Ranked BM25 lexical search via HIDX4 + ZOR / BinaryFuse8 ~0.8% of archive
substring_search Exact arbitrary substring count and {path, offset} via Move-r HMVR1 0 B
bio_query Tabix/BAI-free genomic region, rsID, feature, alignment, and VCF sample query 0 B (info_only) or overlapping blocks only
read_file / grep Hash-verified line windows (span_sha256, halo:///...#L10-L40) or regex matches Target unit only
semantic_search / hybrid_search Deterministic passage retrieval (HSEM + RRF) with exact line spans Index only
verify Full SHA-256, Merkle logical_root, LRC(16,12,6) parity, and Ed25519 check Full check
claude mcp add --transport stdio halo-vault -- halo mcp /abs/path/to/vault.halo
halo bio-query gencode.halo --region chr22:20000000-20100000 --feature gene

General corpora, neural lane and durability

Outside model weights and genomics, the same binary still handles general archives with competitive or stronger ratios:

Corpus HALO Reference Note
B4 docs and JSON (3.2 MB, 89 files, pinned) 7,299 B (max: 6,517 B) tar.xz -9e: 13,572 B paq8px -8: 6,211 B
B3 versioned repo tree (5.2 MB, 720 files, pinned) 41,851 B (--index: 52,069 B) tar.xz -9e: 70,240 B paq8px -8: 37,295 B
B5 compressed containers (4.9 MB: .tar.gz, .zip, .docx, .jar) 66,879 B tar.xz -9e: 266,484 B Exact container replay (zip: 905,295 B)
enwik8 (100 MB Wikipedia, raw HCM3 stream) 19.13 MB (1.531 bpc) xz -9e: 24.83 MB paq8f: 18.29 MB; record phda9: 15.24 MB
enwik8_100k — opt-in neural lane (HLN7 --kv-quarot, SmolLM2-1.7B) 9,637 B (0.701 bpb payload) xz -9e: 33,012 B Zero-float CUDA PTX dp4a == x86 == ARM64
enwik8_1mb — opt-in neural lane (HLN7 --kv-quarot, SmolLM2-135M) 125,136 B (0.994 bpb payload) xz -9e: 290,740 B RTX 4000: 132 s pack / 135 s unpack

For archival resilience, --parity on adds striped LRC(16,12,6) erasure coding over GF(28)\mathrm{GF}(2^8) (the 4-model SmolLM2-135M vault stays 37.2% smaller than raw even with parity enabled while repairing three 64 KiB burst corruptions bit-identically), --password encrypts chunks with PBKDF2-HMAC-SHA256 (200k) + AES-256-GCM, halo sign signs metadata with Ed25519, and halo unpack --in-place extracts from the tail and truncates as it goes for tight disks.

Zero-float determinism

HALO enforces zero float or double tokens across every codec and decode translation unit.

  • Bare-metal cross-architecture parity: 14/14 real workloads — Safetensors (HSN2), FASTQ/FASTA/.fastq.gz (HFQ1), paired-end R1+R2 (HFQ1-PE), Oxford Nanopore homopolymer-conditioned long reads, Dual-PBWT .vcf.gz (HVC1), GENCODE v47 GTF (HBG1), reference-free .sam and BGZF .bam (HBM1), context mixing (HCM3), and indexed archives (HIDX4 + HMVR1) — produce byte-for-byte SHA-256 identical .halo archives between Linux x86_64 (GCC) and bare-metal Apple M4 (arm64 Apple Clang), with 0 compiler warnings and 17/17 native and MCP test suites passing.
  • 4-architecture and compiler matrix: x86_64, AArch64, big-endian PowerPC64 (under static QEMU), and i686 pass 69/69 cross-arch checks, and gcc/clang match across -O0, -O2, -O3, -O3 -ffast-math, and UBSan.
  • GPU ↔ CPU parity: the opt-in CUDA PTX dp4a neural lane (HDET2/HLN7) produces bit-identical bitstreams to x86_64 and AArch64 CPUs.

Honest limits

  • Not a POSIX tar replacement. HALO is a byte-exact content bundle; it does not preserve Unix owners, permissions, timestamps, symlinks, hardlinks, or xattrs.
  • Peak RAM on large GGUF deltas. Multi-donor verify and unpack use topological DAG ordering with reference-counted eviction, but decoding a single 17.5 GB Q4_K_M delta still requires ~35–46 GiB of RAM (parent + child + buffers).
  • Speed varies sharply by lane. Model-weight vaults run at 50–140 MB/s and genomics lanes unpack at 66–1,186 MB/s (--profile hot runs zstd -3 + BCJ at 15–100+ MB/s), whereas deep text context mixing (HCM3/HCM4 on default/max profiles) runs at ~0.1–0.15 MB/s per core.
  • Stronger text-only compressors exist. On small fixed tars and enwik8, paq8px, paq8f, and the Hutter record remain smaller than HCM3.
  • Unencrypted index postings. When --password is combined with --index or --hsem, index postings remain unencrypted; treat indexed metadata as visible to anyone holding the archive file.
  • Audit and hardware scope. In-tree cryptography passes official NIST/RFC vectors and differential tests against Python's cryptography, but has not undergone an independent third-party audit. Big-endian PowerPC64 parity is verified under static QEMU emulation rather than bare-metal hardware.

Reproduce

# One-line build (Linux / macOS — C++20 compiler + CMake only, 0 external libraries)
git clone https://github.com/thebasedcapital/halo.git
cd halo
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j --target \
  halo_cli halo_archive_cli halo_container_cli halo_core_cli \
  halo_hsn3_test halo_hfq1_test halo_hvc1_test halo_hbg1_test halo_hbm1_test \
  halo_living_archive_test halo_crypto_test halo_zstd_test halo_lrc_fuse_test halo_hdet2_test

./build/halo_hsn3_test
./build/halo_hfq1_test
./build/halo_hvc1_test
./build/halo_hbg1_test
./build/halo_hbm1_test
./build/halo_living_archive_test ./build/halo_archive_cli ./build/halo_cli
./build/halo_crypto_test tests/fixtures/crypto

The source repository, security threat model (SECURITY.md), measured experiment log (benchmarks/autoresearch.md), and interactive pure-JS launch film (demo/halo-launch-film.html) are all public at github.com/thebasedcapital/halo under the MIT licence.

Cite this entry

@misc{tbc_halo,
  title = {HALO: lossless vaults for model weights, human genomics and live agent queries},
  author = {{TBC Research}},
  year = {2026},
  note = {F-012, catalogue version 2},
  howpublished = {\url{https://tbcresearch.org/research/halo/}}
}
← All research