The thread: Measured, not assumed — page 12
A choice the fences cannot make
At half a bit a key a levelled store's range-filter memory has two good divisions, one for a store whose levels all meet the same queries and one for a store whose newest level meets few. A switch between them on the ratio of the newest level's reach to the largest's was predicted to land within three points of the fitted division on the shuffled store and ten on the others. It holds on the two stores it was shaped on and fails on a third filled two clusters at a time, 15.9 points behind, choosing the worse division at four checkpoints of six. At three quarters of a bit the floored division is within 1.7 points everywhere and the switch's premise is gone. Priced on a sample of queries instead, the same choice between the same two divisions stays within 3.6 points on every store at both budgets.
What is taught wronglyThe dial that has no setting
The generator has one parameter. The real version history's run count asks it for 2.3% and its phrase count asks for 3.2% — and the reason is not that the dial is badly calibrated. Real edits average 7.3 characters a block and generated ones average 1.04.
StructuresA document already in the answer
The same walk, with the chain's test replaced by a lookup in the answer so far. It reports the same documents at the same cost, and two exchanged lines make it lose nine of seventeen without failing.
The index that replaces the textThe index that does not notice
Three compressed indexes over the same characters. One is flat at six and a half bits a character however many copies the collection holds; the other two fall by factors of five and six. At one copy the two that fall are the largest of the three.
What a bound isThe flat bottom of a shallow curve
The low width is chosen as the floor of log of the universe over the count. Rounding it up instead costs one bit on five thousand, because the total is m·w plus n over two to the w and the minimum is where those two are equal.
What a bound isFlat in the budget, and not
One saving is eleven times at every error budget, because it is a property of the alphabet. The other moves between ninety-eight and a hundred and five, because it follows the share of extensions that find nothing. Two savings, two shapes, and neither line crosses the other.
The data that is not a numberA paragraph moved costs its seams
A paragraph cut from one place in a copy and pasted at another changes no character, only where the characters sit, and both repetition measures charge it for the where. Across thirty-two copies of one text, a moved block adds about three phrases to the Lempel–Ziv parse and eleven runs to the Burrows–Wheeler transform at every length from four characters to 256 — the price of the three seams a move makes, and nothing for the text between them. A tenth of the copies moved in blocks of 64 leaves the transform at 0.030 runs a character, where the same tenth rewritten reaches 0.050; the run-length index stays smaller than the entropy-bounded one up to 9% moved against 4% rewritten, and the phrase index stays the smallest of the three at every share measured.
When the algorithm flips a coinSlack placed where the queue is long
A blocked filter's threshold table, its lines sized for the mean number of closed blocks and each line's surplus carried into the next lines' free slots, had been given a slack line every eighth line and found that one deviation of room cannot drain eight lines of wander. The table is built, not grown, so it knows its queue: placing a slack line whenever the queue reaches eight was predicted to cost 3.15 bits a block for 2.03 lines a lookup and to bound every walk at about eight lines. It costs 3.150 bits for 2.027 lines, the longest walk is eight lines, and at the same bits the fixed spacing reads 0.023 lines more — over twice the hundredth predicted. Every earlier table is about three hundredths of a bit dearer at the same lines. All of it depends on a directory of marks, 972 bits for the whole table, being in cache when a lookup asks it where its line is; read from memory, it costs a whole line, and the design loses to every other.
CountingA switch that reads the long runs
The two-ended selection sort's record of adjacent order pays on long runs and costs on short ones, and a switch on the mean run the pass between neighbours reads could not tell an input of even short runs from one whose keys are half in short runs and half in long. The proposal counted something chosen for what the record is worth: the share of keys the pass finds in runs of at least eight, keeping the record when it reaches a tenth. At three word reads a comparison that switch chooses right on all seventeen inputs measured, including five new ones built to defeat it, where the mean's best threshold leaves up to 0.18%. But the prediction said it would be right at every rate, and it is right only at three: at one word read a comparison it costs 1.2% on runs of eight, at four it drops the record on one run of 64 among single keys, which at that rate pays. One number from the pass is enough to decide. Which number depends on the price of a word.
When it does not fitA level priced on its own sample
A levelled store chose between two divisions of its filter memory by pricing both on a sample of queries, and still divided by the size rule's shape. The proposal was to descend from the floored division instead: price each level alone on the sample at the settings either side of what it has, and move a grid step of bits from the level that saves least to the one that saves most, until no move helps. At three quarters of a bit and one bit a key the descent reaches the fitted division on all three stores in at most two moves, within a third of a point. At half a bit it does not move at all on most of the fill, as the risk named: no single step pays, because the fitted division's trade is the largest level's half bit given up for many steps on the smallest, and a grid step is not a unit of bits. Moves priced in bits instead of grid places close half a bit on two stores of three — but they price up to 60% of the filters a full search builds, and the prediction was under a quarter.
The other axisWhat the chain cost
The chain of previous occurrences is one row number per row — exactly as wide as the suffix array it sits beside, and the largest single part of a document-listing apparatus. It is now absent, and what replaces it is one bit per document.
What is taught wronglyA boundary that costs nothing
A separator occurs nowhere else in the collection, so it must break a phrase that would have spanned it. Cutting a repetitive text into a hundred and twenty-eight documents raises its run count by two per cent, and cutting prose raises it by ten.
StructuresThe price of a boundary is what precedes it
A separator sorts before everything, so its rows sit at the top of the suffix array and hold the documents' last characters. What a document boundary costs the transform is the entropy of the character in front of it, and nothing else.
The index that replaces the textThe tree answers the question
The distinct documents in a range of rows are the distinct symbols of the document array in that range. A wavelet tree enumerates those in one descent, so the range minimum, the chain, the bitmap and the recursion all go at once.
What a bound isThe exponential is in the expression
The subset construction on one family reaches two to the k plus one states, exactly and not approximately. A literal of the same length gives eleven. Both are regular expressions and the difference is that one of them asks the machine to remember something.
The data that is not a numberEdits a history inherits
Every collection of copies measured so far was a star — one original and every other copy an independent edit of it — and a version history is a chain, each version the one before with one more edit. Built as a chain of thirty-two versions with one moved paragraph a step, a collection adds 93 phrases to the Lempel–Ziv parse of identical copies, three a step, exactly what one move costs a star, as predicted; a star whose copies are as far from the original adds 1,285, fourteen times as many. The parse charges an inherited edit nothing. The transform does not quite: a chain of moves costs 15.9 runs a step against eleven predicted, 39% more than a star of one move a copy, while rewritten and scattered edits cost a chain within 5% of a star. And the risk — a later edit cutting an earlier seam — is the common case, nine moves in ten, and costs nothing. A history is priced by how many edits were made, not by how far its copies have drifted.
When the algorithm flips a coinA guess that costs more than the walk
A blocked filter's threshold table placed its slack lines where the queue of carried values was long, and read a directory of marks to find a block's line; read from memory, the directory cost a line and the design lost to every other. Giving each group of 64 lines a fixed budget of slack lines, placed where the queue asks, makes a group's first block arithmetic again, and a lookup can guess its line as if every earlier line were ordinary. The guess is wrong for 41% of lookups at the queue's own budget of fifteen, not a third of a minority; the count each line must carry costs 0.037 bits a block, not under a hundredth; and the queue's demand varies so much between groups that the budget refuses it six lines a group, so walks run to 29 lines again. The design reads 2.45 lines a lookup where fixed spacing reads 2.03 at the same bits, because everything the queue's placement saves is a few thousandths of a line of walking.
What the libraries doThe apparatus that is smaller than its index
Answering "which documents hold this" at a price proportional to the answer used to cost 2.70 times the index it sits beside. Two changes later it costs 0.84, and the largest thing left is an array that says which document each row belongs to.
The other axisTwo currencies for one separator
Giving every document its own boundary marker costs a fifth of the packed text and three per cent of the run count. Both numbers are right, they are about the same change, and which one a collection pays depends on a structure nobody named.
What is taught wronglyOne copy per document is one occurrence per document
The output-sensitive listing apparatus wins when a pattern occurs far more often than it occurs in documents. A collection of versions was supposed to be that case, and it is the one collection where the two numbers are equal by construction.
StructuresThe last array in the apparatus
The document-listing apparatus began as three arrays beside a suffix array. Two of them turned out to be machinery for reading the third, and both have gone. What is left is the document array, and it is the only one of the three that was information.
The index that replaces the textAsking about symbols that are not there
A search extends an interval by every character of the alphabet, and on a deep branch almost all of them produce an empty interval. That is a full rank walk whose entire result is the discovery that nothing was there.
The other axisThe array that says where is twice the samples
An index keeps one suffix-array value in every thirty-two, and a bit vector over all n rows saying which. The vector is sixteen thousand bits and the values it points at are seven thousand — the index of the samples is twice the samples.
What the machine doesThe bucket that fits a line
Make each of a cuckoo table's two candidates a bucket of eight slots laid out on one cache line, and no lookup ever touches more than two lines, the table builds past a load of 0.95, and at that load it misses 1.21 times a lookup where linear probing misses 1.79. The prediction that it would lose to linear probing at low loads was wrong — it misses less at every load measured, 0.94 against 0.96 at 0.3 — because a key it holds almost never lives in its second bucket. The guarantee belongs to the alignment, not the bucket; eight slots on lines of four put a lookup on four lines.
What a bound isA floor under a product
Every lower bound written here so far puts a floor under one quantity. The published time–space bound for sorting puts one under a product: T·S is Ω(n²), so buying time with space and space with time cannot both be done. Measured, heapsort's product is 0.0028 n² — four hundred times under a bound nothing can beat. The bound is not wrong. It is stated in a model where the input may not be written, and every sort here writes to the input, which is where its working memory actually is.
What the libraries doA collection is a construction
The same characters, arranged as one copy per document or cut across the copies, give a different run count, a different boundary cost and a different answer about which structure to build. Which one a benchmark used is usually not recorded.
The other axisThe apparatus, three times smaller again
Eight hundred and thirty-nine thousand bits became two hundred and eighty-five thousand, and now a hundred and twenty thousand. The listing apparatus is fourteen per cent of what it was and holds one array, which is the only part of it that was ever information.
What the libraries doThe smaller tree hands it back unsorted
A frequency-shaped tree is sixteen per cent smaller and returns its documents in code order. A balanced one is larger and returns them sorted. The trade is d log d comparisons against a saving, which is not close — until the answer is truncated.
What is taught wronglyA saving quoted without its collection
A check asking whether a compressed document array is smaller than the plain one passes on the rounding whenever the document count is not a power of two. It would report a saving of nothing as sixteen per cent, on a collection that has no redundancy at all.
StructuresThe branches that find nothing
An approximate search over a twenty-symbol alphabet attempts sixteen thousand eight hundred extensions and nine thousand two hundred of them produce an empty interval. That is a full rank walk whose entire result is the discovery that nothing was there.