A 7B model on a laptop can write kernel migration rules: Qwen2.5-Coder solves 35.3 driver conversions and beats Spinfer on precision
Synopsis
When a Linux kernel API changes, driver conversions are done by hand over months, and earlier conversions are themselves reusable examples. Researchers adapted guided code generation to this task: examples are decomposed into a tree of change variants, a small local model writes one Coccinelle semantic-patch rule per variant under feedback from applying it to the examples, with deterministic repair and a compile check. On 7 migrations whose new APIs postdate all three models' training cutoffs, Qwen2.5-Coder 7B solves 35.3 conversions on average (range 32–41 over three seeds) against 1.0 when prompted directly; Spinfer solves 41 and a frontier LLM agent 66, but the local model's rules are the most precise at 0.74.
Interpretation
A 7B open code model running on a laptop can turn kernel maintainers' earlier hand conversions into Coccinelle semantic-patch rules that apply tree-wide, rather than emitting per-file edits. Such rules were previously written by experts; Spinfer infers them with dedicated heuristics, and frontier LLMs prompted to write them often produce syntactically invalid patches, with both approaches struggling when examples contain several variants of a change. On 7 migrations whose new APIs first appeared after all three models' training cutoffs, with 122 buildable held-out driver conversions, Qwen2.5-Coder 7B prompted directly solves 1.0 conversion, while with the framework it solves 35.3 on average over three seeds (range 32–41).
The pipeline splits each training example into change variants, has the model write one small rule at a time, and uses the examples themselves as tests for repeated correction. Guided code generation had previously helped an 8B model on HumanEval; here its decomposition, bottom-up generation and critic structure move to semantic patches, with training examples as the tests and the C compiler as the critic. Ablation shows that for Qwen2.5-Coder on the test set, test feedback alone changes nothing (1.0 to 1.0), adding variant decomposition raises it to 18.0, and adding minimal-edit, context, interface and hint guidance raises it to 35.3; the compile critic adds no solved conversions but lifts test-set precision from 0.48 to 0.74.
Perspective
The demonstrated scope is 7 Linux migrations whose new APIs postdate all three models' training cutoffs and 122 buildable x86_64 allmodconfig targets, with Qwen2.5-Coder 7B, Llama 3.1 8B and Gemma 3 4B run 4-bit quantised on one 8 GB laptop GPU; success requires the rule output to match the human fix exactly or as a complete subset and to compile, with no driver tests run.
Success only checks whether output matches the human fix and compiles, not runtime behaviour; correct rules that differ in form from the human fix are counted as failures, and divergent outputs were not manually labelled. Compilation covers only x86_64 allmodconfig, so breakage in other architectures or configurations would go unnoticed. The test set has only 7 migrations and three seeds per configuration, and per-migration results swing with whether one leaf rule is right, so seed ranges are reported rather than significance tests.
