{
  "schemaVersion": 1,
  "kind": "constructed-arithmetic",
  "generatedOn": "2026-10-30",
  "units": {
    "size": "bytes",
    "time": "accesses",
    "density": "hits per byte-access"
  },
  "source": "https://www.usenix.org/system/files/conference/nsdi18/nsdi18-beckmann.pdf",
  "sourceSections": "3.1-3.3, equations 2-5",
  "code": "/research/lhd-density.mjs",
  "assumptions": [
    "Candidate probability and expected remaining lifetime are supplied inputs, not estimates fitted to a trace.",
    "For each candidate, probability and lifetime refer to the same age and object class under one eviction policy; these inputs are not calibrated predictions.",
    "The ledger lists completed hit-or-eviction lifetimes, not censored intervals or all cache capacity.",
    "Metadata, fragmentation, idle space and outstanding lifetimes are not represented.",
    "Access time is not wall-clock time. This is not an LHD implementation or a benchmark."
  ],
  "candidates": [
    {
      "id": "A",
      "hitProbability": 0.8,
      "sizeBytes": 100,
      "remainingAccesses": 10,
      "hitsPerByteAccess": 0.0008
    },
    {
      "id": "B",
      "hitProbability": 0.4,
      "sizeBytes": 50,
      "remainingAccesses": 2,
      "hitsPerByteAccess": 0.004
    }
  ],
  "ranking": {
    "higherDensity": "B",
    "densityRatioBOverA": 5,
    "probabilityPerByteWithoutLifetime": [
      0.008,
      0.008
    ]
  },
  "ledger": {
    "lifetimes": [
      {
        "outcome": "hit",
        "sizeBytes": 100,
        "accesses": 2
      },
      {
        "outcome": "eviction",
        "sizeBytes": 100,
        "accesses": 8
      }
    ],
    "hits": 1,
    "byteAccesses": 1000,
    "hitsPerByteAccess": 0.001
  },
  "biasedHitOnlyLedger": {
    "hits": 1,
    "byteAccesses": 200,
    "hitsPerByteAccess": 0.005
  },
  "emptyLedger": {
    "hits": 0,
    "byteAccesses": 0,
    "hitsPerByteAccess": null
  }
}
