# DULO: count demand misses, transfers and positioning separately

The same transferred block count can hide a different I/O request shape.
In this fixed example, both alternatives fetch 16 blocks; demand misses are
10/20 and 7/20. Do not treat any of these quantities as interchangeable.

| Quantity | Traditional | Dual-locality alternative |
| --- | ---: | ---: |
| Demand references | 20 | 20 |
| Demand hits | 10 | 13 |
| Demand misses / references | 10/20 | 7/20 |
| Fetched blocks, including prefetch | 16 | 16 |
| Prefetched blocks beyond the triggering demand | 6 | 9 |
| Positioning events in this model | 10 | 7 |
| Modeled positioning time at 9.5 ms/event | 95.0 ms | 66.5 ms |

## What is being reconstructed

The introductory illustration in [FAST 2005, section 2.1, Table 1](https://www.usenix.org/legacy/events/fast05/tech/full_papers/jiang/jiang.pdf)
uses an eight-block cache, four scattered blocks and two four-block sequential
groups. [ACM TOS 2007, section 2.1, Table I](https://ranger.uta.edu/~sjiang/pubs/papers/ding07_DULO.pdf)
presents the same reference sequence and assumed positioning costs.

The code reconstructs that teaching example. It is not the full DULO algorithm.
The dual alternative retains the scattered blocks throughout this particular
trace. Actual DULO must also age blocks out.

## Reproduce and inspect

Requires Node.js with built-in modules only.

```sh
node replay.mjs
node replay.mjs --write
node --test test_replay.mjs
```

[replay.mjs](replay.mjs) emits every reference, hit/miss decision, fetched group,
and resulting cache order. The second command regenerates [result.json](result.json).
[test_replay.mjs](test_replay.mjs) checks transitions, totals and the stored output.

A demand miss starts one fetch here. Prefetch can satisfy later demands without
another positioning event. At reference 13 the dual alternative fetches four
sequential blocks; the traditional alternative later rereads four scattered
blocks. That changes operation count without changing transferred block count.

## Limits

The event cost is fixed, transfer and computation time are omitted, and prefetch
is immediate. Neither elapsed time nor bandwidth was measured. No device,
current kernel or SSD performance follows from these totals. The 30% reduction
in this modeled positioning total is not an application-speedup estimate.

See the [DULO corpus record](https://hesela.dev/terms/dulo/) for source history,
the CLOCK baseline distinction and the adapted kernel prototype.
