|
| 1 | +MMTk Enhancement Proposal (MEP) |
| 2 | +=============================== |
| 3 | + |
| 4 | +An MMTk Enhancement Proposal (MEP) is a more formal variant of issue. It has a special format, and |
| 5 | +will undergo a more thorough review process. Its goal is helping the MMTk developers making more |
| 6 | +informed decisions. |
| 7 | + |
| 8 | +MEP is inspired by the Java Enhancement Proposal, described in https://openjdk.org/jeps/1 However, |
| 9 | +unlike JEP which is more open-ended, MEP is more focused on making design decisions. |
| 10 | + |
| 11 | +# When is MEP required? |
| 12 | + |
| 13 | +An MEP is required when making a significant change to the design of the MMTk core. It is |
| 14 | +applicable to any kind of significant changes, including but not limited to: |
| 15 | + |
| 16 | +- Bug fixes, including performance bug fixes, that require change to a major part of the MMTk |
| 17 | + core. |
| 18 | +- Changes to the MMTk core to implement a feature demanded by bindings. |
| 19 | +- Major refactoring to the MMTk core. |
| 20 | + |
| 21 | +One purpose of MEP is reducing the risks to the future development of MMTk. Large-scale changes and |
| 22 | +public API changes usually indicate such risks, but these are only indicators, not criteria. The |
| 23 | +assessment of risks is subjective, and we need to discuss in order to reach consensus. |
| 24 | + |
| 25 | +Note: JEP is also required for things that "require two or more weeks of engineering effort" and/or |
| 26 | +"are in high demand by developers or customers". We don't judge whether we need MEP based on |
| 27 | +engineering effort or public demand. Many PRs for MMTk require multiple weeks of work and rigorous |
| 28 | +testing, but most of them can be settled with regular issues and PRs. We label priorities using |
| 29 | +GitHub issue tags, such as `P-normal`, `P-high`, etc. If a feature is requested often, and we have |
| 30 | +man power for that, we can raise the priority. |
| 31 | + |
| 32 | +# Format |
| 33 | + |
| 34 | +A MEP will be posted as a GitHub issue in the `mmtk-core` repository. It should contain certain |
| 35 | +tags: |
| 36 | + |
| 37 | +- **The `MEP` tag** |
| 38 | + - It is used to identify MEPs. |
| 39 | +- **Area (`A-*`)** |
| 40 | + - For example, `A-gc-algorithm`. |
| 41 | +- **Category (`C-*`)** |
| 42 | + - For example, `C-refactoring`. |
| 43 | + - Note that not all MEP are "enhancement" in the sense of `C-enhancement`. Some MEPs may |
| 44 | + simply be intended for fixing long-standing hard-to-fix bugs by making non-trivial changes. |
| 45 | +- **Goal (`G-*`)** |
| 46 | + - For example, `G-safety`. |
| 47 | + |
| 48 | +We use the format of JEP (https://openjdk.org/jeps/2) as a frame of reference, but deviate from it |
| 49 | +when needed. |
| 50 | + |
| 51 | +A MEP should have the following sections: |
| 52 | + |
| 53 | +- TL;DR (summary) |
| 54 | +- Goal |
| 55 | +- Non-goal (optional) |
| 56 | +- Success Metric |
| 57 | +- Motivation |
| 58 | +- Description |
| 59 | + - Impact on Performance |
| 60 | + - Impact on Software Engineering |
| 61 | +- Risks |
| 62 | + - Long Term Performance Risks |
| 63 | + - Long Term Software Engineering Risks |
| 64 | + - Impact on API |
| 65 | +- Testing |
| 66 | +- Alternatives (optional) |
| 67 | +- Risks and Assumptions (optional) |
| 68 | +- Related Issues (optional) |
| 69 | + |
| 70 | +Note: Sections in JEP but not in MEP: |
| 71 | + |
| 72 | +- Dependencies: We have the *Related Issues* section, instead. |
| 73 | + |
| 74 | +# Sections |
| 75 | + |
| 76 | +## TL;DR |
| 77 | + |
| 78 | +This section should use about one to three sentences to summarize the MEP. JEP calls it "Summary", |
| 79 | +but we call it "TL;DR" (too long, didn't read) to emphasize that it should be short enough so that |
| 80 | +readers (including those in a hurry) can get the main idea very quickly without reading through the |
| 81 | +MEP. |
| 82 | + |
| 83 | +## Goals |
| 84 | + |
| 85 | +What are the goals of the proposal? This should be succinct. If there's more than one goal, |
| 86 | +enumerate them in a list. |
| 87 | + |
| 88 | +## Non-Goals |
| 89 | + |
| 90 | +Optional. Use this section to explicitly exclusive goals out of the scope of the current MEP. |
| 91 | + |
| 92 | +## Success Metric |
| 93 | + |
| 94 | +How do we determine whether the MEP is a success? This can include improvements in performance, |
| 95 | +safety, readability, maintainability, etc. Enumerate the success metrics in a list (details should |
| 96 | +be in the *Description* section). |
| 97 | + |
| 98 | +## Motivation |
| 99 | + |
| 100 | +Why should this work be done? Who is asking for it? |
| 101 | + |
| 102 | +Make sure the readers understand the problem this MEP is trying to address. You can also mention |
| 103 | +the languages, VMs, or users that need this enhancement. |
| 104 | + |
| 105 | +If there are alternative ways to solve the problem, you can mention them here, but keep in mind that |
| 106 | +there is an *Alternatives* section for adding more details. |
| 107 | + |
| 108 | +## Description |
| 109 | + |
| 110 | +This is the main section of the MEP. Describe the enhancement in detail. |
| 111 | + |
| 112 | +If you have already made prototype implementations for this MEP, add hyperlinks to the relevant PRs, |
| 113 | +commits, repositories, etc. |
| 114 | + |
| 115 | +If not, describe how you intend to implement this MEP. You should think about all parts of |
| 116 | +mmtk-core that your MEP may interact with. |
| 117 | + |
| 118 | +This section will be long, and will usually be divided into many subsections. The following |
| 119 | +subsections must be included: |
| 120 | + |
| 121 | +- Impact on Performance |
| 122 | +- Impact on Software Engineering |
| 123 | + |
| 124 | +### Impact on Performance |
| 125 | + |
| 126 | +Describe how this MEP will affect the performance. "This MEP should not have any impact on |
| 127 | +performance" is still a valid description if it is so. |
| 128 | + |
| 129 | +### Impact on Software Engineering |
| 130 | + |
| 131 | +Describe whether this MEP will make software engineering easier or more difficult. Will it make the |
| 132 | +code easier or harder to understand, maintain and/or change? |
| 133 | + |
| 134 | +## Risks |
| 135 | + |
| 136 | +Outline the *long-term* risks posed by this MEP and how those risks are mitigated. **The core |
| 137 | +purpose of the MEP process is to avoid the unintentional introduction of changes that bring |
| 138 | +long-term negative impacts to MMTk**. This section is about identifying and accounting for risks |
| 139 | +associated with such negative outcomes. It should include the following subsections: |
| 140 | + |
| 141 | +- Long Term Performance Risks |
| 142 | +- Long Term Software Engineering Risks |
| 143 | +- Impact on API |
| 144 | + |
| 145 | +### Long Term Performance Risks |
| 146 | + |
| 147 | +Enumerate possible negative long-term performance impacts of this MEP, and for each explain how that |
| 148 | +risk will be mitigated. Note: this is *not* about the immediate performance impact of the MEP, |
| 149 | +but about the impact on future work. For example, this includes identifying changes that may impede |
| 150 | +the future introduction of entirely new algorithms, or entirely new optimizations. |
| 151 | + |
| 152 | +It is OK for us to accept temporary minor performance reduction to make more significant |
| 153 | +improvements possible. On the contrary, it is bad to make changes to temporarily improve |
| 154 | +performance and make long-term improvements hard or impossible. |
| 155 | + |
| 156 | +### Long Term Software Engineering Risks |
| 157 | + |
| 158 | +Enumerate possible negative long-term software engineering impacts of this MEP, and for each explain |
| 159 | +how that risk will be mitigated. |
| 160 | + |
| 161 | +One of the core goals of MMTk is making GC development easy. If a developer wants to develop, for |
| 162 | +example, a new GC algorithm, it should be easy to implement it quickly and easily in MMTk. We don't |
| 163 | +want changes that make this difficult. |
| 164 | + |
| 165 | +### Impact on API |
| 166 | + |
| 167 | +Outline how this MEP will affect APIs, both public and internal. Enumerate the cases, and for each |
| 168 | +case, explain how the risk of negative consequences will be mitigated and/or justify the change. |
| 169 | + |
| 170 | +## Testing |
| 171 | + |
| 172 | +If applicable, describe the way to reproduce the problem, and the way to check if the change |
| 173 | +actually works. For MMTk, it includes but is not limited to what (micro or macro) benchmarks to |
| 174 | +use, and which VM binding (with or without changes) to use. |
| 175 | + |
| 176 | +## Alternatives |
| 177 | + |
| 178 | +Optional. If there are more than one way to solve the problem, describe them here and explain why |
| 179 | +this approach is preferred. |
| 180 | + |
| 181 | +## Assumptions |
| 182 | + |
| 183 | +Optional. For the design changes of MMTk, this part mainly includes assumptions about, for example, |
| 184 | +the VM's requirements, the GC algorithms we are supporting, the OS/architecture MMTK is running on, |
| 185 | +etc. If those assumptions no longer hold, we may need to reconsider the design. Describe such |
| 186 | +concerns in this section. |
| 187 | + |
| 188 | +## Related Issues |
| 189 | + |
| 190 | +Optional. If there are related issues, PRs, etc., include them here. |
| 191 | + |
| 192 | +Sometimes people create ordinary issues and PRs to fix some problems, and later MMTk developers |
| 193 | +consider that the change is too fundamental and needs a more thorough reviewing process. If that is |
| 194 | +the case, add hyperlinks to those original issues and PRs. |
| 195 | + |
| 196 | +# MEP Reviewing Process |
| 197 | + |
| 198 | +## Initiate an MEP |
| 199 | + |
| 200 | +An MEP is initiated by creating an MEP issue with the format described in this document. |
| 201 | + |
| 202 | +### Escalate normal PRs/issues and request for MEP |
| 203 | + |
| 204 | +For normal PRs/issues, if any team member thinks it should be an MEP, they should escalate it and |
| 205 | +discuss with the team. If the team decide that it should be an MEP, the PR/issue should be set to |
| 206 | +'Request for MEP', and expects an MEP issue from the contributor. If there is no further action from |
| 207 | +the contributor for a period of time, the PR/issue is considered as stale and it may get assigned to |
| 208 | +an MMTk team member or may be closed. |
| 209 | + |
| 210 | +Note that a team member may escalate an PR/issue for normal discussion, rather than requesting for |
| 211 | +MEP. As we discussed, MEP is a heavy-weight process, and we should not abuse requesting it. |
| 212 | + |
| 213 | +## Review an MEP |
| 214 | + |
| 215 | +### Criteria |
| 216 | + |
| 217 | +The MMTk team will first decide if the proposal meets the criteria for being an MEP. If it does not |
| 218 | +meet the criteria, the proposal issue will be closed, and related changes should be treated as a |
| 219 | +normal PR/issue. |
| 220 | + |
| 221 | +The criteria for what need to be an MEP is mostly subjective, based on a consensus model within the |
| 222 | +MMTk team. We also provide a list of exemption for what do not need to be an MEP. |
| 223 | + |
| 224 | +#### MEP Exemption |
| 225 | + |
| 226 | +MEP is intended to help avoid design changes that may have profound negative impact in the future. |
| 227 | +Some changes will not have profound impact, and can be easily reverted if necessary. They should be |
| 228 | +exempt from the heavy-weight MEP process, and should not be escalated to request for MEP. The |
| 229 | +exemption is intended to ensure that we won't abuse using MEP and that we won't impose burden on the |
| 230 | +contributors to submit an extra MEP proposal. An exempted PR may still be escalated for team |
| 231 | +discussion, but it is exempt from being requested for MEP (submitting a MEP proposal, and going |
| 232 | +through the MEP process). |
| 233 | + |
| 234 | +##### Exemption 1: Well-encapsulated changes |
| 235 | + |
| 236 | +Changes that are well-encapsulated and decoupled intrinsically can be easily corrected in the future |
| 237 | +and will not have profound impact for the future. A PR that has no public API change, and no module |
| 238 | +API change between the top-level modules (`plan`, `policy`, `scheduler`, `util` and `vm` at the time |
| 239 | +of writing) is exempt from MEP. |
| 240 | + |
| 241 | +### Review |
| 242 | + |
| 243 | +The MMTk team will discuss the proposal in weekly meetings. This process may take a while. We will |
| 244 | +keep posting the discussion to the MEP issue, and encourage further inputs from the contributor, and |
| 245 | +the community. An MEP may get updated and refined during the process. |
| 246 | + |
| 247 | +### Outcome |
| 248 | + |
| 249 | +At the end of the review, the MEP will be accepted or rejected based on the consensus of the MMTk |
| 250 | +team. If an MEP is accepted, A PR may follow the MEP and will be reviewed with the normal PR review |
| 251 | +process. |
| 252 | + |
| 253 | +If an MEP is rejected, future related MEPs may not be reviewed again unless they are substantially |
| 254 | +different. We encourage people to get involved in the review discussion, and refine the proposal so |
| 255 | +it will be accepted. |
| 256 | + |
| 257 | +## Communication |
| 258 | + |
| 259 | +After an MEP is implemented, the MMTk team shall announce the significant changes as the results of |
| 260 | +the MEP to make them known to the community. We shall communicate with our sponsors about such |
| 261 | +changes, too, in our regular meetings. |
| 262 | + |
| 263 | +<!-- |
| 264 | +vim: ts=4 sw=4 sts=4 et tw=100 |
| 265 | +--> |
0 commit comments