The data that is not a number

The optimum the flag took away

A bidirectional index's wavelet-tree levels were coded in blocks of 63 bits because a sweep found 63 the best length: shorter blocks pay for more classes, longer ones for offsets that approach the block's own length. Then the classes were coded as runs and each offset given a flag to choose a code of its value changes instead. Lengthening the blocks to 127 bits was predicted to save on English words and the repetitive collection and to change nothing on random letters. It saves on all four texts, and there is no best length short of 1,023 bits on three of them: English words fall from 1.431 bits a character at 63 to 1.304 at 1,023. Under the codings the optimum came from, the same levels cost 3.728 at 1,023. The flag turned a long block's offset into the cost of its change points, which no block length moves, and left the length to be set by the one thing still growing with it: the work of a rank.

The index that is smaller than the text rebuilt a compressed index at five block lengths and found an interior optimum. Every block of a level’s bit vector was stored as a class, how many ones it holds, and an offset, which of the arrangements with that many ones it is. A short block pays for its class whatever is in it, so short blocks are dear. A long block’s offset, ⌈log⁡2(bc)⌉\lceil\log_2\binom{b}{c}\rceil bits, approaches the block’s length as the block lengthens, because a long block is rarely uniform, so long blocks are dear too. The minimum fell at 63 bits, and every page in this line since has coded its levels at 63.

Two things then changed what a block costs. Six bits a class stored the class sequence as runs of one value, because two thirds of the blocks are uniform and they come in stretches. A flag for the blocks that change once let each mixed block choose between its arrangement’s index and a code of the gaps between its value changes, at one bit for the choice. A block that straddles one change of value then costs about eleven bits whatever its length. That essay’s closing section proposed rebuilding the levels at blocks of 15, 31, 63 and 127 bits to find the length the change points want. It predicted that English words’ best length would move from 63 to 127 bits, the repetitive collection’s further, and random letters’ nowhere. It could fail on the many-change blocks: a long block in a mixed stretch catches more stray changes, and if their cost grew faster than the one-change blocks’ fell, longer blocks would only spread the cost.

The same bits, cut at every length

The levels are the index’s own, built once: every wavelet-tree node of both trees over four texts of 16,384 characters, DNA and protein drawn at random, English words, and a repetitive collection. Each node’s bit vector is read back and re-cut into blocks of LL bits, from 15 to 1,023, and costed as the flagged coding costs it. The classes are runs of one value, ⌈log⁡2(L+1)⌉\lceil\log_2(L+1)\rceil bits for the value and an Elias-gamma length, with a pointer into the run stream every superblock. A uniform block needs no offset. A mixed block costs a flag and the shorter of its arrangement’s index and its gap code, the first bit, the count of value changes and each gap, all in gamma. Superblocks of 32 blocks keep a rank and an offset pointer, as built.

At 63 bits the rebuild’s classes and offsets are the earlier essays’ to the bit, and its superblocks are the built vectors’ own. The total is 1.431 bits a character on English words, not the 1.45 the flag’s essay reported. The difference is a quirk of that accounting, which charged an arrangement index to each level’s short last block when it was all ones, a block that needs no offset; it is two hundredths of a bit and is left out here.

Beside the flagged coding, the same vectors are costed as first built: a fixed-width class for every block, and every mixed block’s offset its arrangement’s index. That is the coding the part every saving left alone introduced to these levels, at 63 bits, and the one a block, a class and an offset first priced on a smaller structure, where it found the payload’s penalty falling quickly as the block lengthened.

Where the optimum at 63 came from

The optimum at 63 bits belonged to the first coding: with a six-bit class a block and every offset an arrangement's index, English words' levels cost 1.877 bits a character at 63, 2.134 at 127 and 3.728 at 1,023; with classes as runs and the flag they cost 1.431, 1.367 and 1.304Levels' bits a character at each block length under the coding as first built — a fixed-width class a block and every mixed block's offset its arrangement's index — and under classes as runs with each offset the shorter of arrangement and gaps behind a flag, for English words and the repetitive collection. English words, as first built: 15 2.451, 31 2.000, 63 1.877, 127 2.134, 255 2.627, 511 3.197, 1023 3.728. English words, runs and the flag: 15 1.769, 31 1.538, 63 1.431, 127 1.367, 255 1.325, 511 1.311, 1023 1.304. repetitive collection, as first built: 15 1.733, 31 1.217, 63 1.068, 127 1.279, 255 1.880, 511 2.675, 1023 3.436. repetitive collection, runs and the flag: 15 0.795, 31 0.662, 63 0.607, 127 0.549, 255 0.509, 511 0.476, 1023 0.450. The first coding's least on English words is at 63 bits.01234block length, bits (log scale)levels' bits a character1531631272555111,023English words, as first builtrepetitive collection, as first builtEnglish words, runs and the flagrepetitive collection, runs and the flagdashed: a class a block, arrangements only16,384 characters, both trees
Fig. 1 Levels’ bits a character against block length. English words as first built, a class a block and arrangements only: 2.451 at 15, 1.877 at 63, 2.134 at 127, 3.728 at 1,023. With classes as runs and the flag: 1.769, 1.431, 1.367, 1.304. The repetitive collection: 1.733, 1.068, 1.279, 3.436 as first built; 0.795, 0.607, 0.549, 0.450 with runs and the flag.

Under the coding as first built, English words’ levels have their least at 63 bits, 1.877 bits a character, and cost twice that at 1,023; under classes as runs and the flag they fall at every length, from 1.431 at 63 to 1.304 at 1,023. The earlier sweep’s optimum is reproduced on these levels, and it is a property of that coding. The repetitive collection does the same, its least at 63 under the first coding and none under the second.

The reason is in what each coding charges a long mixed block. An arrangement’s index for a block of 1,023 bits with a few hundred ones is several hundred bits, because it has to name one arrangement among astronomically many, even when the block’s ones sit in two long stretches. The gap code names the stretches: a first bit, a count and a gamma code for each gap, a few dozen bits for a block that changes value a handful of times. The flag takes whichever is shorter, and for a long block on a structured text that is usually the gaps.

The stretches exist because of the transform the levels are built over. A wavelet-tree level is a bit vector over the Burrows–Wheeler column of the text, and the column groups characters that share a following context, so a level’s bits come in long runs that change at the boundaries between groups. The transform that emits nothing showed that the transform changes no character’s frequency, only the order, and the order is exactly what a gap code is paid to describe. On English words and the repetitive collection those boundaries are sparse, and a gap code over a long block pays for a few of them. On random letters the column has no groups to speak of and the boundaries are everywhere.

Every text, against itself at 63

No text's levels stop shrinking at 127 bits: English words fall from 1.431 bits a character at 63 to 1.367 at 127 and 1.304 at 1,023, the repetitive collection from 0.607 to 0.450, DNA too; only protein turns, at 511Bits a character of both trees' levels, classes as runs and offsets coded the shorter way behind a flag, at block lengths of 15, 31, 63, 127, 255, 511, 1023 bits, each text drawn against its own total at 63 bits. English words: 15 1.769, 31 1.538, 63 1.431, 127 1.367, 255 1.325, 511 1.311, 1023 1.304. repetitive collection: 15 0.795, 31 0.662, 63 0.607, 127 0.549, 255 0.509, 511 0.476, 1023 0.450. DNA: 15 2.700, 31 2.398, 63 2.229, 127 2.141, 255 2.086, 511 2.058, 1023 2.041. protein: 15 5.684, 31 5.117, 63 4.797, 127 4.632, 255 4.548, 511 4.505, 1023 4.522.0.80011.20block length, bits (log scale)levels' bits, against the same text at 631531631272555111,023proteinDNAEnglish wordsrepetitive collection16,384 characters, both trees1 = the text at 63 bits
Fig. 2 Each text’s levels against its own total at 63 bits. At 127: English words 0.955, the repetitive collection 0.904, DNA 0.960, protein 0.966. At 1,023: 0.911, 0.741, 0.916, 0.943. Protein’s least is at 511, 0.939.

Lengthening the blocks from 63 to 127 bits saves on every text, 4.5% on English words, 9.6% on the repetitive collection, and 4.0% and 3.4% on DNA and protein, where the prediction expected nothing. And it goes on saving. English words and DNA are still falling at 1,023 bits, and the repetitive collection most steeply of all. Only protein turns, at 511 bits, and by four tenths of a per cent.

The random letters save for a reason that has nothing to do with change points. Their mixed blocks change value dozens of times, so a gap code rarely beats the arrangement’s index, and their offsets grow with length about as the first coding’s did. What falls is the directory: the classes and the superblocks are paid a block at a time, and a block of 127 bits has half as many of them to pay for. On DNA the classes fall from 0.258 bits a character at 63 to 0.154 at 127. The prediction treated the classes and superblocks as a cost on the long-block side of a balance; under run-coded classes they are only that.

English words, part by part

On English words, lengthening the blocks from 63 to 1,023 bits takes the classes from 0.323 bits a character to 0.074 and the superblocks from 0.100 to 0.061, and grows the offsets only from 1.008 to 1.169English words' levels in bits a character at each block length, by part: the classes coded as runs with their pointers, the superblocks' ranks and offset pointers, and the offsets. 15: classes 0.609, superblocks 0.274, offsets 0.887, 1.769 in all. 31: classes 0.430, superblocks 0.155, offsets 0.953, 1.538 in all. 63: classes 0.323, superblocks 0.100, offsets 1.008, 1.431 in all. 127: classes 0.234, superblocks 0.074, offsets 1.058, 1.367 in all. 255: classes 0.162, superblocks 0.065, offsets 1.099, 1.325 in all. 511: classes 0.112, superblocks 0.063, offsets 1.137, 1.311 in all. 1023: classes 0.074, superblocks 0.061, offsets 1.169, 1.304 in all.classes, as runssuperblocksoffsets, the shorter way00.511.5bits a character, both trees15 bits1.76931 bits1.53863 bits1.431127 bits1.367255 bits1.325511 bits1.3111023 bits1.304English words, 16,384 charactersboth trees
Fig. 3 English words’ levels in bits a character, by part. At 15 bits: classes 0.609, superblocks 0.274, offsets 0.887, 1.769 in all. At 63: 0.323, 0.100, 1.008, 1.431. At 127: 0.234, 0.074, 1.058, 1.367. At 1,023: 0.074, 0.061, 1.169, 1.304.

From 63 bits to 1,023 the classes fall by 0.249 bits a character and the superblocks by 0.039, while the offsets rise by only 0.161. The offsets are where the first coding lost everything at long blocks, 1.297 bits a character at 63 rising to 3.612 at 1,023. Under the flag they rise by a sixth.

They rise by so little because a gap code’s cost is the cost of the change points it covers. A change of value inside a block costs a gamma code for the gap before it, about twice the logarithm of the gap. Cutting the vector into longer blocks does not change where the changes fall; it only changes which block each one is charged to and how long the gaps between them are measured, since a block’s first gap starts at the block’s edge. Longer blocks put fewer edges in the way, so the gaps are measured more nearly from change to change. The offsets converge on a code of the vector’s own change points, and that code does not depend on the block length at all.

The one-change blocks, which do not decide it

The blocks the flag was built for are commonest at 127 bits on English words — 46% of mixed blocks change value once, against 33% at 63 — and then grow scarce, 9% at 1,023, as a long block catches a second change; the levels keep shrinking anywayThe share of mixed blocks whose bits change value exactly once, at block lengths of 15, 31, 63, 127, 255, 511, 1023 bits. English words: 15 13% of 2,565 mixed blocks, 7.29 bits each against 11.91 for the others; 31 20% of 1,440 mixed blocks, 9.97 bits each against 24.69 for the others; 63 33% of 885 mixed blocks, 12.19 bits each against 49.70 for the others; 127 46% of 604 mixed blocks, 14.16 bits each against 94.75 for the others; 255 36% of 385 mixed blocks, 15.22 bits each against 138.28 for the others; 511 21% of 238 mixed blocks, 17.88 bits each against 194.38 for the others; 1023 9% of 145 mixed blocks, 17.85 bits each against 288.36 for the others. repetitive collection: 15 45% of 629 mixed blocks, 7.15 bits each against 7.32 for the others; 31 40% of 587 mixed blocks, 9.56 bits each against 10.16 for the others; 63 42% of 566 mixed blocks, 11.28 bits each against 13.10 for the others; 127 39% of 515 mixed blocks, 13.20 bits each against 17.28 for the others; 255 29% of 392 mixed blocks, 15.34 bits each against 26.85 for the others; 511 19% of 254 mixed blocks, 17.88 bits each against 44.39 for the others; 1023 9% of 149 mixed blocks, 17.23 bits each against 74.16 for the others.00.1000.2000.3000.4000.500block length, bits (log scale)mixed blocks that change value once1531631272555111,023English wordsrepetitive collection16,384 characters, both treesa block that changes once
Fig. 4 The share of mixed blocks that change value exactly once. English words: 13% at 15 bits, 33% at 63, 46% at 127, 36% at 255, 9% at 1,023, from 2,565 mixed blocks at 15 bits to 145 at 1,023. A one-change block costs 12.2 bits at 63 and 14.2 at 127; the others 49.7 and 94.8. The repetitive collection: 45%, 42%, 39%, 29%, 9%.

The blocks the flag was built for are commonest at 127 bits on English words, 46% of mixed blocks, and grow scarce beyond, 9% at 1,023; the levels go on shrinking anyway. The prediction’s mechanism was right about the one-change blocks: each costs about the same whatever its length, 12.2 bits at 63 and 14.2 at 127, and a longer block straddles proportionally fewer boundaries. Its failure mode was right about the others: a long block in a mixed stretch catches more changes, and the many-change blocks’ cost doubles with each doubling of length, from 49.7 bits at 63 to 94.8 at 127.

Neither decides the total, because the number of mixed blocks falls as fast as their cost rises. At 63 bits English words have 885 mixed blocks; at 1,023 they have 145, and the 131 many-change blocks among them cost 288 bits each. A block of 1,023 bits that changes value thirty times is charged for thirty changes; at 63 bits the same thirty changes were spread over sixteen blocks, each with its class, its flag and its first gap. The count of changes is what the offsets pay for, at any length.

What a long block costs a rank

What a longer block costs a rank on English words: 15.67 entries and bits read at 63 bits, 23.63 at 127, 36.60 at 255 and 104.36 at 1,023 — the directory's share stays near ten while the decoding inside the block doubles with every doublingOn English words, the mean work of a rank over every position of every level at each block length: the superblock's entry and one entry for every class run between the superblock's first block and the rank's own block, and the decoding inside the block — every bit before the position for a block held by its arrangement, the first bit, the change count and each gap passed for a block held by its gaps, nothing for a uniform block. 15: 5.56 in the directory, 1.55 in the block. 31: 6.71 in the directory, 3.39 in the block. 63: 8.49 in the directory, 7.18 in the block. 127: 9.21 in the directory, 14.42 in the block. 255: 8.61 in the directory, 27.99 in the block. 511: 7.27 in the directory, 53.87 in the block. 1023: 4.22 in the directory, 100.14 in the block.0255075100block length, bits (log scale)work a rank, entries and bits read1531631272555111,023directory and blockthe directoryEnglish words, every position of every levelthe earlier pages' read unit
Fig. 5 On English words, the work of a rank: the superblock’s entry and every class run from the superblock’s first block to the rank’s own block, plus the decoding inside the block. 15.7 at 63 bits, of which 8.5 in the directory; 23.6 at 127; 36.6 at 255; 61.2 at 511; 104.4 at 1,023, of which 4.2 in the directory.

A rank’s work rises from 15.7 entries and bits read at 63 bits to 23.6 at 127 and 104.4 at 1,023, and almost all the growth is inside the block. The directory’s share stays between four and nine, because a superblock spans 32 blocks whatever their length and a run of uniform blocks is one entry. The decoding inside a block is what grows. A block held by its arrangement must be decoded up to the rank’s position, half the block on average; a block held by its gaps must be read gap by gap until the position is passed. Both double with each doubling of length.

That is the cost the block length now trades against. Rank is the only thing it does found that a rank directory’s overhead and its reads are set by two integers and can be traded along a line; the block length of a coded level is a third integer on the same trade. Under the first coding there was nothing to trade, since a longer block cost both more bits and more work past 63. Under the flag every doubling buys bits with work.

Bits against work

Every doubling of the block length buys bits with work, and the price rises: on English words 63 to 127 bits saves 4% of the levels for 51% more work a rank, 255 to 511 saves 1% for 67%Each text's levels in bits, against its own total at 63 bits, and the work of a rank, one point for each block length from 15 to 1,023 bits. English words: 15 bits 1.769, work 7.10; 31 bits 1.538, work 10.10; 63 bits 1.431, work 15.67; 127 bits 1.367, work 23.63; 255 bits 1.325, work 36.60; 511 bits 1.311, work 61.14; 1023 bits 1.304, work 104.36. repetitive collection: 15 bits 0.795, work 3.80; 31 bits 0.662, work 5.91; 63 bits 0.607, work 10.54; 127 bits 0.549, work 19.07; 255 bits 0.509, work 34.36; 511 bits 0.476, work 52.13; 1023 bits 0.450, work 54.62. DNA: 15 bits 2.700, work 16.33; 31 bits 2.398, work 22.67; 63 bits 2.229, work 34.93; 127 bits 2.141, work 59.43; 255 bits 2.086, work 107.30; 511 bits 2.058, work 203.78; 1023 bits 2.041, work 398.89. protein: 15 bits 5.684, work 19.30; 31 bits 5.117, work 27.01; 63 bits 4.797, work 41.77; 127 bits 4.632, work 69.52; 255 bits 4.548, work 124.67; 511 bits 4.505, work 237.12; 1023 bits 4.522, work 438.33.481632641282560.80011.20work a rank (log scale)levels' bits, against the same text at 631531631272555111023proteinDNAEnglish wordsrepetitive collectionpoints: block lengths 15 to 1,0231 = the text at 63 bits
Fig. 6 Each text’s levels against its own total at 63 bits, and a rank’s work, one point a block length. English words: 1.236 at 15 bits for 7.1, 1.000 at 63 for 15.7, 0.955 at 127 for 23.6, 0.926 at 255 for 36.6, 0.911 at 1,023 for 104.4. The repetitive collection reaches 0.741 at 1,023 for 54.7.

On English words, going from 63 to 127 bits saves 4.5% of the levels for 51% more work a rank, and going from 255 to 511 saves 1.1% for 67% more. Every text lies on a curve of the same shape: steep savings for little work at short blocks, a knee between 63 and 255, and then work bought for almost nothing. Where to stand on it depends on how often the index is asked a rank against how much its size matters, which bits and steps on one frame argued for the sampling rate in exactly these terms: neither line is the answer, the answer is a point on the pair.

Read the other way, the curve says what a fixed budget of work allows. An index that can afford about sixteen units of work a rank on English words stands at 63 bits, which is where the first coding put its optimum; one that can afford a hundred stands at 1,023 bits, with levels 8.9% smaller. So the old optimum survives as one point on the new curve rather than as its minimum: it is what the levels cost when a rank may read about as much as it did before the flag.

The repetitive collection’s curve is the most generous. Its levels are long uniform stretches broken by a few changes, its mixed blocks change value rarely, and a gap code walks them quickly, so at 1,023 bits its rank work is 54.7 against English words’ 104.4, and its levels are a quarter smaller than at 63.

What each doubling buys

Each doubling saves less than the one before, and on protein the last one loses — 0.4% more bits at 1,023 than at 511 — while on English words and DNA doubling to 1,023 still saves 0.6% and 0.8%: the bits never ask for a shorter block, only the work doesThe share of each text's levels saved by doubling the block length, from 15 to 31 bits and on up to 511 to 1,023. English words: to 31 13.1%, to 63 7.0%, to 127 4.5%, to 255 3.0%, to 511 1.1%, to 1023 0.6%. repetitive collection: to 31 16.7%, to 63 8.3%, to 127 9.5%, to 255 7.3%, to 511 6.5%, to 1023 5.5%. DNA: to 31 11.2%, to 63 7.0%, to 127 4.0%, to 255 2.5%, to 511 1.4%, to 1023 0.8%. protein: to 31 10.0%, to 63 6.3%, to 127 3.4%, to 255 1.8%, to 511 1.0%, to 1023 -0.4%.0%5%10%15%block length after doubling, bits (log scale)share of the levels the doubling saves31631272555111,023repetitive collectionDNAEnglish wordsprotein16,384 characters, both treessaving from the length before
Fig. 7 The share of each text’s levels saved by doubling the block length. To 63 bits: 7.0% on English words, 8.3% on the repetitive collection, 7.0% on DNA, 6.2% on protein. To 127: 4.5%, 9.6%, 4.0%, 3.4%. To 1,023: 0.5%, 5.5%, 0.8%, and on protein −0.4%.

Each doubling saves less than the one before on English words, DNA and protein, and on protein the last one costs 0.4%; on the repetitive collection doubling still saves 5.5% at 1,023 bits. The bits never ask for a shorter block on three of the four texts, and on protein they ask at 511, by a sliver. Every reason to stop lengthening is the rank’s.

Protein turns because its blocks almost never change value once and a gap code rarely wins there, so at long blocks its offsets grow much as the first coding’s did, and at 1,023 that growth finally outruns the directory’s last savings. The prediction placed random letters where protein ends up, unmoved by length. It placed them for the right kind of reason and at the wrong length.

What the counts depend on

One size of text. Each text is 16,384 characters, and its levels are a few hundred thousand bits; at 1,023 bits a block a level holds a few hundred blocks and the directory’s share is small. A longer text would have more blocks at every length and the same per-character costs, except where the last block’s rounding matters, which is at the longest lengths.

A unit of work, not a time. The rank’s work counts entries and bits read in the earlier pages’ unit. A machine decodes a gap code and an arrangement at different speeds and reads bits a word at a time; the doubling of in-block work with length is the shape that would survive, not the numbers.

One length for every level. Every level of both trees is cut at the same length. The levels differ in how often they change value, and a length chosen per level would sit at a different point of each level’s curve. The level where compression stops paying found that choosing the coding level by level saved five hundredths of a per cent on another structure; choosing the length level by level was not measured.

Superblocks of 32 blocks at every length. The superblock count falls with the block length because a superblock is a number of blocks. A superblock fixed in bits instead would keep the directory’s cost and change the work; it was not swept.

Still open: a flag that weighs the work as well as the bits

The block length now trades bits for the work of decoding inside a block, and the decoding has two costs. A block held by its arrangement must be decoded bit by bit up to the rank’s position, half the block on average; a block held by its gaps is read gap by gap, and a block that changes value a few times is passed in a few steps. The flag chooses between them on bits alone. On English words at 255 bits it holds 126 mixed blocks by their arrangement and 259 by their gaps, and the arrangement blocks are most of the in-block work.

A flag could weigh both. Charge each mixed block its bits plus a price for every unit of work a rank inside it costs, and take whichever code is cheaper at that price. At a price of nought this is the flag measured here; at a high enough price every mixed block takes its gaps. That end is already countable: on English words at 255 bits, giving every mixed block its gap code halves the in-block work, from 28.0 a rank to 12.9, and costs 0.186 bits a character. At 63 bits the same forcing costs 0.344.

The measurement that follows sweeps the price at every block length and draws each length’s curve of bits against work beside the curve this essay drew by changing the length. The prediction is that the two families of curves nearly coincide, so that a 255-bit block with a work-weighted flag reaches the 127-bit block’s work for about the 127-bit block’s bits, and no setting of the price beats simply choosing a shorter block by more than a hundredth of a bit a character. It could come out otherwise if the arrangement blocks that cost the most work are the ones whose gap codes are nearly as short: then a small price would buy most of the halving for little, and a long block with a weighed flag would dominate the short blocks on both counts. The question is whether the block length is the only dial the levels have left, or whether the flag, which took the optimum away, can also set where on the curve the levels stand.

Named alongside this one

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

The objects this essay names

Each one links to every other essay that touches it.

Bidirectional indexCompressed bit vectorEntropyIndex sizePredictionRank querySpace accountingWavelet tree