Linus Torvalds's first LLM-assisted patch series

(lwn.net)

104 points | by janvdberg 2 hours ago ago

75 comments

  • tarkin2 2 hours ago

    Didn't Linus say he stopped coding a while ago, or at least coding the kernel, and mainly reviews and manages the codebase now? Whether the code comes from a machine or a human, perhaps it matters little to how he's been working for a while.

    It's interesting that although I guess he reviewed this LLM generated code, the human review found a race condition.

    • DiabloD3 2 hours ago

      Yes.

      He is now the leader of a cabal of maintainers, and the only coding he does now is minor fixups for branch merging.

      I suspect he still codes his own pet projects in his off time though, that's how we got git after all.

      • projct an hour ago

        we got git 21 years ago.

        • Procrastes an hour ago

          git was good to get got. I hope something is annoying Linus as much these days as source control was then. I appreciate the way he solves problems.

          • none_to_remain an hour ago

            I believe his last one was scuba diving software

          • braiamp 44 minutes ago

            He's doing music pedal thingies. The latest LTT video was when we all "noticed"

            • Insanity 25 minutes ago

              What do you mean "noticed"?

            • unwind 23 minutes ago

              Uh you're not mixing up Linuses, are you? Haven't watched anuthing from LTT in a while but it sounded suspicious. :)

              • vshade 15 minutes ago

                No, he was guest in one episode, when Linus Sebastian built a desktop for Linus Torvalds

    • haywirez an hour ago

      e

  • niemandhier 36 minutes ago

    I looked at the diffs, they are moderately sized and well readable.

    Nothing like the 2k loc people tend to commit with LLMs.

    One can work with commits and MRs like that.

  • dorianniemiec an hour ago

    So what would many anti-AI people say, now that critical infrastructure (Linux, OpenSSL, systemd, MariaDB, and so on) is AI-assisted?

    • ASalazarMX 13 minutes ago

      You gotta understand that not all people fall neatly into the black/white sockets of culture wars, your life will be better after that.

      Many of us don't criticize the use of AI, but the MISUSE/ABUSE of it. It's one perfectly valid use case to let it generate code, and do a manual code review to make sure all of it is solid. It's the lowest of the low as a developer to ask it for a complex program, do a superficial review, and ship it claiming you did it.

      • fasterik 9 minutes ago

        Judging by comments on HN over the past month, a lot of people do fall into black/white thinking about AI. I frequently see a kneejerk rejection of the idea that AI could be useful in any context ever. Also the opposite, refusing to acknowledge any downsides or limitations of AI. I think most people have a more nuanced take, but the parent is referring to a real phenomenon of one-sided anti-AI sentiment that unfortunately is quite common in online discourse.

    • wartywhoa23 an hour ago

      There were many civilizations in the past that eagerly dug their own graves, to great success.

      • pezgordo 25 minutes ago

        Prob at a slower rate than the ones against innovation

      • fasterik 36 minutes ago

        It's not really clear what this response has to do with the parent comment, or even what point you're making. Are you saying that if we use AI in core infrastructure projects that it's going to cause the downfall of civilization?

        • amlib 23 minutes ago

          Clearly his analogy is about the usage of AI causing a downfall in the project itself. Maybe no one can understand the project anymore after thousands of AI commits. Maybe no one can contribute without having access to some fancy AI provider. Maybe the AI was using you, the developer, as a tool all along and the end game is for your project (and other FOSS projects) to be replicated under the tutelage of a few big corporations, making all FOSS projects irrelevant.

          • fasterik 19 minutes ago

            I don't think it's clear that it was an analogy at all. It sounded like a forecast of the collapse of civilization. Even if the claim is narrower, what you're saying is a prediction that can be tested against reality. It's not a foregone conclusion that a project like Linux, with strong leadership and expert eyes on every change, will fail. I suspect reality is a lot less catastrophic and a lot more mundane, and we see a small productivity increase while the project continues more or less as usual.

      • RAWGOD 39 minutes ago

        Like which? Name some civilizations that eagerly dug their own graves

        • vinyl7 37 minutes ago

          Pretty much all of the no longer existing empires. Roman empire, perhaps.

    • hnedeotes 20 minutes ago

      Like linux is some bastion of security or something... I'm everyday more convinced that the reason why linux was let to dominate the server side with no contestation was so that the USA spy network could be done without compromising american companies. This is just the follow up of the same plan.

    • kilroy123 42 minutes ago

      I, too, have this question for the anti-AI people.

      What is the game plan? Use an OS version older than 2023? Stop using tech?

    • sneezychl an hour ago

      Some people have a hard time admitting a that a few GPUs can outperform them.

      I was one of those people. Weren't we all?

      • blurbleblurble an hour ago

        Outperform? Where would those GPUs have been without Linus' prompting? Driving a car consists of brutally simple movements critically orchestrated. This isn't a GPU outperforming Linus Torvalds, it's Linus Torvalds engaging with yet another higher cybernetic order.

      • sosborn an hour ago

        I think a lot of people are stuck in 2023 when thinking about AI quality. It's gotten so much better that it's basically a totally different product now.

        It isn't perfect, but it's certainly useful.

        • xtracto 39 minutes ago

          A couple of days ago we had these flow of Rust based "reimplementation" of Adobe and Microsoft applications. A lot of people couldn't get past the "yeah but it's full of bugs, it's just SlopWare" opinion.

          These people couldn't see the forest. The writing is on the wall, that Slopware is the WORST it will ever be. 1 year ago that was unimaginable. Next year, the quality of the developed software will be way better.

          Selling "code" or "apps" is dead. My wife works in Workday and I've told her to sell as much stock as she can, because there will be an "inflection point" where ALL software based companies will collapse. The same way as Silicon Graphics, Sun , DEC and similar companies collapsed (along with a bit of IBM and HP, who pivoted) with the rise of PC power. Salesforce, SAP, Workday and all smaller companies that sell generic software will fall down.

          • ciupicri 11 minutes ago

            Why are you saying it will be way better when American companies asked their government to hit the breaks?

        • ethin 10 minutes ago

          I think the contributing factor is people who make software but have no idea what they're doing. They want to make photoshop, but they have no knowledge of photo manipulation or how photoshop works, or any software engineering/development practices. And then we wonder why slop still exists. I am of the opinion that it will always exist: people just have no idea what they want to make let alone how they want to work. "Reimplement photoshop" is a nice end-goal, but you have to actually know to a decent degree how photoshop actually works! Not to mention the reverse engineering knowledge you need

      • weberer an hour ago

        Its just inertia of people refusing to update their priors. Two years ago, most LLMs were producing absolute garbage. Even the 70b Llama 3 model would produce nonsense that wouldn't compile, make up completely imaginary API endpoints, and fail to write basic syntax. Then a year ago with Sonnet 4, we actually had something that actually worked, but needed a lot of hand holding for complex tasks. Today, they can be run with minimal supervision. By this time next year, we're going to see the hockey-stick part of the singularity really take off.

      • 1jahF 42 minutes ago

        Certain people are easily outperformed.

        • jlawrence6809 24 minutes ago

          If Linus Torvalds is being outperformed what hope is there for the rest of us?

    • 12947611 an hour ago

      They would say that it occurs at the behest of the Linux Foundation and get flagged.

    • jmclnx 39 minutes ago

      Move to OpenBSD or even more not "AI", NetBSD :)

    • Tanjreeve 44 minutes ago

      “Anti-AI” is anyone who reads code nowadays apparently so it’s about as relevant as if an IDE was used to edit the source code.

    • customguy an hour ago

      Fork all of them, work on those manually and compare in a few years. It'll be like mining Bitcoin before you know if it'll take off. If it doesn't, waste of time, if it does, they'll come begging asking you to make machine go again :P

    • nozzlegear an hour ago

      First you'd have to define what an anti-AI person is. I'm quite bearish on AI, still use it myself, and I say "big whoop." Is this supposed to be some resounding, decisive shot in the pro-AI, anti-AI war?

    • janOla an hour ago

      There's always GNU Hurd and Emacs...

  • tombert 2 hours ago

    I use AI like most software people do nowadays, but I have to admit that I'm a little surprised that Linus is onboard with it. He always felt like one of the last "old school" developers...he wouldn't even touch C++!

    • DiabloD3 2 hours ago

      Linus's policy on patch acceptance covers the LLM problem: it must still be audited by a maintainer before acceptance (and thus, actually be decent code), but also, because of LLMs, be significantly produced by a human, as machine written code cannot be Copyrighted, thus, cannot be Open Source, and thus, cannot be in the kernel because it isn't open source.

      Nobody is really against LLMs producing, for example, exploits for novel security bugs to assist security researchers in patching those bugs. The exploit itself does not need to be Copyrightable nor Open Source. Nor is anybody against LLMs accelerating debugging, and helping find the location and root cause of the bug; again, that is not producing the end product code, thus does not need to be Copyrightable nor Open Source.

      • CodeWriter23 an hour ago

        * should be everyone's policy

      • throwaway7356 an hour ago

        > as machine written code cannot be Copyrighted, thus, cannot be Open Source, and thus, cannot be in the kernel because it isn't open source.

        This is wrong.

        > Nobody is really against LLMs producing [...]

        This is also wrong. There are very vocal people against that.

        > Nor is anybody against LLMs accelerating debugging [...]

        And this too.

        • bee_rider 18 minutes ago

          >> as machine written code cannot be Copyrighted, thus, cannot be Open Source, and thus, cannot be in the kernel because it isn't open source.

          > This is wrong.

          Has this actually been litigated? It seems to one of those things where two camps think the answer is obvious, they’ve got it, but they disagree.

        • n4r9 40 minutes ago

          Who is against using LLMs to find root causes of bugs?

          • Cu3PO42 33 minutes ago

            Some people reject the use of generative AI outright. Some for moral reasons, often based on sourcing of training data, some due to environmental impact, some for concern of how society will change or even just their own job.

      • moffkalast an hour ago

        > as machine written code cannot be Copyrighted, thus, cannot be Open Source

        Including CC0 works as parts of works licensed in other ways is perfectly fine iirc? It's like WTFPL after all.

      • bbor an hour ago

        > because of LLMs, be significantly produced by a human, as machine written code cannot be Copyrighted, thus, cannot be Open Source, and thus, cannot be in the kernel because it isn't open source.

        ...that's not how copyright works. You can't poison an open source project with code that's fully and unreservedly in the public domain, if that precedent stands for much longer and if that precedent is applied to software in a way that's even vaguely analagous to how it's applied to things that judges sorta kinda understand.

        • ciupicri an hour ago

          If I'm not mistaking, you can put public domain or at least BSD/MIT code into the Linus kernel which is licensed under GPLv2. Other people are then free to use that specific code under that specific license instead of GPLv2.

          Also, Linus Torvalds wrote long time ago (before v2.6.12) some simple assembly routines in linux/include/asm-i386/string.h [1] which are public domain:

              NO Copyright (C) 1991, 1992 Linus Torvalds,
              consider these trivial functions to be PD.
          
          [1]: https://github.com/torvalds/linux/blob/v2.6.12/include/asm-i...
        • Aloisius an hour ago

          It will poison it if you replace all of your code with public domain code.

          A small patch here and there of uncopyrightable code doesn't really matter. Years of small patches, on the other hand, could end up replacing most or all the code.

          If you have the policy that all contributions have to be significantly written by a human, and thus copyrightable, you don't have to worry about whether certain files or modules or the entire project are copyrightable in the future.

    • gvfsa an hour ago

      He didn't refuse to add C++ to the kernel because he is "old school". He had a list of valid criticisms. Your comment makes it sound like his refusal to use C++ was ideology-driven and not technically-sound, and that therefore he is vulnerable to making other not technically-sound decisions such as a complete refusal to use AI.

      • forty an hour ago

        https://harmful.cat-v.org/software/c++/linus

        > C++ is a horrible language. It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it. Quite frankly, even if the choice of C were to do nothing but keep the C++ programmers out, that in itself would be a huge reason to use C.

        This kind of technically-sound and valid criticism ? ;)

        • ciupicri 44 minutes ago

          This sounds like one:

              C++ leads to really really bad design choices. You invariably start using
              the "nice" library features of the language like STL and Boost and other 
              total and utter crap, that may "help" you program, but causes:
              
               - infinite amounts of pain when they don't work (and anybody who tells me 
                 that STL and especially Boost are stable and portable is just so full 
                 of BS that it's not even funny)
              
               - inefficient abstracted programming models where two years down the road 
                 you notice that some abstraction wasn't very efficient, but now all 
                 your code depends on all the nice object models around it, and you 
                 cannot fix it without rewriting your app.
          • kllrnohj 34 minutes ago

            I don't see anything in those criticisms that are remotely unique to C++.

            Linux also built up inefficient abstractions in C that are used simply because they are easy to use. Linked lists being a go-to default choice being an obvious example.

        • forty an hour ago

          I want to keep this parallel between C++ and LLM and replace in this quote

          > LLM is a horrible tool. It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it. Quite frankly, even if the choice of not allowing LLM were to do nothing but keep the vibe programmers out, that in itself would be a huge reason not to use LLM

          That actually sounds right ! ;)

    • steveklabnik 2 hours ago

      I recently attended an academic computer science conference. Several people I have looked up to my entire life were there, which also gives you an idea of their age (I am 40). They're all using AI. They are not mindless boosters about it, but clearly find it a useful tool in the toolbox.

      • AnotherGoodName an hour ago

        On the flip side my nephews who don’t really code (i try to teach them but they are kids with everything that comes with that) go around stating things like ‘do you use ai lol!? It’s so bad!!’.

        The ai discourse is reasonably fine on HN but as soon as you go outside of actual developer circles keep in mind that my young nephews and their ilk are posting memes and criticisms without real understanding. I hope they’ll catch on soon but for now be prepared to see a whole lot of ‘Linus using vibe code Linux going to crash lololol’ type of posts in the non-developer communities for a while.

    • furyofantares 2 hours ago

      I would guess Linus has reviewed more code than anyone else in the world, so in that sense I'm not that surprised.

      I also don't think the C++ thing was out of a stubbornness for the old way of doing things, but had concrete reasons to reject it. I guess it was a little of both maybe 20 years ago.

      But there's Rust in the kernel now too.

    • p2detar 2 hours ago

      Stephen Wolfram also looks favorable to using AI in programming and he has been programming a lot. I guess the context of how these tool are used is the important part here.

  • manbash an hour ago

    > The code, the test programs, the review behind the list above and the first draft of this text were done with an LLM coding assistant (Claude Code) under my direction. The measurements were run on my machine.

    (From the empty commit message put at the top of the draft LLM branch: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...)

  • eikenberry 42 minutes ago

    While I'm not surprised by Linus using AI, I am a bit surprised Linus used Claude and not one of the open weights models. I know he's always been much more pragmatic than Richard but using a fully closed, proprietary system that is actively attempting to lock out the (more) open competition seems to go against his general history and preferences for free software.

    • ACS_Solver 35 minutes ago

      I am not surprised - the general pattern with Torvalds seems to be that he's maximally pragmatic. His problems with say Nvidia drivers aren't the fact that they're proprietary, it's that they are difficult to interface with the kernel. I have a strong impression that what matters to Linus is software that works well, so he cares a lot about the quality of the kernel and ideally wants other software to be similarly reliable.

      If he judges that Claude does the best job, it'd be very much like him to use Claude. It would be unlike him to use an open program if he considers it inferior.

    • tonis2 38 minutes ago

      Because the code complexity/quality claude vs open-models can currently write is day and night. I like open-source too, but it's just not there yet.

      • mcbuilder 34 minutes ago

        At the same time I'd rather an experienced dev with an open weight model vs a junior dev with Claude. I assume the experienced dev has good domain knowledge and can prompt his way out of the "lower intelligence".

        I'm fine with DS Flash V4.1 in code bases I have experience in, don't really notice a huge difference other than more steering is needed.

    • ramesh31 38 minutes ago

      Did you consider he would have thoroughly evaluated the top contenders objectively and gone with the one producing the best results? Honestly I wouldn't expect anything else.

  • mono442 2 hours ago

    He could have at least written the commit messages himself. That llm yapping is annoying to read.

  • vatsachak 2 hours ago

    So many people's take away from this story is that Linus used Claude to improve the Kernel therefore anyone can.

    • atniomn an hour ago

      Don't know why you're getting hammered here. There's a clear skill factor in piloting LLMs.

      • vatsachak an hour ago

        Anything pro LLM but anti RSI gets hammered here lol. SPY is giving a little wake up call

        • BoggleOhYeah 40 minutes ago

          Given a lot of the starry-eyed reactions on HN, I’ve come to suspect that a lot of the devs here were/are primarily working on CRUD apps. That would also track with the amount of attention that Ruby articles get around here.

  • relativeadv an hour ago

    When you do it, its slop. When I do it? Its craftsmanship.

    • teekert 21 minutes ago

      For some combinations of people this is indeed true imho.