Structures

One revision, one level

The cap ladder assumed depth is generations of copying. On a real file it is exactly that — one more revision, one more level, nine times running — plus eight levels the first revision already had before any history existed.

Take a file’s first revision. Parse it, and measure the deepest chain of copies in it.

Add the second revision, parse the pair, measure again. Then the first three, the first four, and so on to fourteen. Every point is a real file at a real moment in its history, and the collection at each step is a prefix of the collection at the next.

One more revision is one more level of depthThe worst and mean depth of the first k revisions of one real file. A single revision, with no generations of copying at all, already reaches depth 8: that is the file's own internal repetition, and it is the larger term for the first several generations. From there every added revision adds exactly one to the worst depth — 9 times in a row — until the twelfth, after which nothing gets deeper and the last revisions only add width. The mean rises steadily and far more slowly, at about 0.36 a generation, because most characters are copied from the revision before rather than through the whole chain.05101520510revisions in the collectiondepthone revision alone: 8worst depthmean depthfourteen revisions of another9 generations added exactly one
Fig. 1 The worst and mean depth of the first k revisions of one file. The horizontal rule is what a single revision reaches on its own, with no history at all.

The result is as clean as anything measured here. One more revision, one more level of depth, exactly, nine times in a row.

The increment

The numbers: one revision alone reaches depth 8. Two reach 10, three 11, four 12, and then 13, 14, 15, 16, 17, 18, 19 — one per generation through the eleventh — and then it stops.

The claim the cap ladder made was depth is generations of copying, and as an increment that is exactly right. A character that survives from revision k to revision k+1 is copied from revision k, so its depth is one more than it was. A passage that survives the whole history collects one level per revision, and the deepest chain in the collection is the oldest surviving passage.

That is a very specific thing to be true, and it is worth pausing on how easily it could have been false. If the parse preferred a recent source over an old one when both were available, the depths would stay flat as the history grew: the longest match would be found in revision k rather than in revision 1, and the chain would be short. If the parse preferred the earliest occurrence — which is what this one does, because a suffix automaton’s state hands back the earliest end position it has seen — the chain runs all the way back.

So the increment is a property of the parse as much as of the history. The parse in one pass of the text is the construction, and the choice of the earliest occurrence is not an optimisation: it is what makes the parse reproducible, and it is what makes depth mean “how long has this survived”.

The offset nobody wrote down

The other half of the measurement is the part the ladder’s sentence misses, and it is larger than the part it got right for the first several generations.

A single revision already reaches depth 8. One document, no history, nothing copied from anything: eight levels, from the file’s own internal repetition. Two revisions reach 10, not 1 or 2.

So the honest form of the claim is

depth of a k-generation history = k + what one document had on its own

and on this file the second term is 8, on another it is 9, and on twelve unrelated essays with no history at all it is 15. The offset is not a correction; at k = 4 it is twice the term the ladder was about.

That matters for a cap directly. Somebody choosing a cap from the ladder’s sentence would reason: this file has twenty revisions, so set the cap at twenty. The measurement says: set it at twenty plus eight, and the eight is not a property of the history at all — it is a property of the file, and a system that knows how many revisions it holds does not know it.

One more revision is one more level of depthThe worst and mean depth of the first k revisions of one real file. A single revision, with no generations of copying at all, already reaches depth 9: that is the file's own internal repetition, and it is the larger term for the first several generations. From there every added revision adds exactly one to the worst depth — 4 times in a row — until the twelfth, after which nothing gets deeper and the last revisions only add width. The mean rises steadily and far more slowly, at about 0.36 a generation, because most characters are copied from the revision before rather than through the whole chain.051015246810revisions in the collectiondepthone revision alone: 9worst depthmean depthten revisions of one file4 generations added exactly one
Fig. 2 The same curve on a second file. The offset is nine, the increments are less regular, and the shape is the same: a constant, plus one per generation.

Where the offset comes from

It comes from the same place the essays’ depth comes from, which is ordinary repetition.

A file of five thousand characters contains its own boilerplate: the same identifiers, the same indentation, the same three-line pattern repeated. Each of those is a copy of something earlier, and if the earlier thing was itself a copy, the chain lengthens. Nothing in that is a version history; it is what any text does.

The reason the offset is eight rather than three is that repetition compounds. A phrase copied from a phrase copied from a phrase produces depth 3 from three copies of a passage — and a file with a dozen recurring constructions in it, each recurring a dozen times, produces chains of the length measured here without anything unusual happening.

The depth profile of a real version historyEvery position of twelve unrelated essays — 144,617 characters — placed at the number of copies an extraction has to follow to produce it. The shape is a bell with a peak at 5, holding 21.1% of the collection, and a thin tail out to 15. Drawn behind it is ten revisions of one file, which is not a version history and has no generations of copying at all: its mean depth is 5.71 against this one's 5.17. Whatever produces depth in real text is mostly not what the cap ladder was about, because it is here in full when generations are absent.02468101214mean 5.17depthshare of the collectiontwelve essaysten revisions144,617 characters · 21,166 phrasesworst 15, mean 5.17
Fig. 3 The clearest evidence that the offset is the file rather than the history: twelve unrelated essays, no generations at all, mean depth 5.17 against a ten-revision history’s 5.71.

That is the finding the shape of a real history’s depth records, seen from the other end. There, the point was that depth exists without generations. Here, the point is that it is already there at the first generation, so the history’s contribution has to be measured as an increment rather than as a total.

Why the increment is worth having as an equality

A trend and an equality are different kinds of evidence, and this collection has been careful about the difference before.

A trend — depth grows with generations — is compatible with almost anything: growth that flattens, growth that accelerates, growth with a coefficient of a tenth. It cannot be used to set a parameter, because it does not say what to set it to, and it cannot be refuted by a measurement that is a bit off.

An equality can. Each revision adds exactly one level is refuted by a single generation that adds two, or none, and nine consecutive generations satisfying it is either the mechanism or a coincidence with a probability worth writing down. It also predicts: the twentieth revision of this file will reach depth 27 unless the chain saturates first, which is a claim somebody can check.

That is the same reason measured, not asserted is the first theme in this collection, and the same reason the fits here are refused rather than rounded. A curve that “looks linear” is a description. A curve on which every step is exactly one is a mechanism, and the difference is what makes the offset visible at all — if the increments had been ragged, nobody would have noticed that they started from eight rather than from zero.

What a system would need to know

There is a practical version of this, because the cap is a parameter something has to set.

To set it from the ladder’s sentence, a system needs the generation count, which it knows: a version-controlled file knows how many revisions it holds. To set it from this page’s equality it needs the generation count and the offset, and the offset is a property of the content that no metadata carries.

The offset is cheap to measure — parse one document, take the worst depth, four milliseconds on a five-thousand-character file — but it has to be measured on something, and the natural candidate is the first revision, which a system indexing a history has in front of it. So the rule is implementable: parse the base, add the number of revisions, cap there.

What it cannot do is generalise across files. Eight here, nine on the second history, fifteen on twelve unrelated essays: the offset is a property of one file’s internal repetition and there is no constant that covers a collection of different things. A system holding many histories would have to measure each, or take the worst, or accept that the cap binds harder on the files with more internal structure — and that last option is the one that costs phrases silently, which is the failure this collection’s cap essays exist to make visible.

What the parse’s own choices contribute

One more control is worth stating, because “depth” sounds like a property of a text and is a property of a text and a parse.

The parse here is greedy: at each position it takes the longest match available, and among equal matches the earliest source. Both choices push depth up. A parse taking the latest source would find its match in the most recent revision every time, and the chain would be one hop long — depth would be nearly flat in the generations, and the whole ladder would be about nothing.

That alternative is not hypothetical: it is the one a compressor with a sliding window produces, because an old occurrence has fallen out of the window and only the recent one is available. So a version history compressed with a windowed coder has shallow depths and a windowed coder has a worse compression ratio, and the two facts are the same fact.

A parse that will not follow a long chain is the essay that makes the trade explicit by capping the depth directly rather than by shrinking the window. What this page adds is the measurement of what the uncapped, earliest-source parse actually produces on a real history — which is the left-hand end of that trade, and had never been drawn on anything but a model.

What the mean does instead

The worst depth grows at exactly one a generation. The mean grows at 0.36.

From 3.19 at one revision to 7.92 at fourteen — a rise of 4.73 over thirteen added generations. That gap between 1.00 and 0.36 is the shape of the collection stated as two numbers, and it says something a histogram alone does not.

If every character survived every revision, the mean would grow at 1.00 too: the whole collection would move down one level per generation. It grows at a third of that because most characters do not reach back through the chain. A character in revision 12 is usually copied from revision 11 — the nearest previous occurrence of the passage it belongs to — and only the passages that are stable and old accumulate the full chain.

So the mean rising at 0.36 means roughly a third of the collection at any moment is old, stable text, and the rest is either new or recently touched. That is a statement about how a file is edited, extracted from a parse that knows nothing about editing.

The depth profile of a real version historyEvery position of fourteen revisions of another — 174,282 characters — placed at the number of copies an extraction has to follow to produce it. The shape is a bell with a peak at 8, holding 11.6% of the collection, and a thin tail out to 19. Drawn behind it is a generated collection, which is not a version history and has no generations of copying at all: its mean depth is 4.63 against this one's 7.92. Whatever produces depth in real text is mostly not what the cap ladder was about, because it is here in full when generations are absent.024681012141618mean 7.92depthshare of the collectionfourteen revisionsthe model174,282 characters · 3,462 phrasesworst 19, mean 7.92
Fig. 4 The distribution behind those two numbers, with the generated collection behind it: a bell whose peak moves right as generations are added, and a model whose peak does not move at all.

The saturation

At the twelfth revision the worst depth stops at 19 and does not move again.

That is not the history ending — there are two more revisions in the collection, and the collection keeps growing — and it is not a limit of the parse. It is the oldest passage’s chain ceasing to extend, and there are two ways that happens.

The first is that the passage is edited. A chain from revision 1 to revision 12 breaks the moment somebody rewrites the line it runs through; after that the deepest surviving text is younger.

The second is subtler and is what happens here. A passage that appears in every revision has many previous occurrences, and the parse takes the earliest — so the chain from revision 14 does not run 14 → 13 → 12 → … → 1, one hop per revision. It runs to the earliest occurrence directly, and the depth is set by whichever route the greedy parse actually took at each position. Once the collection contains enough copies, the phrase boundaries stop aligning generation by generation and the chains flatten.

Either way, the practical consequence is the useful one: a long enough history saturates, so a cap set at the saturation depth is free for every future revision as well. That turns a cap from a parameter that has to grow with the collection into a constant, which is exactly the property a system wants from one.

Where each collection stops paying for its capThe knee: the smallest cap whose phrase count is within a twentieth of the free parse's. The cap ladder reported four to eight, on a generated collection at 8,192 characters. On real text it is nine to twelve, and the two version histories are the slowest — which is what one would expect once the depth profile is drawn, because the knee is near the worst depth and the worst depth is the number of generations plus what one document had on its own. The row for the generated collection is the ladder's own number, re-measured here at the same size as the others.ten revisions of one filecap 10worst 14 · mean 5.7fourteen revisions of anothercap 10worst 17 · mean 7.2twelve unrelated essayscap 10worst 14 · mean 4.9eight source modulescap 10worst 78 · mean 5.9a generated collectioncap 10worst 13 · mean 4.6within a twentieth of the free parsefour to eight was the model
Fig. 5 Where each collection stops paying for its cap. The two version histories are the slow ones, and the knee is near the worst depth each of them saturates at.

What it costs to get the offset wrong

Both directions cost, and the plate says how much.

Too tight, which is what the ladder’s sentence produces: cap at the generation count, ignore the offset. On the fourteen-revision history that is a cap of 14 against a worst depth of 19, and it costs 1.7% of the phrase count. Small — because the tail is thin, and cutting the last five levels touches almost nothing.

Much too tight, which is what a reading of the ladder’s sweep produces: the ladder reported a knee at four to eight, so cap at 8. On this collection a cap of 8 costs 68% more phrases, because the mass of the distribution is at 8 and a cap there cuts the collection in half.

Too loose costs nothing in phrases and costs the guarantee: a cap of 24 on this collection is the free parse, and an extraction can follow 19 copies.

The asymmetry is worth stating plainly. Between the peak of the distribution and its tail there is a factor of forty in what the cap costs, and the peak is where a generation-counting rule would put it.

The general shape

This is the third time in this collection that a quantity has turned out to be a constant plus a term somebody was measuring, and the constant has been the larger one at the sizes anybody runs.

The others: an index’s size is a payload plus an overhead, and the overhead dominates at every size drawn — a range minimum quoted at 2n bits carries 651,800 bits of machinery against 131,072 of payload. And a search’s cost is a number of extensions times a per-extension cost, where the per-extension cost had a σ in it that nobody was counting.

Here the constant is a file’s own repetition and the term is the history. The pattern in all three is the same: a quantity gets its name from the part that grows, and at real sizes the part that does not grow is what gets paid for.

Where this sits

Four measurements make up what is known here about depth on real text, and they are best read in order.

The shape of a real history’s depth is the histogram: a bell, peaking in the middle, with a thin tail — and the finding that twelve unrelated essays have nearly the same one. This page is the same quantity as a function of the generation count, which is where the increment and the offset separate.

The deepest text is punctuation is the tail, and it is a different object entirely: a run of one repeated character produces one level per character, so the deepest positions in a collection of source files are the dashes in a comment separator rather than anything that was copied.

The cap that would ship is the parameter, set from all three: the knee on real text is at nine to twelve rather than the four to eight the earlier sweep reported, and the reason it is there is the saturation this page measured.

What is left open

Whether the increment survives a rewrite. This file was edited steadily and never restructured. A history containing one wholesale rewrite should show the chain break — the worst depth falling back towards the offset and climbing again — and that is a shape nothing here has measured, because the two histories available are both incremental.

What the offset is a function of. Eight, nine, fifteen: three files, three offsets, and no model of what predicts them. The obvious candidate is the document’s own repetition measure, and the correlation between a single document’s r or z and its worst depth is a scatter plot over a few dozen files that nothing here draws. The measure that cannot see the alphabet is a reminder that the obvious measure is not always the one that predicts.

And whether saturation is the chain breaking or the parse flattening. Two mechanisms were offered above for why the depth stops at 19, and this page does not separate them. The separation is a measurement: follow the deepest position’s chain at each generation and see whether it still runs to revision 1. That is a few lines against a structure that already exists, and it would say whether a saturated cap is a property of the file or of the parse.

What a cap costs, on five collectionsThe phrase count under a cap, as a multiple of the phrase count without one, against the cap. Every number the cap ladder published came from the generated collection, which is the line marked as such; the real version histories are far steeper. A cap of one costs 35x on fourteen revisions of another against 21x on the model, and the two collections of unrelated documents are flatter than either. The knee — the smallest cap within a twentieth of the free parse — is at 10, 10, 10, 10, 10 respectively, against the four to eight the ladder reported.110110cap on the depthphrases ÷ free parseten revisionsfourteen revisionstwelve essayseight modulesthe model5 collections · free parse = 1worst 35x at a cap of one
Fig. 6 What the offset and the increment cost when a cap is set: the phrase count under a cap, on five collections, with the histories steepest.
How many of the deep positions are a run of one characterten revisions of one file, 75,658 characters. The bars are the share of the collection at each depth and the darker part of each is the share that sits inside a run — a position whose character equals the one before it. A parse may copy from a source that overlaps it, which is what makes a thousand identical characters two phrases rather than five hundred, and it makes the depth of the k-th character of a run exactly k. So the right-hand end of this histogram is not the most-copied text in the collection: it is its longest run, one level per character.02468101214depthshare of the collectioninside a runeverything elseten revisions of one file · worst depth 14mean 5.71
Fig. 7 And the one part of the histogram this page’s arithmetic does not explain: the positions that sit inside a run, which are a different mechanism entirely.

A last note on the instrument

Every point on this page’s curve is a parse of a real collection, and there are fourteen of them — the first revision, the first two, and so on. Together that is about a million and a half characters parsed.

At the quadratic construction this strand started with, that would have been a measurement nobody would attempt. The parse in one pass of the text made it four seconds, which is the reason the curve exists at all rather than a single point with a sentence attached.

Worth saying because it is the pattern this whole strand keeps producing: the instrument arrived, the ceiling moved, and the questions that had been deferred for cost turned out to be a function call each.

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

Every essay whose body links to this one.

The objects this essay names

Each one links to every other essay that touches it.

ControlCopyCorpusDepthExtractionGenerationHistogramParsePhrase countSaturationVersion history