arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.08199cs.OScs.DC
收藏

分支、探索、提交:用于代理探索的操作系统原语

Fork, Explore, Commit: OS Primitives for Agentic Exploration

Multikernel Technologies, Inc.(Multikernel 科技有限公司);University of California, Santa Cruz(加州大学圣克鲁兹分校)

Cong Wang, Yusheng Zheng

AI总结:

本文提出分支上下文操作系统抽象,支持并行探索路径和原子提交回滚,通过BranchFS和branch系统调用实现,提升代理探索效率。

摘要:

AI代理越来越多地进行代理探索:并行追求多个解决方案路径,并仅提交成功的路径。由于每个探索路径可能修改文件并生成进程,代理需要具有原子提交和回滚语义的隔离环境,用于文件系统状态和进程状态。我们引入分支上下文,一种新的操作系统抽象,提供:(1) 副本-on-write状态隔离,具有独立的文件系统视图和进程组;(2) 结构化的生命周期:fork、探索和提交/中止;(3) 首次提交胜出的解决机制,自动使无效兄弟分支;(4) 可嵌套的上下文用于分层探索。我们通过Linux实现分支上下文,通过两个互补组件。首先,BranchFS是一种基于FUSE的文件系统,为每个分支上下文提供隔离的副本-on-write工作区,具有O(1)创建、原子提交到父级和自动无效兄弟分支,无需root权限。BranchFS在https://github.com/multikernel/branchfs开源,附带Python集成库BranchContext,提供可用于代理探索的模式。其次,branch()是一个提议的Linux系统调用,通过可靠的终止、内核强制的兄弟隔离和首次提交胜出协调,生成进程到分支上下文。BranchFS的初步评估显示分支创建时间低于350微秒,与基础文件系统大小无关,提交开销与修改比例成正比(小修改下低于1毫秒)

英文摘要:

AI agents increasingly perform agentic exploration: pursuing multiple solution paths in parallel and committing only the successful one. Because each exploration path may modify files and spawn processes, agents require isolated environments with atomic commit and rollback semantics for both filesystem state and process state. We introduce the branch context, a new OS abstraction that provides: (1) copy-on-write state isolation with independent filesystem views and process groups, (2) a structured lifecycle of fork, explore, and commit/abort, (3) first-commit-wins resolution that automatically invalidates sibling branches, and (4) nestable contexts for hierarchical exploration. We realize branch contexts in Linux through two complementary components. First, BranchFS is a FUSE-based filesystem that gives each branch context an isolated copy-on-write workspace, with O(1) creation, atomic commit to the parent, and automatic sibling invalidation, all without root privileges. BranchFS is open sourced in https://github.com/multikernel/branchfs, along with a Python integration library, BranchContext, that provides ready-to-use agent exploration patterns. Second, branch() is a proposed Linux syscall that spawns processes into branch contexts with reliable termination, kernel-enforced sibling isolation, and first-commit-wins coordination. Preliminary evaluation of BranchFS shows sub-350 us branch creation independent of base filesystem size, and modification-proportional commit overhead (under 1 ms for small changes).

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑