From 703017eda096fea98efe409ad0fa1f577b3f0ea9 Mon Sep 17 00:00:00 2001 From: "nekomimi.pet" Date: Tue, 3 Nov 2026 21:11:35 -0500 Subject: [PATCH] perf: a replay gives each daemon request the 180 s its turn has, since five daemons beside the runner's other workflows can hold a prompt's acknowledgement past the harness's 20 s --- robot-docs/perf.md | 2 +- test/e2e/harness.py | 5 ++++- test/perf/run.py | 6 ++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/robot-docs/perf.md b/robot-docs/perf.md index 2293510ae..6faac726d 100644 --- a/robot-docs/perf.md +++ b/robot-docs/perf.md @@ -12,7 +12,7 @@ python3 test/perf/compare.py /tmp/perf/results.json [--baseline main-results.jso `ALBEDO_TEST_DAEMON` accepts a launcher from `test/snapshot-daemon.sh`; without it the shared E2E harness builds one snapshot for the invocation. `ALBEDO_TEST_CLI` selects a prebuilt CLI and `PERF_COMMIT` names the commit when the checkout has no usable git. Each repetition gets a fresh hermetic daemon home, and the harness stops every private daemon on success and failure. A failed measurement is not retried, and a scenario that stops early reports its own error rather than the recording's unused responses. Replay pairs each proxied provider request with its recorded answer and fails when the counts differ; live keeps the answered requests without per-request bytes when a provider refused or dropped one, and reports `proxied_requests` beside `provider_requests`. -In replay, a scenario's repetitions run at the same time, each on its own daemon (`--jobs 1` runs them in turn; live and recording runs are always sequential). On valefar at CI size (12 CPUs, 12 GiB) a five-run replay of the eight scenarios before idle takes about 2.4 minutes of scenario time concurrently and 10.5 minutes sequentially; idle adds about 1.5 minutes. `--scenario NAME` selects a diagnostic subset and derives no gates. +In replay, a scenario's repetitions run at the same time, each on its own daemon (`--jobs 1` runs them in turn; live and recording runs are always sequential). A replay gives every daemon request the 180 s a turn has (`harness.REQUEST_SECONDS`, 20 s for the e2e suites), since five daemons replaying beside the runner's other workflows can hold a prompt's acknowledgement past 20 s, and request latency is not gated. On valefar at CI size (12 CPUs, 12 GiB) a five-run replay of the eight scenarios before idle takes about 2.4 minutes of scenario time concurrently and 10.5 minutes sequentially; idle adds about 1.5 minutes. `--scenario NAME` selects a diagnostic subset and derives no gates. Scenarios: boot (empty daemon, then one idle session); chat (five text turns); coding (eight cells that read and edit a fixture and run its tests); long (60 text turns: 20 warm-up, then 40 gated, with HTTP and `albedo sessions read` hydration at the end); fan-out (one turn in each of 20 sessions); agents (a parent and three children that mail it); kernel (one cell at rest, five warm-up cells, then 30 cells of ordinary work); pool (a cold kernel, its release, a wake that warms spares, a second session adopting a forked spare, then rest); idle (a session never used, a text turn in another, a cell in a third, then one hour of the daemon's timers at `ALBEDO_TEST_TIME_SCALE=60`). idle's recording is chat's first turn and pool's first turn, which it replays unchanged. diff --git a/test/e2e/harness.py b/test/e2e/harness.py index 0bced6d2c..ffbbfa079 100644 --- a/test/e2e/harness.py +++ b/test/e2e/harness.py @@ -141,6 +141,9 @@ restart_seconds = 0.0 # mist closes a keep-alive connection after 10 idle seconds; one idle for less # than this is reused, so a request never races the daemon closing it. KEEP_ALIVE_SECONDS = 5 +# How long one daemon request may take to answer. A test daemon answers in +# milliseconds; a run that shares its machine with others may raise this. +REQUEST_SECONDS: int = 20 class Provider(fake_provider.Provider): @@ -155,7 +158,7 @@ class _Connection(http.client.HTTPConnection): """A daemon connection that notes when it can carry the next request.""" def __init__(self, port, token): - super().__init__("127.0.0.1", port, timeout=20) + super().__init__("127.0.0.1", port, timeout=REQUEST_SECONDS) self.token = token self.response_class = _Response self.used_at = time.monotonic() diff --git a/test/perf/run.py b/test/perf/run.py index dd3fecf26..141d033a9 100644 --- a/test/perf/run.py +++ b/test/perf/run.py @@ -435,6 +435,12 @@ def main(): parser.error("rate must be nonnegative; only bonsai recordings are committed") pacer = Pacer(args.rate) jobs = args.jobs or (args.runs if args.mode == "replay" else 1) + if args.mode == "replay": + # Five daemons replay at once, beside whatever else the runner has + # on the same VM: a prompt's acknowledgement can take longer than the + # harness's 20 s when the CPU is contended, and that latency is not + # what the gate measures. A request gets the budget a turn has. + harness.REQUEST_SECONDS = 180 scanner = SecretScanner(extra=[os.environ.get(args.key_env, "")]) if args.mode == "replay" and sys.platform != "linux": parser.error("replay memory gates require Linux /proc") -- knotmirror 0.0.1