Skip to main content
Reading viewAll insights →
BLOG9 min read

The Pin Flips on One File: What a Content Hash Can and Cannot Tell You to Rebuild

The Pin Flips on One File: What a Content Hash Can and Cannot Tell You to Rebuild
Tannistha Maitiby Tannistha MaitiHead of Engineering · 2 Dec 2026
Share

Pinning a seismic archive by its content hash is the right discipline, and the usual rule that follows is that when the hash flips, every result built on it must be rebuilt. 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 every pick for a change that touched one: a 50-fold over-rebuild on a 50-station archive. Across 10,000 files at a 1 in 1,000 chance per file, the pin flips on 99.995% of re-fetches.

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

RUN 47b, RE-RUN FROM ITS OWN RECORDThe upstream history is modelled. The state count that follows from it is exact arithmetic.3DISTINCT RUNS SHARE THIS RECORDWhat the pick depends onWhat the commit wrote downwaveforms + metadata2.4 TB, DVC artefactpinned by a fingerprinta17f…c02ecovers 1 state: the one that ranprocessing codeGit, doing its normal jobpinned by a fingerprint9d4b…71aacovers 1 state: the one that ranvelocity model1-D or 3-D, DVC artefactpinned by a fingerprinte5c1…8f30covers 1 state: the one that ransoftware environmentDVC does not cover this onetracked by a namewhatever the machine has todaycovers 3 states, returns the newestRun 47b committedtoday06121824months since the run was committedLatest change, month 10.8: a deprecated call replaced through the pipeline2 silent5 would flip a hash and be seenof 7 changes since the runRun 47b is a note in a lab book: 3 different runs write this same record.pinned by a fingerprintcovered by a namechange that flips a hashchange nothing announcesnot yetNothing here is measured. The change kinds come from this article, as do the fingerprints and the 2.4 TB; the times and file names are invented.
pinned by a content hash:
Run 47b is committed at month 0, and four tracks run away from it: the waveform archive with its station metadata, the processing code, the velocity model, and the software environment. Upstream changes land on each. Pin a track by a content hash and one segment stays lit, because the fingerprint still picks out the state that went into the pick, and every later change on that track shows as a filled mark: a hash cannot absorb a change quietly. Leave a track to a folder name and every segment lights, because the label is still valid, still opens, and now covers several different archives, with hollow marks where nothing was raised. The corner counts what that costs: the distinct runs this record is consistent with, which is the product over the named tracks of the states each name has taken. The figure loads on the trap this article is about. Waveforms, code and velocity model are all pinned, exactly as the three-hash discipline asks, and 12 months on the record still matches 3 distinct runs, because the environment was never a DVC artefact and nobody pinned it. Pin it as well and the count falls to 1. Drag the months back to 0 and every option looks equally fine, which is the honest reason people never notice: a name is not wrong on the day it is written, it decays. The upstream history here is modelled; the counting that follows from it is exact.

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

THE PIN FLIPS ON ONE FILE · THE RULE REBUILDS EVERY PICK50.0xPICKS REBUILT PER PICK ACTUALLY AFFECTED1 changed file of 10,000: the note's rule rebuilds 50 picks, and 1 had a changed input.Over every placement: 1.00 stations touched, 50.00x on average. All counts illustrative; the note prints none.50 STATIONS × 200 EVENT-WINDOW FILES · TICKS ARE CHANGED FILESNOTESCOPEDTHIS RE-FETCHflippedarchive pin50picks the note's rule rebuilds1picks with a changed inputANY RE-FETCH, EACH FILE AT CHANCE f99.995%archive pin flips18.1%one station's inputs change5.5xaverage over-rebuildA pin answers "are these the same bytes?". A rebuild needs "did this pick's inputs change?". DVC's per-file manifest answers the second.changed filerebuilt under the note's rulerebuilt under per-station scopeRule quoted from the note. Station, file and change counts illustrative; the note prints none. Counting exact.

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%.

What a flipped archive-level content hash makes you rebuild. Each row is a station in a receiver-function archive and each tick a file that changed on a re-fetch. The source note's rule is that when the data hash flips, every Moho pick built on it is suspect and should be rebuilt. One hash over the whole archive flips on a single changed file, so under that rule one changed file rebuilds every station's pick, while the pick it actually touches is one: a 50-fold over-rebuild at the default of 50 stations, and N-fold in general, with no probability in it. The right-hand columns compare the two rules row by row. Below, on a re-fetch where each file changes independently with chance f, the archive pin flips with chance 1 - (1 - f)^k: 99.995% at 1 in 1,000 over 10,000 files, while each station's own inputs change 18.1% of the time. DVC hashes a tracked directory as a manifest of per-file hashes, so the scoping information already exists. The rule is quoted from the note; the note prints no station, file or change count, so every control is illustrative. The counting is exact.

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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. Scoping pays in proportion to how sparse the change is: at 1 in 100 per file, 86.6% of stations are touched anyway.
  7. 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

  1. 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
  2. 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.
  3. Why versioning has to start in week one, which this piece assumes: DVC + Weights & Biases: making a subsurface model reproducible.
  4. 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
Tannistha Maiti
Tannistha Maiti

Head of Engineering

More from EarthScan

Related research

All insights →
DVC + Weights & Biases: Making a Subsurface Model Reproducible
Insight

DVC + Weights & Biases: Making a Subsurface Model Reproducible

A Model Registry and CI/CD for Subsurface Models
Insight

A Model Registry and CI/CD for Subsurface Models

MLOps for Geoscientists: Borrowing Practices From Software, Carefully
Insight

MLOps for Geoscientists: Borrowing Practices From Software, Carefully

Stay ahead

EarthScan insights, in your inbox.

Field-tested research on subsurface and energy-transition AI. About twice a month. No noise.

We use your email only for this newsletter. Unsubscribe anytime Privacy.