Skip to content

Battery runner working set is 20–34GB; budget is 8GB #702

Closed

Description

@ehartford

Bar

with build :test's runner process must peak at ≤ 8GB. Today it needs 20–34GB and dies at the 32GiB emergency ceiling (#701). The ceiling is the "something is terribly wrong" line — it is not a budget, and the runner has been living against it.

Measured decomposition (2026-07-22)

Why it accumulates

Everything the parent allocates is permanent, because scope-exit destruction does not yet free the POD tier (#608 — Vec/str buffers, ++ intermediates, extern-returned strings). On top of that base condition:

  1. Action targets comptime-evaluate in the parent — every kind-23 action's full interpreter allocation history is retained. Rebuild runs (all actions live) are the worst case.
  2. Cache fingerprinting reads whole input files — each read buffer (100MB+ binaries) is retained; the ++ amplifier is fixed, the reads remain.
  3. Graph load / bookkeeping baseline ~1GB.

Fix paths

  • Campaign: the wide flip — containers own their buffers (POD-element drop elaboration) #691 (the flip) is the structural fix: with scope-exit destruction, (1)–(3) become transient and the parent should sit near the 1GB baseline. This issue is a concrete acceptance test for the flip: post-flip, full battery parent peak ≤ 8GB.
  • Independent of the flip: run kind-23 actions in spawned workers (the WITH_BUILD_ACTION_WORKER machinery is half-present) so their interpreter state dies with the worker, mirroring how test lanes already isolate.
  • After the flip: add a battery gate asserting the runner's committed peak stays under budget, so regressions self-identify instead of coasting to the ceiling.

Related: #701 (ceiling death, pre-existing evidence), #691 (structural cure), #608 (leak-by-design tier).

Activity

  1. ehartford commented on Jul 22, 2026

    @ehartford
    ContributorAuthor

    Live-heap attribution (via the new WITH_ALLOC_SYSTEM=1 mode + heap on the running parent at 9.1GB):

    After the streaming-hash fix, worker-per-action, the comptime push fix, and a per-run fingerprint memo, the fully-cached battery parent still demands ~35–40GB — and dies 0.17MB short of the 32GiB ceiling (committed=34,359,566,720 vs limit=34,359,738,368). The umbrella is green end-to-end under WITH_MEMORY_LIMIT_BYTES=64GB (22.8GB peak footprint, all lanes + evidence targets).

    Conclusion: the residual mass IS the #608 design decision, not any further fixable site — every remaining gigabyte is retained-by-design memory the #691 flip reclaims. Pre-flip site fixes are exhausted; the 8GB budget is achievable only with the flip.

  2. ehartford commented on Aug 31, 2026

    @ehartford
    ContributorAuthor

    Triage re-scope 2026-08-31: the pre-flip 20–34GB decomposition is historical (the #691/#747 flips, fingerprint memo, and serialized graph cache landed), but nothing enforces the bar and the default ceiling was raised to 64GiB (8b0a144) — so nothing self-identifies a regression. Remaining scope: re-measure the battery runner's committed peak post-flip; the ≤8GB bar stands (src/main.w:88 calls it the flip's acceptance test); add the battery gate asserting the peak stays under budget.

  3. ehartford commented on Sep 1, 2026

    @ehartford
    ContributorAuthor

    Measured with the new per-target RSS instrumentation (ea2196d3), cold full build + :test, 2026-09-01: orchestrator high-water 456M/227M, largest pooled child 499M (regex-runtime-ir), invariance lanes 432M. Nothing within 70× of the recorded 20-34GB.

    Two hypotheses for the gap, needing one re-verification run each: (a) the 20-34GB was the OLD battery's shape — pre-#683 worker respawns + the 22-minute serial world summing many concurrent compiler processes — and the working set genuinely collapsed since; (b) it measured a different quantity (sum over time, or macOS compressed/virtual accounting rather than ru_maxrss). Caveat on today's numbers: grandchildren aren't summed (a lane's sliding-window compiler children are individually ~300-500M; window×size still fits comfortably under 8GB).

    If (a) verifies, this issue likely closes on evidence once #680 lands with a plain width×footprint admission cap rather than the windowing machinery originally envisioned.

  4. ehartford commented on Oct 25, 2026

    @ehartford
    ContributorAuthor

    Triage 2026-10-25, with v0.15.3.0 (main a261b65): does not reproduce. The measurement in the last comment (2026-09-01, cold full build plus :test) found the orchestrator at 456 MB and the largest child at 499 MB; today's battery ledger (~/.local/with-green/battery-times.tsv) records the costliest target at 3.2 GB (pub-lint-check), stage1 and stage2 at 1.6 GB. Nothing approaches the 8 GB bar.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions