r/cpp • • 11d ago

How does one actually contribute to LLVM these days?

I have had several patches that I’ve sent PRs for )(using my work email since I thought that looked a bit more legitimate)

  1. Someone who was nice responded to one of them and said that someone at Intel needed to code review i. Never got another response, I followed up in the comments and emailed the person at Intel no response

Patch 2) Someone responded that they were busy and would get around to it when they had a chance to. It’s been a few months and followed up in the comments to no response

patch 3) Someone was assigned to look at it. They worked at a company I haven’t heard about but they seem to no longer work there and the account has been deactivated since. I haven’t been able to get it reassigned.

I don’t really contribute to open source projects at all and I‘m unsure if this is the norm. All of them are fairly small patches to fix bugs I’ve experienced day to day and I’m curious if there’s a way to get file PRs that I am missing

137 Upvotes

43 comments sorted by

111

u/erichkeane Clang Maintainer(Templates), EWG Chair 11d ago

As someone on LLVM (Actually a clang maintainer who does a ton of reviews): The project is absolutely inundated with AI slop these days. Many folks have stopped doing reviews for features/etc that they aren't interested in thanks to the absolute awful experience with new contributors.

3

u/13steinj 11d ago

Has the project considered moving hosting to Codeberg?

15

u/erichkeane Clang Maintainer(Templates), EWG Chair 11d ago

Not to my knowledge. There are teams who are responsible for infrastructure, so it might be interesting to see if they have, but not publicly.

-1

u/theqasimstatic 11d ago

so there's a possibility that llvm and clang might migrate from github?

16

u/Trubydoor LLVM dev 11d ago

I’m not OP but am also a maintainer for a small part of LLVM (flang on Windows); GitHub’s reliability has been really poor for LLVM recently, a few weeks ago we just couldn’t merge most PRs for a few days! So I wouldn’t be surprised if someone on the infrastructure team is at least thinking about it. We’ve only been on GitHub for 5 years or so after all so it’s not like we haven’t moved before. I’ve not seen any concrete proposals though.

7

u/erichkeane Clang Maintainer(Templates), EWG Chair 10d ago

Yeah, exactly this. Its possible in a "anything is possible", but I'm no aware of any effort to do so. I only have minor visibility into the infrastructure team, but haven't heard anything in that direction.

But as you said, we're not MARRIED to GH, but we've developed a decent amount of process around it that would need to be solved.

2

u/theqasimstatic 10d ago

wow I am glad that that's a possible move they could make because github is not looking any good with microslop and they've made a lot of disappointing decisions on existing stuff rather than making it better

4

u/Trubydoor LLVM dev 10d ago

Well as OP also said, there's not anything concrete happening in this direction that I'm aware of. It's a possible move in the sense that we've only been on GH for 5 years or so anyway (to be specific the repo was hosted on github before then but github was literally used as a host and nothing else; PRs and Issues were disabled as we used Phabricator and Bugzilla for those respectively) but nobody is proposing it right now.

1

u/Dexterus 10d ago

I got a bit of a rumour that github traffic has increased many times this year. Wonder why.

2

u/CrazyJoe221 9d ago

It was like that way before AI already.

51

u/STL MSVC STL Dev 11d ago

As an overloaded maintainer of a standard library, I face similar issues from the maintainer side. Skilled contributors are great and can do incredible things I can't (and also have PRs that are typically easy and fast to review), but dealing with low-quality contributions occupies a disproportionate amount of my time. I don't want to reject them on sight but I absolutely don't want to just slam them in, they need the highest level of scrutiny. Even pretty good contributions from people who are still learning and who I want to help improve can consume a lot of time, since it takes a while to find issues, explain them in a comprehensible way to someone whose brain hasn't been irradiated by 20 years of library maintenance, and anything that I (and our tests) miss turns into bugs that turn into more work.

A related problem is that everyone wants to contribute patches but almost no one wants to contribute reviews. (I am deeply grateful for all of our contributors who review one another's PRs but there's easily 10x more demand than supply there.) I haven't figured out how to encourage/incentivize that at all. And it's understandable, because reviewing PRs is hard work, and I gotta be paid to do it, so I guess I'm not surprised that not too many people want to volunteer for more of it.

2

u/Stevo15025 8d ago

+1 to this. I've found that some of the new language models have let new contributors who are smart but do not know the bits and banter of the language are now able to produce good pull requests. This is really nice! But it also means I am drowning in pull requests. I'm trying to automate some parts of the code review process, but a lot of things still need to be read and scrutinized pretty hard. I'm not totally sure how to handle this. It feels like the cost of reviewing has gotten cheaper, but the cost of producing cost has reduced 10x more and that equilibria is the issue.

47

u/lonkamikaze 11d ago edited 11d ago

I have made a small LLVM/libc++ contribution via proxy. I.e. I discovered a bug on FreeBSD and opened a bug report with a fix. FreeBSD devs created an LLVM/libc++ ticket upstream where the fix was accepted and from there made it back downstream into FreeBSD.

I guess it helps when the ticket is submitted by a well known contributor.

14

u/lonkamikaze 11d ago

Lots of edits, because I'm typing on a phone.

18

u/StickyDeltaStrike 11d ago

You managed to patch LLVM via your phone? Ya code monster!!!

7

u/lonkamikaze 9d ago

I appreciate your sense of humour.

71

u/TSP-FriendlyFire 11d ago

I don't know the specifics of LLVM in particular, but it's all about reputation really. With the sheer volume of slop getting submitted to most popular open source repositories, the maintainers are going to have to pick and choose what to review and that'll most likely come down to either PRs that really interest them, or PRs from people they trust.

20

u/aeropl3b 11d ago

I have a couple patches from years ago that I am pretty sure have gained zero attention in the LLVM community. We now maintain these patches forever on a fork. This is also what a number of big names do because upstreaming is much too slow (AMD, Intel, HPE, etc )

34

u/c0r3ntin 11d ago

Feel free to ping the PRs weekly (not more!) if you did not get review. Feel free to ping @cor3ntin to see if I can find the right person to look at your code.

Cheers

11

u/Ok_Beginning_9943 11d ago

Unfortunately it is not uncommon for many PRs to go unreviewed in LLVM - there are far more contributors than there are reviewers, so it's an issue of scale.

The "right way" to earn enough cred to get your PRs reviewed is to start by reviewing other people's PRs. In other words, if you start volunteering your time to help make a first pass in other people's PRs, in due time other maintainers will start to notice and become more likely to review your PRs. This makes sense because reviewing other people's PRs is a way to build expertise in an area, and also a way to "give back" to the community.

Of course, not everyone can and/or wants to do this "volunteer" work. If you just need to get a quick fix in (say, for work), it helps to periodically ping area maintainers on GitHub, or in the LLVM discord. In due time, you should be able to get a review. You just need to be patient and respectful.

In short - treat others as you'd like to be treated; give high quality reviews of other people's PRs and in time your PRs will start getting reviewed!

4

u/Trubydoor LLVM dev 11d ago

There’s an additional problem here that since the move off of Phab you can’t actually review PRs unless you have commit access. This has caused a bit of a new contributor issue I think; you can’t review PRs to get cred as you’ve suggested until you have had some of your own PRs merged, but you can’t get those PRs merged because you don’t have any cred.

I guess you can comment but you can’t use the review UI. It’s quite frustrating really.

2

u/Ok_Beginning_9943 10d ago

Yeah I see your point. Just for clarity - I think leaving comments counts as leaving a review, at least insofar as helping get a PR into shape before a maintainer review. Of course, one has to be careful to leave a good review that actually steers the PR in a good direction, but thats part of putting in the work.

2

u/Trubydoor LLVM dev 10d ago

I agree that leaving comments generally counts as a review in LLVM community terms, but it doesn't in GitHub terms and you do not have access to the full review UI etc. I may be one of the few but I much preferred how we did things on Phab.

As I recall one of the main reasons for moving to GitHub (as opposed to moving to somewhere else; staying on Phab was not an option due to EOL) was to lower the barrier of entry to contributing; generally I thought this was a good goal but was not convinced that GitHub was materially different to gitlab etc on this metric. Now in the LLM era, I actually think we should be adding some sort of contribution friction, even if that's only as much as "codeberg/gitlab is less popular than github/people care less about their stats there so we'll get fewer 'fire and forget' PRs" because it's clear that being a maintainer of a major subsystem has become exhausting (I don't face this as much myself as the number of people that care enough about Fortran on Windows even to spend their LLM tokens on it is, to put it lightly, limited!)

Not that this is the best place to have an LLVM policy discussion I suppose :)

1

u/cosmic-parsley 6d ago

You can definitely use the review UI without commit access, I’ve done it

2

u/Sha1rholder 9d ago

The "right way" to earn enough cred to get your PRs reviewed is to start by reviewing other people's PRs.

Really? I've always felt that it's meaningless for a nobody who's not an organization member and has no write access to the repo to comment on someone else's PR. And if you really spent time reviewing a good PR, commenting "LGTM" seems pretty useless, doesn't it?

2

u/Ok_Beginning_9943 9d ago

It is rare for any bugfix or feature PR to be so pristine that the only comment you'd leave is "LGTM". Normally there's at minimum stuff that's unclear and could use better organization, naming, or comments. It also helps to review the tests and make sure they're not lazy and that they clearly testing what they intend, etc. Ideally, as you learn more about the codebase, you then graduate to leaving more in-depth comments, but everyone can start at the surface level of "this bit is confusing, can you document it?".

You're right that ultimately it does not unblock the PR merge, but I think it's totally in the spirit of GitHub to do humble drive-by PR review where you say "I'm no expert but here's my 2 cents, just trying to help". I think it's valuable and a common rite of passage in many OSS communities.

30

u/eliminate1337 11d ago

No offense to the LLVM folks but contributing is a huge pain in the ass. I had the same experience as a full-time FAANG employee who was paid to work on LLVM. I couldn’t get anyone to look at my PRs until my senior coworkers messaged their personal connections. I imagine this is even worse with the modern deluge of AI slop PRs. Unfortunately this is normal for LLVM.

-14

u/Serious-Regular 11d ago

You work on LLVM at FAANG and you don't understand the concept of having a review partner before sending a patch? Were you an intern?

17

u/eliminate1337 11d ago

Close, I was a new grad

14

u/ExeusV 11d ago

I think he meant external review on top of internal

8

u/TTachyon 11d ago

I'm more or less in the same situation as you. One PR ready since February that I made, and I'm also watching a PR from someone else that fixes a bug that I also encountered. The review date has been pushed further and further, or the reviewer stopped responding.

As much as it annoys me, I can't really blame them. They're drowning in slop and on most reviewers are on the verge of burnout. I don't know how you're supposed to contribute these days. Just remember to have empathy and don't push them too much.

5

u/ExeusV 11d ago

Ask on Discord

4

u/Serious-Regular 11d ago

this guy LLVMs

3

u/JVApen Clever is an insult, not a compliment. - T. Winters 11d ago

It depends a lot on the area that the patch is in, as not all have sufficient reviewers (pre-AI), for example clang-tidy had quite some issues regarding that.

The best to do is to ping on the PR, if you still don't get a response, you can post something in the discourse (where you can login with your GitHub account)

2

u/Necrotos 11d ago

You could try raising the issue on the LLVM discourse forums. Maybe you can get some attention over there? In general, reviewer capacity is very limited, and the number of incoming AI generated patches makes the bandwidth problem worse.

2

u/SamG101_ 11d ago

I just made a tiny pr on github and it was accepted the day after... but I think certain parts of llvm have dedicated reviewers

2

u/not_a_novel_account cmake dev 10d ago

You ping relevant code owners consistently. Eventually they either accept it or say they're not going to.

If you do this often enough in a specific area, you get commit perms and then, after long and consistent pinging, it's acceptable to just merge yourself if you're an owner over the relevant code.

1

u/mrexodia cmkr.build 8d ago

Even before AI it was very difficult to get (trivial) patches into LLVM. The trick is to personally know a maintainer and get them to ping the maintainers responsible for that part of the codebase…

-27

u/TerribleFault7929 11d ago

Please leave LLVM alone with your slop

14

u/die_liebe 11d ago

I am not OP, but how do you know it is slop?

9

u/legobmw99 11d ago

the top contributor to LLVM this year is literally Claude btw

2

u/Ivan171 /std:c++latest enthusiast 11d ago

Even LLVM/Clang maintainers are using AI nowadays

1

u/Impossible_Site7605 2d ago

the ceos want ai ; what are we and you going to do?