ftts_kernels/lib.rs
1#![deny(unsafe_op_in_unsafe_fn)]
2
3//! The sole crate permitted to contain audited kernel `unsafe` islands.
4//!
5//! Every future unsafe kernel must be feature-gated, carry a `SAFETY:` comment,
6//! and retain a bit-identical safe scalar fallback.
7//!
8//! ## Frankentorch boundary
9//!
10//! This Phase-0 scaffold intentionally has no frankentorch dependency: it does
11//! not yet expose a kernel facade that consumes one. Add each dependency only
12//! alongside a real facade API and its scalar fallback; do not predeclare a
13//! machine-local or otherwise unused substrate dependency.
14//!
15//! # Permanent integer-kernel law
16//!
17//! A route cannot become dispatchable until [`selftest::run_selftest`] proves its all-extreme
18//! reduction at every model-specific census binding row against an independent i64 oracle: the
19//! U8S8 envelope (`255 * 127 * K`, the ceiling for a future unsigned-activation VNNI route) on
20//! the checked scalar path, and the S8S8 kernel contract (`±127 * 127 * K`) through the real
21//! [`int8::dot_i32`] on every available tier with scalar equality. Every native tier, Q4 unpack
22//! path, codec convolution, verifier, and batched variant extends that same surface before it
23//! may be selected.
24
25pub mod enhance;
26pub mod f32ref;
27pub mod int4;
28pub mod int8;
29pub mod mmap;
30pub mod packed_gemm;
31pub mod route;
32pub mod selftest;
33pub mod sleef;
34pub mod startup_env;
35pub mod team;
36
37/// Identifies this crate's scaffold revision.
38pub const SCAFFOLD_REVISION: u8 = 1;