State now records which tokens its KV cache holds. Model::prefill_reuse keeps the longest common prefix
with a new prompt (always recomputing the last token, whose logits are needed) and prefills only the
rest. A position that would leave a gap after the cached tokens is refused. Tests check that the result
equals a fresh prefill bit for bit for identical, extended, diverging and unrelated prompts.
The experimental AVX-VNNI tile kernels now use unsigned weights (w + 128, no sign instruction), start
each block's accumulation from -128 * sum(x) in lane 0, and read pre-broadcast activation scales
(PreparedAct / ActRef in cpu-sys). Tests bound the difference to the portable reference by
(blocks + 16) * 2^-23 * sum of |terms| computed with absolute weights and activations. In bench_tiles
this is not measurably faster than the sign-based tile (4x4 tile for 8 activations: 1.30x the one-row
kernel at 10 threads, against 1.35x before; run-to-run noise on this laptop is about 10%), so the tiles
stay unused by the decoder.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>