HeavyHittersResult
Space-Saving heavy-hitters snapshot. keys, counts, errors are parallel arrays of length <= capacity. totalSeen is the unweighted update count.
The true weighted count of a tracked key lies in [counts[i] - errors[i], counts[i] + deficit]. Each bound closes one direction, and which one is slack depends on policy:
Under AdmissionPolicy.Classic a count can only overestimate. errors carries the per-key bound inherited from the evicted minimum, and deficit is zero.
Under AdmissionPolicy.MisraGries a count can only underestimate, because it is only ever incremented exactly or decremented in bulk. errors is zero - correctly, not for want of a bound - and deficit carries the number of decrement rounds, which bounds the shortfall for every key.
A merge that mixes the two accumulates deficit and degrades policy, so both bounds stay sound.