Skip to content

feat(resource): aggregate bounded browser process-set RSS - #66

Draft
seonghobae wants to merge 6 commits into
feat/browser-task-resource-telemetryfrom
feat/browser-process-set-rss
Draft

feat(resource): aggregate bounded browser process-set RSS#66
seonghobae wants to merge 6 commits into
feat/browser-task-resource-telemetryfrom
feat/browser-process-set-rss

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Partial implementation of #28, stacked on PR #51.

Buyer-visible gap

PR #51 can sample exactly one caller-supplied Linux process RSS value, but Chromium is multi-process. A resource governor that accepts only one PID can materially undercount a real Agent Task even when every individual /proc/<pid>/status sample is valid. This follow-up defines a bounded, duplicate-safe process-set aggregation boundary without pretending to discover or attribute Chromium processes.

Dependency

This Draft is stacked on exact PR #51 head dab26e4e9652408fb67dc8eedf9fd1820e524805. It remains Draft and is not independently integrable before that prerequisite.

TDD / RCA sequence

  1. Test-only head 8b1ae110c2a5940e0bf11f1e76a9160dd4b1debd required MAX_BROWSER_PROCESS_SET_SIZE, pure bounded aggregation, exact-set Linux sampling, empty/zero/duplicate/oversized rejection, checked aggregate overflow, and fail-closed partial-set sampling before production implemented that boundary.
  2. Production then added the narrow process-set implementation. Exact head 61ddf7bb085cc91c08ca393efb3da705b45dd6f4 exposed one test defect rather than a production aggregation defect: the integration test compared two independent sequential /proc/<pid>/status RSS reads for byte equality even though process RSS can legitimately change between samples.
  3. Head 8958b55d0ef1b135be3d2a48dc61c604447cb01a corrected that race by testing the kernel sample contract directly: the current Linux process must yield a positive byte count in the kernel-kB granularity, while invalid/partial process sets remain fail-closed. CI run 31446492816 then passed repository contracts, formatting, locked workspace checks/tests, strict Clippy, rustdoc and exact owned production function/line/region/branch coverage.
  4. Current exact head 986958ab8a29b3ca708c80e44df45e1ec5f9f868 records the bounded process-set behavior in the Unreleased changelog without widening the implementation claim.

Implemented boundary

The branch now:

  • accepts an explicit caller-owned process set of at most 256 unique nonzero PIDs;
  • provides pure aggregate_browser_process_rss_samples over explicit (pid, rss_bytes) samples;
  • samples every exact supplied Linux PID through the existing strict /proc/<pid>/status VmRSS parser;
  • rejects empty, zero-PID, duplicate and oversized process sets;
  • uses checked addition and rejects aggregate overflow rather than silently undercounting;
  • fails the entire process-set sample if any member cannot be sampled; and
  • leaves Chromium process discovery, task attribution, process-tree/cgroup walking, GPU/VRAM and cross-platform sampling to later trusted adapters.

Exact-head evidence

On unchanged exact head 986958ab8a29b3ca708c80e44df45e1ec5f9f868, stacked on exact #51 head dab26e4e9652408fb67dc8eedf9fd1820e524805:

  • CI run 31446842334: success;
  • Rust contracts job 93642785102: repository Python contracts, formatting, locked workspace/all-target check, full tests, strict Clippy and rustdoc all success;
  • Production coverage job 93642785059: success, including exact owned production function/line/region/branch enforcement;
  • CodeRabbit exact-head commit status: success;
  • no formal reviews or inline review threads are currently returned; and
  • GitHub reports the PR mergeable against its exact prerequisite base.

No predecessor-head check, review or mergeability result is transferred to this exact head.

Truth boundary

This lane does not discover Chromium PIDs, prove that supplied PIDs belong to one browser task, walk a browser child-process tree/cgroup, sample GPU/VRAM or JS heap, launch/control Chromium, persist telemetry, alter workflows, or make release claims. Trusted browser/process attribution remains a later adapter responsibility. Canonical whole-product documentation remains owned by PR #44.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0ae9670b-185f-4401-9f5d-96e9ae2d8607

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant