细化规范,削减代码:一种生成性文件系统案例
Sharpen the Spec, Cut the Code: A Case for Generative File System with SYSSPEC
AI总结:
本文提出SYSSPEC框架,通过生成性文件系统利用LLM生成和演变文件系统,展示SPECFS在并发性和正确性上的有效性。
摘要:
文件系统是至关重要的操作系统组件,需要不断进化以支持新的硬件和新兴的应用需求。然而,传统的开发功能、修复错误和维护系统的范式带来了显著的开销,尤其是随着系统复杂性增加时。本文提出了一种新的范式,即生成性文件系统,利用大语言模型(LLMs)从提示中生成并演变文件系统,有效解决了对稳健进化的需要。尽管LLMs在代码生成方面取得了广泛的成功,但尝试创建一个功能性的文件系统迄今为止尚未成功,主要是由于自然语言提示的歧义性。本文介绍了一个名为SYSSPEC的框架,用于开发生成性文件系统。其核心思想是用来自形式方法的原理取代模糊的自然语言。而不是模糊的提示,SYSSPEC采用一个多部分规范,准确描述文件系统的功能、模块性和并发性。规范充当一个无歧义的蓝图,指导LLMs生成预期的代码。为了管理进化,我们开发了一个基于DAG结构的补丁,作用于规范本身,使新功能的添加无需违反现有不变量。此外,SYSSPEC工具链包含一组基于LLM的代理,具有在构建和演变过程中缓解幻觉的机制。我们通过生成SPECFS,一个并发文件系统,来展示我们的方法。SPECFS在数百个回归测试中展示了与手动编写基线相当的正确性水平。我们进一步通过无缝集成10个来自Ext4的真实世界功能来确认其可进化性。我们的工作表明,一个基于规范的途径使生成和演变复杂系统不仅成为可能,而且非常有效。
英文摘要:
File systems are critical OS components that require constant evolution to support new hardware and emerging application needs. However, the traditional paradigm of developing features, fixing bugs, and maintaining the system incurs significant overhead, especially as systems grow in complexity. This paper proposes a new paradigm, generative file systems, which leverages Large Language Models (LLMs) to generate and evolve a file system from prompts, effectively addressing the need for robust evolution. Despite the widespread success of LLMs in code generation, attempts to create a functional file system have thus far been unsuccessful, mainly due to the ambiguity of natural language prompts. This paper introduces SYSSPEC, a framework for developing generative file systems. Its key insight is to replace ambiguous natural language with principles adapted from formal methods. Instead of imprecise prompts, SYSSPEC employs a multi-part specification that accurately describes a file system's functionality, modularity, and concurrency. The specification acts as an unambiguous blueprint, guiding LLMs to generate expected code flexibly. To manage evolution, we develop a DAG-structured patch that operates on the specification itself, enabling new features to be added without violating existing invariants. Moreover, the SYSSPEC toolchain features a set of LLM-based agents with mechanisms to mitigate hallucination during construction and evolution. We demonstrate our approach by generating SPECFS, a concurrent file system. SPECFS demonstrates equivalent level of correctness to that of a manually-coded baseline across hundreds of regression tests. We further confirm its evolvability by seamlessly integrating 10 real-world features from Ext4. Our work shows that a specification-guided approach makes generating and evolving complex systems not only feasible but also highly effective.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。