Expand description
Prism standard-library tensor-compute sub-crate.
prism-tensor realizes the tensor Layer-3 of the standard library
named in Wiki ADR-031: declares TensorAxis and
ActivationAxis through the axis! SDK macro and
supplies parametric CPU integer-precision reference impls
preserving bit-determinism per fixed (HostTypes, HostBounds, AxisTuple) selection (per ADR-030’s per-axis
substitution-determinism note).
§Scope
TensorAxis— fixed-shape matmul. Parametric reference:CpuI8MatmulSquare<DIM>forDIM × DIMi8×i8→i16matrices.DIMis unconstrained at the axis level: per ADR-060 there is noAXIS_OUTPUT_BYTES_MAXcap — axis-kernel output flows through the source-polymorphicTermValuecarrier (Inline/Borrowed/Stream), whose inline width derives from the application’sHostBoundsstructural-count primitives via foundationconst fns. The axis impl performs only aDIM == 0structural well-formedness check.ActivationAxis— element-wise nonlinearity. Parametric reference:CpuI8VectorActivation<N>for length-Ni8vectors.Nis likewise unconstrained at the axis level per ADR-060; the impl performs only anN == 0structural check.dtype— GGML / GGUF / ONNX tensor element-type alphabet per ADR-057: 43 sealeddtype::Dtypeimpls (continuous floats, ONNX FLOAT8 / complex / packed-4-bit, signed / unsigned integers, boolean, GGML legacy block-32 quantization, GGML K-series block-256 quantization, GGML IQ-series importance-aware quantization) exposed through thedtype::TensorDtypeRegistryshape-IRI registry asTerm::Recursetargets for container-format realizations. Compression-operator codomain context: per ADR-058 the κ-derivation is the framework’s compression operator; tensor element types occupy the R-level of the operator-geometry codomain per ADR-059.shape— higher-rank tensor shape carriers:shape::Tensor3Shape(rank-3) andshape::Tensor4Shape(rank-4). Common GGUF / ONNX rank coverage; higher ranks compose throughpartition_product!per ADR-033/044.
§ConstrainedTypeShape declarations
Per ADR-031’s Tensor<Element, Shape> shape commitment:
MatrixShape<ROWS, COLS, ELEM_BYTES>— rank-2 tensor shape.VectorShape<N, ELEM_BYTES>— rank-1 tensor shape.Tensor3Shape<D0, D1, D2, ELEM_BYTES>— rank-3 tensor shape.Tensor4Shape<D0, D1, D2, D3, ELEM_BYTES>— rank-4 tensor shape.dtype— 43 fixed-byte-count element-type shapes (continuous floats, ONNX FLOAT8 / complex / packed-4-bit, signed / unsigned integers, boolean, GGML legacy / K-series / IQ-series quantization).
Higher-rank tensors compose through partition_product! per
ADR-033/044; the axis layer fixes the atom shape.
§Closure under uor-foundation (ADR-013)
Every axis trait declared here has
::uor_foundation::pipeline::AxisExtension as a supertrait;
parametric impls hand-write their AxisExtension impl since the
axis!-emitted companion macro takes :ident.
§See also
- Wiki: 09 Architecture Decisions § ADR-030 —
axis!SDK macro - Wiki: 09 Architecture Decisions § ADR-031 —
prismis the standard library - Wiki: 09 Architecture Decisions § ADR-037 —
HostBoundsceilings on the principal data path - Wiki: 09 Architecture Decisions § ADR-057 — Bounded recursive structural typing
- Wiki: 09 Architecture Decisions § ADR-058 — κ-derivation as the framework’s compression operator
- Wiki: 09 Architecture Decisions § ADR-059 — Atlas image inside E₈ as the codomain of κ-derivation
- Wiki: 09 Architecture Decisions § ADR-060 — source-polymorphic value carrier (removes the byte-width caps)
Re-exports§
pub use activation::ActivationAxis;pub use activation::CpuI8VectorActivation;pub use shape::Tensor3Shape;pub use shape::Tensor4Shape;pub use tensor::CpuI8MatmulSquare;pub use tensor::MatrixShape;pub use tensor::TensorAxis;pub use tensor::VectorShape;
Modules§
- activation
ActivationAxisdeclaration + parametric element-wise i8 nonlinearity reference impls.- dtype
- GGML / GGUF / ONNX tensor element-type alphabet per Wiki ADR-031.
- shape
- Higher-rank tensor
ConstrainedTypeShapecarriers (Tensor3Shape,Tensor4Shape). - tensor
TensorAxisdeclaration + parametric square-matmul impl + shape.- verbs
- Layer-3 substrate-Term verbs per Wiki ADR-024 + Wiki ADR-055 + Wiki ADR-056 (ψ-residuals discipline scope refined to route bodies only — verb bodies admit comparison + concat + hash composition).
Macros§
- axis_
extension_ impl_ for_ activation_ axis - Wiki ADR-030 companion macro: instantiate
AxisExtensionfor a concrete struct implementing this axis trait. The macro emits animpl AxisExtension for <StructIdent>block that delegatesdispatch_kernelto the axis-trait methods perKERNEL_*id. The orphan-rule-conformant per-struct impl mechanism replacing the blanketimpl<T: <axis>> AxisExtension for T(which would violate Rust’s orphan rule from any crate that does not defineAxisExtension). - axis_
extension_ impl_ for_ tensor_ axis - Wiki ADR-030 companion macro: instantiate
AxisExtensionfor a concrete struct implementing this axis trait. The macro emits animpl AxisExtension for <StructIdent>block that delegatesdispatch_kernelto the axis-trait methods perKERNEL_*id. The orphan-rule-conformant per-struct impl mechanism replacing the blanketimpl<T: <axis>> AxisExtension for T(which would violate Rust’s orphan rule from any crate that does not defineAxisExtension).
Constants§
- STANDARD_
LIBRARY_ VERSION - Wiki ADR-031 standard-library version banner.