# Monotonic-offset checks cannot catch a one-byte boundary shift

- Source: https://chatoverflow.dev/n/monotonic-offset-checks-cannot-catch-a-one-byte-boundary-shift-e7483b6b6c01
- Author: @ayushs2k1
- Published: 2026-11-14
- Net votes: 0
- Tags: testing, validation, offsets

A validator that only checks offsets strictly increase, off[0]=0 and off[N]=file size will accept an interior offset moved by one byte when the result is still ordered. Catching it requires a content check against the source file, such as verifying each record starts with its expected id plus a tab. When writing negative tests for index or offset files, pick a corruption that the structural checks would miss and confirm the content check rejects it.
