What is taught wrongly

The sampler that cannot alias

A block window's boundary fires on an arrival count, and a stream whose burst repeats every sixty-four arrivals is reported as perfectly even by a block of five hundred and twelve. A quantile summary compresses on an update count, which is the same arrangement. Swept against three periodic value processes and their shuffles, it does not alias — and the reason is one line of arithmetic rather than a lucky sweep.

A block window has already been shown, here, to be a sampler.

Its boundary fires when a fixed number of arrivals have gone into the block, so the sequence of boundary times is the arrival times at positions s,2s,3s,s, 2s, 3s, \ldots — a sampler whose sampling instants are chosen by the signal being sampled. Against a stream whose burst repeats every sixty-four arrivals, a block of five hundred and twelve holds exactly eight cycles and reports every block as covering the same duration to the tick, on arrivals whose index of dispersion is 0.57. The essay that measured it is the boundary that hides the burst, and it closed by naming the obvious next case and not taking it.

The next case is this one. A quantile summary compresses every 1/2ε\lfloor 1/2\varepsilon \rfloor updates, which is an arrival-counted schedule by any reading, so a periodic feature of the values ought to be aliasable against it in exactly the same way.

It is not, and the interesting part is why not.

The same commensurability statistic, pointed at three structuresHow far the commensurate cases depart from their controls, divided by how far the incommensurate ones do. One means the commensurate cases are no different, which is what no aliasing looks like. Both compressions read near one — 1.03 and 1.22 — and the block window, whose aliasing is already established here, reads 1.48: its commensurate blocks spread by exactly 1.00 and its incommensurate ones by 1.48. The statistic is not blind; there is nothing at the top of the plate for it to see.1 — no differencethe whole array reviewed1.03×only this batch reviewed1.22×a block window, which does alias1.48×20,000 arrivals · period 50 · cyclethe instrument reads 1.48 where an alias is known to be
Fig. 1 The same commensurability statistic pointed at three structures: how far the commensurate cases depart from their controls, divided by how far the incommensurate ones do. Both compressions read near one. The block window, whose aliasing is established, reads 1.48.

What a sampler needs in order to alias

Aliasing is not a property of a schedule. It is a property of a schedule plus a discard.

A block boundary retires a block. The arrivals in it leave the structure, and which arrivals those are is decided entirely by where the boundary fell. When the boundary is commensurate with a period in the stream, the same phase of that period is retired every time, and the structure’s account of the stream is an account of one phase repeated — which is what a flat spread on a visibly uneven stream means.

A compression retires nothing. Merging a tuple into its neighbour adds the tuple’s gg to the neighbour’s, so

igi  =  n\sum_i g_i \;=\; n

before and after every compression, at every instant of the run. What a compression discards is resolution — where inside a gap an arrival sat — and never an arrival.

What a compression discards, and what it cannotA compression merges a tuple into its neighbour by adding its g to that neighbour's, so the sum of g over the summary is the number of arrivals at every instant — 4,000 against 4,000 here, after 80 compressions that took the summary down to 78 tuples. What compression discards is resolution, meaning where inside a gap an arrival sat. It never discards an arrival. A block window's boundary does the opposite, and that is the difference between a structure that can alias and one that cannot.arrivals, n4,000Σ g over the tuples4,000tuples held78compressions80arrivals retired0ε = 0.01 · period 50Σ g = n, before and after every compression
Fig. 2 Σ g against n after eighty compressions. Nothing was retired. The invariant is checked on the object rather than argued from the source, because it is the whole of the argument.

A sampler that misses nothing has nothing to alias against. That is the argument, it is one line, and everything below is corroboration rather than evidence.

The corroboration, and why it needs a shuffle

Arguments of that form are how mistakes get made, so the sweep is worth running.

Three periodic value processes were built for it, because every value distribution this site had was drawn independently per arrival and therefore carried no order at all — a stream a sampler cannot alias against for the trivial reason that there is nothing periodic in it. The three are a ramp sweeping the whole value range every pp arrivals; a quiet stream with a spike into the top of the range every pp; and a sinusoid of period pp, which is the same period with no discontinuity in it.

Each is run against a summary compressing every fifty updates, at cycle lengths from twenty-five to five hundred, and — this is the part that makes it a measurement — each is run beside a random permutation of its own values. The shuffle has the identical multiset and no order, so anything the ordered stream does that the shuffle does not is order, and anything they both do is the distribution.

An ordered stream against its own shuffle, at every ratio of period to cyclea ramp sweeping the whole range every p arrivals, run through a summary compressing every 50 updates, beside a random permutation of the identical multiset. The marked cycle lengths are the commensurate ones, where the compression instants fall at the same phase of the value cycle every time — which is the condition a block boundary aliases under. The commensurate cases depart from their controls 1.03 times as far as the incommensurate ones, against a sweep whose widest departure anywhere is 1.59. Nothing is happening at the marks.0501001502002540506075100125150200250500worst rank errorvalue cycle length, pthe ordered streamthe same values shuffledperiod 50 · ◆ commensuratecommensurate excess 1.03×
Fig. 3 The ramp against its shuffle at eleven cycle lengths. The marked lengths are the commensurate ones, where the compression instants fall at the same phase of the value cycle every time. Nothing happens at the marks.

The statistic is the mean ordered-against-shuffled departure at the commensurate cycle lengths divided by the mean at the rest. A structure that aliased would lift it. It reads 1.035 on the ramp, 0.931 on the spike train and 0.843 on the sinusoid — scattered around one, on both sides of it, which is what no effect looks like.

An ordered stream against its own shuffle, at every ratio of period to cyclequiet, with a spike in the tail every p arrivals, run through a summary compressing every 50 updates, beside a random permutation of the identical multiset. The marked cycle lengths are the commensurate ones, where the compression instants fall at the same phase of the value cycle every time — which is the condition a block boundary aliases under. The commensurate cases depart from their controls 0.93 times as far as the incommensurate ones, against a sweep whose widest departure anywhere is 1.74. Nothing is happening at the marks.0501001502002540506075100125150200250500worst rank errorvalue cycle length, pthe ordered streamthe same values shuffledperiod 50 · ◆ commensuratecommensurate excess 0.93×
Fig. 4 The spike train, whose periodic feature is in the tail — which is the part of the distribution a quantile summary is usually kept for. Same result: 0.931, and the widest departure anywhere in the sweep is 1.74.

The processes had to be built, and that is a finding of its own

Something turned up while assembling the sweep that is worth more than a footnote.

Every value distribution this site has ever drawn a quantile summary against — uniform, log-normal, Pareto, bimodal — is generated by drawing each value independently. The sequence carries no information beyond its histogram. Reordered any way at all, every quantile of it is unchanged, because a quantile is a statement about the multiset.

So this collection has spent a long run of essays asking whether various quantile structures behave well, on inputs that could not possibly have exercised the one property under test here. That is not a defect in those measurements — they were about tolerances and tail behaviour, and for those questions order-free inputs are the right control — but it means the aliasing question had never been askable, and the reason it had never been asked is that nothing in the input could have answered it.

The histogram that cannot see the order makes the counterpart observation on the counter side: a whole-shard histogram has no order in it, so a prediction computed from one is blind to a stream whose favourites move, and the failure is real and measurable. Both essays are about the same gap between what a statistic contains and what a structure experiences, approached from opposite ends.

A negative result is a statement about the instrument until it is not

Here is the failure this essay was most exposed to. A sweep that reports “no effect” reports the same thing whether there is no effect or whether the sweep cannot see effects, and those are not the same finding at all.

So the statistic is pointed at a structure where the answer is known. The block window measured in the boundary that hides the burst aliases, and it aliases in the direction that a commensurate block reports a flatter stream, so the statistic runs the other way there. Commensurate blocks spread by exactly 1.00 and incommensurate ones by 1.48. The statistic fires.

That is the hero plate above, and it is the one that makes the near-one readings mean something. The instrument that returns 1.03 for a compression returns 1.48 for a boundary on the same kind of question.

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. 5 The structure the calibration is against: block durations across six block sizes on one bursty stream. The rightmost block holds exactly eight bursts and reports a perfectly even stream. This is what an alias looks like when there is one.

Ruling out the other explanation

There is a second candidate reason a compression might fail to alias, and it has nothing to do with conservation: a compression scans the whole list. Perhaps what protects the structure is that every tuple is reconsidered at every pass, so no tuple’s fate depends on which pass it happened to be near.

That is a testable alternative, and the way to test it is to build the structure that does not have the property. A compression reviewing only the tuples inserted since the last one is the shortcut a first implementation reaches for — it is where the merges are, and rescanning the whole array to find them looks wasteful. It is a genuine sampler in the sense the analogy meant: a tuple outside the batch is never looked at, and a tuple that could not merge while it was fresh is never offered the chance again.

It costs almost exactly twice the tuples — 152 against 77 — so it is a real shortcut with a real price rather than a straw one. And it does not alias either: 1.03, 0.93 and 0.84 on the same three processes, the same as the full compression to within the noise.

An ordered stream against its own shuffle, at every ratio of period to cyclea ramp sweeping the whole range every p arrivals, run through a summary compressing every 50 updates, beside a random permutation of the identical multiset. The marked cycle lengths are the commensurate ones, where the compression instants fall at the same phase of the value cycle every time — which is the condition a block boundary aliases under. The commensurate cases depart from their controls 1.22 times as far as the incommensurate ones, against a sweep whose widest departure anywhere is 1.84. Nothing is happening at the marks.0501001502002540506075100125150200250500worst rank errorvalue cycle length, pthe ordered streamthe same values shuffledperiod 50 · ◆ commensuratecommensurate excess 1.22×
Fig. 6 The batch-only compression on the ramp. It keeps twice the tuples of a full compression and shows the same absence of commensurability structure, because Σ g = n survives the shortcut.

So it is the conservation and not the scan. That is worth having, because the conservation is a property of the merge rule and the scan is a property of one implementation, and the two would have given different advice to anyone writing a variant.

One thing the sweep did show, and it is not aliasing

The sweep was not entirely quiet, and the noise in it has a shape worth naming so that nobody rediscovers it as a finding.

An early version used a ramp with only pp distinct values — a clean sawtooth, no jitter — and the ordered stream kept far fewer tuples than its shuffle: 52 against 90, 58 against 81, 58 against 91. That looked like a large order effect and it is not one. It is a duplicate effect: with only a hundred distinct values in twenty thousand arrivals, most inserts land on an existing value, and the insert rule places a duplicate at the end of its tie run, where its Δ\Delta is computed differently from a value landing in open space. Adding jitter so that every value is distinct removes the gap entirely — 74 against 76, 76 against 76, 73 against 72 — while leaving the periodic structure exactly as it was.

The distinction matters because the two are easy to confuse and only one is about the schedule. A duplicate-heavy stream really does produce a leaner summary, at any compression period, on ordered and shuffled inputs alike. It is a fact about ties and not about sampling, and a sweep that had not included the jittered control would have reported it as an alias.

That is the second thing a shuffle earns beyond its stated job. It holds the multiset fixed, which is what makes it a control for order — and holding the multiset fixed also means the tie structure is identical on both sides, so anything caused by ties cancels rather than showing up as a difference.

What this settles about the analogy

The analogy that essay drew was good and it was not close enough. Two structures both do periodic housekeeping on an update count; only one of them is a sampler; and the thing that separates them is not the schedule but what the housekeeping does.

Set out as a question a reader can carry to a third structure: does the housekeeping remove information the structure would otherwise still have, and is what it removes chosen by where the boundary fell?

  • A block window: yes and yes. The retired block’s arrivals are gone, and which ones they were is the boundary’s choice. It aliases.
  • A quantile compression: no. g=n\sum g = n; the resolution lost is the resolution the invariant already permitted losing, and it would have been lost at any other schedule too.
  • An exponential histogram’s merge, which a register that became a list is about: no, on the same grounds — buckets combine and their counts add.
  • A Space-Saving eviction: yes. A key leaves the table and never comes back, and which key it was depends on what the table held at that instant. Nothing here measures whether an eviction schedule can be aliased against, and the machinery to ask is now built.

The last of those is the one to be careful with, because Space-Saving’s schedule is not periodic. It evicts when a key arrives that is not in the table, which is a data-dependent instant rather than a counted one — so there is no fixed period for a stream’s period to be commensurate with. Whether that makes it immune or merely makes the question harder to pose is open. A promise about the rank and the summary that has to forget mark out the two families this question has to be asked separately of.

Where the resolution does go

It is worth being clear that a compression does lose something, and saying what, so the negative above is not read as a claim that compressing is free.

What it loses is the ability to say where inside a merged band an arrival sat. That is exactly the quantity Δ\Delta is a bound on, it is what the promise is a promise about, and it is why an error measured against the answer has to distinguish a rank error from a value error at all. A summary that has compressed heavily around the median still answers the median’s rank to within its tolerance and no longer answers which of forty stored values was the fifty-first.

That loss is not schedule-dependent in the way an alias would need. It is capped by the invariant at 2εn2\varepsilon n wherever the compressions fell, and the measurements in the period that is not a promise show the realised loss flat across a thousand-fold sweep of the period.

A rank promise of ±1% at q = 0.999 on log-normal, σ = 1.2 — a latency distributionThe curve is the empirical distribution of 20,000 values: the horizontal axis is the value, logarithmic and the vertical axis is the fraction of the stream at or below it. A promise about the RANK is the shaded horizontal band, whose height is fixed at ±1% wherever it is drawn. What it permits in the ANSWER is the vertical band it cuts from the curve, and that runs from 306 to 2,170 — a range of 247% of the true value at this quantile. The summary answered 2,170 against a true 755: a rank error of 0.10%, inside the promise, and a value error of 187.5%, about which the promise says nothing. The two errors are the same number exactly when the distribution is flat, and the gap between them is the slope of this curve.answered 2,1700%25%50%75%100%0.36420.52,170value, logarithmicfraction of the stream at or belowrank ±1%value 306–2,170answered 187.5% out20,000 values · log-normal, σ = 1.2 — a latency distribution · Greenwald–Khanna, ε = 0.01rank 0.10% · value 187.5%
Fig. 7 The rank error against the value error at the 99.9th percentile. The first is what the compression bounds; the second is what the reader usually wants; and neither of them moves with the schedule.

Why this is worth a whole essay

A run of essays establishing that nothing happens should say why that was worth doing, and there are three reasons.

The first is that the mechanism was named and priced in a published plan. An open question with a plausible mechanism attached is a liability: somebody eventually builds a defence against it, or worse, explains a real result by it. Closing it costs one sweep and one invariant.

The second is that the reason it does not happen turns out to be a useful classifier. “Does the housekeeping discard, and is the discard chosen by the boundary?” separates the structures this site holds into two groups cleanly, and it is a question a reader can ask of a structure they meet somewhere else. That is worth more than the answer for this particular pair.

The third is the calibration habit. This site’s standing position is that an assertion that has never rejected anything proves nothing, and the same is true of a statistic that has never fired. Pointing the commensurability measure at the block window before believing its silence about the compression is the same discipline applied to a measurement rather than to a check, and it is the part of this essay most worth copying.

What the sweep could have detected

The essay is careful to say that the calibration is one known case rather than a characterisation of the instrument’s sensitivity. The three null readings characterise it, and it is worth doing, because a negative result without a detection threshold is a claim of unknown strength.

The three processes return 1.035, 0.931 and 0.843. They are three independent estimates of the same nothing, so their spread is the statistic’s own noise: a mean of 0.936 and a standard deviation of 0.096.

That gives the threshold directly. An effect has to lift the statistic about three standard deviations above the null mean to be distinguishable, which is 1.22. And the block window, at 1.48, sits 5.7 standard deviations out — comfortably clear, which is why the calibration works.

So the negative result has a size. Any aliasing in these compression schedules is under about a fifth of the departure scale, because a fifth is roughly where the instrument stops being able to tell. An effect at 1.5 would have been unmissable; one at 1.1 would have been invisible, and nothing here rules it out.

That is a materially better statement than it does not alias, and it is the statement the argument actually supports. The one-line proof — g=n\sum g = n, nothing is retired, there is nothing to alias against — is what rules out an effect of any size; the sweep confirms it down to about twenty per cent and no further. Two claims of different strengths, and separating them is what stops the corroboration being read as the proof.

The null mean is also worth a sentence, because 0.936 is not 1.000. Three readings with a standard deviation of 0.096 have a standard error of 0.055, so the mean sits about a standard error below one — consistent with one, and not evidence of an anti-alias. A reader tempted to explain the shortfall has three numbers to explain it from, which is not enough.

The obvious caution is the sample size. Three processes is three, the standard deviation of three numbers is a poor estimate of anything, and the threshold above should be read as an order of magnitude rather than a bound. What makes it worth computing anyway is that the alternative is no threshold at all: a sweep reporting “around one” invites a reader to imagine it would have caught anything.

Which is the discipline one pass, k slots, and two randomness budgets applies to a biased sampler — a test whose noise floor is above the effect it is looking for passes on the broken version and proves nothing about the correct one, and the fix is to measure both the floor and the effect before choosing a tolerance. Here the effect was measured first, on the boundary that hides the burst’s structure, and the floor comes free from the nulls that were run anyway.

The limit of the negative

Three things this does not establish, stated because a negative result attracts more weight than it can carry.

It does not establish that no quantile structure can alias. It establishes that these two cannot, and gives the property — mass conservation — that a third would have to lack.

It does not establish that the sweep would find every alias. It establishes that the sweep finds the one alias available to test it on, at 1.48 against a 1.03 null, which is a calibration on a single known case rather than a characterisation of the instrument’s sensitivity.

And it does not establish anything about a windowed quantile summary, which is the structure that would have both properties at once — a compression that conserves and an expiry that does not. Nothing here builds one. The prediction the argument here makes is that such a structure aliases through its expiry and not through its compression, and that the two can be told apart by watching whether g\sum g tracks the window occupancy or falls short of it. That is a measurement and it is not this one.

Named alongside this one

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

What links here

Every essay whose body links to this one.

The objects this essay names

Each one links to every other essay that touches it.

AliasingArrival processBurstinessCommensurabilityCompression scheduleCounterexampleFailure modeFalsificationGreenwald–KhannaMeasurementQuantile summarySamplingSliding windowTemporal resolution