Seekable Buffered reader, revisited

In another thread I concluded, that you manually need to sync between SeekableStream and BufferedReader on the same file if you want to seek and continue reading at that point:

pub const ReadStream = struct {
    reader: std.io.BufferedReader(4096, std.fs.File.Reader),
    seeker: std.fs.File.SeekableStream,

    pub fn init(file: std.fs.File) ReadStream {
        return .{
            .reader = Reader{ .unbuffered_reader = file.reader() },
            .seeker = file.seekableStream(),
        };
    }

    pub fn seekTo(self: *Self, pos: u64) SeekError!void {
        self.reader.fifo.head = 0;
        self.reader.fifo.count = 0;
        return try self.seeker.seekTo(pos);
    }
};

I have been using this struct for a while now and it serves me well. Then I thought I optimize seekTo() for cases, where the seek position is still in the buffer:

pub fn seekTo(self: *Self, pos: u64) !void {
    const buffer_len = self.reader.fifo.head + self.reader.fifo.count;
    const buffer_start = (try self.seeker.getPos()) - buffer_len;
    const buffer_offset = @intCast(i64, pos) - @intCast(i64, buffer_start);

    if (buffer_offset >= 0 and buffer_offset < buffer_len) {
        const bo = @intCast(usize, buffer_offset);
        const d = self.reader.fifo.head - bo;
        self.reader.fifo.head = bo;
        self.reader.fifo.count += d;
    } else {
        self.reader.fifo.head = 0;
        self.reader.fifo.count = 0;
        return try self.seeker.seekTo(pos);
    }
}

This code works, if I build with -Drelease-fast=true, but not, if I omit the fast=true option. I assume this is related to how fifo.discard() will actually overwrite its contents with undefined after reading them.

At this point it feels like I’m fighting the API. Is the use case of seeking in a buffered stream really that odd? Or am I approaching this the wrong way?