Our field note on versioning a seismic archive makes the case for a discipline we practise and recommend. Leave the terabytes where they live, record a content hash of them in version control, and pin the waveforms, the processing code and the velocity model together in one commit. That commit, not a folder called final_v3_reprocessed_USE_THIS, is what makes a Moho pick reproducible.
It then states the rule that follows: "When the data hash flips unexpectedly, that is a signal ... and every Moho pick built on the old hash is now suspect and should be rebuilt." The first half is right. At the scale the note is describing, the second half has an exact defect, and it is worth fixing before the discipline gets abandoned for being expensive.
A word on the terms first. The note gives two archive sizes, "two terabytes" and "2.4 TB", and no count of stations, files or changes. So every such count in the second exhibit below is a control, and says so. What carries the argument is counting, and the counting is exact whatever values you set.
What a pin buys
That exhibit is the note's argument made mechanical, with an upstream history that is modelled rather than recorded, as its plate says. A folder name is not wrong on the day it is written. It decays: the label still opens, and now covers several different archives. A content hash does not decay, because it identifies bytes rather than places, and every later change shows up as a mismatch. Pin three of the four ingredients and the environment's history still multiplies through, which is the note's own warning about pinning software versions too.
So the pin does its job. The question is what to do when it fires.
One file flips it
50 stations of 200 files is 10,000 files under one pin. With 1 changed, the note's rule rebuilds 50 picks where 1.00 are expected to have a changed input. At a per-file change chance of 1 in 1,000, the pin flips on 99.995% of re-fetches and a given station's inputs change on 18.1%.
The note is precise about how sensitive a content hash is: "if a single waveform sample is edited ... the fingerprint changes". Put one hash over the whole archive and that sensitivity applies to the whole archive. One changed file anywhere flips it.
Now apply the rule. A receiver-function Moho pick at one station is built from that station's event windows and nothing else. A single changed file therefore affects exactly one station's pick. The rule rebuilds all of them. On a 50-station archive that is a 50-fold over-rebuild, and on an N-station archive it is N-fold. There is no probability in that statement. It is what happens every time the pin flips on one file.
More changed files close the gap slowly. Ten changes placed at random touch 9.15 stations on average, so the rule still rebuilds 5.5 times more than it needs to. At 50 scattered changes, 31.8 stations are touched and the rule rebuilds 1.6 times what it should.
And it flips nearly every time
The second half of the exhibit asks how often the pin flips at all. If each file has some small chance of changing on a re-fetch, the pin survives only if every file survives, so it flips with probability 1 minus (1 minus f) to the power k, over k files.
That expression is unkind to large archives. At 50 stations of 200 files, 10,000 files in all, and a 1 in 1,000 chance per file, the archive pin flips on 99.995% of re-fetches. The chance that a particular station's own 200 files include a change is 18.1%. So on an average re-fetch the rule rebuilds everything, and on the same re-fetch about one pick in five had a changed input. That is a 5.5-fold over-rebuild as the normal state of affairs, not an edge case.
The note names re-downloading from a data centre as a typical cause of a flip. A file's bytes can change on a re-download for reasons that leave its samples untouched, such as records packed differently. The pin cannot distinguish that from an edited sample, because distinguishing things is not what a content hash is for.
A warning that fires on 99.995% of occasions is not a warning. A team facing it has two choices, and both are bad: rebuild every pick after every re-fetch and pay for it, or stop reacting to the flip, at which point the discipline has quietly ended.
The information to scope the rebuild already exists
The fix is not a different hash. It is asking the pin a narrower question.
DVC records a tracked directory as a manifest: in its own documentation's words, the directory entry "contains the mapping of files inside (as a JSON array), identified by their hash values". So when the top-level pin flips, which files changed is already recorded. The rule discards that by reacting to the top-level hash alone.
Record, for each pick, the files it read. When the pin flips, rebuild the picks whose inputs appear among the changed files, and only those. On a single-file change that is one pick instead of fifty.
The limit of this is worth stating plainly, because it is where the argument stops. Scoping pays in proportion to how sparse the change is. At a 1 in 100 chance per file, 86.6% of stations have a changed input anyway, and per-pick scope saves little over rebuilding everything. The dense case is also the one where rebuilding everything is correct. The sparse case, one station's response corrected or one day's data re-issued, is the common one, and it is the one the archive rule gets most wrong.
The pin is also blind, in a different place
Our October piece on station responses argues the other direction, and the two belong together. There, a revised instrument response "leaves the incoming stream untouched and changes the meaning of recordings already made", and as that piece puts it, "Content-hashing works on artefacts you hold." A response fetched from a web service at run time and discarded is never hashed, so its revision changes the pick without flipping anything.
So a single archive-level pin fails both ways at once. It fires on byte changes that do not touch the pick, and it stays silent on metadata changes that do. Both have the same repair: tie each pick to the specific artefacts it consumed, including the response it applied, and ask about those.
And it is separate from our 2024 piece on reproducible subsurface models, which argued that versioning has to start in week one because lineage not captured cannot be reconstructed afterwards. That is still true, and this piece assumes you did it. The question here is what the lineage you captured should make you do when it changes.
What to do
Keep the pin. It is still the only thing that tells you the archive changed at all.
Record input lineage per result, not per archive: the list of files, with their hashes, that each pick actually read. That is small, it is written once at run time, and it turns a flip from a verdict on everything into a query.
Rebuild by lineage. When the pin flips, intersect the changed files with each pick's inputs and rebuild the intersection.
Pin the metadata you applied as an artefact of its own, the station response included, so that a revision upstream shows up as a changed input rather than not at all.
And where it is cheap, hash the decoded samples as well as the file bytes. A change to the bytes with no change to the samples is packaging, and it should not cost a rebuild.
Key takeaways
- Pinning waveforms, code and velocity model by content hash in one commit is the right discipline; the rule that every result built on a flipped pin must be rebuilt is where it goes wrong at archive scale.
- One hash over a whole archive flips on a single changed file, and a receiver-function pick reads only its own station's files, so that rule rebuilds N picks for a change that touched 1: a 50-fold over-rebuild on 50 stations, with no probability in it.
- Over k files each changing with chance f, the pin flips with probability 1 - (1 - f)^k: 99.995% of re-fetches at 1 in 1,000 over 10,000 files, while a given station's inputs change 18.1% of the time.
- A warning that fires on almost every occasion is either paid for in full every time or quietly ignored, and either way the discipline stops working.
- DVC already records a tracked directory as a manifest of per-file hashes, so the changed files are known; record each pick's inputs and rebuild the intersection.
- Scoping pays in proportion to how sparse the change is: at 1 in 100 per file, 86.6% of stations are touched anyway.
- The same pin is blind to a revised station response that never became a hashed artefact, so pin the metadata you applied as well.
Limitations
The note prints no station, file or change count, so 50 stations, 200 files each, and every per-file change chance on the plate are illustrative. The N-fold over-rebuild on a single change is exact for any N. The probabilities depend on the values chosen.
The model treats file changes as independent and equally likely. Real changes cluster: a corrected response touches every file from one station, and a re-issued day touches one file from every station. Clustering by station helps per-pick scope; clustering by day is the dense case, where scope saves little.
It assumes a pick reads only its own station's files, which is true of a single-station receiver-function stack and not of a network-wide inversion. A result that reads the whole archive has the whole archive as its lineage, and for it the archive rule is correct.
We have not measured how often a re-download from a data centre changes a file's bytes without changing its samples. The piece says only that it can, and that the pin cannot tell the difference.
The first exhibit's upstream history is modelled rather than recorded, as its plate says.
References
- Data Version Control, Internal Files, for how a tracked directory is recorded as a mapping of files to their hashes. doc.dvc.org/user-guide/project-structure/internal-files
- The other direction, a revision that changes a result without changing a byte you hold: The station response is an input you do not own.
- Why versioning has to start in week one, which this piece assumes: DVC + Weights & Biases: making a subsurface model reproducible.
- L. Zhu, H. Kanamori. Moho depth variation in southern California from teleseismic receiver functions. Journal of Geophysical Research, 2000, for the single-station receiver-function stack. doi.org/10.1029/1999JB900322




