Skip to main content

Module hebbian_cache

Module hebbian_cache 

Source
Expand description

Hebbian Co-Access Cache with Boltzmann-Temperature Eviction.

Scientific basis:

  • Hebb (1949): “Neurons that fire together wire together” — files accessed together strengthen their association, making co-accessed files resistant to eviction.
  • Boltzmann distribution (Statistical Physics): P(evict) = exp(-E/kT) where E is the “value” of a cache entry and T is the memory pressure. Low T = deterministic (only lowest-value entries evicted), High T = stochastic (prevents thrashing).

Structs§

CoAccessMatrix
Tracks co-access patterns between files (Hebbian learning).
EntryEnergy
Compute the “energy” (value) of a cache entry for Boltzmann eviction. Higher energy = more valuable = less likely to be evicted.

Functions§

boltzmann_select_evictions
Boltzmann eviction decision. Returns the indices to evict from a list of energy scores, given a temperature T.
path_hash
Compute a fast hash for a file path.