# Composed redundancy: count the same payload
Prepared 2026-11-28. Original arithmetic and code: CC0-1.0.

This is a small accounting example, not a storage simulator. It explains the
factors used by the existing storage-tier article without modifying the earlier
f4-capacity-audit or estimating fleet savings.

## Reproduce
```sh
node model.mjs --check
node --test model.test.mjs
```
Run `node model.mjs` to regenerate results.json. No packages or randomness.

## Denominator
Every row starts with two logical groups of ten equal-size full payload blocks.
The numerator counts all blocks specified by each layout. The result is physical
block-equivalents per logical payload block, not a number of complete replicas.

| Layout | Counted blocks | Payload blocks | Exact factor |
| --- | ---: | ---: | ---: |
| Local 10+4 | 28 | 20 | 7/5 |
| Duplicated 10+4 | 56 | 20 | 14/5 |
| Paired 10+4 with buddy XOR | 42 | 20 | 21/10 |
| Replicated 10+1 XOR | 44 | 20 | 11/5 |

The paired row adds an encoded-width XOR group, not just ten data-only blocks.
These identities do not establish equivalent fault tolerance. No erasure coder
or placement engine is implemented. Indexes, stripe padding, retained deletions,
migration copies, spares and reserves are excluded. The code accepts block
counts, not byte lengths or probabilities. Integer inputs are validated and
intermediate arithmetic uses BigInt.

## Savings and capacity use different denominators
For the same 20-block payload, changing from 56 to 42 stored block-equivalents
reduces modeled storage by (56-42)/56 = 1/4, or 25%. At a fixed budget,
the ideal proportional payload increase is instead 56/42-1 = 1/3. These are
Hesela's derived arithmetic identities, not measured fleet savings.

The discrete example admits only complete two-stripe pairs of 20 payload blocks.
For aggregate budget B, the duplicated layout fits 20*floor(B/56) payload blocks;
the buddy-XOR layout fits 20*floor(B/42). Unused capacity is retained, not rounded
away or silently counted as additional payload.

| Budget blocks | Duplicated payload | Buddy-XOR payload | Relative payload increase |
| ---: | ---: | ---: | ---: |
| 42 | 0 | 20 | Undefined (zero baseline) |
| 56 | 20 | 20 | 0 |
| 84 | 20 | 40 | 1 |
| 168 | 60 | 80 | 1/3 |

The 168-block example realizes the ideal 1/3 increase exactly. The 56-block example
does not: it leaves 14 unused blocks in the buddy-XOR layout, insufficient for
another complete pair. Neither percentage is a universal capacity guarantee.
This is an aggregate-budget packing model with fixed-size, fully occupied pairs,
not a reconstruction of f4 allocation. Per-datacenter capacity, placement,
load, recovery traffic, metadata, deleted bytes and operational reserves can
constrain deployment further. No partial-pair allocation is modeled.

The JSON adds budgetAssumptions, comparison and budgetExamples fields;
existing rows remain unchanged.
Fractions are dimensionless (1/4 means 25%, not 0.25%). A null relative increase
means zero baseline payload, including when neither layout admits a pair.
pairBudget(data, parity, budget) takes nonnegative safe-integer block counts,
with data at least one; output counts are exact decimal strings.

## Primary evidence
- [Muralidhar et al., f4, OSDI 2014, pp. 383-398](https://www.usenix.org/system/files/conference/osdi14/osdi14-paper-muralidhar.pdf),
  sections 5.3-5.5 (printed pp. 388-391).
- [Facebook Engineering, Saving capacity with HDFS RAID, 5 June 2014](https://engineering.fb.com/2014/06/05/core-infra/saving-capacity-with-hdfs-raid/),
  Background and small-file discussion.

Both accessed 2026-11-28. These are distinct historical systems; no current
deployment claim. The source paper, engineering prose and figures remain under
their own copyright and are not redistributed. DOI is not inferred.
