zipora 3.1.2

High-performance Rust implementation providing advanced data structures and compression algorithms with memory safety guarantees. Features LRU page cache, sophisticated caching layer, fiber-based concurrency, real-time compression, secure memory pools, SIMD optimizations, and complete C FFI for migration from C++.
[package]
name = "zipora"
version = "3.1.2"
edition = "2024"
rust-version = "1.88"
authors = ["InfiniLabs"]
description = "High-performance Rust implementation providing advanced data structures and compression algorithms with memory safety guarantees. Features LRU page cache, sophisticated caching layer, fiber-based concurrency, real-time compression, secure memory pools, SIMD optimizations, and complete C FFI for migration from C++."
license-file = "LICENSE"
repository = "https://github.com/infinilabs/zipora"
keywords = ["compression", "data-structures", "trie", "succinct", "concurrency"]
categories = ["compression", "data-structures", "algorithms", "concurrency", "memory-management"]

[lib]
name = "zipora"
crate-type = ["rlib", "cdylib"]

[features]
default = ["simd", "mmap", "zstd", "serde", "lz4", "async"]
simd = []
# AVX-512 support requires nightly Rust due to experimental intrinsics
# Currently disabled by default for stable Rust compatibility
avx512 = ["simd"]
# Nightly features for performance optimizations
nightly = []
mmap = ["dep:memmap2"]
zstd = ["dep:zstd"]
lz4 = ["dep:lz4_flex"]
ffi = ["dep:cbindgen"]
serde = ["dep:serde", "dep:serde_json", "dep:bincode"]
async = ["dep:tokio"]

[dependencies]
# Core functionality
memmap2 = { version = "0.9.9", optional = true }
bytemuck = "1.24"
thiserror = "2.0"
log = "0.4"

# Performance
ahash = "0.8.12"
rayon = "1.11"
thread_local = "1.1"
fastrand = "2.1"

# Compression (optional)
zstd = { version = "0.13.3", optional = true }
lz4_flex = { version = "0.12", optional = true }

# Serialization (optional)
serde = { version = "1.0", features = ["derive"], optional = true }
serde_json = { version = "1.0", optional = true }
bincode = { version = "1.3", optional = true }
bitflags = "2.10"

# Phase 4 dependencies
once_cell = "1.20"
libc = "0.2"

# Async runtime (optional)
tokio = { version = "1.43", features = ["full"], optional = true }

# System utilities dependencies
raw-cpuid = "11"
base64 = "0.22"

# FFI support (optional)
cbindgen = { version = "0.29", optional = true }

[dev-dependencies]
criterion = { version = "0.8", features = ["html_reports"] }
proptest = "1.9"
tempfile = "3.14"
arbitrary = { version = "1.4", features = ["derive"] }
rand = "0.9"
# Note: rayon is already in main dependencies

[build-dependencies]
cbindgen = { version = "0.29", optional = true }
pkg-config = "0.3.27"

[[bench]]
name = "benchmark"
harness = false

[[bench]]
name = "benchmark_rank_select"
harness = false

[[bench]]
name = "simd_rank_select_bench"
harness = false

[[bench]]
name = "dictionary_optimization_bench"
harness = false
[[bench]]
name = "cache_bench"
harness = false

[[bench]]
name = "avx512_bench"
harness = false

[[bench]]
name = "secure_memory_pool_bench"
harness = false

[[bench]]
name = "specialized_containers_bench"
harness = false

[[bench]]
name = "rank_select_bench"
harness = false

[[bench]]
name = "simd_memory_bench"
harness = false

[[bench]]
name = "hash_maps_bench"
harness = false

[[bench]]
name = "lru_map_bench"
harness = false

[[bench]]
name = "dict_zip_bench"
harness = false

[[bench]]
name = "valvec32_performance_bench"
harness = false

[[bench]]
name = "cpp_impl_comparison"
harness = false

[[bench]]
name = "entropy_bench"
harness = false

# Performance validation example
[[example]]
name = "production_benchmark"
path = "examples/production_benchmark.rs"

[profile.release]
opt-level = 3           # Maximum optimization level
lto = "thin"           # Thin LTO: ~95% of fat LTO quality, much faster link
codegen-units = 16     # Parallel codegen — use all cores during compilation
panic = "unwind"       # Unwind for test compatibility
strip = false          # Keep debug symbols for tests
overflow-checks = false # Disable overflow checks in release for performance
debug-assertions = false # Disable debug assertions in release

# Shipping profile: use for final binaries (`cargo build --profile shipping`)
# Keeps codegen-units=1 + fat LTO for maximum runtime performance.
[profile.shipping]
inherits = "release"
lto = "fat"            # Full link-time optimization
codegen-units = 1      # Single codegen unit for best optimization
strip = true           # Strip symbols for smaller binary

[profile.bench]
opt-level = 3           # Maximum optimization for benchmarks
lto = "thin"           # Thin LTO: fast link, accurate benchmarks
codegen-units = 8      # Parallel codegen
overflow-checks = false # Optimize for performance
debug = false          # Remove debug info for accurate benchmarks
debug-assertions = false # No debug assertions in benchmarks

[profile.test]
opt-level = 1           # Moderate optimization: fast compile, reasonable test speed
debug = true           # Enable debug info for test failures
debug-assertions = true # Enable debug assertions in tests
overflow-checks = true  # Enable overflow checks for safety in tests

[package.metadata.docs.rs]
features = ["simd", "mmap", "zstd", "lz4", "serde", "ffi"]
all-features = true

# Miri configuration for enhanced memory safety testing
[package.metadata.miri]
# Flags for comprehensive memory safety verification
flags = [
    "-Zmiri-strict-provenance",      # Strict pointer provenance checking
    "-Zmiri-symbolic-alignment-check", # Check alignment symbolically  
    "-Zmiri-check-number-validity",   # Check for invalid bit patterns
    "-Zmiri-disable-isolation",       # Allow file system access for tests
]
# Exclude tests that require specific hardware features not available in Miri
exclude = [
    "tests/simd_specific_tests.rs",
    "tests/avx512_tests.rs", 
    "benchmarks/*",
]