Repository navigation
Conversation
…opportunity) Add orchestrator.sandbox.checkpoint.change_footprint, a per-pause counter sliced by file_type (memfile|rootfs) and clean (dirty bytes <= one block), emitted from recordSnapshotDiff off data already computed every pause. The per-dimension clean rate is the filesystem-only-downgrade / skip opportunity measured on real traffic; both dimensions clean on one pause is the full-skip rate (join by sandbox/trace in the dashboard). This is the measurement a skip-unchanged feature needs BEFORE adding any mechanism: it answers how often a checkpoint is a no-op, from existing signals, with no new machinery, no in-guest agent, and no behavior change.
AdaAibaby
requested review from
ValentaTomas,
dobrac and
jakubno
as code owners
October 27, 2026 02:53
Contributor
Author
|
Related issues surfaced while building this metric:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add
orchestrator.sandbox.checkpoint.change_footprint— a per-pause counter sliced byfile_type(memfile|rootfs) andclean(dirty bytes <= one block), emitted fromrecordSnapshotDiffoff data already computed on every pause. No behavior change.Why
Agent sandboxes checkpoint constantly, and many turns change little. Whether to skip an unchanged checkpoint (or downgrade it to filesystem-only) is only worth building if the no-op rate is actually high — and today there is no metric for it.
snapshot.diff.{bytes,ratio}exist but carry the full dirty size; nothing says "this pause was a no-op," and nothing is sliced so a dashboard can read the skip opportunity directly.This counter is the measurement before the mechanism:
It needs no new machinery, no in-guest agent, no kernel features — just exposes the authoritative dirty-page count the orchestrator already derives every pause.
Context
A prior attempt to add skip-unchanged checkpoints (#2586, closed as "complex, benefits uncertain") bet on an in-guest eBPF inspector to manufacture a change signal. But the orchestrator already computes the exact dirty set per pause — the missing piece was never the signal, it was a way to quantify the opportunity so the feature can be decided on data rather than a guess. This PR is exactly that quantification, and nothing more.
Change
meters.go: new counter name + description + unit.snapshot_metrics.go: register the counter; emitAdd(1, {file_type, clean, team})inrecordSnapshotDiff; extractsnapshotDiffClean(dirtyBytes)(threshold = one 4 KiB block) as a tested helper.Caveat (documented separately)
On the destroy-path pause the
memfilediff is parented on the original template, not the previous snapshot, so its "clean" reflects the resume working set, not since-last-snapshot change. Therootfsdimension is a true diff and is unaffected. Filed separately as a baseline-semantics clarification so the metric is not misread for memory.