That's a good question, and has to do with how we handle rollover. Because counters don't have infinite space, and may be reset at one time or another, we save a valuestream of the current good count and bad count. When the counter drops below the previous number, we assume it rolled back to zero and then continued counting up.
Essentially what's happening is every time it drops down, this happens:
Drops from 800 -> 799
System thinks made 800 before, reset to zero, and then made 799
799 parts in the last X period of time -> feed it into the calculation.
Does that make sense?