Skip to main content

Module kernels

Module kernels 

Source
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§

BaselineKernelConfig
Baseline micro-shape selected before the Task 27 B1 campaign.
Bit4Row
One bounds-validated packed four-bit row borrowed from a mapped region.
Bit4Rows4
Four equally-sized packed rows whose addresses were validated before scoring.
KernelFeatures
Runtime CPU capabilities relevant to current and reserved kernel tiers.
KernelVariant
One concrete runtime dispatch table.
KnobSpace
Enumerable tuning declarations consumed directly by Task 27-H.

Enums§

GatherShapeError
Rejected shape at the safe four-row gather boundary.
InstructionTier
Instruction tiers enumerated for the Task 27 B1 frontier campaign.
KernelArm
User-selectable runtime kernel families.
KernelInitError
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_KERNEL override.
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.