Expand description
Forward error correction over GF(256): systematic Cauchy Reed-Solomon erasure coding.
Packet loss on UDP is an erasure - the receiver knows WHICH packet is missing from the gap in the sequence numbers - so the decoder recovers from any K survivors out of K + R coded packets without needing to locate the error. This is the FEC half of the reliable-UDP transport’s FEC-primary / ARQ-fallback design: a block of K source packets ships with R parity packets, and up to R losses per block are recovered with no retransmit round-trip.
The code is systematic (the K source shards are transmitted
verbatim; only the R parity shards are computed) and MDS (any K of
the K + R shards reconstruct the block). The MDS property comes from
a Cauchy parity matrix: every square submatrix of a Cauchy matrix is
invertible, so any K-row submatrix of the [I_K ; Cauchy] encoding
matrix is invertible.
GF(256) uses the primitive polynomial 0x11D with log / antilog
tables computed at compile time (const fn), so there is no runtime
initialization.
Modules§
- gf
- GF(256) arithmetic with the primitive polynomial
x^8 + x^4 + x^3 + x^2 + 1(0x11D) and generator2.
Structs§
- RsCode
- A systematic Cauchy Reed-Solomon erasure code:
kdata shards plusrparity shards, recovering anykof thek + r.
Enums§
- FecError
- Error from constructing or decoding an
RsCode. - GfBackend
- GF(256) multiply-add backend, exposed so an A/B bench can compare every
SIMD rung against the scalar baseline and so the GFNI / AVX-512 logic can be
validated on a host without the silicon via the bit-exact software affine
emulation. The production hot loop (
gf_mul_add) auto-selects the fastest rung this host can run; the ladder always bottoms out atScalar.
Functions§
- gf_
mul_ add_ auto out[i] ^= gf::mul(coef, src[i])through the auto-detected fastest backend. The public entry point for callers outsideRsCode(the sliding-window RLC FEC) that want the SIMD-accelerated GF(2^8) multiply-add without managing a backend. Thecoef == 0 / 1shortcuts skip the multiply.- gf_
mul_ add_ backend - Run
gf_mul_addthrough a specificGfBackend- the A/B-bench and emulation-validation entry point. The hardware rungs require their ISA feature; call only thoseGfBackend::available()reports (thedebug_assertcatches a mismatch in test builds).