You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: bench/SPEC.md
+28-2Lines changed: 28 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -215,7 +215,7 @@ job: the cell still runs, and its note says what to distrust.
215
215
|`noop`| nothing | how cheap is "already up to date" |
216
216
|`touch-hub`| mtime bump on a widely-imported unit, **content unchanged**| can the engine prove the interface did not change? |
217
217
|`edit-comment`| a comment inserted into that same unit | the bytes *did* change but the interface did not — only an engine that compares the produced BMI avoids the cascade |
218
-
|`edit-body`| a real semantic edit inside a function body | the everyday loop. For an inline body in an interface unit the BMI legitimately changes and a cascade is **correct**|
218
+
|`edit-body`| a real semantic edit inside a function body | the everyday loop — and whether a cascade is owed depends on **where the body lives**, not on the edit. See below.|
219
219
|`touch-leaf`| mtime bump on a unit nobody imports | recompile 1 + link |
220
220
221
221
`edit-comment` exists **separately from `edit-body`** on purpose: without the
@@ -247,7 +247,33 @@ reason: **a number whose meaning depends on an invisible choice is not a
247
247
measurement.**
248
248
249
249
`edit-body` is the control that keeps the suite honest in the other direction —
250
-
there, no engine should be fast, and one that is has skipped work it owed.
250
+
where a cascade IS owed, no engine should be fast, and one that is has skipped
251
+
work it owed.
252
+
253
+
#### But a body edit does not always owe a cascade, and that is the point
254
+
255
+
Measured directly, GCC 16.1, comparing the BMI before and after:
256
+
257
+
| what is edited | BMI | cascade |
258
+
|---|---|---|
259
+
| a free exported function's body, in the `.cppm`|**byte-identical**| not owed |
260
+
| a **member function of an exported class**, inline in the `.cppm`|**differs**|**owed**|
261
+
| a body in a separate `.cpp` implementation unit |**byte-identical**|**not owed**|
262
+
263
+
A class's member function bodies are part of the class definition, which every
264
+
importer has to see, so they are serialised into the BMI. A free function's body
265
+
is not, and nothing in an implementation unit is.
266
+
267
+
So "editing one function rebuilt forty modules" is not inherent to named modules
268
+
— it is a consequence of where the body was written. `mcpp`'s own
269
+
`src/version_req.cppm` is the first case (the perturbation lands in
270
+
`Version::str()`, a member of an exported class), which is why its `edit-body`
271
+
row is a near-full rebuild and why that is correct.
272
+
273
+
**This is what the two xlings pins measure.** Moving the implementations out of
274
+
the interface units takes `edit-body` from 88.33s to **1.77s** on the same
275
+
project — ~50x, the largest single effect anywhere in this suite, and a code
276
+
style rather than an engine feature.
251
277
252
278
Real projects run five of the six: `touch-leaf` needs a unit nobody imports
253
279
*and* a stable name for it, which a generated fixture has by construction and a
0 commit comments