# Same error marginals, different RAID6 recovery

This is an exact, intentionally small teaching model. It is not a disk
measurement, a Monte Carlo simulation, or a calibrated reliability estimate.

## Reproduce

Use Python 3.10 or later, standard library only:

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

The JSON contains every equally weighted state, exact fractions, assumptions
and the SHA-256 of the generating model. No random seed is needed. The code
makes no network requests and does not access any storage device.

## Experiment contract

There are four members and four stripes. Each stripe is one codeword containing
one symbol from each member, with a two-symbol data dimension and two parity
equivalents. A model symbol is not a whole multi-sector chunk. Member 0 is missing.
Every survivor has exactly one known erased symbol in local positions 0..3;
all surviving information is current and correct. No repair occurs during
this observation window. An ideal (4,2) MDS erasure code recovers a stripe
from any two surviving symbols.

Three laws share *all* single-member location marginals and the exact total
erasure count. Aligned positions have four equally weighted states;
independent positions have 64; all-distinct positions have 24. Every member
has probability 1/4 of its erasure being at each position in every law.
The fraction of states with at least one unrecoverable stripe is respectively
4/4, 40/64 and 0/24. This is a failure of identifiability from marginal
statistics, not three forecasts for RAID6 installations. Mixing aligned and
separated laws preserves the marginals and makes failure probability equal
the aligned-law mixture weight: the full interval from zero to one is possible.

The independent value is also 1 - (4 * 3 * 2) / 4^3 = 5/8.
A missing *symbol* is not a bit error, and 3/12 erased surviving symbols is
not a datasheet UBER.

## Address mapping control

The offset example maps local position p on survivor d to stripe
(p - offset[d]) modulo four, using offsets (0,1,2). Identical local
positions then occupy different stripes. But positions (u,u+1,u+2) modulo
four collide under that mapping. Both retain uniform single-member
marginals. Independent positions keep their 5/8 collision probability under
every bijective offset choice.

Offsets illustrate a dependence on the joint fault pattern; they are not
instructions to reconfigure an array, a production RAID layout, or a claim
that logical positions are physical neighbors.

## Independent arithmetic control

Tests compare all 64 position tuples against all 64 offset tuples with
Gaussian elimination over GF(5), using a separate four-row, two-column MDS
matrix. Its 16 erasure masks and all 25 data vectors under every pair of
survivors are checked. This finite-field oracle is not Linux's GF(256)
RAID6 format and is not a hardware experiment.

No confidence interval is appropriate for an exhaustive finite construction.
Uncertainty about real fault distributions remains wholly unestimated.
Unrecoverable full-stripe content does not mean every file is lost or an
array is offline.
