Skip to main content

uor_matmul_codec/
lib.rs

1//! Codecs: the *decode* half of decode-accumulate-encode (ยง6).
2//!
3//! A weight tier is a codec `d : Code -> Alphabet(B)`. The codec is not an
4//! argument of the arithmetic, which is why the same result survives a change
5//! of tier, a change of reduction schedule, and a change of substrate. That is
6//! `CL-MM01`, cited from upstream and reproduced here as a `some-true` claim;
7//! `CK-02` and `CK-05` are the evidence that these types realize it.
8//!
9//! Every tier in this crate is an *instantiation* of one trait, not a special
10//! case. [`Codec::MAX_BLOCK`] unifies the scalar and block cases exactly as the
11//! upstream `scalar_eq_block` does: a scalar codec is the block codec of its
12//! singletons, so no identity and no kernel is written twice.
13//!
14//! Every table is **borrowed**, never owned: a codebook lives in the caller's
15//! `static`, in flash, or in a `&'static` produced by `include_bytes!`. On an
16//! embedded target the E8 table is 2048 bytes of read-only memory and the codec
17//! is a pointer (R7, C1).
18
19#![no_std]
20#![forbid(unsafe_code)]
21#![deny(missing_docs)]
22#![deny(clippy::disallowed_types)]
23
24pub mod codecs;
25pub mod e8;
26pub mod kappa;
27pub mod matrix;
28pub mod tier;
29
30pub use codecs::{
31    canonicalize, Arena, Book, Grid, Identity, Offset, Packed, Runs, Sign, SymbolCode, Ternary,
32    Transcode,
33};
34pub use e8::{e8_codec, e8_codec_u8, e8_table, E8_I8};
35pub use matrix::CodedMatrix;
36pub use tier::{Codec, Enumerable, IndexStream, TierId};
37
38pub use kappa::{Addressing, KappaError, Manifest};