Large Language Models (LLMs) are consistently improving at increasingly realistic software engineering (SE) tasks. In real-world software stacks, significant SE effort is spent developing foundational system software like the Linux kernel. Unlike application-level software, a systems codebase like Linux is multilingual (low-level C/Assembly/Bash/Rust); gigantic (>20 million lines); critical (impacting billions of devices worldwide), and highly concurrent (involving complex multi-threading). To evaluate if ML models are useful while developing such large-scale systems-level software, we introduce kGym (a platform) and kBench (a dataset). The kGym platform provides a SE environment for large-scale experiments on the Linux kernel, including compiling and running kernels in parallel across several virtual machines, detecting operations and crashes, inspecting logs, and querying and patching the code base. We use kGym to facilitate evaluation on kBench, a crash resolution benchmark drawn from real-world Linux kernel bugs. An example bug in kBench contains crashing stack traces, a bug-reproducer file, a developer-written fix, and other associated data. To understand current performance, we conduct baseline experiments by prompting LLMs to resolve Linux kernel crashes. Our initial evaluations reveal that the best performing LLM achieves 0.72% and 5.38% in the unassisted and assisted (i.e., buggy files disclosed to the model) settings, respectively. These results highlight the need for further research to enhance model performance in SE tasks. Improving performance on kBench requires models to master new learning skills, including understanding the cause of crashes and repairing faults, writing memory-safe and hardware-aware code, and understanding concurrency. As a result, this work opens up multiple avenues of research at the intersection of machine learning and systems software.
翻译:大语言模型(LLMs)在日益真实的软件工程(SE)任务上持续进步。在现实世界的软件栈中,大量的SE工作被投入到开发像Linux内核这样的基础系统软件中。与应用级软件不同,像Linux这样的系统代码库是多语言的(涉及低级C/汇编/Bash/Rust);规模巨大(超过2000万行代码);至关重要(影响全球数十亿设备);并且高度并发(涉及复杂的多线程)。为了评估机器学习模型在开发此类大规模系统级软件时是否有用,我们引入了kGym(一个平台)和kBench(一个数据集)。kGym平台为Linux内核的大规模实验提供了一个软件工程环境,包括在多个虚拟机中并行编译和运行内核、检测操作与崩溃、检查日志、以及查询和修补代码库。我们利用kGym来促进对kBench的评估,kBench是一个源自真实世界Linux内核错误的崩溃修复基准测试。kBench中的一个示例错误包含崩溃堆栈跟踪、一个错误复现文件、一个开发者编写的修复补丁以及其他相关数据。为了了解当前性能水平,我们通过提示LLMs修复Linux内核崩溃进行了基线实验。我们的初步评估表明,表现最佳的LLM在无辅助(即模型不知晓错误文件)和辅助(即向模型披露错误文件)设置下的成功率分别为0.72%和5.38%。这些结果凸显了需要进一步研究以提升模型在软件工程任务中的性能。要在kBench上提升性能,模型需要掌握新的学习技能,包括理解崩溃原因并修复故障、编写内存安全和硬件感知的代码、以及理解并发性。因此,这项工作为机器学习与系统软件交叉领域开辟了多个研究方向。