# Cache-residency metric denominators

This is a deterministic, constructed set example, not a cache simulator,
paper replication or device measurement. Block identifiers are opaque nonempty
strings. Inputs are sets, so repeated identifiers count once. There is no time
axis, replacement policy, workload sample or confidence interval.

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

The example reports 80 predicted residents, 100 actual residents and 60 shared
blocks. False positives number 20; false negatives number 40. Dividing by the
respective resident counts yields 0.25 and 0.40. Undefined fractions use null
when their denominator is zero. No universe of nonresident blocks is supplied,
so conventional false-positive rate is intentionally not computed.

[Definition and evidence](https://hesela.dev/terms/x-ray/).
[Implementation](model.mjs). [Tests](model.test.mjs).
