R296 · Infrastructure for agents at scale › Agent session hosting and control planes

Live-forking a running sandbox: cloning stateful tool sessions for agent exploration

Read the original

agent-sandboxesagent-harnessinfrastructurememory-efficiencyparallel-exploration

An agent that drives a stateful tool — an interactive shell, a design environment, a simulation engine, a tuned database — needs to branch. It wants to try three edits from the same prepared session, keep the best, and throw the others away. Today it has two ways to do that, and both are bad. It can serialise the tool's in-memory state to disk and restore it into a fresh process, which is I/O-bound and scales with the image size. Or it can relaunch the tool from scratch and replay everything that got the session into its current state.

A paper from NVIDIA (arXiv:2611.32255, 24 November 2026) proposes the third option: fork the running container the way a process forks, with copy-on-write, so the clone exists immediately and only the pages that diverge cost memory. The system is called TimeTravelContainer, the code is published under NVlabs, and the measurements come from two agentic electronic design automation flows.

Why the obvious implementations are unavailable

Live forking a container is not a new idea, and the paper is careful about what already exists. One prior system injects a kernel module to get cross-container copy-on-write page-table sharing and extends CRIU to rebuild process trees across namespaces without serialising memory, reaching 3.4× lower fork latency than stock CRIU. Another proposes an incremental checkpoint abstraction and forks from a frozen template process. A third gives each agent clone an isolated workspace through a FUSE copy-on-write filesystem — but at the filesystem level only, so live process state is not forked at all.

The first two need a custom kernel or a privileged module. That is precisely what you cannot have on a shared compute farm, in a managed cloud environment, on a laptop, or on an edge device — which is where agents increasingly run. The constraint driving this design is therefore deployment, not performance: the fast approaches exist, and they are unavailable in the environments that need them.

The mechanism: all the OS state in one userspace process

TimeTravelContainer is built on gVisor's Sentry, a userspace kernel. Sentry is a single unprivileged process that intercepts every system call and page fault from guest applications and simulates the full Linux interface — process management, virtual memory, filesystems, networking, signals. A guest process sees a complete, unmodified Linux environment, whether it is a threaded application server, a database, or a proprietary EDA binary.

That is the whole trick. Because all the operating-system state lives inside Sentry's address space rather than in host kernel data structures, container-level fork, pause, dehydrate and migrate become operations on the runtime's own in-process data. No kernel cooperation is required, and no co-design with the guest: the tool runs unmodified and the operations are invisible to it.

On Linux the runtime intercepts syscalls through seccomp and needs no hardware virtualisation at all, with an optional KVM backend available where virtualisation exists and lower syscall latency is wanted. On Apple Silicon it uses a native hypervisor backend. Windows is supported through WSL 2.

The branch model

Clones of one container form a sandbox family, organised as Git-like branches. All branches share one userspace platform instance and one page pool; each owns an independent kernel object graph — its own process tree, file descriptors, virtual filesystem, and network stack. Pages are shared until a branch writes to one, at which point the write is retired as a one-time per-page cost and subsequent accesses go through the hardware MMU with no runtime involvement. Steady-state memory overhead is therefore proportional to the pages that actually differ, not to total resident size.

Four operations sit on top of this:

There is also a copy-on-write filesystem, offered explicitly as an alternative to the git worktree isolation that software-engineering agent harnesses commonly use. The objection to worktrees is that they duplicate the entire working tree whether or not a file will be modified — fine for source code, expensive for design files, model weights, database snapshots and intermediate results.

The runtime is also extensible at the hardware-abstraction layer, with built-in support for in-container Vulkan, OpenGL and CUDA. The published consequences are a forkable graphics-accelerated Android, and GPU-accelerated local inference running inside a forkable container.

What the numbers say, and what they measure

The evaluation uses two flows: an agent driving Cadence Innovus for interactive macro placement, and an evolutionary agent driving KLayout for design-rule-check repair. These are chosen deliberately as hard cases — tens to hundreds of gigabytes resident, proprietary binaries that cannot be instrumented, shared farms without root. Hardware is dual Xeon Platinum 8270 (52 physical cores) with 755 GiB RAM.

Cloning latency. On the smaller design, checkpoint save plus load takes 86.5 seconds against 1.03 seconds to fork: 84.1×. On the larger design, 185.7 seconds against 3.01 seconds: 61.8×. The fork cost is dominated by metadata serialisation and is largely independent of resident size, which is why the bigger design does not cost proportionally more.

Memory. This is where a headline range hides the shape of the result. With six concurrent branches, sharing saves 70% and 72% on the two designs immediately after the fork, before anything has diverged. After each branch runs connectivity checks, a DRC pass and three edit-and-report cycles, the saving falls to 56% and 34%. With two branches it sits between 24% and 38%. The published "31–72%" is accurate and spans both ends of that decay. The useful statement for capacity planning is the lower end: expect roughly a third to a half, not two thirds, once branches have done real work.

End-to-end. Replacing per-candidate tool relaunch with a fork gives a steady 1.8–1.9× on the small benchmark blocks. The large multipliers come from the three bigger designs, where the largest falls from 23.7 hours to 2.5 hours across ten calls. The paper states the modest case plainly rather than burying it: on small designs the startup cost is modest and the gain is about 2×; the point of the big numbers is that multi-day runs become sub-hour experiments.

The missing measurement

Every comparison in the paper is against checkpoint-and-restore or against relaunching the tool. There is no comparison against running the tool natively.

That omission matters, because the design's cost is exactly the thing left unmeasured. A userspace kernel intercepts every syscall and page fault; the paper mentions an optional KVM backend "for lower syscall latency" and so clearly knows syscall cost is a live issue. For a workload that holds hundreds of gigabytes resident and runs proprietary binaries over many hours, a reader needs to know what fraction of throughput the sandbox costs before the forking pays for itself. There is no limitations section, and no such figure anywhere.

The second gap is scope. The results are entirely EDA. Software engineering, database administration, robotics simulation and scientific computing are named as beneficiaries in the introduction and the conclusion, and none of them is tested. The EDA choice is defensible — it is a genuinely demanding case — but "stateful tool sessions" is a broad claim resting on two tools from one domain.

Failure modes to plan for

Review checklist

Connections

See R296 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.