Expand description
Runtime-dispatched compute kernels. Runtime-dispatched dot-product and packed-bit Hamming kernels.
Callers validate dimensions once at the engine boundary. Every hot kernel
therefore uses debug_assert! for the equal-length and row-shape contracts
instead of repeating release-mode validation in the scan loop. Call
crate::kernels::initialize during engine initialization to apply the optional
ZE_KERNEL=scalar|neon|avx2 override and surface unsupported requests as a
typed crate::kernels::KernelInitError. If no explicit initialization occurs, the first
kernel call safely caches the best runtime-detected arm.
The scalar implementation is the behavioral oracle. crate::kernels::KernelVariant
exposes every runtime-supported table to property tests, fuzzing, and the
future Task 27 frontier harness without moving selection to build time.
Modules§
- postings
- Posting-block decode kernels: bit-unpack and delta prefix sum. Posting-block decode kernels: bit-unpack and delta prefix sum.
Structs§
- Baseline
Kernel Config - Baseline micro-shape selected before the Task 27 B1 campaign.
- Bit4Row
- One bounds-validated packed four-bit row borrowed from a mapped region.
- Bit4
Rows4 - Four equally-sized packed rows whose addresses were validated before scoring.
- Kernel
Features - Runtime CPU capabilities relevant to current and reserved kernel tiers.
- Kernel
Variant - One concrete runtime dispatch table.
- Knob
Space - Enumerable tuning declarations consumed directly by Task 27-H.
Enums§
- Gather
Shape Error - Rejected shape at the safe four-row gather boundary.
- Instruction
Tier - Instruction tiers enumerated for the Task 27 B1 frontier campaign.
- Kernel
Arm - User-selectable runtime kernel families.
- Kernel
Init Error - Typed failures produced while applying a runtime kernel override.
Constants§
- BASELINE_
KERNEL_ CONFIG - Shipped baseline configuration; B1 may replace every value with evidence.
- KERNEL_
KNOB_ SPACE - Registered Task 27-H kernel tuning space.
- MAX_
DOT_ I8_ DIMENSION - Largest supported dimension for an i8 dot product.
Functions§
- detected_
features - Returns cached runtime feature detection, including reserved B1 features.
- dot_
bit4 - Scores a signed-byte query against one packed four-bit row.
- dot_
bit4_ batch - Scores one signed-byte query against contiguous packed four-bit rows.
- dot_f16
- Computes an f32 dot product from equal-length IEEE f16 bit vectors.
- dot_f32
- Computes the dot product of equal-length f32 vectors.
- dot_i8
- Computes the dot product of equal-length signed-byte vectors.
- dot_
i8_ batch - Scores one i8 query against contiguous row-major vectors.
- hamming_
u1 - Computes Hamming distance over equal-length packed-byte vectors.
- hamming_
u1_ batch - Scores one packed-bit query against contiguous row-major byte vectors.
- initialize
- Applies runtime feature detection and the optional
ZE_KERNELoverride. - is_
arm_ supported - Reports whether a user-selectable arm is executable on this CPU.
- prefetch_
bit4_ row_ group - Prefetches one already-validated four-row gather group.
- prefetch_
bit4_ rows - Prefetches caller-selected packed rows into L1 for a later gather group.
- score_
bit4_ ptrs - Scores four arbitrary validated packed four-bit rows through runtime dispatch.
- selected_
arm - Returns the cached arm, selecting the best safe runtime arm if necessary.