Skip to main content

Crate haagenti

Crate haagenti 

Source
Expand description

§Haagenti

Next-generation compression library for the Daemoniorum ecosystem.

Haagenti provides a unified interface for multiple compression algorithms with SIMD acceleration and streaming support.

§Quick Start

ⓘ
use haagenti::{Codec, Lz4Codec, ZstdCodec};

// LZ4 - fastest compression/decompression
let lz4 = Lz4Codec::new();
let compressed = lz4.compress(b"Hello, Haagenti!")?;
let original = lz4.decompress(&compressed)?;

// Zstd - balanced speed and ratio
let zstd = ZstdCodec::new();
let compressed = zstd.compress(b"Hello, Haagenti!")?;

§Available Algorithms

AlgorithmFeatureSpeedRatioBest For
LZ4lz4⚡⚡⚡⭐⭐Real-time, databases
Zstdzstd⚡⚡⭐⭐⭐General purpose
Brotlibrotli⚡⭐⭐⭐⭐Web, static content
Deflatedeflate⚡⚡⭐⭐⭐Compatibility

§Feature Flags

  • lz4 - LZ4 compression (default)
  • zstd - Zstandard compression (default)
  • brotli - Brotli compression (default)
  • deflate - Deflate/Gzip/Zlib compression (default)
  • simd - SIMD-accelerated primitives (default)
  • stream - Streaming I/O adapters (default)
  • full - All features enabled

Re-exports§

pub use compressive::CompressiveSpectralDecoder;
pub use compressive::CompressiveSpectralEncoder;
pub use spectral_analysis::Compressibility;
pub use spectral_analysis::SpectralAnalyzer;
pub use spectral_analysis::SpectralStats;
pub use adaptive::AdaptiveBatchEncoder;
pub use adaptive::AdaptiveEncodingMeta;
pub use adaptive::AdaptiveSpectralDecoder;
pub use adaptive::AdaptiveSpectralEncoder;
pub use adaptive::BatchEncodingStats;
pub use svd_compression::SvdCompressedWeight;
pub use svd_compression::SvdDecoder;
pub use svd_compression::SvdEncoder;
pub use hybrid_compression::CompressionMethod;
pub use hybrid_compression::HybridCompressedWeight;
pub use hybrid_compression::HybridCompressionStats;
pub use hybrid_compression::HybridDecoder;
pub use hybrid_compression::HybridEncoder;
pub use hybrid_compression::TensorType;
pub use mixed_precision::MixedPrecisionDecoder;
pub use mixed_precision::MixedPrecisionEncoder;
pub use mixed_precision::MixedPrecisionWeight;
pub use importance::ImportanceCompressedWeight;
pub use importance::ImportanceGuidedDecoder;
pub use importance::ImportanceGuidedEncoder;
pub use importance::ImportanceMap;
pub use importance::Sensitivity;
pub use importance::TensorImportance;
pub use streaming::LoadPriority;
pub use streaming::LoadStatus;
pub use streaming::ProgressCallback;
pub use streaming::ProgressiveLoadConfig;
pub use streaming::StreamingModelLoader;
pub use streaming::StreamingTensorLoader;
pub use pipeline::CompressionCheckpoint;
pub use pipeline::CompressionConfig;
pub use pipeline::CompressionPipeline;
pub use pipeline::CompressionReport;
pub use pipeline::IncrementalHctWriter;
pub use pipeline::PipelineConfig;
pub use pipeline::QualityReport;
pub use pipeline::QualitySampler;
pub use pipeline::QualitySummary;
pub use pipeline::ShardReader;
pub use pipeline::ShardStatus;
pub use pipeline::TensorEntry;
pub use pipeline::TensorIndexEntry;
pub use pipeline::TensorResult;
pub use pipeline::TensorStatus;
pub use hct_test_vectors::all_stress_vectors;
pub use hct_test_vectors::all_test_vectors;
pub use hct_test_vectors::cosine_similarity;
pub use hct_test_vectors::reference_dct_2d;
pub use hct_test_vectors::reference_idct_2d;
pub use hct_test_vectors::HctTestVector;

Modules§

adaptive
Adaptive Spectral Encoding
compressive
Compressive Spectral Encoding for HoloTensor
entropy
Fast entropy fingerprinting for compression decisions.
hct_test_vectors
HCT Specification Test Vectors
holotensor
Re-export of HoloTensor format from haagenti-hct.
hybrid_compression
Hybrid Compression Pipeline
importance
Importance-Guided Compression
mixed_precision
Mixed Precision Compression
pipeline
Production pipeline for large model compression with checkpointing.
simd
SIMD-accelerated primitives.
spectral_analysis
Spectral Analysis for Adaptive Retention
stream
Streaming compression adapters.
streaming
Streaming decompression for progressive inference loading.
svd_compression
SVD-based Compression for Neural Network Weights
tensor
Re-export of HCT tensor format from haagenti-hct.

Structs§

BlockIndex
Block index entry.
BlockIndexV2
Block index entry with optional checksum for v2.
BrotliCodec
Brotli codec combining compression and decompression.
BrotliCompressor
Brotli compressor.
BrotliDecompressor
Brotli decompressor.
ChecksumError
Checksum validation error.
CompressionStats
Statistics from a compression/decompression operation.
DeflateCodec
Raw DEFLATE codec.
DeflateCompressor
Raw DEFLATE compressor.
DeflateDecompressor
Raw DEFLATE decompressor.
FragmentIndexEntry
Index entry for a fragment (24 bytes).
GzipCodec
Gzip codec (DEFLATE with gzip wrapper).
GzipCompressor
Gzip compressor.
GzipDecompressor
Gzip decompressor.
HctCompressionStats
Statistics from compression.
HctHeader
Header for the compressed tensor format.
HctReader
Reader for compressed tensor files.
HctReaderV2
Reader for HCT v2 files with checksum validation.
HctWriter
Writer for compressed tensor files.
HctWriterV2
Writer for HCT v2 format with checksum and quantization support.
HoloFragment
A holographic fragment containing partial tensor data.
HoloTensorDecoder
Holographic tensor decoder.
HoloTensorEncoder
Holographic tensor encoder.
HoloTensorHeader
HoloTensor file header (88 bytes base + variable).
HoloTensorReader
Reader for deserializing HoloTensor data from a stream.
HoloTensorWriter
Writer for serializing HoloTensor data to a stream.
LrdfDecoder
Low-Rank Distributed Factorization decoder.
LrdfEncoder
Low-Rank Distributed Factorization encoder.
Lz4Codec
LZ4 codec combining compression and decompression.
Lz4Compressor
LZ4 compressor.
Lz4Decompressor
LZ4 decompressor.
QualityCurve
Quality prediction curve for reconstruction.
QuantizationMetadata
Quantization metadata for HCT v2.
RphDecoder
Random Projection Holography decoder.
RphEncoder
Random Projection Holography encoder.
SeededRng
Simple xorshift64 PRNG for reproducible random projections.
SpectralDecoder
Spectral holographic decoder.
SpectralEncoder
Spectral holographic encoder using DCT.
ZlibCodec
Zlib codec (DEFLATE with zlib wrapper).
ZlibCompressor
Zlib compressor.
ZlibDecompressor
Zlib decompressor.
ZstdCodec
Zstandard codec combining compression and decompression.
ZstdCompressor
Zstandard compressor.
ZstdDecompressor
Zstandard decompressor.
ZstdDictCompressor
Dictionary-aware compressor
ZstdDictDecompressor
Dictionary-aware decompressor
ZstdDictionary
A Zstandard dictionary for compression/decompression

Enums§

Algorithm
Supported compression algorithms.
CompressionAlgorithm
Compression algorithm identifier.
CompressionLevel
Compression level presets.
DType
Data type identifier.
Error
Compression error types.
HolographicEncoding
Holographic encoding scheme.
QuantizationScheme
Quantization scheme identifier.

Constants§

DEFAULT_BLOCK_SIZE
Default block size (16 KB uncompressed). Note: 16KB chosen for compatibility with haagenti-zstd which has issues at larger sizes
FLAG_BLOCK_CHECKSUMS
Flag: Per-block checksums present (XXH3-64 for each block).
FLAG_HEADER_CHECKSUM
Flag: Header checksum present (XXH3-64).
FLAG_HOLOGRAPHIC
Flag: Holographic encoded data (HoloTensor format). When set, the HCT file contains holographic fragments instead of raw blocks. The fragment data follows the HoloTensorHeader structure.
FLAG_QUANTIZATION
Flag: Quantization metadata present.
FLAG_TENSOR_NAME
Flag: Tensor name embedded in extended header.
HCT_MAGIC
Magic bytes for the HCT format.
HCT_VERSION
Format version 1 (original).
HCT_VERSION_V2
Format version 2 (with checksums and quantization metadata).
HOLO_FLAG_ESSENTIAL_FIRST
Flag: Essential data replicated in fragment 0.
HOLO_FLAG_FRAGMENT_CHECKSUMS
Flag: Per-fragment checksums present.
HOLO_FLAG_HEADER_CHECKSUM
Flag: Header checksum present.
HOLO_FLAG_INTERLEAVED
Flag: Coefficients interleaved for streaming.
HOLO_FLAG_QUALITY_CURVE
Flag: Quality curve coefficients present.
HOLO_FLAG_QUANTIZATION
Flag: Quantization metadata present.
HOLO_MAGIC
Magic bytes for HoloTensor format: “HTNS”
HOLO_VERSION
HoloTensor format version.

Traits§

Codec
Combined codec for both compression and decompression.
Compressor
One-shot compression operations.
Decompressor
One-shot decompression operations.
DictionaryCompressor
Dictionary-based compression for improved ratios on similar data.
DictionaryDecompressor
Dictionary-based decompression.

Functions§

compress
Compress data using the specified algorithm.
compress_file
Compress a tensor file to HCT format.
compress_with_level
Compress data using the specified algorithm and level.
dct_1d
1D Discrete Cosine Transform Type-II using FFT.
dct_2d
2D DCT via separable 1D transforms (row then column).
decode_from_file
Read and decode tensor data from a file in one step.
decode_from_file_progressive
Read and decode tensor data with progressive quality target.
decompress
Decompress data using the specified algorithm.
detect_algorithm
Auto-detect algorithm from compressed data header.
encode_to_file
Encode and write tensor data to a file in one step.
idct_1d
1D Inverse Discrete Cosine Transform Type-II (aka DCT-III).
idct_2d
2D IDCT via separable 1D transforms.
open_holotensor
Open a HoloTensor file for progressive reading.
read_holotensor
Read a HoloTensor from a file.
write_holotensor
Write a HoloTensor to a file.

Type Aliases§

Result
Result type alias for compression operations.