# Acknowledged copies and site coverage

Two acknowledgements can be insufficient against one site loss if both
acknowledged replicas occupy that site.

## A concrete version boundary

Place primary P and backup L at site A, and backup R at site B. Initially all
contain version v1. At the boundary examined here, only the acknowledged replicas
have received v2. No propagation or repair occurs before a whole site disappears.

| Acknowledged replicas | Sites containing confirmed v2 | Lose A | Lose B |
| --- | --- | --- | --- |
| P | A | No v2 remains | v2 remains |
| P, L | A | No v2 remains | v2 remains |
| P, R | A, B | v2 remains | v2 remains |
| P, L, R | A, B | v2 remains | v2 remains |

The two middle rows have the same acknowledgement count and different coverage.
A count of two does not identify which row occurred. Waiting for all three
guarantees a surviving confirmed copy after any one site loss in this example.

## Method

Replica 0 is the primary and must be acknowledged. For n replicas and q
acknowledgements, enumerate every subset of q-1 backups: C(n-1, q-1) sets.
Map each set to distinct site labels and take its minimum cardinality, d.
Then d-1 arbitrary whole-site losses leave at least one confirmed copy in every
enumerated acknowledgement set. Losing all d covered sites is a counterexample.

An independent calculation fills the primary's site first, then fills other
sites in descending capacity until q acknowledgements fit. This gives the same
minimum coverage without enumerating subsets. A separate bitmask oracle checks
both implementations over 6,015 placement/threshold configurations: one to six
replicas, three possible site labels, every valid q.

[results.json](results.json) enumerates three layouts and all their thresholds.
These are possibility counts, not equal-likelihood outcomes. No probabilities,
failure rates or latency measurements are inferred.

## What the model excludes

A non-acknowledging replica could already contain v2 in a real system. Here it
does not: the example is a possible adverse ordering, not proof that a late
acknowledgement means missing data. A surviving copy does not prove it can be
elected, read or served immediately. Configuration services, quorum rules,
network reachability, repair and storage-controller persistence are outside the
model. It is not a WheelFS implementation or performance reproduction.

## Reproduce

Requires Python 3.10+; no third-party packages, network access or seed.

```sh
python3 -B model.py --check
python3 -B -m unittest discover -s . -p test_model.py
python3 -B -O -m unittest discover -s . -p test_model.py
```

[model.py](model.py) regenerates results.json when run without --check.
[test_model.py](test_model.py) includes invalid-input and independent-oracle tests.

## Source context

[WheelFS](https://hesela.dev/terms/wheelfs/) motivates keeping acknowledgement
count separate from placement policy. The worked example and enumeration above
are Hesela's independent teaching model. [sources.json](sources.json) records
the paper version and access date. The paper and its figures are not redistributed.
