Search papers, labs, and topics across Lattice.
This study investigates the semantic stability of code changes in the Linux kernel by analyzing 10,117 function-level trajectories across patch revisions in the IIO subsystem. The findings reveal that while a high percentage of functions remain textually unmodified, the true semantic similarity of edited functions is maintained at a mean score of 0.990, indicating that the core purpose of the code is largely preserved despite revisions. However, the research uncovers that most semantic drift occurs in the initial review round, raising questions about the measurement tools used to assess the significance of minor edits in later rounds.
Semantic stability in Linux kernel code changes reveals that initial reviews drive most drift, challenging assumptions about later edits preserving function purpose.
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.