Skip to content

SutraDB v5.5.0 — Unified Rust SIMD Engine, .sutra.idx Persistence & RBAC

Latest

Choose a tag to compare

@Sam-CodesAI Sam-CodesAI released this 28 Nov 02:30
· 2 commits to main since this release

SutraDB v5.5.0 unifies the storage, indexing, SIMD distance, and observability pipeline under a native Rust core with prebuilt cross-platform Python wheels, a standalone --no-default-features gRPC/HTTP server binary, and verified durability up to 100K × 768d.


Quick Install

Python (sutradb-core==5.5.0)

Prebuilt wheels for Linux, macOS, and Windows (+ source sdist):

pip install sutradb-core==5.5.0

Standalone Rust Server Binary (Zero Python Dependency)

cargo build --release --no-default-features --bin sutradb-server
./target/release/sutradb-server --host 0.0.0.0 --port 50051 --http-bridge-addr 127.0.0.1:8765 --data-dir ./sutra_data

Container Images (321 MB Non-Root)

docker pull samcodesai/sutradb:5.5.0
# or via GHCR:
docker pull ghcr.io/sam-codesai/sutradb:5.5.0

Key Architecture Upgrades Since v5.1.0

  • Unified Rust Engine & Zero-Copy NumPy Ingest: Replaced split Python hot paths with NativeCollection backed by PyO3 insert_numpy zero-copy buffer ingestion.
  • Contiguous Arenas & Runtime SIMD Auto-Dispatch: Flat VectorArena, SQ8Arena, BQArena, and PQArena slabs paired with runtime std::arch kernels (AVX-512, AVX2 + FMA, ARM NEON, and scalar tails) safe across odd dimensions and non-finite inputs.
  • Cost-Based RoaringBitmap 1%-Filter Planner: Automatically bypasses HNSW traversal into a direct exact SIMD scan over matching RoaringBitmap document IDs when valid_count <= 2048 (or < 3% selectivity up to 4096), eliminating post-filtering recall collapse and high-ef graph hops (412× speedup: 77 ms -> 0.187 ms at 100K × 768d).
  • Mean-Centered 2-Stage BQ & Parallel PQ with Mmap FP32 Eviction: 1-bit Binary Quantization (32× RAM reduction) and Product Quantization with mmap-backed FP32 arena eviction cleanly cut resident memory footprints while keeping Stage-2 reranking exact/SQ8-backed.
  • O(N)-Free Sparse BM25 & WAND Pruning: Replaced full-corpus BM25 score vector allocations and idf_cache RwLock contention with sparse postings accumulation + tombstone compaction, and added WAND / Block-Max WAND pruning to SparseIndex::search().
  • Atomic .sutra.idx Instant-Restart Persistence & Parallel HNSW: Persists HNSWIndex (flat Vec<Vec<u32>> layers + RoaringBitmap tombstones), IVFIndex, BQArena, PQArena + PQCodebook, and ColbertCentroids in a CRC32-verified .sutra.idx sidecar for instant cold restarts without rebuilding graphs, alongside Rayon-parallel HNSW batch construction (m=32, ef_construction=200).
  • Buffered SWB1 Binary WAL: Added 64 KB BufWriter group commit (append_batch), compact binary frame encoding, partial-tail crash truncation, and Drop buffer flushing.
  • Production Auth/RBAC & Prometheus Observability: Constant-time API key authentication + collection-scoped RBAC (admin | write | read) via SUTRA_API_KEY and SUTRA_RBAC_CONFIG across gRPC, HTTP bridge, and FastAPI /ui/stats proxy, plus Prometheus 0.0.4 histograms (sutradb_query_duration_seconds) and engine/WAL gauges at GET /metrics.

Verified Out-of-L3-Cache Scale Benchmark (100,000 × 768d)

Measured on a 2-vCPU Linux x86_64 host (AMD EPYC 7763, AVX2 / FMA, Python 3.14.2, Cosine, top_k=10, raw FP32 matrix = 293.0 MiB — reproducible via benches/scale_benchmark.py):

Engine & Mode Ingest / Build P50 (ms) P99 (ms) QPS Vector / Index RAM Compression Recall@10
NumPy (Exact GEMV) - 35.019 56.064 27.4 293.0 MiB 1× 100.00%
SutraDB Flat (Rust AVX2 SIMD) 29,228 docs/s 14.236 21.737 68.1 293.0 MiB 1× 100.00%
SutraDB HNSW Unfiltered (m=16) 1,063 docs/s (build) 0.417 0.645 2,291.2 326.2 MiB 1× 100.00%
SutraDB HNSW 1%-Filtered (Cost-Based Roaring SIMD) 1,063 docs/s (build) 0.187 0.297 4,913.9 326.2 MiB 1× 100.00%
SutraDB SQ8 (Mmap-Evicted 4×) 18,966 docs/s 6.516 10.836 141.5 73.2 MiB 4.0× 97.90%
SutraDB 1-Bit BQ (Mmap-Evicted 32×) 19,243 docs/s 2.043 3.580 436.2 9.2 MiB 32.0× 92.10%
  • Cold Restart (.sutra + .sutra.idx sidecar): Save in 1.99 s (308.3 MiB .sutra + 14.9 MiB .sutra.idx); cold load() in 3.07 s (3066.35 ms) with has_hnsw=True and exact top-10 parity preserved. (At 10K × 128d in benches/BENCHMARK_REPORT.md: 0.321 ms HNSW P50 / 99.20% Recall@10, 634.54 ms cold restart.)

Verification & Peak Chaos Scoreboard (332/332 Tests + 5/5 Torture Scenarios)

Reproducible via benches/peak_stress_test.py against target/release/sutradb-server and sutradb-core==5.5.0:

Scenario Result Exact Measured Numbers
1. 32-Client Concurrent Storm (20s, RBAC + Prometheus + live compact()/save()) PASS 3,055 ops (152.75 ops/s), P50 = 70.80 ms, P99 = 1521.00 ms, 0 panics / 0 HTTP 500s; Prometheus parity (2,389 queries, 3,224 ingested docs)
2. Real OS SIGKILL (kill -9) Torture (3 consecutive cycles, WAL enabled) PASS 744 / 744 HTTP-200 acknowledged surviving docs recovered (100% survival across 75 batches + 15 deletes, 0 ghost deletes)
3. 50% Delete/Upsert Churn + Compact + Cold Load (20,000 × 256d -> 10,000 -> 15,000) PASS 10,000 tombstones compacted, 0 ghost docs across HNSW / 1%-filter / BM25 / SQ8 / BQ, post-compaction HNSW Recall@10 = 98.20%
4. 10,000-Query PyO3 -> Rust Memory-Leak Soak (6 mixed query modes) PASS RSS@1K = 291.32 MiB, RSS@10K = 291.32 MiB (+0.00 MiB delta); Early vs Late P50: 0.228 -> 0.229 ms, P99: 0.553 -> 0.554 ms
5. Live Adversarial Fuzz & Security Gauntlet PASS 30 / 30 probes returned clean 400/401/403/404/200 (NaN/1e50, wrong dim, top_k=0/1M, ../ + NUL traversal, ReDoS regex, cross-tenant /ui/stats, bit-flipped .sutra/.sutra.idx)
CI Test Suites (clippy -D warnings + cargo test --release + pytest) PASS 332 / 332 passing (98 Rust + 234 Python)

Scope & Roadmap Note

v5.5.0 is an embedded/single-node vector + lexical + ColBERT engine verified up to 100K × 768d (293 MiB FP32). Multi-segment LSM compaction and 10M+ multi-node distributed tiering are planned for v6.0.