[Paper] Fork, Explore, Commit: OS Primitives for Agentic Exploration
Source: arXiv - 2602.08199v1
Overview
The paper “Fork, Explore, Commit: OS Primitives for Agentic Exploration” proposes a new operating‑system abstraction—branch contexts—that lets AI agents run many “what‑if” explorations in parallel, each with its own isolated filesystem and process space, and then atomically commit the winning branch. By giving agents OS‑level copy‑on‑write isolation and a simple fork‑explore‑commit lifecycle, the authors aim to make agentic exploration reliable, fast, and safe for real‑world software development pipelines.
Key Contributions
- Branch Context Abstraction – a unified OS primitive that isolates both file‑system state and process groups, supporting atomic commit/rollback semantics.
- BranchFS – a user‑space FUSE filesystem that implements copy‑on‑write workspaces with O(1) branch creation, sub‑350 µs latency, and modification‑proportional commit cost (≤ 1 ms for small changes).
branch()System Call (proposal) – a kernel‑level API that spawns processes directly into a branch context, enforces sibling isolation, and implements a “first‑commit‑wins” resolution rule.- Nestable Contexts – branches can be created inside other branches, enabling hierarchical exploration trees.
- Open‑source implementation – BranchFS is released at https://github.com/multikernel/branchfs, allowing developers to experiment immediately.
Methodology
- Design of the abstraction – The authors formalized the fork‑explore‑commit lifecycle and defined the semantics for copy‑on‑write isolation of both files and process groups.
- Implementation of BranchFS – Built as a FUSE module, BranchFS intercepts file operations, stores changes in an in‑memory overlay, and lazily copies data only when a write occurs (COW). Branch creation simply allocates a new overlay, making the operation constant‑time regardless of the underlying filesystem size.
- Prototype
branch()syscall – Specified a Linux kernel extension that creates a new process group attached to a branch context, tracks its lifetime, and coordinates commit arbitration among sibling branches. - Evaluation – Benchmarks measured branch creation latency, commit time versus amount of changed data, and overhead of process isolation. Experiments were run on a standard x86‑64 Linux workstation with typical ext4 and overlayfs back‑ends.
Results & Findings
- Branch creation costs under 350 µs on average, independent of the size of the parent filesystem (e.g., a 200 GB repo).
- Commit overhead scales linearly with the amount of modified data; committing a few kilobytes of changes finishes in < 1 ms, while larger diffs incur proportionally higher but still modest latency.
- Isolation guarantees are enforced by the kernel (via the proposed syscall) and by the FUSE overlay, preventing accidental cross‑branch side effects.
- First‑commit‑wins automatically aborts all sibling branches once one branch commits, simplifying coordination for parallel agents.
- Nesting works without additional complexity: inner branches inherit the copy‑on‑write semantics of their parent, enabling deep exploration trees.
Practical Implications
- AI‑driven CI/CD – Build agents can try multiple refactorings, dependency upgrades, or test configurations in parallel, committing only the successful outcome without contaminating the main workspace.
- Automated debugging & repair – Tools that generate patches can explore many candidate fixes simultaneously, rolling back failed attempts instantly.
- Secure sandboxing – Since each branch isolates processes, developers can run untrusted code (e.g., generated by LLMs) with guaranteed filesystem and process separation, reducing the attack surface.
- Rapid prototyping – Developers can spin up “what‑if” environments on‑the‑fly (e.g., trying a new library version) without cloning the whole repo or managing Docker containers, saving time and storage.
- Integration with existing tooling – Because BranchFS is a FUSE mount, it can be layered on top of any existing filesystem, making adoption painless for existing pipelines.
Limitations & Future Work
- Kernel support is still a proposal – The
branch()syscall is not yet merged into mainline Linux, so full kernel‑enforced isolation requires a custom kernel build. - Performance under heavy write loads – While small commits are fast, the paper notes that large, write‑intensive branches could incur higher overhead due to copy‑on‑write page faults.
- Security model – The current implementation relies on user‑space FUSE; a hardened kernel implementation would be needed for high‑security environments.
- Cross‑platform portability – The prototype targets Linux; extending the concept to Windows or macOS would require substantial re‑engineering.
- Scalability of nested branches – The authors plan to evaluate deeper nesting scenarios (e.g., > 10 levels) and their impact on memory usage and commit latency.
Overall, the branch context abstraction offers a compelling OS‑level building block for the next generation of AI‑assisted development tools, bridging the gap between exploratory AI agents and the deterministic world of operating systems.
Authors
- Cong Wang
- Yusheng Zheng
Paper Information
- arXiv ID: 2602.08199v1
- Categories: cs.OS, cs.DC
- Published: February 9, 2026
- PDF: Download PDF