Skip to content

Refactor layer cache index#49

Merged
luke-lombardi merged 8 commits into
masterfrom
luke/layer-index-cache
Jun 11, 2026
Merged

Refactor layer cache index#49
luke-lombardi merged 8 commits into
masterfrom
luke/layer-index-cache

Conversation

@luke-lombardi

Copy link
Copy Markdown
Contributor

No description provided.

luke-lombardi and others added 8 commits June 11, 2026 12:35
Layer indexing now emits self-contained, deterministic LayerArtifacts
(ordered entry ops + gzip checkpoints + decompressed hash) that are
merged sequentially in layer order. Artifacts are cacheable via the new
LayerIndexCache interface keyed by layer digest, so unchanged layers
skip the registry pull and decompression entirely. Layers index
concurrently (default 4), root timestamps derive from the image config
created time for byte-reproducible metadata, and the content cache warm
prefers a size-aware existence check.

Co-authored-by: Cursor <cursoragent@cursor.com>
verify pushes a synthetic image (whiteouts, opaque dirs, hardlinks,
symlinks, multi-checkpoint file) to an in-memory registry and asserts
sequential, parallel, and layer-index-cached runs produce identical
output that matches independently computed overlay ground truth.
bench measures cold vs warm indexing of a real image.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Gunzip dominates indexing cost; klauspost decompression is ~30% faster
than stdlib (180 -> 234 MiB/s sequential on a 922 MiB image). bench now
reports cold-sequential vs cold-parallel vs warm with throughput, and
verifies outputs are identical across all modes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
OCI layer digests are the sha256 of the compressed bytes, so compressed
blobs can live in the content-addressed cache directly under the digest.
Indexing now reads layer bytes from the content cache when present
(verified against the digest) and warms them on registry pulls, so a
layer the cluster has seen is never re-pulled, with no path-addressed
metadata needed.

Co-authored-by: Cursor <cursoragent@cursor.com>
Indexing now emits two info lines per image (start + summary with cache
hit counts); cache hit/store/skip details move to debug, and the
content-cache existence check in the store path is compacted.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the test-flavored clip-harness layout with a cleaner package:
reference image construction and the in-memory registry live in
image.go, index runs and comparison in index.go, and the verify/bench
commands read top-down. Binary renamed to bin/harness.

Co-authored-by: Cursor <cursoragent@cursor.com>
@luke-lombardi luke-lombardi merged commit ec3ed89 into master Jun 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant