Skip to main content

Crate seyd_fec

Crate seyd_fec 

Source
Expand description

Reed-Solomon erasure coding over GF(256) with a Cauchy generator matrix.

Rationale, measurements and history live in PLAN.md §1.7 and in the legacy Python reference packages/agent/fec.py. What matters for this crate:

  • k parity chunks over n equal-length data chunks recover any k erasures. Cauchy rather than Vandermonde because every square submatrix of a Cauchy matrix is invertible, which is exactly that guarantee.
  • The construction — poly 0x11d, A[i][j] = 1 / (i XOR (k + j)) — is part of the wire contract. Changing it breaks interop silently, which is why tools/fec-vectors.py | cargo run -p seyd-fec --example check exists.
  • The coder is payload-agnostic: it never parses what it protects.

Modules§

gf
GF(256) arithmetic, field polynomial 0x11d.

Constants§

MAX_SYMBOLS
Hard limit of the construction: n + k <= 256.

Functions§

cauchy_matrix
decode
Reconstruct missing data chunks in place. Returns false if unrecoverable.
encode_parity
Compute k parity chunks from n equal-length data chunks.
parity_count
Parity chunks for an n-chunk block at pct overhead.

Type Aliases§

Matrix
k x n Cauchy matrix, cached per (n, k).