Skip to main content

validate_slab_values

Function validate_slab_values 

Source
pub fn validate_slab_values(
    encoding: u32,
    data: &[u8],
    n: usize,
    dim: usize,
) -> Result<()>
Expand description

Reject any NaN/Inf in a fixed-stride vector slab of the given section encoding (raw f32, float16, int8, int4). The canonical embeddings, the embeddings_fp rerank slab and every multimodal band go through this before a kernel ever scores them: a NaN lane would turn a cosine into a NaN score, and a NaN score is what breaks a ranking (found by the mutation fuzz harness through the space bands).