What is taught wrongly

The boundary that hides the burst

A window whose blocks hold five hundred and twelve arrivals reports a perfectly even stream — every block the same duration to the tick — while the arrivals it is retiring have an index of dispersion of 0.57. Move the block to a hundred and twenty-five and the same stream varies by 1.8 times.

Of the four arrival patterns driven through a block-window summary, three behave as expected. The evenly spaced one gives blocks of identical duration, which is the control. The Poisson one gives a spread of 1.16, which is the fluctuation of five hundred independent gaps. The drifting one gives a spread of 26, which is the rate ratio arriving in the duration.

The bursty one gives 1.00. Exactly one — every block covering 4,543 ticks, to the tick, over thirty-nine blocks — on a stream that is silent for stretches and then floods, and whose index of dispersion measured over the same intervals is 0.57.

The block boundary is a sampler, and a sampler aliasesA stream of bursts of 64 arrivals separated by silence, summarised by a window of 8 blocks. Each bar is one block size: the longest block duration divided by the shortest, over 20,000 arrivals. When the block holds a whole number of bursts — the last bar — every block covers exactly the same duration and the structure reports a perfectly even stream. The arrivals have an index of dispersion of 0.57 throughout. A block holding 1.95 bursts sees 1.82× between its longest and shortest.1.821251.951.431752.731.302253.521.292503.911.183755.861.005128.00longest block ÷ shortestarrivals per block, and bursts per blockpart of a bursta whole numberbursts of 64 · 8 blocks · 20,000 arrivalsdispersion 0.57 and a ratio of 1.00
Fig. 1 The same bursty stream through six block sizes. The rightmost block holds exactly eight bursts and reports a perfectly even stream; a block holding under two bursts reports a spread of 1.82. Nothing about the arrivals changed.

A boundary that fires on a count is a sampler

The mechanism is short and it generalises past this structure.

A block retires when a fixed number of arrivals have gone into it. So the boundary advances through the stream at whatever rate the stream is arriving at, and the sequence of boundary times is the arrival times at positions s,2s,3s,s, 2s, 3s, \ldots for a block of ss arrivals.

That is a sampler whose sampling instants are chosen by the signal being sampled. Against a pattern with a period of its own it will do what any sampler does at a commensurate rate: return the same value every time, and the value it returns will be the average over one period.

The burst pattern used here has a period of sixty-four arrivals — a rapid burst followed by the silence that restores the mean rate. A block of five hundred and twelve arrivals is exactly eight periods, so every block covers eight complete cycles, so every block covers the same duration.

The structure is not failing to notice the burstiness. It is reporting, correctly, the duration of eight complete cycles, which is the same for all of them because the pattern repeats.

Each block covers 512 arrivals, and no fixed amount of timeEvery block of a 4,096-arrival window in 8 blocks, over 20,000 arrivals of the bursts and silence process at 100 Hz. The flat line is the same structure over an evenly spaced stream at the same mean rate, where every block is 5.1 s because the arrivals are equally spaced by construction. The bursty stream's blocks run from 4.5 s to 4.5 s, a factor of 1.0, and the structure cannot tell: it is counting arrivals.even streamduration, in 1 ms ticksblock, in orderbursty · 100 Hz · 1 ms clock4.5 s – 4.5 s, a factor of 1.0
Fig. 2 The block durations of the bursty stream, in order, against the even stream’s flat line. Two flat lines. One of them belongs to a stream with no structure in it and the other does not.

The sweep, and where the spread appears

Moving the block off the period brings the variation back.

At a hundred and twenty-five arrivals — a little under two cycles — the blocks run from 700 to 1,276 ticks, a spread of 1.82. At a hundred and seventy-five, 1.43. At two hundred and twenty-five, 1.30. At two hundred and fifty, 1.29. At three hundred and seventy-five, 1.18. At five hundred and twelve, 1.00.

The trend is what a sampler does: the more cycles a block contains, the more of the pattern it averages over, and the less any offset between blocks can move the total. A block holding a hundred cycles would be flat whether or not the count divided the period.

So the spread reported by an arrival-counted window is not a property of the stream. It is a property of the ratio between the block size and whatever period the stream has, and both of those are things a deployment sets or inherits without considering the other.

The first 4.00 s of each streamOne mark per arrival, over the same stretch of the same clock. Every row carries the same mean rate — one arrival every 10 ticks — and the rows are not the same picture. The evenly spaced row is the only one for which "the last W arrivals" and "the last D seconds" are the same set of items, and it is the only one that does not occur. Marks are drawn at one-tick resolution: two arrivals the clock cannot separate are one mark, which is itself a property of the measuring instrument rather than of the stream.even400 herePoisson371 herebursty448 heredrifting2134 here0.01.02.03.04.0seconds1 ms clock · same mean rate on every row4 processes, one stretch
Fig. 3 The four processes on a time axis. The bursty one is visibly and grossly uneven — that is what the plate is for — and it is the one the structure reports as flat.

Not integer bursts. Integer cycles.

The obvious statement of the rule is that a block holding a whole number of bursts is blind, and it is not quite right.

Sweeping block sizes of a hundred, a hundred and fifty, two hundred, three hundred, four hundred and five hundred and twelve gives spreads of 1.85, 1.44, 1.00, 1.22, 1.00 and 1.00. Two hundred arrivals is 3.125 bursts and four hundred is 6.25, and both are flat.

The reason is that the commensurability that matters is between the block and the repeat, over the whole run of blocks rather than within one. Two hundred arrivals is twenty-five sixty-fourths of a cycle times eight; after eight blocks the offset returns to where it started, and the eight offsets turn out to cover equal durations because the pattern is exactly periodic and the offsets tile it.

The block boundary is a sampler, and a sampler aliasesA stream of bursts of 64 arrivals separated by silence, summarised by a window of 8 blocks. Each bar is one block size: the longest block duration divided by the shortest, over 20,000 arrivals. When the block holds a whole number of bursts — the last bar — every block covers exactly the same duration and the structure reports a perfectly even stream. The arrivals have an index of dispersion of 0.57 throughout. A block holding 1.56 bursts sees 1.85× between its longest and shortest.1.851001.561.441502.341.002003.131.223004.691.004006.251.005128.00longest block ÷ shortestarrivals per block, and bursts per blockpart of a bursta whole numberbursts of 64 · 8 blocks · 20,000 arrivalsdispersion 0.57 and a ratio of 1.00
Fig. 4 A second sweep, where two of the block sizes that do not hold a whole number of bursts are nonetheless flat. The condition is a commensurability between the block and the repeat over the run, not within one block.

That refinement matters because it makes the failure harder to avoid by inspection. Do not set the block to a multiple of the burst size is a rule somebody could follow. Do not set the block to any value whose ratio to the burst size is a fraction with a small denominator is not, and a real stream does not announce its period anyway.

What the structure could have been asked

There is a version of this that is not a defect: a structure that reports a rate over a window is supposed to average, and averaging over whole cycles is the best kind of averaging.

The trouble is what the structure is asked. It is not asked for the mean rate. It is asked what happened in the last four thousand events, and the answer is being read as what happened in the last forty-five seconds, and the substitution’s error is exactly what this plate family measures.

On the bursty stream that substitution happens to be safe, and it is safe by accident. Move the block size, or let the burst size drift — a real burst is not sixty-four events every time — and the same substitution acquires an error of 1.8 times with nothing changing in the code or in the load.

A quantity that is stable because of a coincidence is not a stable quantity. It is an unstable one that has not yet been perturbed, and the perturbation here is a configuration change nobody would think to review.

The slack, in seconds rather than in arrivalsThe structure's slack is bounded and small in its own currency: the answer is about between 4,096 and 4,608 arrivals, never more, and that bound is checked on every build. Converted to the clock it is the duration of the oldest surviving block, drawn here for every block of the bursty stream. It runs from 4.5 s to 4.5 s, and the worst is 1.0× the typical one. Nothing the structure holds knows this number; it has no clock.mean 4.5 sslack, as a durationblock, in order of retirementbursty · 4,096 arrivals in 8 blocks · 100 Hz1.0× between the typical slack and the worst
Fig. 5 The slack of the bursty stream in seconds, block by block. A flat line at 4.5 seconds, and every reading of it is correct.

The answers are still right

It would be easy to read all this as an accuracy problem and it is not one. The structure’s answers about keys are unaffected.

A block-window summary is asked which keys are heavy over the last WW arrivals, and it answers that question over between WW and W+W/bW + W/b of them, always, whatever the timing. The slack bound holds on the bursty stream exactly as it does on the even one, and it is checked rather than assumed. The window that is not full has the argument for why that bound is the tight one and what it costs to tighten.

What is wrong is not the answer but a statement about the answer — the sentence that converts the last four thousand events into the last forty-five seconds. That sentence lives in an alert, a dashboard label or a runbook, and no gate anywhere reads it.

This is why the failure belongs in the same group as the count somebody chose and the model a bound was quoted in rather than among the accuracy results. In all three the computation is right and the sentence attached to it is about a different quantity, and in all three the sentence is the thing anybody acts on.

The other instrument sees it

The time window over the same stream reports a spread of 1.14 in its occupancy: 449 to 511 items in a window matched to the block’s mean duration. Small, and not one.

So the two models disagree about whether the stream is uneven, and the one that says it is is right. That is a rare and useful thing — the dual that the window that is even in the wrong currency sets out holds on the other three streams and breaks here, in a direction that identifies which instrument is aliasing.

Why the time window is not aliasing is worth a sentence. Its boundary advances with the clock rather than with the arrivals, so its sampling instants are independent of the pattern, and a fixed duration that is not a multiple of the cycle will contain a varying number of cycles. It has its own commensurability problem — a duration exactly one cycle long would be flat too — and the difference is that its period is set by a parameter rather than by the stream.

The statistic that does not see it either

The warning statistic offered for a different failure has the same blind spot, and the coincidence is instructive.

Elsewhere in this collection a merge-damage prediction is checked against a statistic that splits a stream in half and reports how much the top keys change between the halves. On the bursty stream that statistic reads 0.195 — the same as the well-behaved streams — while the prediction is two and a half times out, because the flooding key is heavy in both halves and the split does not resolve what happens inside one.

Both of those are cases where an instrument’s grain decides what it can report, in the way the count somebody chose is about a unit of cost deciding what a measurement can say. Two different instruments, two different failures, one cause: each samples at a grain, and a structure whose behaviour is set at a finer grain is not described by it. The dispersion measure has the same property, which is why every plate here that prints one also prints the interval it was measured over.

The period is not usually sixty-four

A reader could reasonably object that the burst pattern here is unrealistically regular, and the objection is worth taking because it changes what the finding claims.

A generator that emits sixty-four arrivals and then exactly the silence needed to restore the mean rate is periodic by construction. A real bursty load is not — its bursts vary in size, its silences vary in length, and no block size will be commensurate with anything for long.

So the exact 1.00 is an artefact of a clean generator. What is not an artefact is the shape around it: the spread falls monotonically as the block grows relative to the pattern’s scale, from 1.85 at one and a half cycles to 1.18 at six, and it would keep falling on an irregular stream too. A block that is long compared with whatever timescale the load varies on will report a stable duration whether or not the load is stable.

That is the same conclusion arrived at from the other side by a window that is a duration, where the two window models were found to diverge when the window is short compared with the timescale the rate varies on and to agree when it is long. Agreement in that setting is not the two instruments both being right; it is both of them averaging the variation away.

A long window is a low-pass filter, and a low-pass filter reports quiet. The block sizes at which the aliasing is exact are a sharp special case of that, and the general case is on every plate in this group.

What one block of 125 arrivals covered, in timeA window of 1,000 arrivals in 8 blocks, driven by four arrival processes at the same mean rate of 100 Hz on a 1 ms clock. Each bar spans the shortest block that stream produced to the longest, with the mean marked. The structure counts arrivals and has no clock in it, so it retires a block at exactly 125 arrivals however long that took. On the evenly spaced stream every block is 1.2 s. On the drifting stream they run from 128 ms to 4.6 s — 35.8× — and the alert written in seconds against this window is wrong by that factor.even1.2 s – 1.2 s1.00× · dispersion 0.00Poisson956 ms – 1.6 s1.70× · dispersion 1.18bursty700 ms – 1.3 s1.82× · dispersion 0.96drifting128 ms – 4.6 s35.79× · dispersion 346.95duration one block covered1,000 arrivals in 8 blocks · 100 Hz · 1 ms clock35.8× on the drifting stream
Fig. 6 The four processes through blocks of a hundred and twenty-five arrivals — just under two cycles of the burst. The bursty row is now the widest of the four, on the same arrivals that produced a flat line at five hundred and twelve.

What to do about it

The repair is not a better block size, because the period being aliased against is a property of a load nobody controls.

Report the spread, not a spread. A structure that retires blocks knows the arrival index of every boundary it crosses. If it also knows the time — one stamp per block, which is bb stamps rather than one per key — it can report the durations its blocks actually covered, and the flat line above becomes evidence rather than silence. What a window costs in bits has the accounting that makes this cheap: the expensive stamps are the per-key ones.

Compare two instruments. The disagreement between the arrival window’s spread and the time window’s occupancy spread is exactly the signal that one of them is aliasing, and it costs a second cheap structure rather than a redesign.

And do not read a flat measurement as a flat stream. The general form of that is the oldest habit on this site — an assertion that has never rejected anything proves nothing — and it applies to a measurement as much as to a check. A number that does not move is either evidence of stability or evidence that the instrument cannot move, and the two are distinguished by perturbing the instrument rather than by looking at the number.

One key, decayed and windowed, through bursts and silenceThe blue curve is an exponentially decayed counter with a half-life of 4 s. The second curve is an exact count over a window of 5.77 s — the window chosen so that the two agree in the mean on a steady stream. They do not agree here and the shape of the disagreement is the point: the windowed count is a step function that drops the moment an arrival leaves, and the decayed value is smooth and never reaches zero. Through a silence the window empties and the counter fades; through a burst the window jumps and the counter climbs behind it. Neither is wrong. They are answers to different questions, and a dashboard showing one labelled as the other is the ordinary case.decayedwindowed060120secondscount attributed to key 0half-life 4 s · window 5.77 s · burstythe same key, two questions
Fig. 7 A structure with no window in it at all over the same bursty stream, where the fade is driven by the clock rather than by a count. It has its own difficulties and aliasing against the arrival pattern is not among them.

The condition, stated exactly, and the repair it hands over

A fraction with a small denominator is the right instinct and it is not a rule anybody can apply. The two sweeps between them hold eleven block sizes and their spreads, which is enough to state the condition exactly — and the exact form comes with a repair the loose form cannot suggest.

Sort the eleven by whether they are flat. Flat: 200, 400, 512. Not flat: 100, 125, 150, 175, 225, 250, 300, 375.

Every flat size is divisible by eight and no other size is. Eleven points, no exceptions.

Eight is not a property of the stream. It is the number of blocks the window holds, and eight blocks of ss arrivals span 8s8s of them, so 8s8 \mid s is exactly the statement that 8s8s is a multiple of the burst’s sixty-four. The condition is that the whole run of blocks covers an integer number of cycles, not that any one block does — which is the refinement this page reaches for and states qualitatively.

Written that way it generalises to a formula. With bb blocks and a period of pp arrivals, the blind sizes are the multiples of p/gcd(b,p)p/\gcd(b,p). At b=8b = 8 and p=64p = 64 that is every multiple of eight — one block size in eight is blind, which is a lot of exposure for a parameter chosen for memory.

And the formula is a dial. Move the block count to seven and gcd(7,64)=1\gcd(7,64) = 1, so the blind sizes are the multiples of sixty-four — one in sixty-four. Move it to nine, eleven, thirteen: the same. Any block count sharing no factor with the period reduces the exposure by the whole of that factor, and a period in a real stream is far more likely to be a round number of events than an odd one.

So a block count coprime to whatever the load repeats at is a repair, and it is free. It changes no bound: the slack a block window promises is between WW and W+W/bW + W/b arrivals, so seven blocks is a slightly looser bound than eight and nine a slightly tighter one, and neither costs anything the structure was not already paying. The window that is not full has that bound and its tightness; nothing in it prefers a power of two.

That is worth putting beside the two repairs above, because it is cheaper than both. Reporting the durations costs bb timestamps and a plate to read them on. Running a second instrument costs a second structure. Choosing an odd block count costs nothing and removes seven eighths of the block sizes at which the instrument can go blind — and the reason nobody does it is that eight is the number a person picks when the parameter is about memory, which is what what a window costs in bits says it is about.

The honest limit on this is the one the section above already states: a real burst has no exact period, so no block count makes a real stream exactly flat and none makes it exactly safe either. What the formula describes is the sharp special case, and what it recommends survives the general one — a schedule whose parameters share factors with a load’s timescale will lock onto it more readily than one whose parameters do not, and coprimality is the cheapest way to arrange that.

The same trap in a different instrument

The block boundary is a sampler because it fires on a count. Two other things in this collection fire on a count and have the same exposure, and naming them is cheaper than rediscovering the effect twice more.

A decayed counter fires on nothing — it fades continuously with the clock — and is immune, which is one more entry on the ledger the counter with no window in it opened. A block-window summary fires on arrivals and is exposed. A summary that compresses every fixed number of updates, which is how the quantile structures keep their size down, fires on arrivals too: its compression instants are chosen by the stream, and a stream with a period could in principle be compressed always at the same point of its cycle.

Whether that matters for the quantile structures is not measured here and is not obviously nothing. The compression schedule decides which tuples are candidates for folding at each pass, so a schedule locked to a periodic feature of the values would fold the same regions repeatedly. It is named here as an open question with a mechanism rather than as a finding, because the measurement that would settle it — sweeping the compression period against a periodic value stream — has not been made.

What is settled is the general rule, and it is short. Anything whose schedule is set by the data can alias against the data. The instruments that fire on a clock cannot; the ones that fire on a count can, and all of them are cheaper for exactly that reason.

What the flat line was worth

The measurement that opened this essay is a structure reporting, correctly and precisely, that a stream has no variation in it — over thirty-nine blocks, to the tick, on arrivals that a raster plot shows to be grossly bunched.

There was no bug. Every block covered eight complete cycles and eight complete cycles take the same time. The failure is that the question how long did five hundred and twelve arrivals take was being used as a proxy for is this stream steady, and the proxy is exact at some block sizes and useless at others, with nothing in the output to say which case is in hand.

That is worth keeping beside the other cases where an instrument’s silence was mistaken for a finding. It is the same shape as a check that has stopped rejecting anything: the output looks like the output of a working instrument, and the way to find out is to feed it something it must respond to. That is the discipline counting instead of timing established for this collection’s measurements and it turns out to apply to the instruments as readily as to the algorithms.

What this makes readable

Essays that name this one as a prerequisite.

Named alongside this one

Essays reaching for the same objects. Nobody chose these; they are what the concept index makes visible.

What links here

The 8 essays that link to this one and share the most of its objects, of 10 that link here.

The objects this essay names

Each one links to every other essay that touches it.

AliasingArrival processBurstinessClock resolutionCommensurabilityExpiryExponential histogramFailure modeMeasurementOccupancySamplingSliding windowTemporal resolutionTime window