Skip to content

CI measurement: emit whole-tree cgroup memory.peak at the binding-cap ancestor (sound placement divisor) - #5564

Closed
gunbai-bot[bot] wants to merge 19 commits into
mainfrom
session/quick-ant-298
Closed

gunbai-bot[bot] wants to merge 19 commits into
mainfrom
session/quick-ant-298

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

What

Additive measurement instrument in claim_executor: alongside the existing self-RSS VmHWM line, emit the whole-tree cgroup memory.peak (+ pids.current) read at the binding-cap ancestor cgroup — the same tightest-memory.max level read_host_memory_budget_bytes already walks to. Also emits the sccache-server cgroup path.

Why (§5)

The existing [measurement] floor peak RSS line is the executor's SELF-RSS (/proc/self/status VmHWM), which excludes child rustc/sccache PIDs. A placement divisor (host_RAM / per-job-peak) keyed on self-RSS under-counts in the OOM-reproducing direction. cgroup v2 memory.peak is hierarchical (accounts for all descendant cgroups) and children fork-inherit the executor's cgroup, so reading peak at the budget-binding ancestor captures every PID the budget governs — the sound divisor input. This is the measurement that produces the real numbers #5559 (placement) and #5546 (compile-jobs) consume.

The sccache-server cgroup path is emitted beside the ancestor path so the "accounted exactly once" classification (sccache inside the subtree → counted in peak; sibling → subtract as host_fixed_overhead) is a read of two paths, not a brittle in-process prefix check.

Properties

  • Purely additive: new functions + one new emit line; no existing logic touched. Reuses the proven leaf→root cgroup walk idiom.
  • Runtime-harmless: read-only of /sys/fs/cgroup + /proc; best-effort with graceful unavailable / not-found fallbacks.
  • Validated (as far as a ~31GiB container allows): compiles clean; the cgroup-read paths are confirmed readable and produce sensible values in-container. Full green-by-execution = the harvest on the real 128GiB runner (the ~40GB rust_tests peak can't be hosted locally).

Status

HELD as draft pending the operator's CI-triad resume-go (bright-stag's split: build-ready now, land + CI-harvest at resume). On resume: land → harvest the real per-job-type cgroup peaks from the next CI run → distribute to #5559/#5546 as measured inputs. — sent from quick-ant-298

briansrls and others added 16 commits June 21, 2026 04:20
…he 3× fleet-red)

Pins the 3× fleet-red to stale-green (PR validated against a pre-gate base,
merged without re-validating current main) via the #5429 timeline receipts;
ranks the merge-policy fixes (merge-queue >> require-up-to-date under the
approval outage); scopes neat-ibex's reverse-staleness lens as complementary,
not the 3×-red killer. Decision record for the operator's merge-policy call.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…e (the §1 coverage keystone)

Scoping artifact for the operator greenlight call. One declared fact (rust-test→
consumed-.dag closure on the existing NodeArtifactProvenance carrier) read in two
directions: FIRE-when-consumed (coverage wall, fail-closed) and SKIP-when-unaffected
(affordability selector) — DESIGN §4 one grammar both directions. Shared
testgen-reflection blocker; first vertical slice; honest multi-day estimate. Build
HELD for operator nod; decoupled from #5427.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…try (closure ⊇ reads)

bright-stag's load-bearing sharpening: coverage (fire-on-change) is fail-OPEN to
under-declaration (declaration drift re-opens the .dag→rust hole), while affordability
(skip) is fail-safe to over-declaration. So (1) the completeness lens must check
closure ⊇ actual-.dag-reads (CORRECTNESS), not mere presence — presence is the §5
faked-cache-key trap; (2) structural closure discovery IS the soundness, not optional
polish — a hand-authored closure is the §3/§5 fork that silently re-opens the hole;
(3) slice-1 must state whether its closure is structurally derived (proves the wall) or
hand-listed (proves only the wiring).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ge item (doc reachability)

The new docs/plans/edge-b-rust-dag-provenance-brief.md was an orphan doc → the
floor witness doc_graph_has_no_orphan_docs (dsl/test/claim/doc_reachability_witness_test.dag)
RED on #5526. Fix per the rule (every docs/**/*.md reachable from a ROADMAP/DESIGN
root): add a terse pointer on the existing §1 rust-gate-coverage line, its correct
semantic home — edge-(b) is the .dag→rust coverage wall that #5427 (the .rs-hole-closer)
does not close.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… refinement)

Per the operator short-lines rule (bright-stag enforces): move the mechanism density
(rust-test↔consumed-.dag closure, fail-closed both directions) into the brief; keep the
ROADMAP line a short scannable summary + pointer + explicit no-overclaim status
('SCOPED / pending operator greenlight'). Build is NOT greenlit; the line now says so.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gunbai-bot gunbai-bot Bot changed the title ci is slow investiation CI measurement: emit whole-tree cgroup memory.peak at the binding-cap ancestor (sound placement divisor) Jun 22, 2026
briansrls and others added 2 commits June 22, 2026 21:37
The hand-written binding_cap_cgroup_dir / cgroup_peak_pids_at_binding_ancestor
/ sccache_server_cgroup_rel helpers were not rustfmt-clean; this only reflows
them. No logic change. Fixes the rust_tests fmt failure on the held draft #5564.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review June 22, 2026 21:52
@gunbai-bot
gunbai-bot Bot marked this pull request as draft June 22, 2026 21:56
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review June 22, 2026 22:03
@gunbai-bot

gunbai-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Closing as SUPERSEDED. The measurement intent (CI cgroup peak as the placement divisor) is fully carried by #5574, which reads the LEAF runner cgroup memory.peak — the correct approach on the live UNCAPPED fleet, where this PR's binding-cap-ancestor read returns None (memory.max=max) and emits nothing. This branch (the session catch-all) has also drifted: the auto-committer swept in the budget-tree carrier (now properly isolated in #5582) and a stale claim_executor copy. Real work lives in #5574 (measurement) + #5582 (budget tree). The modeling-coherence UNAVAILABLE on this head is an infra host/ctrl gunbc pin skew, not a modeling issue. — sent from quick-ant-298

@gunbai-bot gunbai-bot Bot closed this Jun 22, 2026
briansrls added a commit that referenced this pull request Jun 22, 2026
…ak (per-job placement divisor) (#5574)

* WIP: ci is slow investiation

* docs/plans: ci-merge-freshness decision record (stale-green root of the 3× fleet-red)

Pins the 3× fleet-red to stale-green (PR validated against a pre-gate base,
merged without re-validating current main) via the #5429 timeline receipts;
ranks the merge-policy fixes (merge-queue >> require-up-to-date under the
approval outage); scopes neat-ibex's reverse-staleness lens as complementary,
not the 3×-red killer. Decision record for the operator's merge-policy call.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs/plans: scoped edge-(b) brief — rust-test↔consumed-.dag provenance (the §1 coverage keystone)

Scoping artifact for the operator greenlight call. One declared fact (rust-test→
consumed-.dag closure on the existing NodeArtifactProvenance carrier) read in two
directions: FIRE-when-consumed (coverage wall, fail-closed) and SKIP-when-unaffected
(affordability selector) — DESIGN §4 one grammar both directions. Shared
testgen-reflection blocker; first vertical slice; honest multi-day estimate. Build
HELD for operator nod; decoupled from #5427.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs/plans: edge-(b) brief — fold in the coverage-completeness asymmetry (closure ⊇ reads)

bright-stag's load-bearing sharpening: coverage (fire-on-change) is fail-OPEN to
under-declaration (declaration drift re-opens the .dag→rust hole), while affordability
(skip) is fail-safe to over-declaration. So (1) the completeness lens must check
closure ⊇ actual-.dag-reads (CORRECTNESS), not mere presence — presence is the §5
faked-cache-key trap; (2) structural closure discovery IS the soundness, not optional
polish — a hand-authored closure is the §3/§5 fork that silently re-opens the hole;
(3) slice-1 must state whether its closure is structurally derived (proves the wall) or
hand-listed (proves only the wiring).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ROADMAP: anchor the edge-(b) keystone brief from the rust-gate-coverage item (doc reachability)

The new docs/plans/edge-b-rust-dag-provenance-brief.md was an orphan doc → the
floor witness doc_graph_has_no_orphan_docs (dsl/test/claim/doc_reachability_witness_test.dag)
RED on #5526. Fix per the rule (every docs/**/*.md reachable from a ROADMAP/DESIGN
root): add a terse pointer on the existing §1 rust-gate-coverage line, its correct
semantic home — edge-(b) is the .dag→rust coverage wall that #5427 (the .rs-hole-closer)
does not close.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ROADMAP: trim edge-(b) line 36 to short summary + status (bright-stag refinement)

Per the operator short-lines rule (bright-stag enforces): move the mechanism density
(rust-test↔consumed-.dag closure, fail-closed both directions) into the brief; keep the
ROADMAP line a short scannable summary + pointer + explicit no-overclaim status
('SCOPED / pending operator greenlight'). Build is NOT greenlit; the line now says so.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* WIP: ci is slow investiation

* fmt: rustfmt the cgroup-peak measurement additions (claim_executor)

The hand-written binding_cap_cgroup_dir / cgroup_peak_pids_at_binding_ancestor
/ sccache_server_cgroup_rel helpers were not rustfmt-clean; this only reflows
them. No logic change. Fixes the rust_tests fmt failure on the held draft #5564.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* CI measurement: rust_tests-job leaf cgroup peak + --measure-cgroup-peak (per-job placement divisor)

Second half of the whole-tree CI memory measurement (companion to #5564's ci-job
emit): a claim_executor --measure-cgroup-peak standalone mode + a rust_tests-job
ci.yml step that calls it, so the rust_tests job (the binding ~16-23 GiB per-job
constraint, measured live on srv1) emits its own cgroup peak.

Corrects #5564's cap-ancestor read for the real fleet. Live srv1 inspection
(operator-granted) shows the runner units run MemoryMax=infinity (UNCAPPED), so
binding_cap_cgroup_dir returns None and the cap-ancestor read emits "unavailable".
The measurement now reads memory.peak at the LEAF runner cgroup (the ephemeral
per-job cgroup, always present) and reports capped-vs-uncapped + host MemTotal.

One walk, all reads (single authority): the emit line carries memory.peak (usage)
+ memory.max (budget, =uncapped on the fleet) + host_ram + pids.current/max + the
sccache server cgroup classified descendant-vs-sibling (the "accounted exactly
once" decision) — consumed by the compile-jobs divisor (#5546) and the placement
model (#5559).

Stacked on #5564 (reuses its binding_cap_cgroup_dir / sccache scan). ci.yml
regenerated via main_wet; drift gate green; fmt + clippy -D warnings + release
build clean; --measure-cgroup-peak verified by execution.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Review fix (#5574): path-component prefix for sccache descendant check

claude-opus-4-7 flagged that sccache_under_leaf used a bare string prefix, so a
sibling like <leaf>-other.service would misclassify as a descendant (under-counts
host_fixed_overhead — the fail-OPEN direction). Compare on path components: leaf
itself, or a strict <leaf>/ prefix. Comment updated to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Brian Searls <briansrls@gunb.ai>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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