Linus Torvalds just used AI to help fix a Linux kernel bug.
Let me tell you that this is a rare event. Not because Torvalds is using AI. Last Christmas holidays, Torvalds used AI for the first time for a personal, hobby project. He was averted to AI at first but made his peace with it, even for AI-assisted code contributions in the kernel project.
The event we are talking about is rare because Torvalds doesn't code on Linux kernel anymore. He is in the maintainer mode. He just reviews code and merges pull requests from various contributors to the kernel code.
So this is a rare occasion in recent time when he made a kernel patch himself. And he did that with the assistance of AI.
Fixing a one-liner bug with AI
Don't scoff at "one-line" code change. Speak to any software developer and they will telly you that often the bugs are easy, few line code changes. It's the process of finding the root cause that takes time, effort, and skills.
The bug Torvalds dealt with was in the Intel Xe graphics driver for Battlemage G21 cards. It caused GDM, the display manager, to restart endlessly.
Tracking it down with AI required 24 debug patches (did he just use "printfs?) and 18 kernel boots. Ultimately, the culprit turned out to be a single line where round_up() should have been round_down().
And this was a debug session from hell, enormously helped by an AI doing much of the grunt-work.
The AI "did the grunt work" for Torvalds by adding debug instrumentation, running analysis, and even writing the final commit message. I can feel the commit message part, it's a boring but necessary task.
But this debugging session was not all smooth sailing. Torvalds didn't just add "don't make mistakes" to his prompts. On the contrary, the AI told Linus multiple times that the problem was "impossible and unsolvable." Torvalds refused.
I suspect those things have been trained by people who may not be quite as stubborn as I am.
AI is a tool, use it effectively
This is what many people in the software industry understand. AI is just a tool and it is essentially useful when there is a capable human driving the process.
Look at the example here with Torvalds. A vibe coder with no knowledge of what's going on with the code, would have left it to AI to make decisions, and AI would have called the bug unfixable and walked away.
But Linus Torvalds has experience. He could understand what the AI was doing right or wrong. He persisted and fixed the bug.
The patch will be in Linux 7.3 and has been marked to be backported to stable kernel branches.
The creator of Linux needed 18 boots to find a one-line fix. The AI helped him get there. Although, I think he would have gotten there all by himself as well, even if it would have taken a bit longer.
There is no information available on what model or tool he used. In his personal project, where he used AI for the first time, he had used Gemini from Google. I guess he is not into local AI for now. I hope he finds enough interest and gives us a new gift after Linux kernel and Git. Wishful thinking, I know.
Source: Phoronix.
Enjoyed this update? Support independent Linux news coverage
It's FOSS has been helping people use Linux for the past 14 years. Help us stay independent from big tech. Become a Plus member, enjoy ad-free reading and get 5 eBooks.