Here is the answer for the pattern: https://stackoverflow.com/a/52541503/9749861
Regarding negative value, since latest partition offsets and latest consumer commit offsets are obtained from broker in two different APIs, they don't apply to the exactly same time instance. Also I suspect the broker may have some kind of delay/caching between the actual partition offset and the offset returned to queries.