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
{{ message }}
Repository navigation
Commit 2b2314e
Browse filesBrowse the repository at this point in the historyBrowse files
"policy_implementation_digest_framing": "sha256 over the source set ordered by the UTF-8 bytes of each repo-relative POSIX path. Each file contributes, with no header and no separator: its path byte length as an 8-byte big-endian unsigned integer, its path's exact UTF-8 bytes, its blob byte length as an 8-byte big-endian unsigned integer, and its exact git blob bytes.",
Copy file name to clipboardExpand all lines: docs/notes/p022-263a-instrument.md
+40-10Lines changed: 40 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -222,19 +222,49 @@ into. **Both halves of every pair are committed**, and run B records run A's
222
222
path and sha256, so the verdict can be recomputed from evidence rather than
223
223
trusted.
224
224
225
-
## 9. Peak RSS
225
+
## 9. Peak memory
226
226
227
-
By a named mechanism, recorded, never eyeballed:
227
+
By a named mechanism **and a named quantity**, recorded, never eyeballed. The
228
+
quantity is not the same on both platforms, and the field says which one it is:
228
229
229
-
- POSIX: `os.wait4` — the kernel's per-child `ru_maxrss`, for exactly the
230
-
process spawned. Chosen over `/usr/bin/time -v` as primary because GNU time is
231
-
a package that may simply be absent, and "the tool was missing" is not a
232
-
memory measurement. `/usr/bin/time -v` remains the documented fallback.
233
-
- Windows: a Job Object, `PeakProcessMemoryUsed` via `QueryInformationJobObject`.
230
+
| platform | mechanism |`memory_metric`| what it counts |
231
+
|---|---|---|---|
232
+
| POSIX |`os.wait4` — the kernel's `ru_maxrss`|`max_process_peak_resident`| peak **resident** set, over the child and the descendants it waited for |
233
+
| POSIX fallback |`/usr/bin/time -v`|`max_process_peak_resident`| the same quantity |
234
+
| Windows | Job Object `PeakProcessMemoryUsed` via `QueryInformationJobObject`|`max_process_peak_commit`| peak **committed** memory of any process ever associated with the job |
235
+
236
+
`os.wait4` was chosen over `/usr/bin/time -v` as primary because GNU time is a
237
+
package that may simply be absent, and "the tool was missing" is not a memory
238
+
measurement.
234
239
235
-
Where nothing is available the value is `null`**with a reason**, so a silent
236
-
absence can never be read as a measured zero. Allocation counts are not yet
237
-
captured — recorded as owed on population B's track rather than quietly dropped.
240
+
**This used to be one field called `peak_rss_bytes`, and on Windows that was
241
+
false.** A witness settles it rather than a manual page: a child that commits
242
+
256 MiB and never touches a page is reported as 262.5 MiB through the job
243
+
object, while on Linux nothing becomes resident — job and process memory limits
244
+
are defined on committed virtual memory. The same witness refuted the other half
245
+
of the suspicion: `wait4` on the immediate child does *not* stop at a wrapping
246
+
shell. `shell -> heavy child` and `shell -> shell -> heavy child` both returned
247
+
the descendant's 260 MiB against 13 MiB for a light control.
248
+
249
+
So the two strata answer different, honest questions. The numbers are comparable
250
+
Rust-vs-Python **within** a platform and **may not be pooled or compared across
251
+
platforms**. The resident analogue on Windows is `PeakWorkingSetSize`, and
252
+
obtaining it for a tree of processes that come and go needs handle tracking or
253
+
polling; this instrument does not sample, and will not perturb the elapsed-time
254
+
interval so that two operating systems can pronounce the same noun.
255
+
256
+
A value produced under any metric kind outside that closed set raises rather
257
+
than being recorded, and no alias lets a Windows commit number go on being read
258
+
as an RSS number. Where nothing is available the value is `null`**with a
259
+
reason**, so a silent absence can never be read as a measured zero. Allocation
260
+
counts are not yet captured — recorded as owed on population B's track rather
261
+
than quietly dropped.
262
+
263
+
The repair moved `measurement_harness_digest` from `562a7f7232da` to
264
+
`104c384d01bf`. Steps 4, 5 and 6 were re-bound to the new digest in their own
265
+
commit; the committed evidence of runs that already happened was **not** rewritten
266
+
and still carries the old field name, because it records what the old instrument
267
+
produced.
238
268
239
269
On POSIX the same `wait4` call also carries the child's CPU split, fault counts
240
270
and context-switch counts. Those are now kept rather than discarded — see *The
0 commit comments