Help migrating to Zig 0.16.0 IO model: std.Io.File.Reader fails during readSliceAll A developer migrating a vector database storage engine to Zig 0.16.0 reports a runtime failure in std.Io.File.Reader's readSliceAll method, which returns an unexpected EndOfStream error when reading a binary Manifest struct from a file, despite successful file creation and writing. The issue occurs in a test that writes and reads back a Manifest structure with fields including magic, version, dimension, vector_count, metric, quantization, and reserved bytes. The developer seeks guidance on the new intrusive Reader/Writer interfaces in Zig 0.16.0. Hello everyone, I am currently working on migrating a small vector database storage engine to the new Zig 0.16.0 IO system. I am hitting a runtime issue test failure when trying to read a binary struct from a file using std.Io.File.Reader. Here is the context: I have a Manifest structure that I write to disk and then try to read back inside a test block. js const std = @import "std" ; pub const Manifest = struct { magic: 7 u8, version: u32, dimension: u32, vector count: u64, metric: u8, quantization: u8, reserved: 6 u8, }; pub fn writeManifest io: anytype, path: const u8, manifest: Manifest, void { var file = try std.Io.Dir.cwd .createFile io, path, .{} ; defer file.close io ; var write buf: 1024 u8 = undefined; var w = file.writer io, &write buf ; try w.interface.writeAll std.mem.asBytes &manifest ; } pub fn readManifest io: anytype, path: const u8, Manifest { var file = try std.Io.Dir.cwd .openFile io, path, .{} ; defer file.close io ; var manifest: Manifest = undefined; const bytes = std.mem.asBytes &manifest ; var read buf: 1024 u8 = undefined; var r = file.reader io, &read buf ; // This is where it fails at runtime try r.interface.readSliceAll bytes ; return manifest; } test "manifest persistence" { const io = std.testing.io; const file path = "test.manifest"; defer std.Io.Dir.cwd .deleteFile io, file path catch {}; const manifest = Manifest{ .magic = .{ 'Z', 'V', 'E', 'C', 'T', 'O', 'R' }, .version = 1, .dimension = 768, .vector count = 10000, .metric = 0, .quantization = 1, .reserved = .{0} 6, }; try writeManifest io, file path, manifest ; const loaded = try readManifest io, file path ; try std.testing.expectEqual manifest.dimension, loaded.dimension ; } When running zig test src/storage.zig, the compilation succeeds, but the test fails at runtime exactly on the line: try r.interface.readSliceAll bytes ; It seems like the reader is returning an unexpected EndOfStream or a failing error code, even though the file is successfully created and written to beforehand. Any guidance on how the new intrusive Reader/Writer interfaces orchestrate unbuffered or buffered file reading in 0.16 would be greatly appreciated Thanks in advance