{
  "slug": "statstack",
  "term": "StatStack",
  "aliases": [
    "StatStack cache model"
  ],
  "definition": "StatStack estimates fully associative LRU cache miss ratios from sparsely sampled intervals between references to the same cache line.",
  "note": "Mechanism: sampled intervals feed an expected stack-distance distribution, which approximates the distribution used to estimate misses. StatCache instead models random replacement. [paper] [project]\n\nNaming: the paper calls the count of intervening accesses reuse distance and the count of distinct intervening lines stack distance. Its first quantity is a request-index reuse interval minus one; immediate repetition gives zero. [paper]\n\nAveraging: thresholding an expected distance can hide misses when individual distances straddle capacity. Sampling and approximation errors are separate; smaller sampling windows can reduce phase mixing but miss longer reuse behavior. [paper]\n\nWorked example: the final A in ABBA and ABCA has request-index interval 3, but distinct-entry distances 1 and 2. At two-slot LRU capacity, one of these two reuses misses. Comparing their mean distance 1.5 with capacity 2 predicts neither miss. This is a constructed illustration of averaging, not a StatStack implementation. [example]",
  "status": "research",
  "advantages": [],
  "limitations": [],
  "related": [
    "reuse-time",
    "reuse-distance",
    "miss-ratio-curve",
    "shards",
    "statcache",
    "average-eviction-time"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-18",
  "citations": [
    {
      "id": "paper",
      "title": "Eklov and Hagersten. StatStack: Efficient Modeling of LRU Caches. ISPASS 2010; thesis Paper I, sections I.3-I.6.",
      "url": "https://uu.diva-portal.org/smash/get/diva2:730614/FULLTEXT01.pdf",
      "accessed": "2026-11-18"
    },
    {
      "id": "project",
      "title": "Uppsala University. Efficient Modeling Technology: separate random-replacement and LRU models.",
      "url": "https://www.it.uu.se/research/upmarc/research/resource-man/resource-modeling-technology.html",
      "accessed": "2026-11-18"
    },
    {
      "id": "example",
      "title": "Hesela. Constructed reuse intervals and mean-distance threshold example; exact event ledgers.",
      "url": "https://hesela.dev/research/statstack-averaging.json",
      "accessed": "2026-11-18"
    },
    {
      "id": "code",
      "title": "Hesela. Executable averaging example, using the existing bounded exact reuse evaluator.",
      "url": "https://hesela.dev/research/statstack-averaging.mjs",
      "accessed": "2026-11-18"
    }
  ],
  "provenance": [
    "Paper I was read in the author's thesis copy, PDF pages 41-66. No original benchmark data, sampler or implementation was reproduced.",
    "The example checks conditional averaging only; it does not estimate StatStack accuracy or storage latency."
  ]
}
