test(scripts): retarget the Bun 1.4 memory stack onto dev with blockers closed - #2376
Conversation
… diagnostics/GC-relief/smol-worker plans, macmini measurement protocol
Lands the research ledger and the 010/020/030/040 decade docs from #2301, rebuilt on current dev with the recorded review blockers closed. The EOF whitespace blocker is fixed: git diff --check was red on all six added files and is now clean. The future-date blocker is moot rather than fixed. The review was written on 2026-08-21 and objected that 000_research.md claimed 2026-08-22 as "today". Today is 2026-08-22, so the date is now simply correct; it is not backdated. Two plan-quality defects the landing review found are also fixed here: - 010 specified the unavailable extraMemorySize case as 0. Unavailable is not a measured zero, and coercing it would disagree with the watchdog and doctor layers, which type the field as optional. The plan now omits the key. - 040 step 3 described matched GC pairs driven by identical concurrent request streams, which contradicts 020's split into idle RSS cells and separate latency cells. Running an RSS cell under load reintroduces the allocator residual the split exists to remove. Step 3 now follows 020. Docs only. No production Bun.gc(true) call and no smol:true flag is landed here; both experiments recorded FAIL verdicts and those stand.
…ockers closed Rebuilds the harness halves of #2303 and #2304 directly on dev, without the #2302 runtime commit those PRs were stacked on. Merging them as stacked would have dragged in the extraMemorySize: 0 fabrication that #2302 still carries, and would also have reverted unrelated coordinator work that landed on src/cli/doctor.ts after the stack was cut. scripts/bun-gc-relief-eval.ts Records rssBeforeLoad and derives postLoadGrowth and recoveryFraction. The controlling 260731 gate is "at least 50% of post-load RSS GROWTH is gone", and the previous shape could not express that: rssAfterLoad - rssPlus60s cannot separate recovery from ordinary drift, and the recorded verdict divided recovered bytes by total post-load RSS, which answers a different question than the gate asks. recoveryFraction is null when growth was not measurable, so a cell that proves nothing does not read as 0% recovery. A child-side gc-error now rejects the waiting cell instead of expiring into a ten-second "gc receipt timeout" that hides the real cause. scripts/macos-rss-retention-harness-child.ts The SIGUSR2 collector is installed only under OCX_GC_EVAL=1. It was gated by a comment saying the 7h retention protocol never sends that signal, which is a claim about one sender rather than a property of the process; a stray signal would have collected inside the measurement that protocol exists to take. scripts/smol-worker-ab.ts payloadMb and runs are validated as bounded integers. Previously runs=0 produced a report claiming completionSuccess over an empty result set with the median fields silently absent, and a negative payload ran a meaningless workload instead of refusing. Medians are computed only once both arms are complete, so a verdict can never be derived from a partial set. The header claimed to measure the audited shapes of history, restore and policy workers; it imports none of them. It now says what it is: a synthetic screening of the array-plus-JSON burst shape those workers share. The FAIL verdicts both harnesses recorded stand. No production Bun.gc(true) call and no smol: true flag is landed here. The GC harness needs a live upstream fixture to produce new numbers, so the recorded RSS cells are NOT regenerated by this commit and the 020 table still carries the old denominator. Re-running the cells and rewriting that table around recoveryFraction is deliberately left as the next measurement pass rather than claimed here.
|
✅ Deterministic PR hygiene checks passed. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThe PR adds plans and executable harnesses for Bun 1.4 memory diagnostics, GC-relief evaluation, smol-worker A/B testing, and macmini measurements. It defines fresh-process gates, guarded GC control, optional JSC fields, latency and RSS criteria, and JSON evidence reports. ChangesBun 1.4 memory follow-up
Estimated code review effort: 4 (Complex) | ~45 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Evaluator
participant SSE fixture
participant Retention harness
participant Report
Evaluator->>SSE fixture: Run load and probe streams
Evaluator->>Retention harness: Send SIGUSR2
Retention harness-->>Evaluator: Return GC timing or error JSONL
Evaluator->>Evaluator: Sample RSS and calculate latency quantiles
Evaluator->>Report: Write cell results and runtime metadata
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Summary
Retargets the Bun 1.4 memory stack (#2301, #2303, #2304) onto
devwith the recorded review blockers closed. Two commits: the devlog roadmap, then the harness scripts.Deliberately excludes the #2302 runtime commit. Merging the stack as-is would have done two bad things: dragged in the
extraMemorySize: 0fabrication #2302 still carries, and reverted the coordinator work that landed onsrc/cli/doctor.tsafter the stack was cut (git diff origin/dev cac21afb -- src/cli/doctor.tsis-94/+6).Blockers closed
#2301 —
git diff --checkwas red on all six added markdown files (extra blank line at EOF); now clean. The future-date objection is moot rather than fixed: the review was written 2026-08-21 objecting to a2026-08-22date, and today is 2026-08-22, so it is correct now and was not backdated.Two plan defects also fixed:
010specified the unavailableextraMemorySizecase as0(unavailable is not a measured zero, and it contradicted the watchdog/doctor layers that type the field optional), and040step 3 described concurrent-stream GC pairs that contradict020's split into idle RSS cells and separate latency cells.#2303 — the harness recorded
rssAfterLoad/rssPlus5s/rssPlus60sbut no pre-load baseline, so it could not express the controlling gate ("at least 50% of post-load RSS growth is gone"). It now recordsrssBeforeLoadand derivespostLoadGrowthandrecoveryFraction, withnullwhen growth was not measurable so an inconclusive cell doesn't read as 0% recovery. A child-sidegc-errornow rejects the cell instead of expiring into a 10s timeout that hid the cause.The SIGUSR2 collector in the retention child is now gated on
OCX_GC_EVAL=1. It was gated by a comment saying the 7h protocol never sends that signal — a claim about one sender, not a property of the process.#2304 —
payloadMbandrunsare validated as bounded integers. Reproduced before fixing:Both invalid inputs now refuse. Medians are computed only after both arms complete. The header claimed to measure the audited shapes of the history/restore/policy workers while importing none of them; it now says what it is — a synthetic screening of the shared array+JSON burst shape.
What is NOT claimed
Both experiments' FAIL verdicts stand. No production
Bun.gc(true)and nosmol: trueflag is landed.The GC harness needs a live upstream fixture to produce new numbers, so the recorded RSS cells are not regenerated here and the
020table still carries the old denominator. Re-running the cells and rewriting that table aroundrecoveryFractionis the next measurement pass, not something this PR pretends to have done.Verification
Checklist
privacy:scangreenSummary by CodeRabbit
Documentation
Tools