# Hyperbolic priority crossing
Hesela teaching arithmetic, generated on 2026-11-12.
Run `python3 -B model.py` and
`python3 -B -m unittest discover -s . -p test_model.py`.
No third-party runtime packages or random seeds are needed.

A has count 4 and insertion time 0. B has count 1 and insertion time 9.
Both remain resident; neither receives another access during the example.
Compare 4/t with 1/(t-9), for t>9. Multiplication by the positive
denominators gives equality at 4(t-9)=t, hence t=12.
Before 12 the smaller score belongs to A; after 12 it belongs to B.
A ranking frozen at time 10 cannot answer the comparison at time 20.
A possible history is A at 0,1,2,3 and B at 9; these are arbitrary elapsed
time units, not a prescribed global request trace.

The sampling calculation conditions on a fixed set of priorities at one
eviction decision. Uniform independent draws with replacement give a no-hit
probability ((N-k)/N)^s. Uniform distinct draws give
choose(N-k,s)/choose(N,s). Complements give the recorded probabilities.
Neither is a cache hit-rate prediction. Retention, correlated sampling,
nonuniform selection or changing priorities invalidate these particular formulas.

Zero residence age is intentionally rejected. A deployed cache must define
timestamp granularity, counter overflow, zero-age handling and tie-breaking.
No experiment on hardware or Redis/Django was run; no paper result is replicated.
Source: Blankstein, Sen and Freedman, USENIX ATC 2017, pp.499-511,
https://www.usenix.org/conference/atc17/technical-sessions/presentation/blankstein
The original paper is not redistributed. Reference code is independently written.
