|
| 1 | +# Major Change Process |
| 2 | + |
| 3 | +* [Zulip thread](https://zulip-archive.rust-lang.org/131828tcompiler/44719designmeeting20191220.html) |
| 4 | + |
| 5 | +## Summary |
| 6 | + |
| 7 | +* We want some kind of system where people advertise changes that they are making or plan to make |
| 8 | + * and the team can give high-level feedback early |
| 9 | + * and -- if we decide to go with the change -- we can ensure there is a reviewer beforehand |
| 10 | +* This document describes motivations and a specific "early draft" proposal |
| 11 | + |
| 12 | +## Motivations |
| 13 | + |
| 14 | +Proposal is to add *some* sort of notification / lightweight process before making major changes. |
| 15 | + |
| 16 | +In contrast, today there is no stated process for a "major change" beyond just opening a PR. |
| 17 | +Of course some changes get a lot of discussion before hand, but others do not. |
| 18 | + |
| 19 | +Some problems that we see with today's system: |
| 20 | + |
| 21 | +* Sometimes we get large PRs that have attempted a major change without any discussion beforehand |
| 22 | + * There may not be a reviewer with time and interest |
| 23 | + * Also reviewing without context is very difficult |
| 24 | + * There may be concerns about the technical approach or direction |
| 25 | + * Starts the discussion with "accept or reject this PR" versus "what is best approach" |
| 26 | + * On the other hand, a more concrete discussion can be more effective |
| 27 | +* Often, as a result, these PRs can sit for a very long time without any feedback |
| 28 | + * this is frustrating for everyone involved |
| 29 | +* Current "lack of system" can also be a turnoff |
| 30 | + * do a lot of work to prep PR, but can you know if that change is welcome? |
| 31 | +* Over time, a focus on PRs (versus explaining the idea) leads to |
| 32 | + * more tech debt and less overall cohesion |
| 33 | + * lack of documentation |
| 34 | + |
| 35 | +Some strengths of today's system that we would like to preserve: |
| 36 | + |
| 37 | +* Low barrier to entry, not a lot of "bureaucratic overhead" |
| 38 | +* People should be able to experiment without "authorization" before hand |
| 39 | +* We don't want a lot of overhead for the *compiler team* to manage some authorization process |
| 40 | + |
| 41 | +We would know the system is working if: |
| 42 | + |
| 43 | +* We have a better idea of what is being done and by whom |
| 44 | + * and also whether the team has approved of that direction |
| 45 | +* Major changes will be discussed before they become a PR that is up for active review |
| 46 | + * reviewers will be identified beforehand |
| 47 | +* When reviewing a PR, reviewers will have a better idea of its goals and how it fits into the bigger picture |
| 48 | +* We still have a "high throughput" system and we don't spend a ton of time on "bureaucratic overhead" |
| 49 | + * in particular we should be able to "green light" changes fairly quickly and we should do that most of the time |
| 50 | + |
| 51 | +## Initially proposed process |
| 52 | + |
| 53 | +* When considering or experimenting with a "major change", open an issue on compiler-team repo to let people know |
| 54 | + * Describe the general idea in a sentence or two |
| 55 | + * Identify mentors or reviewers, if you are working with one |
| 56 | +* These issues will be reviewed weekly and classified |
| 57 | + * New triage process? Part of existing process? |
| 58 | + > [name=Felix S Klock II] Note we already often go-over allotted time at the Thursday triage meeting. We *can* add this to the agenda, but we need to figure out what else will get de-prioritized. |
| 59 | + * Is weekly a good frequency? |
| 60 | + * mark: this is pretty high latency for some of these changes, |
| 61 | + we might otherwise merge them in a week's time |
| 62 | + Maybe that's not a bad thing though :) |
| 63 | +* Some possible outcomes: |
| 64 | + * Closed -- this doesn't seem like something we want to do |
| 65 | + * Requires design meeting -- requires a larger group |
| 66 | + > [name=Felix S Klock II] should also add "Needs RFC" as potential outcome (a more extreme variant on "Needs Design Mtg") |
| 67 | + * Deferred -- not deciding for now, or trying to find a reviewer |
| 68 | + * Approved for experimentation |
| 69 | + * once PR is ready, nominate for discussion |
| 70 | + * may request "mitigation", such as a `-Z` flag |
| 71 | + * implementor should understand that we may just decide the idea isn't worth it |
| 72 | + * Approved to land -- requires a willing reviewer |
| 73 | + * no special approval required to land, just r+ |
| 74 | +* If a "major change" PR is opened without going through this process |
| 75 | + * Close with a friendly note recommending an issue be opened (we should write a standard template with a link) |
| 76 | + |
| 77 | +## What is a "major change"? |
| 78 | + |
| 79 | +* "You know it when you see it" |
| 80 | +* If it is a major time commitment to review it, it probably qualifies |
| 81 | + * This might be beause it affects many parts of the compiler |
| 82 | + * But it might also be a narrow change with subtle implications |
| 83 | + * Or require reading up on a relevant RFC or other background material |
| 84 | +* Examples of major changes: |
| 85 | + * Allocate HIR on an arena: |
| 86 | + * Yes, because it touches a set of data structures used throughout the whole compiler |
| 87 | + * However, presuming we could find a reviewer, this would be something we'd like approve quickly within the initial triage because it is fairly mechanical and doesn't require a design meeting |
| 88 | + * Introducing chalk, nll, or polonius |
| 89 | + * Yes, replacing a major component |
| 90 | + * This kind of effort might be "redirected" to forming a working group to help lead the design and implementation |
| 91 | + * (which is of course what we have done) |
| 92 | + * Changing universally used internal APIs |
| 93 | + * Heads up, `PlaceBase::Static` is being removed, breaking every single use site of place.base: https://github.com/rust-lang/rust/pull/67000 |
| 94 | +* Grey zone, let's discuss: |
| 95 | + * Const propagation |
| 96 | + * It is major in that it is something that has been discussed quite a bit, multiple people might have ideas on it |
| 97 | + * It is low-risk because it can easily be turned off at any time |
| 98 | + * [Use the recorded types in MIR to determine generator auto-trait implementations](https://github.com/rust-lang/rust/issues/65782) |
| 99 | + * [Implement RFC 2532 – Associated Type Defaults](https://github.com/rust-lang/rust/pull/61812) |
| 100 | + * contained, but reviewing is a lot of work |
| 101 | + * Niko has rather inexcusably let this sit far too long (plans to change that) |
| 102 | + * *But* it's an example of something that's hard to schedule, and where some up-front notice might've been helpful (or could've given warning that won't have available bandwidth until later) |
| 103 | +* Examples of minor changes: |
| 104 | + * Fix some ICE |
| 105 | + * Local optimizations |
| 106 | + |
| 107 | +## Why this will help |
| 108 | + |
| 109 | +* For people who have very full calendars, being able to have a "heads up" of larger changes and to integrate into a review schedule could be helpful |
| 110 | + * but it will take discipline to use effectively |
| 111 | + |
| 112 | +## Notes from the meeting |
| 113 | + |
| 114 | +* simulacrum points out that it would be good to have some kind of "fast path" if you have a reviewer and you have documented things, so that no meeting is required at all |
| 115 | + * the only "hard block" would be if you don't have a "partner" or "sponsor" from compiler team |
| 116 | + * somewhat analogous to the project group lang team concepts |
| 117 | +* reviewer not expected to be a pair programmer |
| 118 | +* one possible definition for "what is a major change" might be "what would modify the rustc-guide" |
| 119 | + * or, since rustc-guide is always a WIP, "welp this *should've* in the guide and if it were, it *would've* required a modification" |
| 120 | +* what to do with new PRs that don't follow the process? |
| 121 | + * should we close them? |
| 122 | + * maybe have a canned comment and give them some amount of time |
| 123 | + * this comment might also emphasize the role of documentation |
| 124 | +* [we discussed and settled on](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/design.20meeting.202019-12-20/near/183945490) |
| 125 | + * leave a nice message, which it S-waiting-on-author |
| 126 | + * close per usual triage process if no issue is filed within a certain amount of time |
| 127 | + * if an issue is filed but it is not "green lighted", then we can close the PR |
| 128 | + * i.e., if we decide that a design meeting or broader project group is needed |
| 129 | +* when a project is proposed, what are the possible responses? |
| 130 | + * I have concerns |
| 131 | + * I approve but don't have ability/time to review |
| 132 | + * I approve on an experimental basis; we should discuss again when we gain more experience |
| 133 | + * I am happy to review but I would like another to approve too |
| 134 | + * I am happy to review and I think we can just go forward (only possible for "members") |
| 135 | +* can we make a Zulip stream where each issue creates a topic? |
| 136 | +* how to handle experimentation? |
| 137 | + * we should have some way to add "caveats", like |
| 138 | + * would like to review performance results |
| 139 | + * we need a `-Z` flag |
| 140 | + * we need docs :) |
| 141 | +* final discussion point was about exactly how to handle requests for rustc-guide edits |
| 142 | + * since a major change is part of a rustc-guide change, it makes sense that it should come accompanied with a rustc-guide write-up |
| 143 | + * ideally this would come along with the compiler-team issue |
| 144 | + * but maybe it would be more something we wait for until issue is *approved* or, in extreme cases, co-develop with author |
| 145 | + * if we want to see more docs, we are going to have to start holding the line *somewhere* |
| 146 | + * sometimes it's not possible or desirable to write complete docs before-hand |
| 147 | + * details may change through review process |
| 148 | + * person may not know enough context to write the docs, need help with that |
| 149 | + * but the bar should be that the issue can **explain the change** in sufficient detail for it to be understood |
| 150 | + * the *actual* rustc-guide changes themselves can come later |
| 151 | + * it may be that the role of the learning wg can be to help with some of that |
| 152 | + |
| 153 | +## Final proposed process |
| 154 | + |
| 155 | +* When considering or experimenting with a "major change", open an issue on compiler-team repo to let people know |
| 156 | + * Describe the general idea in a sentence or two |
| 157 | + * Identify mentors or reviewers, if you are working with one |
| 158 | + * There will be some "prototype" to guide people in this |
| 159 | +* What is a "major change"? |
| 160 | + * something where it would make sense to update rustc-guide |
| 161 | + * if rustc-guide doesn't cover this code yet, then you may have to use your imagination about what *ought* to be documented :) |
| 162 | +* These issues will be reviewed by compiler team members |
| 163 | + * Compiler team members and contributors can leave concerns and approvals asynchronously (see below) |
| 164 | + * maybe we can make a dedicated Zulip stream where new things get |
| 165 | + * In particular, note that a compiler team member who is confident something is correct and will not be controversial can just go ahead and approve and act as reviewer |
| 166 | + * though there should still be an issue |
| 167 | + * But there should also be some synchronous sweep, not clear when that should occur |
| 168 | + * maybe as part of meta wg? |
| 169 | + * perhaps just team co-leads do it on a regular basis? |
| 170 | + * existing triage meeting is too full, that's clear |
| 171 | +* Feedback from a compiler team member or contributor typically has the form (these are not fully orthogonal): |
| 172 | + * I have concerns (give details) |
| 173 | + * this might lead to more details |
| 174 | + * or a design meeting |
| 175 | + * or an RFC |
| 176 | + * or just closing the idea |
| 177 | + * I approve but don't have ability/time to review |
| 178 | + * I approve but with some caveats, e.g. we should examine perf afterwards, would like to re-review, or want a `-Z` flag |
| 179 | + * I am happy to review but I would like someone else to approve too (must be a "compiler team contributor") |
| 180 | + * I am happy to review and I think we can just go forward (only possible for "members") |
| 181 | + * the idea here is that if you are an expert on the code and confident this is a good path, that's fine, do it |
| 182 | +* If a "major change" PR is opened without going through this process |
| 183 | + * We post a standard comment that directs people to open an issue |
| 184 | + * And the PR is marked as waiting on author |
| 185 | + * It can be closed per the usual triage process if author does not respond |
| 186 | + * If the issue turns out to be controversial (i.e., nobody steps up as reviewer write away), then we close the PR and just focus on discussing in the issue |
0 commit comments