From 5f73e5dc901f47cda6b2a26eea31cf9fc6178bc7 Mon Sep 17 00:00:00 2001 From: Onur Gündüz Date: Wed, 10 Jun 2026 15:31:32 +0200 Subject: tests: threaded kernel paths, bf16 widen, shard payload accounting --- tests/test_safetensors.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/test_safetensors.c') diff --git a/tests/test_safetensors.c b/tests/test_safetensors.c index 401aab3..fea570b 100644 --- a/tests/test_safetensors.c +++ b/tests/test_safetensors.c @@ -109,6 +109,18 @@ int main(void) ONE_TENSOR_B, zeros, 4); check("multi", path_in("valid_multi"), 1); + /* Payload accounting across shards: two 4-byte F32 tensors. */ + { + multi_safetensors_t *ms = multi_safetensors_open(path_in("valid_multi")); + size_t nbytes = 0; + if (!ms || multi_safetensors_data_nbytes(ms, &nbytes) != 0 || + nbytes != 8) { + fprintf(stderr, "multi data_nbytes: got %zu want 8\n", nbytes); + failures++; + } + multi_safetensors_close(ms); + } + mkdir(path_in("missing"), 0755); write_st(path_in("missing/model-00001-of-00002.safetensors"), ONE_TENSOR_X, zeros, 4); -- cgit v1.3.1