Which data, which code and which settings made this map?
GeoStack · background · bytes → id → history
Abstract¶
Pictures first. B12_v2_final_fixed.zarr is a name someone chose; it says nothing reliable about what is inside. This page builds the alternative step by step: ids that come from content, snapshots that never overwrite, history with branches and tags, commits that cannot half-happen, and products stamped with what made them. git, DVC, Icechunk and pipekit are all this one idea.
The running example¶
Identity: a name that comes from the content¶
A hash: any bytes in, one short fingerprint out
band B12
SHA-256
ce51a570eb6e4d0b0b50a4c45e370ab95c4d68f5b8dd87da82a02adf648fb406
one pixel +1
SHA-256
5d32c793384f3f313e96d34c69e57e4c450a188c36b609647d659307573e5668
63 of 64 digits differ. Hashing the band took .
Measured on a synthetic band of the running example’s size. Same bytes always give the same hash; different bytes give a different one, for every practical purpose. A hash is a name the content gives itself.
import hashlib
# id = SHA-256(bytes)
band_id = hashlib.sha256(band.tobytes()).hexdigest() # (5490, 5490) → 64 hex digitsA hash function maps any number of bytes to a fixed-length value. A good one (SHA-256, or the older SHA-1 and MD5 that git and DVC use) changes completely when one bit of input changes, and two different inputs sharing a hash is not something you will meet. An id made this way is a content address: anyone holding the bytes can recompute it and check.
Snapshots: versions that share what did not change¶
Version 1: 121 chunks
Version 2: the site window reprocessed
4 chunks changed(38, 39, 49, 50)117 are byte-for-byte the same, so they are stored once.Stored: 125 chunks, not 242
Measured in an Icechunk repository: the first commit wrote 121 chunk objects, the second added 4 (1.8 MB on top of 51.6 MB). A new version costs what changed, not a copy.
A snapshot is a list of pointers
snapshot E76W51X7…B12/c/3/5 chunk B12/c/3/6 chunk … 119 more
4 old chunks
still there: version 1 reads exactly as before
117 shared chunks
snapshot HDTKHFT9…B12/c/3/5 chunk B12/c/3/6 chunk … 119 more
4 new chunks
never overwrote anything
Nothing is edited in place. A change writes new chunks and a new list that points at them and at everything unchanged. Each list gets an id; that id names the whole state of the data.
The rule that makes this work is immutability: a stored piece is never changed after it is written. Old versions cannot break, because nothing they point to is ever touched. The cost is that deleted data lingers until a clean-up (expiry and garbage collection) removes pieces no snapshot points to any more.
History: branches and tags¶
History: each snapshot remembers its parent
1CECHNKR…repository created
tag v1E76W51X7…ingest 2026-06-12
HDTKHFT9…reprocess site window
branch main6XCPCASN…writer A
A tag never moves. A branch moves to each new snapshot. An id is forever.
The actual history from the test repository. Reading tag v1 returns the pixel as 3449; reading main returns 3450. Both are available at once, which is what “time travel” means.
import icechunk
import zarr
# today (icechunk 2.3)
repo = icechunk.Repository.create(icechunk.local_filesystem_storage(path))
# today (icechunk 2.3)
session = repo.writable_session("main")
array = zarr.create_array(
session.store, name="B12", shape=(5490, 5490), chunks=(512, 512), dtype="uint16"
)
array[:] = band # 121 chunks, not yet visible
first = session.commit("ingest 2026-06-12") # → snapshot id
# today (icechunk 2.3)
session = repo.writable_session("main")
array = zarr.open_array(session.store, path="B12")
array[2000:2100, 3050:3150] = reprocessed # touches 4 chunks
second = session.commit("reprocess site window") # → snapshot id
# today (icechunk 2.3)
repo.create_tag("v1", snapshot_id=first)
old = zarr.open_array(repo.readonly_session(tag="v1").store, path="B12")
new = zarr.open_array(repo.readonly_session("main").store, path="B12")Commits: all or nothing, one writer at a time¶
A commit: write everything new, then move one pointer
1
write new chunks under fresh keysinvisible: no snapshot points at them
2
write the new snapshot and its listsinvisible: no branch points at it
3
move the branch, on one condition: it has not moved since I startedone small conditional write: the commit
Crash before step 3: readers never see any of it.Two writers: the first moves the branch; the second’s condition fails ( ConflictError ) and it retries on top.
Both behaviours were checked on the test repository: discarding a session left main where it was, and the second of two concurrent writers got a ConflictError. Step 3 is the conditional PUT from the object storage page.
This is the same promise a database transaction makes (databases and catalogs), built from the only safe multi-object pattern a bucket offers (object storage). It is what lets a catalog row and the chunks it describes appear together, or not at all.
Provenance: ids on the product¶
What made this product?
datasnapshot id
HDTKHFT9…
codepipeline hash
environmentlock-file hash
settingsin the pipeline’s state
ridge
plume enhancement mapstamped with all four
Versioning the data is half the answer. A product is reproducible when every input has an id and the product records them. Same four ids in, same product out, provided the code is deterministic (seeded).
import pipekit_ops.hashing
# today (pipekit)
# h = SHA-256(stable_json(state) ‖ 0x00 ‖ weights)
recipe_id = pipekit_ops.hashing.pipeline_hash(pipeline, weights) # → 64 hex digitspipekit already computes the code half. What is missing today is writing it, with the data snapshot id, onto each output; that is the recipe stamp in the recipe registries design.
One idea, several tools¶
| Immutable pieces | A state | Movable names | Ids are | |
|---|---|---|---|---|
| git | blobs (file contents) | commit → tree of blobs | branches, tags | content hashes (SHA-1) |
| DVC | files in a cache | .dvc pointers and dvc.lock, committed to git | git’s | content hashes (MD5) |
| Icechunk | chunks | snapshot → manifests → chunks | branches, tags | generated, not content hashes |
| pipekit registry | operator, weights, metadata under <hash>/ | one registered model | tags (_tags/<name>) | content hashes (SHA-256) |
| Lock files (pixi, uv) | exact package builds | the resolved environment | — | hashes per package |
| Container images | layers | an image manifest | tags such as latest | content hashes (digests) |
One row differs. Icechunk’s ids are generated, not derived from content: writing the same band into a second repository gave a different snapshot id (measured). Its ids tell you which commit, not which bytes. If you need to prove two arrays are equal, hash them; if you need to say which state you read, the snapshot id is enough.
DVC and Icechunk together¶
The two overlap in one place only, versioning large arrays, and are otherwise good at different things. DVC versions whole files and the pipeline that made them, and ties both to a git commit. Icechunk versions an array chunk by chunk, lets it be read straight from storage, and gives writers transactions.
| DVC | Icechunk | |
|---|---|---|
| Versions | whole files, and the stages that made them | chunks of arrays |
| Tied to | git: one commit names code and data | its own history of snapshots |
| A small change costs | the whole file again | the chunks that changed |
| Reading | pull a copy to disk first | a window, straight from storage |
| Several writers | no coordination | transactions; conflicts detected |
| Knows how the data was made | yes: stages, dependencies, dvc.lock | no |
| Storage | almost anything, Google Drive included | an object store with conditional writes (S3, GCS, Azure), or local disk |
One git commit names both
git commit (tag v1 )
dvc.lock · *.dvc files
labels.csv.dvca content hash (MD5)
snapshot.jsonsnapshot DYQD9P6W…
DVC remote1 file, · Drive is fine
Icechunk repository138 objects, · an object store
DVC keeps the pipeline and the ordinary files; Icechunk keeps the array. The join is a pointer file a few lines long: to DVC it is one more output, and inside it is the snapshot id.
stages:
ingest:
cmd: python ingest.py $STORE/b12.icechunk
deps:
- ingest.py
params:
- reprocess_site
outs:
- snapshot.json: # the pointer; small, so git keeps it
cache: false
stats:
cmd: python stats.py
deps:
- stats.py
- snapshot.json # a new snapshot reruns this stage
metrics:
- metrics.json:
cache: false# --- ingest.py, the last lines ---
snapshot_id = session.commit(f"B12, reprocess_site={params['reprocess_site']}")
# a tag keeps this snapshot from being expired while git still points at it
repo.create_tag(f"dvc-{snapshot_id}", snapshot_id=snapshot_id)
pointer = {"repo": store_path, "snapshot_id": snapshot_id}
pathlib.Path("snapshot.json").write_text(json.dumps(pointer, indent=2) + "\n")
# --- stats.py: read exactly the snapshot the pointer names, never "latest" ---
pointer = json.loads(pathlib.Path("snapshot.json").read_text())
repo = icechunk.Repository.open(icechunk.local_filesystem_storage(pointer["repo"]))
session = repo.readonly_session(snapshot_id=pointer["snapshot_id"])
window = zarr.open_array(session.store, path="B12")[2000:2100, 3050:3150] # → (100, 100)Run with DVC 3.67.1 on the running example: a DVC project with a labels file and the two stages above, a local folder as the DVC remote (standing in for Drive), and the band in a local Icechunk repository. $STORE is the folder that holds it.
| Step | What happened |
|---|---|
dvc repro, then git commit and tag v1 | both stages ran; pointer DYQD9P6WW7ZXXC64SGZG; site pixel 3449 |
dvc repro again | both stages skipped: nothing changed |
set reprocess_site: true, dvc repro, tag v2 | both stages reran; pointer 981DA6145WQFHJTQE0XG; site pixel 3450 |
dvc metrics diff v1 | site mean 2001.2117 → 2002.2117 |
git checkout v1, run the stats stage | pointer back to the first snapshot; site pixel 3449 again, though the repository has moved on |
| What each store holds | DVC remote: 1 file, 22 kB. Icechunk: 138 objects, 53 MB |
DVC cannot check the array. It hashes the pointer file, not the data; an Icechunk id says which commit, not which bytes. The pointer is trusted.
dvc pulldoes not fetch it. Reproducing the work also needs access to the Icechunk store.Clean-up can break old commits. If Icechunk expires a snapshot that an old git commit points at, that commit can no longer be reproduced. The ingest stage tags every snapshot it records for that reason.
In your stack¶
Checked at geostack 343d60e, pipekit 9e86a56 and icechunk 2.3.1.
| Where | What it versions, and how |
|---|---|
| geostack: git + DVC | code and configs in git; data and results as DVC outputs with dvc.lock committed, so a commit names code and data together |
pipekit DVCDatasetVersioning | tracks a dataset’s content hash through the DVC command line (add, pull, hash); the snapshot-aware dataset of the recipe registries design is its Icechunk counterpart |
pipekit_ops.hashing.pipeline_hash | SHA-256 over an operator graph’s state and its weights: the id of a recipe |
| pipekit model registries | content-addressed entries under <hash>/, with tags as one-line files; written as separate objects, so not yet all-or-nothing |
TrainingDataset.content_hash | a hash of the dataset’s configuration; it does not change when the data behind the same path does |
| Design pages | Icechunk snapshots for collections (Level 2 collections, A, B); a transactional registry, recipe stamps and snapshot-aware datasets (recipe registries, G–J) |
Where this goes next¶
| Idea here | Shows up as |
|---|---|
| Snapshot id names a state | IcechunkGeoCatalog.open(ref=…) pins rows and chunks together (Level 2 collections, A) |
| Commit = one pointer move | CatalogTransaction (Level 2 collections, B); IcechunkModelRegistry (recipe registries, H) |
| Ids on the product | RecipeStamp (recipe registries, G), stored in the product catalog record |
| Config hash is not data identity | SnapshotDataset folds the snapshot id into the hash (recipe registries, J) |
Sources and status
Sources: the Icechunk documentation and behaviour observed in icechunk 2.3.1 with zarr 3.4.2; the git and DVC documentation, as I know them and not re-checked online for this page; pipekit at 9e86a56; geostack at 343d60e. The DVC section was run with DVC 3.67.1 and a local folder as its remote; Google Drive itself was not used. Measurements: a synthetic 5 490 × 5 490 uint16 band in a local-disk Icechunk repository, one machine. Random pixel values compress poorly, so the stored megabytes overstate a real band; the chunk counts do not depend on that. Every number and listing on the page comes from notebooks/background/versions.py; its recorded output is docs/images/background_versions/ (results.json and dvc_icechunk.json).