1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//! rusty_erasure-accel — the workspace's ONLY unsafe crate: hand-written SIMD
//! twins of the scalar kernels in `rusty_erasure-core`.
//!
//! The named reason these exist (codec-vectorize-kernel step 0): the GF(2^8)
//! multiply here is either the PSHUFB/TBL/swizzle nibble-table algorithm or a
//! `GF2P8AFFINEQB` affine transform — *different algorithms* from the scalar
//! per-byte lookup, in the polynomial/table class the compiler cannot derive.
//! Auto-vectorization is structurally unavailable; hand-written kernels are
//! the only route.
//!
//! Per-arch inventory (the per-arch-parity non-negotiable):
//! - [`x86`] — SSSE3/AVX2 nibble + AVX2-GFNI affine (runtime-dispatched)
//! - [`aarch64`] — NEON TBL nibble (baseline, no dispatch needed)
//! - [`wasm`] — SIMD128 swizzle nibble (compile-time `+simd128`)
//!
//! Discipline: every kernel set is exposed only through checked constructors;
//! every unsafe block carries a `// SAFETY:` invariant and the safe wrappers
//! re-assert slice lengths; the scalar set in core stays the permanent oracle
//! (`*_matches_scalar` gates every set); every set counts its source bytes
//! into [`ACCEL_CENSUS_BYTES`] — the reach census is always on.
use AtomicU64;
use Kernels;
/// Census counter shared by every accel kernel set: source bytes processed.
/// One relaxed add per call, never per element.
pub static ACCEL_CENSUS_BYTES: AtomicU64 = new;
/// The `(xor_gen, pq_gen)` function pair a RAID dispatch returns.
pub type RaidKernels = ;
/// The best kernel set for the running CPU on THIS architecture, or `None`
/// when no SIMD set applies — callers fall back to `Kernels::scalar()`.
/// The best RAID kernel pair (xor_gen, pq_gen) for this architecture, or
/// `None` when only the scalar core applies. Byte-identical to
/// `rusty_erasure_core::raid` on every arch (oracle-tested).
/// The best kernel set consuming ISA-L NIBBLE-format tables (the compat
/// layer's requirement — its callers hand it `ec_init_tables`-format tables
/// by contract, and GFNI's affine tables must never be mixed in).