# Obsolete mapping payload, live recovery link

A newer mapping can supersede an older value without making the older record's
link dispensable. Consider this synthetic backward chain:

| Record address | Mapping payload | Previous record |
| --- | --- | --- |
| 40 (tail) | X = 400 | 30 |
| 30 | Y = 300 | 20 |
| 20 | X = 200 | 10 |
| 10 | Z = 100 | none |

Recovery follows 40 -> 30 -> 20 -> 10, retaining the first value for each key.
It obtains X = 400, Y = 300 and Z = 100.

Record 20's X value is obsolete. Delete that record and the same traversal stops
at a missing link: record 10 still exists, and Z remains current, but the chain
cannot reach it. Silently accepting the recovered prefix would lose a mapping.
The executable deliberately rejects the incomplete chain.

## What this establishes

Payload obsolescence alone is insufficient to authorize reclamation of a
recovery structure. A system must also preserve reachability or supply a
different, valid discovery route. The example neither deletes user data nor
models persistence ordering; addresses and values are abstract integers.

The source motivation is section 3.2 of [Wang, Anderson and Patterson,
OSDI 1999](https://www.usenix.org/legacy/publications/library/proceedings/osdi99/full_papers/wang/wang_html/node8.html).
The example tests only a simple chain. It does not implement or verify the
paper's tree-shaped replacement mechanism, tail persistence, checksum checks,
scan fallback or physical device behavior.

## Reproduce

Python standard library only, no input data or random seed:

```sh
python3 -B model.py --check
python3 -B -m unittest -v test_model.py
python3 -B -O -m unittest -v test_model.py
```

[model.py](model.py) generates [results.json](results.json); use --write to
regenerate it. [test_model.py](test_model.py) checks the example, address zero,
noncontiguous addresses, newest-version selection, missing links and cycles.

All histories of lengths 1 through 6 over three keys are also enumerated.
An independent chronological overwrite oracle checks the intact chain.
For each superseded record, a separate removal must fail closed. A separate
set comparison counts removals hiding at least one still-current older key.
These finite counts are test coverage, not a storage failure probability.
There is no sampling uncertainty and no empirical population.

## Read with the research terms

- [Eager writing](https://hesela.dev/terms/eager-writing/)
- [Virtual log](https://hesela.dev/terms/virtual-log/)
- [Source metadata and reading scope](sources.json)

Hesela worked example, 2026-12-02. No paper benchmark replication is claimed.
