Manuscript Offprint

arXiv:2610.09088

RippleCP: Measuring Counterfactual Checkpoint Advantage in Coding Agents

Mayur Akewar, Ravi Ranjan

Abstract

Agent checkpoint systems decide what state is recovery-relevant, how to snapshot it, and whether rollback is admissible. None decides which of the safe boundaries they expose are worth materializing. We formulate this as counterfactual checkpoint advantage, the reduction in future recovery cost obtained by checkpointing a candidate rather than skipping it, and measure it by driving a CP branch and a SKIP branch to the same logical failure and recovering both under matched model, tool, verifier, and stopping conditions. On a frozen pilot of 12 SWE-bench Verified tasks and 106 real recovery branches, checkpointing saves 49.4 s per task, and that figure resolves into two regimes two orders of magnitude apart. The first checkpoint returns 100.0 s on 156.5 s of protected work, a conversion of 0.64; a second one step later returns -1.1 s on 41.8 s, a conversion of -0.03. Recovery is a re-derivation rather than a replay, so preserved work is a poor guide to saved work, and the classical elapsed-work rule misprices the second checkpoint by its full nominal cost. We identify where placement can pay, and set the bar a placement policy must clear.

1 Introduction

Long-horizon agents increasingly behave like stateful systems: they alternate model calls with shell commands, file edits, tests, external tools, retries, and pauses. A late crash can force substantial re-execution, and a growing set of runtimes makes checkpoint and restore for such agents practical. CRAB detects recovery-relevant OS effects [1], DELTABOX targets low-latency sandbox rollback [2], and DART reasons about semantically admissible recovery points [3]. Each of them answers where a checkpoint may be taken. None answers where one should be: among the safe boundaries a runtime exposes, which are worth paying to make durable?

Classical placement answers that by trading checkpoint overhead against expected recomputation [4], which presumes recomputation cost is known. For agents it is not. Downloading a gigabyte may be cheap to repeat, while rediscovering a one-line dependency incompatibility can determine every subsequent edit, build, and test. We expect checkpoint-worthy agent state to be sparse in bytes but dense in downstream influence (Appendix I), which would make the usual proxies of elapsed work and bytes changed unreliable. Whether it does is an empirical question, and Section 4 answers it directly. Either way the quantity is one to measure rather than assume.

RIPPLECP makes it measurable. Rather than labelling a state “important,” we run two matched futures from the same candidate: checkpoint now, or skip now. Both are driven by the real agent to the same logical failure and recovered under the same model, tool, verifier, and stopping conditions, so their cost difference, the checkpoint advantage, comes from executed system behaviour rather than from an LLM judge or a human annotation. This paper reports that measurement on a frozen pilot; learning a policy from it is future work.

The result reshapes the placement question: the aggregate advantage is large, but it decomposes almost entirely into the value of having a checkpoint at all rather than of choosing where to put it. We contribute the advantage formulation, a paired-recovery harness producing labels from executed agent branches, and the pilot that separates those regimes and prices each.

References (24)