Linus Torvalds slams AI‑filled Linux patch

Linus Torvalds rejected a 41,000‑line AI‑generated Linux patch and warned developers the fix could spawn new bugs, costing maintainers time and stability.
Linus Torvalds slams AI‑filled Linux patch — Image: cybernews.com

The massive AI‑driven pull request

The EXT4 subsystem of the Linux kernel was hit with a pull request that inserted more than 41,000 lines of code during the 7.4‑rc5 development phase. Marketed as a set of bug fixes, the bulk of the changes came from an AI‑assisted generation tool rather than hand‑written edits. Although Linus Torvalds eventually merged the patch, he later called the sheer size "thousands of insertions" that risk concealing fresh defects.

Torvalds noted that the submission arrived late in the release cycle, a moment when developers have little time to run exhaustive validation before the merge window closes. The timing, he argued, makes it difficult to guarantee that the new code will not destabilise the kernel.

Torvalds’ blunt reaction

On the kernel mailing list, Torvalds expressed clear irritation, writing, "Stop thinking that you – or AI – never add bugs when you fix something." He warned that even well‑intentioned fixes can introduce subtle regressions, especially when they are generated en masse by an algorithm. The veteran creator described the episode as "idiocy" and said he would ignore a similar submission in the future.

His comments emphasized that developers must not assume AI‑generated patches are automatically clean. "If the bugs were subtle things that have been around for a while without being detected by AI, the fixes by definition are fixing something subtle and rare that nobody has noticed until now," he added.

Testing on a separate branch

Veteran developer Theodore Ts’o suggested that adding KUnit tests would make it safer to validate AI‑generated patches. Torvalds echoed this advice, insisting that any new development and test cases should live on a separate branch before being merged during the official merge window. He argued that isolated testing prevents accidental side‑effects from spilling into the main code line.

The recommendation reflects a broader practice in kernel development: rigorous pre‑merge testing isolates potential faults, allowing maintainers to catch issues early. By keeping AI‑assisted changes off the main branch until they pass automated checks, the community can avoid the cascade of bugs that Torvalds warned about.

Torvalds’ evolving stance on AI tools

Initially skeptical, Torvalds described the AI‑coding market in October 2024 as "90 % marketing and 10 % reality." By late 2025 he softened his tone, calling AI‑assisted coding a "wonderful way to find joy in programming" for newcomers. He later labelled AI a "gateway drug," acknowledging that he uses the technology for personal toy projects while stressing that it remains merely a tool.

He also warned that "the AI slop people aren’t going to document their patches as such" is an obvious truism, underscoring the need for clear documentation when AI contributes code. This nuanced view shows he is open to learning applications but rejects careless, undocumented submissions.

Impact on Linux contributors

The episode sends a clear signal to kernel contributors: AI‑generated fixes must be treated with the same scrutiny as any human‑written patch. Developers who rely on large, automated changes now face the prospect of extra review cycles, additional testing, and possible rejection if they bypass the recommended branch workflow.

For maintainers, the risk is tangible. Undetected bugs can propagate through downstream distributions, forcing time‑consuming back‑ports and security patches. The cost is not only in developer hours but also in the stability expectations of enterprises that depend on a reliable Linux kernel.

Broader message for the open‑source world

Torvalds’ outburst highlights a growing tension between rapid AI code generation and the meticulous quality standards of open‑source projects. As more developers experiment with large language models, the community may need to codify new contribution guidelines that mandate isolated branches, thorough testing, and explicit documentation.

If the kernel’s gatekeepers enforce these practices, AI could become a productive assistant rather than a source of hidden defects. The debate sparked by a 41,000‑line patch therefore serves as a litmus test for how the wider open‑source ecosystem will balance innovation with reliability.

More on this

hello world!
© 2026 The Watched Citizen. All rights reserved.
menu