Skip to main content

Module proof_cache

Module proof_cache 

Source
Expand description

Proof Caching Layer

Caches proof results keyed by (goal_hash, kb_version) to avoid redundant inference. Supports LFU-style eviction (lowest access_count first) and TTL-based expiry.

§Design

  • Linear scan over a Vec<CachedProof> (suitable for small caches ≤ 256).
  • LFU eviction: when at capacity, the entry with the lowest access_count is removed to make room for a new entry.
  • TTL: entries are considered stale if now_secs - cached_at_secs >= ttl_secs.
  • Optional invalidation on KB version change via invalidate_on_kb_change.

Structs§

CachedProof
A single cached proof result together with its bookkeeping metadata.
ProofCacheConfig
Configuration for ProofCachingLayer.
ProofCacheKey
Composite key for a cached proof: goal identity × KB version.
ProofCacheStats
Cumulative statistics for a ProofCachingLayer.
ProofCachingLayer
An LFU-evicting, TTL-expiring cache for proof results.

Functions§

fnv1a_hash
Compute the FNV-1a hash of a string.