arXiv:2608.10101cs.SEcs.AI2026-08

分析Linux内核代码审查中函数语义的稳定性,发现相似度高或因测量局限而非真实目的保持。

Exploring Semantic Stability Across Reviews in the Linux Kernel

论文配图:Exploring Semantic Stability Across Reviews in the Linux Kernel
图 1 · 摘自论文原文
  • 追踪10,117个函数在补丁历史中的演变轨迹,对比无关函数对作为基线。
  • 未修改函数占75.3%,导致整体相似度虚高;真正编辑过的函数平均语义相似度为0.990。
  • 初期审查阶段语义漂移明显,但主要因未修改函数增多,非编辑趋于保守。

代码审查被证明显著改变了补丁从首次提交到最终合并版本之间的代码。然而,以往研究通常只关注最终合并的补丁,而未与初始提交进行对比。本文提出一种函数级别的度量方法,追踪了Linux IIO子系统中10,117条补丁系列的函数演化轨迹,将相似度得分与无关函数对进行对比作为基线。初步观察显示相似度接近100%,但这主要是由组合效应导致:75.3%的轨迹在版本间无文本修改,贡献了100%的相似度,从而夸大了总体结果。若仅考虑有实际修改的轨迹,其平均语义相似度仍高达0.990(基线为0.909),但语义漂移主要集中于首轮审查,原因在于后续轮次中更多函数无人修改,而非编辑趋向保守。控制该因素后,仍存在统计上可检测但较小的残余效应。这一发现引发一个开放问题:接近满值的相似度是真实语义稳定性的体现,还是测量工具无法识别小范围、局部修改的重要性?本文提供首次探索,并提出未来方向。

原文摘要 · Abstract (English)

Code review is credited with substantially changing a patch's code between its first submission and the version that eventually lands. However, prior work typically studied only the final merged patch without comparing it to the first submission. We present a function-level measurement that tracks 10,117 trajectories (each function followed across the numbered revisions of one patch series) through the patch history of the Linux IIO subsystem, comparing similarity scores against unrelated function pairs as a baseline. A naive reading yields near-total similarity, but this is largely an artifact of composition: 75.3% of tracked trajectories are never textually modified between versions, contributing a trivial 100% similarity that inflates the headline. Restricting to the trajectories with a real edit, semantic purpose is still largely preserved (mean similarity 0.990 vs. a 0.909 baseline), but drift appears to concentrate in the first review round mainly because later rounds contain more functions that nobody touched, not because edits become more conservative over time. After controlling for it, a statistically detectable but small residual effect remains. This points to an open question: whether near-ceiling similarity reflects preserved purpose or a measurement tool that cannot detect the significance of small, localized edits. We present this work as a first look and outline next steps.

代码审查语义分析内核开发

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。