Skip to main content

Module kernel

Module kernel 

Source
Expand description

Scalar erasure-coding kernels — the permanent oracles every SIMD twin (M4) is gated against, and the fallback on every CPU.

All kernels consume ISA-L’s expanded 32-byte nibble tables (tables::init_tables / tables::mul_table32), exactly as the vector kernels will: per byte, c*x = tbl[x & 0xf] ^ tbl[16 + (x >> 4)]. Length agreement is validated — a mismatch is a typed error, never a silent truncation and never a panic.

Structs§

Kernels
A pluggable kernel set. The choice is made ONCE, at coder construction or the facade surface (never inside a loop — the dispatch-placement law), and core stays free of all detection machinery: this crate only ever provides Kernels::scalar; SIMD sets come from rusty_erasure-accel via the facade.

Statics§

SCALAR_CENSUS_BYTES
Census counter for the scalar kernel set: source bytes processed. The reach census (mission plan §7.1) is always on — one relaxed add per call, never per element — so “which kernels does production actually run” is a measured fact, not an assumption.

Functions§

vect_dot_prod
dest[i] = XOR_j (c_j · srcs[j][i]) — the GF(2^8) dot product at the heart of encode (ISA-L’s gf_vect_dot_prod). gftbls holds one 32-byte table per source, in source order.
vect_mad
dest ^= c · src — multiply-and-add, the incremental-update primitive (ISA-L’s gf_vect_mad).
vect_mul
dest = c · src where tbl is c’s expanded 32-byte table (ISA-L’s gf_vect_mul, without its len-multiple-of-32 restriction).

Type Aliases§

EncodeFn
Full-encode kernel: out[l] = XOR_j (c[l][j] · data[j]) for every row.
UpdateFn
Fused-update kernel: fold source vec_i into every output row in one pass.