# Cache observability: identical misses, different residents

This is an original, deterministic teaching example, not a reproduction of any
published cache, a hardware measurement, a prevalence estimate or a new theorem.

Run with Node.js:
```sh
node --test model.test.mjs
node --input-type=module -e 'import {example} from "./model.mjs"; console.log(JSON.stringify(example(), null, 2))'
```

Both four-request histories use an initially empty, fully associative two-slot
LRU cache and equal-size objects. Each miss emits one lower read. There are no
writes, prefetch, expiry, invalidations, bypass, concurrent requests or latency
model. Request indices are positions, not measured timestamps. The downstream
observer is deliberately restricted to reads and their request positions;
metadata, memory addresses and explicit eviction messages are not inputs.

ABAC and ABBC both emit A, B, C at positions 1, 2, 4 and both have one upper hit
out of four requests. Their final resident sets differ: A/C versus B/C.
A following A hits only in the first history. Thus known capacity, policy,
request count, hit count and lower read positions still do not identify residency.

Five tests include an independent last-use-history oracle over 3279
trace/capacity pairs (alphabet A/B/C, lengths 0..6, capacities 1..3), invalid
inputs and boundary controls. This is bounded verification, not exhaustive proof
over arbitrary streams. There is no sampling uncertainty for these exact counts.

The companion article compares the additional observations used by DEMOTE,
X-RAY and Geiger. The toy model does not claim these systems cannot distinguish
its histories when given their additional information. Their primary sources
retain their own rights; no paper figures or source code are redistributed.

Sources and source locators:
- Wong and Wilkes, USENIX ATC 2002, sections 1.1-1.2:
  https://www.usenix.org/legacy/publications/library/proceedings/usenix02/full_papers/wong/wong_html/index.html
- Bairavasundaram et al., ISCA 2004, sections 3-5:
  https://research.cs.wisc.edu/wind/Publications/xray-isca04.pdf
- Jones et al., ASPLOS 2006, sections 3, 4, 7 and 8:
  https://research.cs.wisc.edu/adsl/Publications/geiger-asplos06.pdf

Source sections reviewed 2026-12-02. No cross-paper speedup ranking is asserted.
