Repository navigation
Description
Problem
ripr measures wall-clock time only. It cannot report how much CPU time a run consumed, and it cannot report how much memory it held. Every efficiency claim the project makes — "fast", "bounded", "minimal working set" — is therefore unfalsifiable from evidence the product itself produces.
Verified against main at a452edaf2, classification verified_current.
What exists today
Wall clock only, via an opt-in stderr phase trace:
crates/ripr/src/analysis/seam_inventory.rs:342-368emitsduration_ms=lines fordiscover_rust_files,collect_workspace_state,cache_load,cold_compute,file_fact_cache,apply_oracle_policy,inventory_seams,evidence_for_seams,classify_seams,cache_store,total.crates/ripr/src/analysis/test_grip_evidence.rs:208-214emits per-chunk evidence progress.cargo xtask repo-exposure-latency-report(xtask/src/main.rs:10411) parses those lines intotarget/ripr/reports/repo-exposure-latency.{json,md}.cargo xtask targeted-rerun-benchmark(xtask/src/reports/targeted_rerun.rs:10-16) assertsWARM_P50_TARGET_MS = 30_000andSPEEDUP_TARGET = 5.
Every one of these is Instant::now() / elapsed(). There is no CPU-time attribution and no memory observation anywhere.
What does not exist
A repository-wide search of crates/, xtask/ and editors/ for
peak_rss, getrusage, working_set, VmHWM, max_rss, rusage,
GetProcessMemoryInfo, WorkingSetSize returns no measurement code. The
only hits are the unrelated working_set analysis scope name in
docs/OUTPUT_SCHEMA.md and schemas/ripr/review-comments.schema.json, the
traceability corpus, and a TypeScript MEMORYSTATUSEX struct in
editors/vscode/src/lspCompatibility.ts:88-89 that measures the editor, not
ripr.
Consequences that matter to a user deciding whether to adopt the tool:
- "Is
riprgoing to OOM my 16 GB CI runner?" is unanswerable from product output. The
project has already had runner-OOM incidents (ripr review-guidance pass dies by SIGTERM (oomd-class) on ~1700-file closures: peak memory scales with closure size #3768, ripr analysis OOMs the GitHub Actions runner on large module-extraction diffs (~2600+ lines) #1324, Diff-scoped analysis exhausts GitHub-hosted runner resources on large PRs (runner shutdown, exit 143) #1023) and repaired them by
inspection, not by measurement. - Wall time cannot attribute cost. A run that takes 300 s may be 300 s of CPU on one core,
or 30 s of CPU spread across 10 rayon workers plus 270 s blocked ongitorcargo metadata.evidence_for_seamsandclassify_seams_ownedare currently sequential
(analysis/test_grip_evidence.rs:202-215,analysis/seam_classification.rs:155-175)
while rayon is already a hard dependency used inanalysis/facts/build.rs:117,182—
only CPU time can tell a parallelization win from an I/O wait. - The existing perf claims cannot be regression-guarded. A RAM budget with no observation
is not a budget.
Non-goals
- No new benchmark harness, criterion bench, or profiling profiler.
- No performance change to the analysis pipeline. This issue only makes cost observable.
- No published or public resource envelope claim in this slice.
- No gate that fails CI on a resource number.
Acceptance
riprcan observe its own process CPU time and peak resident memory, portably, with
nounsafe(crates/ripr/Cargo.toml:107inherits workspaceunsafe_code = "forbid").- Observation is opt-in and off by default, and emitted on stderr so stdout JSON stays
byte-identical. It rides the existingRIPR_REPO_EXPOSURE_LATENCY_TRACE=1family rather than
inventing a parallel switch. - Where a platform offers no safe observation, the report says so explicitly as a named
unavailable/unknown state. It never prints0, never omits the field silently, and never
presents a partial observation as complete. cargo xtask repo-exposure-latency-reportcarries the observed CPU and peak-memory values
intotarget/ripr/reports/repo-exposure-latency.{json,md}, with the same
observed/unavailable distinction, and states the host it observed on.- The measured numbers are attributable to the run, not to the harness: a reviewer can tell
which process the CPU time and peak RSS belong to. - Tests discriminate the real behavior:
- a unit test that the emitted record round-trips and that the unavailable state is
distinct from a zero measurement; - a test that with tracing off, no resource line is emitted and stdout is unchanged;
- a test that the xtask report parser carries the new fields through and preserves the
unknown state rather than defaulting it away.
- a unit test that the emitted record round-trips and that the unavailable state is
Rollback
Revert the trace emission and the xtask parser change. No analysis behavior, output schema,
or classification depends on it.
Notes for implementation
- Linux peak RSS is readable from
/proc/self/statusVmHWMwith no dependency and no
unsafe. Linux CPU time is readable from/proc/self/statutime+stime(clock ticks). - On Windows,
winsafeis already acfg(windows)dependency with thekernelfeature
(crates/ripr/Cargo.toml:78), andprocess-wrapis already used for Job Object ownership.
Prefer those reviewed safe wrappers over adding a raw FFI surface. - Read the observation at the end of the run, not on a timer thread.
- Do not let the observation itself allocate materially or hold the trace string.
Activity
fix(observability): observe Windows CPU time and peak memory with the…
perf(observability): report ripr's own CPU time and peak memory (#5213)…
EffortlessSteven commentedon Oct 4, 2026
Delivered — PR #5282, merge commit
7043d576All seven acceptance items are met at
7043d576, verified at the merged head.riprobserves its own CPU time and peak RSS, portably, nounsafecrates/ripr/src/analysis/resource_cost.rs; Linux via/proc/self/{stat,status}, Windows viawinsafe's safeHPROCESS::GetProcessTimes/GetProcessMemoryInfo(psapifeature added atCargo.toml:78-84)RIPR_REPO_EXPOSURE_LATENCY_TRACEanalysis/resource_cost.rsis now the single owner of that env family; the two duplicate private trace-line copies were removed.tracing_off_leaves_stdout_and_stderr_byte_identicalpins stdout and stderr0, never silently omittedResourceUnavailableReason;observedandunavailableare distinct serialized shapes, and both the producer's and the consumer's mirrors carrydeny_unknown_fieldsrepo-exposure-latency-reportcarries CPU and peak RSS, names the host, preserves unavailablextask/src/main.rs, independent mirror types, reportschema_version0.2 -> 0.3observer: "ripr_process_self"plusobserver_pid, carried as dataOne premise in this issue was wrong, and it is recorded
Acceptance 1 asked for portability, and the implementation note suggested
winsafe'skernelfeature already covered Windows. It did not, in the way the note assumed. The first candidate
published a false capability-absence claim — that Windows had no safe per-process counter —
in a module doc, an enum variant, and
docs/OUTPUT_SCHEMA.md.It was false because the search behind it was: on Windows PowerShell,
src/**/*.rspassed toSelect-String -Pathis not recursive, so it read the rawexterndeclarations and neverreached the safe
handles/wrappers. Both calls were already available. The issue's note iscorrected in
docs/LEARNINGS.md, which now records that a capability-absence claim needs asearch that provably covered the tree, and that "the grep found no implementation" is not the
same claim as "the API does not exist".
This is worth flagging beyond this issue: the same shallow-search failure mode can manufacture a
false absence anywhere in this repository, and the project's history of false capability claims
makes that a recurring hazard rather than a one-off.
Honest residuals, carried forward rather than closed as solved
#[cfg]blocks compile under
--target x86_64-unknown-linux-gnuand hosted Linux CI builds and teststhe crate, but the emitted Linux values have not been observed by a human.
ripr mcp --stdiobypassescli::runviastartup.rsand emits no receipt. Honest — noreceipt rather than a partial one — but the long-lived MCP server's own cost is exactly what a
user would ask about, and it is not covered.
asserts an exact stderr line set will notice.
Closing as delivered. The residuals above are stated, not claimed as solved.