Engineering notes / Part 3 · State

A snapshot is not a backup.
It’s a scheduling primitive.

What 150 ms restore, 97.6% page sharing, and fork restores change about how agents can retry, branch, and resume.

Everyone benchmarks how fast a sandbox boots.

Almost nobody benchmarks the state the agent lost when it died.

That is the part I keep coming back to. A filesystem commit captures files. It does not capture the process that was halfway through a plan, the tool call it was waiting on, or the branch it had already ruled out. You restart the agent, rehydrate context, and hope the model takes the same path again.

A VM memory snapshot captures the guest: memory, device state, and rootfs. Restore is not a cold boot. The process continues.

A filesystem commit remembers paths, not a process

Filesystem state is necessary, but it is not sufficient for an agent. The interesting state is often in memory: a partially built plan, a retry counter, a connection, a parser halfway through a document.

If your unit of recovery is a filesystem, every recovery becomes a re-execution. That is expensive, and it is nondeterministic. The model may choose differently the second time.

What a memory snapshot captures

Pullrun captures guest memory, device state, and the rootfs as AES-256-GCM artifacts. Memory is cut into 64 KiB content-addressed pages, so unchanged pages are stored once.

The result is a snapshot you can restore — or fork — without rebuilding the process from a prompt.

The measurements

On a Linux KVM host with a 512 MiB guest:

  • 8,192 logical 64 KiB pages describe the guest memory.
  • The first snapshot stored 441 unique pages — 27.6 MiB.
  • A second, identical VM wrote 194 new pages; 97.6% of pages were reused.
  • Normal restore: 153 ms.
  • 9 concurrent forks: 142–483 ms each.

The 441 and 194 numbers are different measurements. 441 is the total unique page count in the first snapshot. 194 is what the second snapshot newly wrote. The reuse is (8192 − 194) / 8192.

The dedup is the point

Without deduplication, every fork copies another 512 MiB of memory. With it, the Nth fork reads the same pages. Storage stops scaling with the number of forks.

That changes the scheduling question. Instead of “restart the agent and retry,” you can branch at a decision point: one fork tries tool A, one tries tool B, and you keep the trace that worked. A snapshot becomes a scheduling primitive, not a backup artifact.

The limits, stated plainly

  • Key custody: AES-256-GCM at rest, but the key currently sits next to the store. No KMS/HSM yet.
  • Guest identity: forks inherit IP, MAC, entropy, and clock. Each gets an isolated tap/bridge, but not a new identity.
  • Capture model: storage-incremental dedup, not a capture-time delta. Taking the snapshot still takes time.
  • Format coupling: Firecracker snapshot state is version-bound.
  • Secrets: snapshots contain guest memory, so they inherit whatever secrets were in it.

A snapshot is not a backup. It is a point-in-time execution state with a specific threat model. Treat it that way.

The question

If restoring a running agent cost ~150 ms, what would you branch?

SnapshotsFirecrackerPage dedupAgents
All writing ↗

Run the runtime, not another stack.

Install Pullrun ↗
Mohammed Boukaba

AI infrastructure and systems engineer. Creator of Pullrun and Rune. Rust, Go, Firecracker, Kubernetes.

GitHub ↗