Skip to content

Formal Verification & Quality Engineering

Verifying that an engine cuts memory in half on a static RDB snapshot takes five minutes. Approving that engine to replace hundreds of mission-critical in-memory state nodes requires proving properties that short benchmarks never exercise: zero off-by-one byte corruption inside packed blocks, zero lost or resurrected keys across coroutine/compaction interleavings, deterministic crash and bit-flip recovery bounds, and zero chronic RSS drift across hundreds of hours of variable-length churn.

Anchored by our Five-Tier Engineering Priority Hierarchy (Compatibility > Data Integrity & Recovery > Tail Latency > Memory Density > Peak Throughput), Engula 2.3.0 enforces a five-layer defense-in-depth verification architecture in which every layer is calibrated via deliberate fault and mutant injection.


1. Five-Layer Defense-in-Depth Architecture

Verification Layer Defect Classes Targeted Core Tools & Engineering Mechanics Engula 2.3.0 Gate Status
Layer 1: Deductive Proofs & Bounded Model Checking on C Source Packed-block offset overruns, integer overflows, undefined behavior (UB), codec round-trip corruption Direct verification on our C source with Frama-C 33.0 (WP + Eva), Alt-Ergo 2.4.3, and CBMC 6.8.0 Core index well-formedness & insert/lookup proved (0 admit, 0 Eva UB alarms); block region isolation, branchless lookup equivalence, and varint / 36 → 16 byte UUID bijections proved
Layer 2: State-Machine Modeling & Differential Fuzzing Three-phase compaction vs. foreground delete interleavings, dual-buffered dataset switching, cross-encoding edge drift Scoped TLA+ synchronization-point specifications (planned / in progress) + active dual-encoding randomized differential oracles & stateful module range walkers Active differential fuzzing uncovered 6 deep edge-case bugs in upstream valkey-io/valkey B+ tree (PR 4359) and upstreamed PR 4637, PR 4644, PR 4645; TLA+ models scoped for concurrency/recovery
Layer 3: 14-Domain Destructive Fault & Interop Matrix Truncated/flipped RDBs, network partitions, WAN link flaps, mixed Sentinel failover, live mixed-cluster MIGRATE Container & chaos fault-injection harness with three-way validation across prose specs, YAML registry, and test tags 144 / 146 system scenarios active; INTOP 10/10 live bidirectional Redis 7.2.15 interop passed; 5.55 s vs. 5.50 s median Sentinel RTO
Layer 4: 24/7 (168h) Multi-Profile Soak & Conservation Watchdog Multi-day chronic memory leaks, slab page pinning, compression queue starvation, internal counter drift Deterministic schedule-fingerprint multi-profile rotation with an independent observer enforcing five conservation invariants 6h variable-length churn flat at 415–417 MB RSS (vs. 4,865 MB stock); 168h primary–replica soak with zero crashes, zero drift, and byte-exact end-state digests
Layer 5: CodeProof 61-Gate Community-Tool Release Harness Vendor benchmark bias, OS shared-library coupling, inability to audit closed-source claims inside air-gapped networks Orchestrates stock runtest, memtier_benchmark, redis-shake, and 6 language SDKs into a standalone report.html Covers Compatibility (16/16), HA (6/6), Performance, Stability, Clients, Migration, and Platform (46 / 61 active in 2.3.0), plus rolling runs at /proof-live

2. Deductive Mathematical Proofs & CBMC Bijections

Rather than verifying simplified toy models, Layer 1 runs directly against our C source code:

  1. Frama-C 33.0 WP Deductive Proofs (Core Index, 0 admit): Across our core in-memory index—the critical component mapping logical slot identifiers to exact physical locations—ACSL contracts specify preconditions, loop invariants, memory separation, and postcondition bounds. Every core-index well-formedness and insert/lookup proof obligation is discharged automatically via Alt-Ergo 2.4.3 with zero unproved assumptions (0 admit), while modular proof slicing bounds per-job solver RAM from over 20 GB down to 2.3 GB or less—designed for bounded, deterministic execution in our target CI gate.
  2. Zero Frama-C Eva Runtime Alarms: Abstract interpretation across index lookup and boundary arithmetic confirms 0 alarms for division by zero, invalid pointer dereference, out-of-bounds memory access, or signed integer overflow.
  3. CBMC 6.8.0 Bit-Exact Codec Bijections & Non-Overlapping Block Regions: Bounded model checking proves bit-for-bit round-trip bijections across variable-length integer codecs and the 36-char UUID to 16-byte binary key-suffix codec, proves that internal block regions stay strictly non-overlapping across all valid states, and proves exact equivalence between branchless binary search and reference linear search.

3. Anti-Vacuity & Mutant Calibration Discipline

A verification gate that always turns green due to contradictory preconditions or silent sampling gaps is worse than no gate at all. Every verification layer in Engula is calibrated against deliberate negative controls:

  • Vacuity probes & mutant injection in formal proofs (Layer 1): In classical logic, an inconsistent precondition (false ==> P) makes any broken C function "verify" in milliseconds. Every ACSL and CBMC contract attaches automated vacuity probes confirming satisfiable reachable states, alongside seeded off-by-one and counter-omission mutants verified to fail proof gates 100% of the time.
  • Deterministic keyspace pre-population & < 1% miss-rate floor in benchmarks (Layer 3): Read benchmarks verify keyspace pre-load and fail the entire run if the key-miss rate exceeds 1% (outside explicit cold-cache tests), preventing fast nil misses from inflating reported decompression throughput.
  • Five conservation gates & schedule-fingerprint locking in 24/7 soak runs (Layer 4): Load generators and observers cross-check cryptographic plan-fingerprint values; any unreachable sampling window fails the run outright, while enforcing five conservation invariants: (1) zero crashes or Fail-Stop markers, (2) zero monotonic RSS drift across identical profile cycles, (3) byte-identical primary/replica end-state digests, (4) closed-form ENGULA INFO block/record accounting, and (5) steady-state latency under continuous maxmemory eviction.

4. Independent Verification Inside Your Own Environment

Architecture review boards and InfoSec teams can verify every claim independently through three channels:

  1. Live Rolling Public Logs: Inspect raw stdout logs across all 4,316 official compatibility subtests, BGSAVE / LOAD matrices, and reconnect-storm benchmarks at /proof-live.
  2. Air-Gapped CodeProof Self-Audit: Pull the offline CodeProof container into your quarantined intranet (see CodeProof Usage Guide) and run ./proof test compat, ./proof test ha, and ./proof test migration to generate a zero-external-link report.html artifact.
  3. White-Box Source Review: Regulated institutions requiring code-level inspection can review the underlying C storage kernel and formal specifications under Enterprise Source Subscription.