Repository navigation
bench(render): N-session baseline harness for the daemon epic (#14) - #26
Merged
Merged
Conversation
axisrow
added a commit
that referenced
this pull request
Sep 27, 2026
The fork's main branch is already red: 21 eslint errors across PowerlineThemeSelector.tsx (+test), renderer-regular-theme.test.ts, separator-font-fallback.test.ts, cli.ts, powerline.ts and renderer.ts from earlier theme/CLI merges. Every PR fails "Lint & Type Check" on them, including #26, whose own files are clean. Mechanical, behavior-preserving fixes: - 17 auto-fixed via `bun run lint:fix` (arrow-parens, indent, import order/newlines) - powerline.ts: `if (x === null) x = f()` -> `x ??= f()` (type is `PowerlineFontStatus | null`, so ??= is exactly equivalent) - renderer-regular-theme.test.ts: replace `first!`/`second!` (banned by no-non-null-assertion; demanded by non-nullable-type-assertion-style) with an explicit narrowing throw - a stronger check than the previous toBeDefined() pair - PowerlineThemeSelector.test.ts: `.filter(...)[0]` -> `.find(...)` bun run lint: clean. bun test: 2494 pass, 0 fail. Co-Authored-By: Claude Code <noreply@anthropic.com>
Extend scripts/benchmark-render.py with a baseline mode: 1/10/36 concurrent sessions, cold/warm, small/large transcripts. Per-scenario child interpreters give clean getrusage(RUSAGE_CHILDREN) CPU accounting including all descendants; RSS via ru_maxrss peak plus ps-sampled aggregate; wall latency p50/p95/p99; PATH-shim instrumented passes count git/security spawns. Built-in loadavg gate and per-scenario load stamps. Results (26/26 runs, Apple M5, node dist): docs/baseline-14-results.json, methodology and tables: docs/baseline-14-verification.md. Legacy sirmalloc#397 single-run mode unchanged. No daemon code, no src/ changes. Red line for #14 (warm, 36 sessions): ~207 CPU-s/wall-min, agg RSS 1.8-2.4 GB, 0 git spawns/render warm, 4.0 cold. Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
axisrow
force-pushed
the
feat/benchmark-baseline
branch
from
September 27, 2026 02:57
2e3aa4c to
e263db9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extends
scripts/benchmark-render.py(the sirmalloc#397 render benchmark) into an N-session baseline harness for the daemon epic #14 — and commits the measured one-shot baseline. No daemon code, nosrc/changes; onlyscripts/anddocs/.Closes nothing; provides the red-line reference for #14: the daemon's aggregate CPU and RSS must not exceed these numbers.
Harness (scripts/benchmark-render.py, stdlib only)
benchmark-render.py <runtime> <entry> <label>, unchanged), plusbaseline/run-one/_sampler, plus--self-test.s36-warm-small(run-to-run variance). Each scenario runs in a dedicated child interpreter sogetrusage(RUSAGE_CHILDREN)starts at zero — CPU user+sys covers the runtime and all reaped descendants (git, sh).ru_maxrss), aggregate RSS (ps-sampled live process tree, mean→max), wall latency p50/p95/p99, git/security spawn counts, output hashes, machine context and per-scenario loadavg stamps.execthe real binary); their CPU/latency never enters baseline tables.Reproduce:
bun install && bun run build python3 scripts/benchmark-render.py baseline --runtime node --entry dist/ccstatusline.js --out /tmp/ccsl-baseline-14 --max-load 10Baseline (Apple M5, 10 cores, node dist/ccstatusline.js, CCSL_FORK=1, 26/26 runs OK)
Cold = fresh HOME, first render per session; warm = 2 warmups then 6 measured renders/session (persistent git cache populated, steady state). All sessions share one HOME per run (same-OS-user realism, the daemon's target) and one dirty git repo as cwd; each session has its own transcript.
securityspawns: 0.0 everywhere. Full 26-run machine-readable data (per-render latency arrays, loadavg stamps, hashes):docs/baseline-14-results.json; methodology and noise notes:docs/baseline-14-verification.md.Run-to-run variance (s36-warm-small ×3)
CPU/render spread ~7%, aggregate RSS ~6%; latency is noisier under ambient load, as expected.
How the daemon red line uses this
Warm, 36 sessions anchors: ~207 CPU-seconds per wall-minute at ~1040 renders/wall-min, ~1.8–2.4 GB aggregate RSS across ~36 concurrent process trees (75–108 MB peak each), 0 git spawns/render warm vs 4.0 cold. A daemon prototype at N sessions must match renders at aggregate CPU and RSS not above the matching baseline row; the cold table bounds the all-sessions-repaint burst after a daemon restart.
Honesty notes
bun run lint:tsc --noEmitclean; ESLint reports 21 pre-existing errors onorigin/mainfiles, none from this branch (which touches onlyscripts/anddocs/).Risks / follow-ups
--self-testcovers percentile/fixture/shim logic; full-matrix runtime is bounded (~10–15 min of measuring plus gate waits).🤖 Generated with Claude Code