# FOMO decision-boundary replay

Source: [Lyons Jr. and Rangaswami, Algorithms 2024, Algorithm 1](https://www.mdpi.com/1999-4893/17/7/301).

Run `node --test model.test.mjs` beside [model.mjs](./model.mjs) and [model.test.mjs](./model.test.mjs). No dependencies.

Inputs are match counts over one supplied observation window. Outputs are the next state only. This does not implement history maintenance, request ordering, period sizing or eviction.

Constructed controls for 100 requests:

| Current state | Cache matches | History matches | Next state |
| --- | ---: | ---: | --- |
| Filter | 0 | 5 | Filter |
| Filter | 0 | 6 | Insert |
| Filter | 6 | 6 | Filter |
| Insert | 0 | 0 | Filter |

No empirical hit rate, latency or endurance result is claimed. Read the [term and limitations](https://hesela.dev/terms/fomo-cache-admission/). Observation windows shorter than the paper's configured period can be tested arithmetically, but this does not specify how an implementation should round that period.
