{
  "slug": "car-replacement",
  "term": "CAR (CLOCK with Adaptive Replacement)",
  "aliases": [
    "CAR",
    "CLOCK with Adaptive Replacement"
  ],
  "definition": "CAR is an adaptive cache replacement policy combining CLOCK reference bits with histories of recently evicted pages.",
  "note": "Resident pages occupy T1 and T2; B1 and B2 retain identities without cached payloads. Hits set a reference bit instead of immediately moving a recency-list entry. History hits adjust the target for T1. [car-slides]\n\nA history hit remains a cache miss because B1 and B2 lack the payload. Figure 2 performs replacement before adapting p: a hit in B1 raises p (capped at capacity), while a hit in B2 lowers it (floored at zero); the returning page enters T2 with bit zero. Here p is an eviction target, not a fixed partition. Replacement rechecks the current T1 length against max(1, p) on each visit, so promotion can switch the scanned list. [car-paper]\n\nFigure 2 line 29 clears a referenced T1 page's bit before moving it to T2; line 34 sends a T2 victim to B2. Section III.B instead says one and B1 at those points. Hesela follows Figure 2 and records these as editorial discrepancies, not author-confirmed errata. [car-paper]\n\nTake c=2, p=0, T1=[C:1] and T2=[B:1], with list heads at the left. Figure 2 evicts C after 3 visits; retaining the promoted bit evicts B after 4. This is an offline transition check, not a full CAR implementation or a performance benchmark. [hesela-car-steps]\n\nCheap hit updates do not imply constant work on a miss. For one Figure 2 replacement with c resident pages and no concurrent hits, at most c + 1 head visits suffice: each initially set bit can be cleared once before eviction. All-set T2 reaches that bound. This is a derived operation count, not a latency guarantee. [hesela-car-code] [hesela-car-tests]",
  "status": "research",
  "advantages": [
    {
      "text": "Avoids the hit-path recency-list movement of conventional LRU.",
      "citationIds": [
        "car-slides"
      ]
    }
  ],
  "limitations": [
    {
      "text": "The paper gives single-threaded pseudocode and describes serialized misses; this is not a complete lock-free cache.",
      "citationIds": [
        "car-paper"
      ]
    },
    {
      "text": "CART adds temporal filtering and is a different algorithm, not another name for CAR.",
      "citationIds": [
        "car-paper"
      ]
    }
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-02",
  "related": [
    "clock-replacement",
    "adaptive-replacement-cache",
    "ghost-cache-entry",
    "cache-pollution"
  ],
  "provenance": [
    "Source review plus constructed transitions; no author benchmark reproduction or concurrency measurement."
  ],
  "citations": [
    {
      "id": "car-paper",
      "title": "Bansal and Modha. CAR: Clock with Adaptive Replacement. FAST 2004, section III.B and Figure 2 lines 29/34; section IV.",
      "url": "https://www.usenix.org/events/fast04/tech/full_papers/bansal/bansal.pdf",
      "accessed": "2026-11-02"
    },
    {
      "id": "car-slides",
      "title": "Bansal and Modha. CAR: CLOCK with ADAPTIVE REPLACEMENT. Author presentation, FAST 2004.",
      "url": "https://theory.stanford.edu/~sbansal/pubs/fast04ppt.pdf",
      "accessed": "2026-11-02"
    },
    {
      "id": "hesela-car-steps",
      "title": "Hesela: constructed CAR replacement steps, Figure 2 versus prose controls",
      "url": "https://hesela.dev/research/car-replacement-steps.json",
      "accessed": "2026-10-30"
    },
    {
      "id": "hesela-car-code",
      "title": "Hesela: dependency-free replacement-step source, not a complete CAR simulator",
      "url": "https://hesela.dev/scripts/car-replacement-step.mjs",
      "accessed": "2026-10-30"
    },
    {
      "id": "hesela-car-tests",
      "title": "Hesela: standalone CAR transition equivalence and offline visit-bound checks",
      "url": "https://hesela.dev/scripts/car-replacement-step.test.mjs",
      "accessed": "2026-10-30"
    }
  ]
}
