@@ -293,57 +293,63 @@ warranted when performing a code review.
293293Quality
294294-------
295295
296- The minimum quality standards that any change must satisfy before being
297- committed to the main development branch are:
298-
299- #. Code must adhere to the `LLVM Coding Standards <CodingStandards.html >`_.
300-
301- #. Code must compile cleanly (no errors, no warnings) on at least one platform.
296+ Sending patches, PRs, RFCs, comments, etc to LLVM, is not free -- it takes a lot
297+ of maintainer time and energy to review those contributions. Our quality bar can
298+ be summarized with the **golden rule ** that a contribution should be worth more
299+ to the project than the time it takes to review it.
300+
301+ However, this rule is held in balance with our goal to make the LLVM project
302+ welcoming and open to aspiring compiler engineers who are willing to invest time
303+ and effort to learn and grow, because growing our contributor base and
304+ potentially recruiting new maintainers helps sustain the project over the long
305+ term.
306+
307+ Contributors who repeatedly make low-value contributions according to the
308+ standards of our maintainers will be asked to increase the quality of their
309+ contributions or cease contributing. As a community, we encourage maintainers to
310+ invest effort in reviewing work from new contributors. We label PRs from
311+ first-time contributors to set maintainer expectations on quality. However, we
312+ expect to see a growth pattern in the quality of a contributor's work over time.
313+ Maintainers can use their discretion and push back against burdensome
314+ contributions and ask contributors to meet their quality bar. In addition to the
315+ minimum guidelines outlined in thie section, maintainers can set their own
316+ quality standards using their considerable domain expertise.
317+
318+ The following is a checklist of some of the minimum quality standards that any
319+ change must satisfy before being reviewed in detail or committed to the main
320+ development branch:
302321
303322#. Bug fixes and new features should `include a testcase `_ so we know if the
304323 fix/feature ever regresses in the future.
305324
306- #. Code must pass the `` llvm/test `` test suite .
325+ #. The code should compile cleanly on all supported platforms .
307326
308- #. The code must not cause regressions on a reasonable subset of llvm-test,
309- where "reasonable" depends on the contributor's judgement and the scope of
310- the change (more invasive changes require more testing). A reasonable subset
311- might be something like "`` llvm-test/MultiSource/Benchmarks ``" .
327+ #. Code must pass the relevant regression test suites on all supported
328+ plaftorms.
329+
330+ #. Code must adhere to the ` LLVM Coding Standards < CodingStandards.html >`_ .
312331
313332#. Ensure that links in source code and test files point to publicly available
314333 resources and are used primarily to add additional information rather than
315334 to supply critical context. The surrounding comments should be sufficient
316335 to provide the context behind such links.
317336
318- Additionally, the committer is responsible for addressing any problems found in
319- the future that the change is responsible for. For example:
320-
321- * The code should compile cleanly on all supported platforms.
322-
323- * The changes should not cause any correctness regressions in the ``llvm-test ``
324- suite and must not cause any major performance regressions.
325-
326- * The change set should not cause performance or correctness regressions for the
327- LLVM tools.
337+ Our quality policy goals are captured by this quote from `Working in Public: The
338+ Making and Maintenance of Open Source Software
339+ <https://press.stripe.com/working-in-public> `_ by Nadia Eghbal:
328340
329- * The changes should not cause performance or correctness regressions in code
330- compiled by LLVM on all applicable targets.
331-
332- * You are expected to address any `GitHub Issues <https://github.com/llvm/llvm-project/issues >`_ that
333- result from your change.
341+ .. pull-quote ::
334342
335- We prefer for this to be handled before submission but understand that it isn't
336- possible to test all of this for every submission. Our build bots and nightly
337- testing infrastructure normally finds these problems. A good rule of thumb is
338- to check the nightly testers for regressions the day after your change. Build
339- bots will directly email you if a group of commits that included yours caused a
340- failure. You are expected to check the build bot messages to see if they are
341- your fault and, if so, fix the breakage.
343+ "When attention is being appropriated, producers need to weigh the costs and
344+ benefits of the transaction. To assess whether the appropriation of attention
345+ is net-positive, it’s useful to distinguish between *extractive * and
346+ *non-extractive * contributions. Extractive contributions are those where the
347+ marginal cost of reviewing and merging that contribution is greater than the
348+ marginal benefit to the project’s producers. In the case of a code
349+ contribution, it might be a pull request that’s too complex or unwieldy to
350+ review, given the potential upside."
351+ -- Nadia Eghbal
342352
343- Commits that violate these quality standards (e.g. are very broken) may be
344- reverted. This is necessary when the change blocks other developers from making
345- progress. The developer is welcome to re-commit the change after the problem has
346- been fixed.
347353
348354.. _commit messages :
349355
@@ -424,6 +430,39 @@ squashing and merging PRs.
424430For minor violations of these recommendations, the community normally favors
425431reminding the contributor of this policy over reverting.
426432
433+ Post-commit responsibilities
434+ ----------------------------
435+
436+ After landing a change, the committer is responsible for addressing any problems
437+ found in the future that the change is responsible for. For example:
438+
439+ * The code should compile cleanly on all supported platforms.
440+
441+ * The changes should not cause any correctness regressions in the ``llvm-test ``
442+ suite and must not cause any major performance regressions.
443+
444+ * The change set should not cause performance or correctness regressions for the
445+ LLVM tools.
446+
447+ * The changes should not cause performance or correctness regressions in code
448+ compiled by LLVM on all applicable targets.
449+
450+ * You are expected to address any `GitHub Issues <https://github.com/llvm/llvm-project/issues >`_ that
451+ result from your change.
452+
453+ We prefer for this to be handled before submission but understand that it isn't
454+ possible to test all of this for every submission. Our build bots and nightly
455+ testing infrastructure normally finds these problems. A good rule of thumb is
456+ to check the nightly testers for regressions the day after your change. Build
457+ bots will directly email you if a group of commits that included yours caused a
458+ failure. You are expected to check the build bot messages to see if they are
459+ your fault and, if so, fix the breakage.
460+
461+ Commits that violate these quality standards (e.g. are very broken) may be
462+ reverted. This is necessary when the change blocks other developers from making
463+ progress. The developer is welcome to re-commit the change after the problem has
464+ been fixed.
465+
427466.. _revert_policy :
428467
429468Patch reversion policy
@@ -1458,23 +1497,66 @@ permission.
14581497AI generated contributions
14591498--------------------------
14601499
1500+ LLVM's policy on AI-assisted tooling is fundamentally liberal -- We want to
1501+ enable contributors to use the latest and greatest tools available. Our policy
1502+ guided by two major concerns:
1503+
1504+ 1. Ensuring that contributions do not contain copyrighted content.
1505+ 2. Ensuring that contributions are not burdensome and exceed our `quality `_ bar.
1506+
14611507Artificial intelligence systems raise many questions around copyright that have
14621508yet to be answered. Our policy on AI tools is guided by our copyright policy:
14631509Contributors are responsible for ensuring that they have the right to contribute
14641510code under the terms of our license, typically meaning that either they, their
14651511employer, or their collaborators hold the copyright. Using AI tools to
14661512regenerate copyrighted material does not remove the copyright, and contributors
14671513are responsible for ensuring that such material does not appear in their
1468- contributions.
1469-
1470- As such, the LLVM policy is that contributors are permitted to use artificial
1471- intelligence tools to produce contributions, provided that they have the right
1472- to license that code under the project license. Contributions found to violate
1473- this policy will be removed just like any other offending contribution.
1474-
1475- While the LLVM project has a liberal policy on AI tool use, contributors are
1476- considered responsible for their contributions. We encourage contributors to
1477- review all generated code before sending it for review to verify its
1478- correctness and to understand it so that they can answer questions during code
1479- review. Reviewing and maintaining generated code that the original contributor
1480- does not understand is not a good use of limited project resources.
1514+ contributions. Contributions found to violate this policy will be removed just
1515+ like any other offending contribution.
1516+
1517+ Recent improvements in AI-assisted tooling have made it easy to generate large
1518+ volumes of code and text with little effort on the part of the contributor. This
1519+ has increased the asymmetry between the work of producing a contribution, and
1520+ the work of reviewing the contribution. In order to protect the time and
1521+ attentional resources of LLVM project maintainers, the onus is on contributors
1522+ to justify why their contributions are not burdensome and exceed our `quality `_
1523+ bar. Contributors who repeatedly send low-quality contributions to our project
1524+ will be subject to escalating moderation actions and eventually a project ban.
1525+
1526+ This policy covers, but is not limited to, the following kinds of contributions:
1527+
1528+ * Code, usually in the form of a pull request
1529+ * RFCs or design proposals
1530+ * Issues or security vulnerabilities
1531+ * Comments and feedback on pull requests
1532+
1533+ We encourage, but do not require, contributors making large changes to document
1534+ the tools that they used as part of the rationale for why they believe their
1535+ contribution has merit. This is similar in spirit to including a sed or Python
1536+ script in the commit message when making large-scale changes to the project,
1537+ such as updating the LLVM IR textual syntax.
1538+
1539+ Here are some examples of contributions that demonstrate how to apply the
1540+ principles of this policy:
1541+
1542+ * `This PR <https://github.com/llvm/llvm-project/pull/142869 >`_ contains a
1543+ proof from Alive2, which is a strong signal of value and correctness.
1544+
1545+ * This `generated documentation
1546+ <https://discourse.llvm.org/t/searching-for-gsym-documentation/85185/2> `_ was
1547+ reviewed for correctness by a human before being posted.
1548+
1549+ **References: ** Our policy was informed by experiences in other communities:
1550+
1551+ * `Rust policy on burdensome PRs
1552+ <https://github.com/rust-lang/compiler-team/issues/893> `_
1553+
1554+ * `Seth Larson's post <https://sethmlarson.dev/slop-security-reports >`_ on slop
1555+ security reports in the Python ecosystem
1556+
1557+ * The METR paper `Measuring the Impact of Early-2025 AI on Experienced
1558+ Open-Source Developer Productivity
1559+ <https://metr.org/blog/2025-07-10-early-2025-ai-experienced-os-dev-study/> `_.
1560+
1561+ * `QEMU bans use of AI content generators
1562+ <https://www.qemu.org/docs/master/devel/code-provenance.html#use-of-ai-content-generators> `_
0 commit comments