Added
- Zero-copy model loading: the matrix points into the file or embedded bytes when alignment allows (little-endian targets). Load on potion-base-8M drops 36 -> 21 ms (f32), and
@embedFileconsumers stop paying RSS for a second copy of the matrix. - tq4 files carry a
tq4_versionmetadata field; the reader rejects unknown versions. - The safetensors parser is fuzzed: a randomized harness runs on every
zig build test, plus azig build test --fuzzentry point.
Changed (breaking)
safetensors.parsetakes an options argument andMatrixslices are const.Model.loadFromBytesborrows the safetensors bytes, which must outlive the Model.- tq4 files written by 0.1.0 are rejected; re-run
m2v-quantize --tq4.
Fixed
- Three parser overflow bugs against crafted files: a wrapped header-length bounds check (crash), wrap-prone tensor offset checks, and an overflowing shape product that could hand out a matrix backed by no data.
Full details in CHANGELOG.md. Requires Zig 0.16.0.