Expand description
rusty_erasure — Intel ISA-L’s erasure coding, remade with Rust.
The facade crate: the typed public API (Matrix, Coder), parameter
validation, the ISA-L-named compat layer (isal), and kernel dispatch —
resolved ONCE at coder/best_kernels, never inside a loop. The
always-on reach census reports which kernel set production bytes
actually flow through.
Conformance is byte identity with ISA-L’s erasure_code module across the
full config matrix — exact GF(2^8) integer math, no tolerance anywhere.
Mission plan: docs/plans/erasure_mission.md.
Modules§
- census
- The always-on kernel-reach census (mission plan §7.1).
- compat
- Compatibility constructions for migrating from other erasure engines — the payoff of a matrix-flexible API: adopt the incumbent’s exact matrix and its shards stay valid in both directions, no format break.
- gf
- GF(2^8) arithmetic over the field ISA-L uses: the polynomial x^8 + x^4 + x^3 + x^2 + 1 (0x11d), generator 2.
- isal
- The ISA-L compat layer: functions named and shaped like Intel ISA-L’s erasure-code API, so C callers and ISA-L’s own tests port line-for-line.
- kernel
- Scalar erasure-coding kernels — the permanent oracles every SIMD twin (M4) is gated against, and the fallback on every CPU.
- matrix
- Coding matrices: generation (Vandermonde / Cauchy), inversion, and row selection for recovery.
- raid
- RAID parity ops, dispatched: AVX2 kernels when the CPU has them (byte- identical to the scalar core, oracle-tested), the core implementation otherwise. Checks always run the core code (they are already word-wide).
- tables
- Expanded multiplication tables — ISA-L’s
ec_init_tableslayout, bit-identical: 32 bytes per coefficientc, being the two PSHUFB nibble tables{c*0, c*1, ..., c*15}then{c*0x00, c*0x10, ..., c*0xf0}.
Structs§
- Coder
- An erasure coder for one
(matrix)configuration:ksource shards in,pparity shards out, recovery from anyksurvivors. - Decode
Plan - A prepared decode: the survivor selection, inverted submatrix (composed
into per-target coefficient rows), and expanded tables for ONE loss
pattern — reusable across every stripe sharing that pattern. Built by
Coder::decode_plan, consumed byCoder::recover_with. - Matrix
- A row-major
rows x colsmatrix over GF(2^8).
Enums§
- Code
Error - Errors from encode and update operations.
- Matrix
Error - Errors from coding-matrix construction and inversion.
- Recover
Error - Errors from the recovery path.
Functions§
- best_
kernels - The best kernel set for the running CPU: the accel SIMD sets when the
accelfeature is on and the CPU supports them (detection cached), the scalar oracle otherwise. Resolved once per call site — hold the result or build aCoderwithcoderrather than re-asking in a loop. - coder
- Build a
Coderdriving the best kernel set for this CPU. This is the constructor applications want;Coder::newin core is the always-scalar variant. - kernels_
named - Look up a kernel set by name — the bench/census arms:
"auto","scalar","ssse3","avx2","gfni".Nonewhen the name is unknown or the CPU lacks the feature.