# Freeblock opportunity: range-count reconstruction

The FAST 2002 illustration leaves some eligible sectors unused because its
external scheduler permits only one contiguous request. This packet checks the
counting, not the paper's performance results.

| Inclusive LBN range | Sectors |
| --- | ---: |
| 1326-1334 | 9 |
| 1112-1145 | 34 |
| Both ranges | 43 |
| Selected / unused | 34 / 9 |

The selected share is exactly 34/43 of this opportunity. Its denominator is
neither total disk capacity nor all opportunities in a workload.

## Reproduce

Use Python 3, with no dependencies. Keep these files together:
[opportunity.py](./opportunity.py), [test_opportunity.py](./test_opportunity.py),
[result.json](./result.json).

```sh
python3 -B opportunity.py
python3 -B -m unittest -v test_opportunity.py
python3 -B -O -m unittest -v test_opportunity.py
```

The tests enumerate all 511 nonempty subsets of nine synthetic sectors and
compare the result with all eligible contiguous requests. Invalid, overlapping
or non-maximal adjacent ranges are rejected. Equal-size ties choose the lower
LBN; that convention is not attributed to the prototype.

## Interpretation

The input ranges are declared eligible. This calculation cannot infer physical
track geometry, seek time, a command's arrival phase, a speedup or a scan deadline.
No drive was tested. It is an arithmetic reconstruction of an illustration,
not an experimental replication.

Source: Lumb, Schindler and Ganger, [Freeblock Scheduling Outside of Disk
Firmware](https://www.usenix.org/legacy/publications/library/proceedings/fast02/full_papers/lumb/lumb.pdf),
FAST 2002, section 5.3 and Figure 11. Accessed 2026-11-30.
The paper and original figure are not redistributed here.

[Definition and engineering context](https://hesela.dev/terms/freeblock-scheduling/).
