fosdem2024_bigint: improve sv.adde diagram
[libreriscv.git] / HDL_workflow / libresoc_bug_process.mdwn
1 [[!toc ]]
2
3 ---
4
5 # LibreSOC Bug Process
6
7 * [Bug #1126](https://bugs.libre-soc.org/show_bug.cgi?id=1126)
8
9 * HDL workflow guide page: [[HDL_workflow]]
10 * RfP submission process: [[HDL_workflow/rfp_submission_guide]]
11
12 This page describes in detail how to raise new tasks (bugs) and how to approach
13 development within the project in order to get appropriate amount of funding
14 for the tasks completed.
15
16 # Why raise issues
17
18 * [Bug #1126](https://bugs.libre-soc.org/show_bug.cgi?id=1126)
19
20 If you have discovered a problem in Libre-SOC (software, hardware, etc.),
21 please raise a bug report!
22 Bug reports allow tracking of issues, both to make the developers lives easier,
23 as well as for tracking completed grant-funded work.
24
25 It is **extremely** important to link the new bug to previous ones. As Luke
26 mentioned on [this bug](https://bugs.libre-soc.org/show_bug.cgi?id=1139#c3),
27 "it is a mandatory project requirement that the graph from any bug
28 contain all other bugs (one "Group")".
29
30 The primary reason for this is to ensure bugs don't get buried and lost,
31 and will aid those tackling similar problems at a later time.
32
33 Also, for project management and financing purposes, it helps developers
34 to keep an up-to-date list of their tasks.
35
36 ##How to raise issues
37
38 1. Create a bug report.
39 2. Add in any links from the mailing list or IRC logs to the bug report for
40 back tracking (this is mandatory). Also fill in the URL field if there is a
41 relevant wiki page.
42 3. CC in relevant team members
43 4. Make absolutely sure to fill in "blocks", "depends on" or "see also" so
44 that the bug is not isolated (otherwise bugs are too hard to find if isolated
45 from everything else)
46 5. Ping on IRC to say a bug has been created
47 6. Unless you know exactly which milestone to use, leave blank initially. This
48 also applies when editing milestone, budget parent/child, toml fields. See
49 section [[HDL_workflow#Task management guidelines]] further down.
50 7. After setting the milestone, it is **absolutely required** to run
51 [budget-sync](https://git.libre-soc.org/?p=utils.git;a=blob;f=README.txt;hb=HEAD),
52 as it will point out any discrepancies. The budget allocations will be used for
53 accounting purposes and **MUST** be correct. *Note you can only get paid for
54 stuff done **after the nlnet grant is approved** (before the MOU is signed)*
55
56 If a developer ever needs to check which bugs are assigned to them, go to the
57 Libre-SOC bug tracker
58 [advanced search page](https://bugs.libre-soc.org/query.cgi?format=advanced),
59 and in the "Search by People" section, check "Bug Assignee" and "contains"
60
61 ## Additional info
62
63 ### Linking bugs - 'use bug#NNN' format
64
65 - When mentioning other bugs in bug description or comment, use the
66 "bug #NNN" format, and not "#NNN". For example, writing `bug #1000` in
67 in the bugtracker comment section will create a link to
68 [bug #1000](https://bugs.libre-soc.org/show_bug.cgi?id=1000).
69 Following this syntax ensures the Bugzilla system converts
70 every bug reference into a hyperlink which makes things easier to track
71 (as you see the interdependencies between various tasks/bugs/milestones etc.).
72
73 ### Do not attempt to re-use bugs
74
75 - As LibreSOC uses the bugtracker system for task management and grant/budget
76 allocation, it is critical not to change the purpose of a previously created
77 bug. If a duplicate bug has been created, mark as `DUPLICATE` (see the
78 procedure section further down on this page on additional types of bugs
79 which would not be worked on).
80 - All comments cannot be removed (with the exception of having no comments
81 other than the initial description, *and* no link/references to other bugs).
82 - The bug may also be referenced externally, and thus re-use is not permitted.
83
84 # Adding sub-tasks to tasks under existing milestone
85
86 * notify Michiel and the relevant NNNN-NN@nlnet.nl team of
87 advance notice of intent to add new sub-tasks, cc'ing bob
88 goudriaan
89 - confirm with them that this is NOT a change in the AGREED
90 MILESTONE BUDGETs, because it is just sub-task allocation.
91 - confirm that they are happy to add the sub-tasks to the MoU
92 (this needs approval of bob goudriaan)
93 * *re-generate* the JSON file
94 * make a DIFF against the *PREVIOUS* JSON file
95 * create a MANUAL report/summary of "changes" that
96 NLnet may easily action
97 - "add the following task X to parent Y of amount W",
98 - and if any: "change parent Z available amount to V as a WRAPUP")
99 (this latter is because occasionally there are subtasks **not**
100 totalling the full parent amount, usually because a summary
101 report is needed. Michiel and I privately agreed to call
102 this "wrapup")
103 * obtain a confirmation that this has been actioned
104 * **double-check** that the RFP database correctly matches the new
105 bugzilla status.
106
107 PLEASE NOTE: YOU CANNOT ACTION THE ABOVE UNDER THE FOLLOWING CIRCUMSTANCES
108
109 1. to make a change to the actual budgetary amounts of the
110 Grant Milestones, without written authorization from Bob
111 and Michiel. a DIFFERENT PROCEDURE is needed.
112 this is because NLnet had to go through a 3rd party Verification
113 Process with the European Union: changing the amounts without
114 consent is therefore tantamount to fraud.
115
116 2. if there has been an RFP already submitted under a given Milestone,
117 it becomes NO LONGER POSSIBLE to change the JSON file in NLnet's
118 system because it is too complex.
119
120 there is one Grant in this complex situation: bug #690, the crypto
121 grant. it is made much more complex because it *pre-dates* NLnet's
122 current RFP system, where RFPs were submitted by EMAIL and there
123 are manual records not fully integrated into the database.
124
125 also note: as the addition of sub-tasks *requires a change to the MOU*
126 it should NOT be taken lightly, i.e. should not be arbitrarily done
127 one by one, but only in "batches".
128
129 considerable care therefore has to be taken to ensure that NLnet are
130 not overloaded, nor that the EU Auditor is given grounds to become
131 "suspicious" because of a dozen or more alterations to the MOU.
132 and write your nickname (i.e. andrey etc.).
133
134 # Budget Estimation
135
136 Working out a time taken (and budget) for a sub-tasks requires
137 guestimating. A small self-contained task should take
138 approximately **1/2 a day up to 8 days (+/- 40%)**.
139
140 The total for a group of sub-tasks should be approximately
141 **5-25 days**. If a single tasks looks like it might take
142 longer than 8 days, it is **required** to break it into
143 smaller subtasks. Big tasks can quickly get out of hand, so
144 if in doubt, splitting a task is the better option.
145
146 Assume *1 month is appx EUR 3000* (this is an average; the value
147 may be higher depending on circumstances) and back-calculate.
148
149 These numbers come from Luke's
150 [comment #8 on bug #1126](https://bugs.libre-soc.org/show_bug.cgi?id=1126#c8)
151
152 Statistically speaking using the +/- 40% variance for each task,
153 and adding up over 20+ tasks will give a time estimate
154 **that is accurate to +/- 10%**.
155
156 *(Any sources on this?)*
157
158 However it is very important to have a *clear idea of what is
159 actually needed*, and to *not leave anything out*.
160
161 For example, when determining the task of adding instructions:
162
163 - For each instruction perform a thought experiment:
164 "how many lines of HDL, how many unit tests?"
165 - Then from *- past experience -* estimate the total number
166 of days.
167 - Assume 1 month is appx EUR 3000 and back-calculate.
168 - Put that number for each instruction (or group)
169 into comment 0, add them up, and make that the total
170 for the task.
171
172 *(Luke has used this method for the last 5 years based on 20 years
173 of project management, and it is **expected for the team to familiarise
174 themselves with it**)*
175
176 Also, make sure not to forget including **documentation** in your
177 estimate. This ensures a portion of grant money is allocated
178 to actually documenting the work involved.
179
180 Without documentation, it is not only difficult to teach newcomers about
181 the code in question, it makes it difficult to come back to the code
182 6-12 months later for maintenance and/or improvement
183 (not a rare situation in LibreSOC).
184
185 Don't forget to ask fellow project for help, they might be able
186 to help determine the scope of the work involved.
187
188 # "I'm thinking of doing... procedure"
189
190 ## Preamble
191
192 Given the scale of this project and the critical reliance on certain parts
193 of it (such as devscripts, ISA csv files, ISACaller, etc.) on the work done
194 by the team, it is extremely important to raise any proposed changes and/or
195 improvements, and to wait for feedback *before* implementing said changes.
196
197 Going forward, we all need to keep this in mind when working on
198 critical parts of the codebase.
199
200 To make good use of available time and budget, the LibreSOC team should
201 focus on:
202
203 1. Completing tasks under grant budget
204 2. Make small, incremental changes which keep the overall codebase functional.
205 3. When coming up with fixes or improvements which are intrusive to the
206 *current* workflow (which may slow the team down from completing tasks
207 under grant budget), assign them to 'Future' milestone for grant
208 applications going forward.
209
210 Why these three points?
211
212 1. Work that cannot be related to grant sub-tasks (even if indirectly, by
213 bringing us closer to eventual completion), should be put aside *until
214 future funding is secured/confirmed*.
215 2. Small changes make it easier and quicker to find mistakes. That's one of
216 the reasons Luke has specified on [[/HDL_workflow]] to stick to small
217 commits. *(Andrey: I need to improve on this myself)*
218 3. Big changes are inherently risky. When LibreSOC was just a few people
219 (Luke and Jacob), it was easier to keep track of each other's progress.
220 5 years down the line, the situation has changed.
221 Keep in mind that changes to critical parts (whether big or small) will
222 now affect at minimum Luke, Dmitry, Jacob, Sadoon, myself
223 (perhaps also Cesar and Konstantinos, and so on).
224 By going through the process of documenting a change in a new bug report,
225 not only there's an opportunity to take a pause and think about
226 repercussions, it also adds to the list of work for future grant
227 applications (which will make it easier to draft focussed grants with
228 realistic timescales and budget).
229
230 ## Procedure
231
232 - If you discover a problem in code, raise a bug report, and use a
233 corresponding 'importance' setting depending on how serious you perceive the
234 issue to be. This will start a *discussion*.
235
236 **No work is to be started yet.**
237
238 - Based on generated discussion, determine if the issue is a *blocker to
239 current tasks under budget*. If it is a blocker , then the task 'importance'
240 to be set to 'major' or 'critical (or 'blocker').
241 *Andrey: need to clarify this*
242 If possible, a budget may be assigned after discussion and confirmation with
243 Luke and Andrey (depends on remaining budget/tasks).
244
245 - If the issue is *not a blocker*, but useful in future work, then the
246 'Future' milestone is to be assigned. The issue will be evaluated at a later
247 stage. At this point, no further time should be spent on this issue
248 (to prioritise outstanding tasks).
249
250 *(Andrey): Sometimes determining whether to use WONTFIX or INVALID is
251 difficult. Perhaps more examples would help?*
252
253 - If the issue is not a blocker, and the discussion shows that it is not
254 an issue at all, it is to be set to either of the following:
255 - `RESOLVED DUPLICATE` - If the issue raised already exists.
256 [Example, bug #962](https://bugs.libre-soc.org/show_bug.cgi?id=962)
257 - `RESOLVED WONTFIX` - If the issue requires too much time or budget.
258 [Example, bug #921](https://bugs.libre-soc.org/show_bug.cgi?id=921)
259 - `RESOLVED INVALID` - If the issue does not align with project goals or
260 methodology.
261 [Example, bug #76](https://bugs.libre-soc.org/show_bug.cgi?id=76)
262 - The final status will be confirmed after *at least two other people* (other
263 than the reporter) look at the bug report.
264 For cases considered to be `WONTFIX` or `INVALID`, 48h should be given
265 before the bug report is closed. This ensures the team has enough time to
266 see the discussion before the issue disappears.
267
268 - Once the issue has been discussed and determined to be critical to current
269 grant sub-task/s, and budget considered, *then* work can proceed in a separate
270 branch. Only after fixes have been confirmed to keep the CI tests passing,
271 can they be rebased (to keep commit history) into the master branch.
272 - *Note*: branch names **should not include personal info** such as names.
273 This is because others may require to use or work on the branch, and no
274 single developer owns a branch.
275
276 This procedure adds a time delay between the issue discovery and
277 start of work. This is important however because it allows for team members
278 to read bug updates without being overwhelmed and have time to add input.
279