Skip to content

improve(compaction): prepare large histories outside the Gateway thread - #200114

Merged
roboclaw-bot merged 19 commits into
mainfrom
openclaw/nimble-crayfish
Nov 16, 2026
Merged

roboclaw-bot merged 19 commits into
mainfrom
openclaw/nimble-crayfish

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #185111 (large-history preparation context; not a claim to resolve its Codex pre-turn workload).

What Problem This Solves

Preparing a large retained history for default safeguard compaction can block the Gateway thread and delay unrelated sessions.

User Impact

Eligible default compaction prepares and rerenders history in the existing transcript reader. Provider requests, authentication, hooks, custom providers, mutable SDK behavior and guarded writes remain host-owned. Oversized or unsupported windows retain complete acknowledged host hydration, not truncated context.

Paired performance acceptance remains pending. This is not a proven CPU/memory improvement or global no-blocking guarantee. No configuration, public SDK signature, schema or migration changes are required.

Why This Change Was Made

One internal preparation algorithm preserves row provenance and the public four-argument API. Canonical tool, replay, hydration and summary-budget owners serve worker and host consumers. No worker is held across inference, new cache, whole-history graph-transfer protocol or public read-only extension API.

The #194536 worker-memory fix is preserved: private plan/render cohorts are admitted before payload decoding, with a 16 MiB serialized-input ceiling and the unchanged 512 MiB worker heap. Larger windows retain complete streamed host hydration. This input ceiling is not a universal decoded-heap guarantee. Renders use the maintained filtered JSONL budget check in the same snapshot.

Current-main integration preserves repeat-guard metadata, announced compaction IDs and #200063's session/model-only checkpoint replay identity. Transport authentication is unchanged.

Scope, simplification and test cost

The signed series contains five coherent owner prerequisites and private producer/consumer adoption. Yield-only, exclusive-handoff and held-worker alternatives were rejected; duplicate materialization and eager replay work were deleted. Existing SQL position/retention bodies have one context-navigation owner, unchanged except exported-signature formatting, without a line-cap suppression.

The CI repair moves canonical worker data types out of host implementation modules and migrates every internal type caller. Sixteen moved casts are removed through real type narrowing; sparse legacy billing does not acquire fabricated zero-cost data. The wrapper inventory now includes its hydration decoder. Shared prepared-runtime fixtures supply their required catalog. Existing Gateway tests still make 40 real reads and assert over 64 transcript events, using distinct valid read limits rather than weakening the repeat guard. Diagnostic tests own a scoped transport host rather than inheriting another test's mocked provider callbacks.

Against main fcf29c4: 107 paths, +6,882/−2,665 lines, including mechanical moves. The runtime CI repair is 43 paths, +232/−206; its subsequent fixture-only follow-up changes two existing tests and their allocation. Test growth passes at 2,101 net lines = 400 allowance + 1,701 reviewed allocation: the earlier 93-line real-worker admission case plus 17 further net lines in existing CI fixtures. There is no new test case/file/cold shard, timeout change or raised shared threshold. Obsolete assertion and mock debt only shrinks; no unrelated UI allowance is added.

The changed 13-case hydration file costs 101.528 s cold wall / 174.598 local child CPU-seconds, including bootstrap; the new case takes 2.599 s in the affected batch. PostgreSQL conformance costs 79.568 s wall / 135.495 local child CPU-seconds. The diagnostic red reproduction costs 68.920 s wall, mostly transformation; its original lifecycle cases remain present. CI seconds are unobserved, and these different workloads are not speed comparisons.

Evidence

The runtime implementation is normal-hook signed 2557ac2, tree 68e73028926dae2bebb772f62519c683bd753963. Its exact sourcePerformance build passes with unchanged tracked source. The preceding whole-feature review retains its original scope; fresh P0–P2 review of the complete 43-path runtime CI repair is scoped-clean with 412,619 bytes of intact input.

The latest fixture-only follow-up is normal-hook signed a05d6ff, published tree 57ab8bd72361aba17d7eb8f90c22803d6b4fa71d. Production inputs are byte-unchanged from 2557, so its build, Gateway and native proofs are reused, not relabeled as new-source captures. A fresh three-file P0–P2 review is scoped-clean with 31,559 bytes of intact input.

  • 331 distinct focused cases across 14 files pass through current or unchanged-input-reused proof: the earlier 169-case batch, a further 154-case batch with four overlapping diagnostic cases, seven isolated Gateway E2E cases, and the latest nine-case fixture run with four diagnostic repeats.
  • The diagnostic isolation reproduction fails at the unrelated throwing provider host before the fixture fix, with the other three lifecycle cases passing; all four pass after the fix. Model-call lifecycle and no-prompt-serialization assertions remain intact.
  • Hosted CI exposed two additional fixture type errors. The explicit inert plugin host now supplies its complete existing port contract. The prepared-session test consumes SettingsManager.inMemory directly with the former fixture's exact settings after main retired an unused private helper export; no compatibility export is restored. Both failing owning graphs, agents-root and agents-sessions, now pass locally, as do matching strict type-aware lint, format and all nine fixture cases. Remote CI must still finish.
  • Earlier targeted type graphs pass; the combined import graph has zero cycles. Assertion, mock, max-lines and test-growth ratchets pass without weakening their limits.
  • The earlier replay migration passed 127 cases. The unchanged memory/SDK/hydration repair passed 121 focused cases and two PostgreSQL cases with zero skips, including catalog/migration/trigger checks and disposable cleanup. These overlapping runs are not added to the distinct count above.
  • The real 18 MiB admission fixture preserves byte/navigation facts while corrupting a payload: pre-fix decoding wins over rejection, while fixed plan and render reject before decoding. Restoring it verifies complete streamed hydration. The initial 33,000-row attempt failed at projection rebuilding and remains invalid setup evidence, not a product reproduction.
  • An initial offline E2E build preparation failed before any tests at an unavailable registry fetch. The documented same-source prebuilt route then passed all seven real Gateway cases after the exact build succeeded. An interrupted diagnostic attempt remains interrupted; completed static phases are not relabeled as a completed test run.

Runtime Gateway qualification — source 2557, reused unchanged

defaultauto-landing3-warm-q1 binds signed 2557ac2, its exact build and common workload 178e6b14eb40c725396b838c8114dd85ced6dcce. 300/300 probes are valid; warmup and measured phases share PID 1035. Each verifies one actual prepared plan, four rendered results, four HTTP 200 maintenance requests and durable boundaries 18 → 19. The outcome is degraded-quality fallback, not normal-quality summary success. Both original 47,184-row prefixes match their recorded bytes/SHA-256. All 71 raw files and two links are unchanged, inspection copies removed and cleanup valid.

This is one source-bound qualification, not matched performance acceptance. All measured costs remain visible:

Metric Source-2557 qualifier
Stream RPC median / p95 / p99 / max 3.478 / 6.385 / 42.212 / 279.563 ms
Maintenance-window RPC median / p95 / p99 / max 3.500 / 14.560 / 180.152 / 279.563 ms
Stream / full maximum sampler gap 120 / 374 ms
Stream / full Gateway process CPU 23,176.989 / 99,603.749 ms
Stream / full main-isolate CPU 1,831.857 / 14,109.509 ms
Stream / full sampled maximum RSS 2,631,634,944 / 2,631,634,944 bytes
Stream / full main heap 510,138,232 / 545,380,976 bytes
Stream / full observed worker heap 127,378,848 / 158,638,504 bytes
Stream / full worker large-JSON parse count 81,882 / 194,371
Stream / full worker large-JSON parsed bytes 559,635,186 / 1,274,631,589
Stream / full distinct observed worker IDs 5 / 13
Stream / full retained transport chunks / frames 1 / 8; 2 / 16
Stream / full retained transport bytes / events 333,107 / 4; 666,244 / 8
Whole-rig child CPU 188,673.716 ms

The stream brackets are immediate samples, 0 ms before and 60 ms after, without prorating. Full CPU includes startup/warmup and is last observed cumulative CPU per Gateway PID; unsampled shutdown tails remain unobserved. Process CPU already includes workers. Worker counters cover successful userland JSON strings of at least 1,024 UTF-16 units, not host parsing; overlapping tasks include overhang. Worker IDs are distinct observations, not simultaneous peaks. Full capture has two plans/eight renders including warmup; measured request count five includes its pressure request, not five maintenance requests.

Prior-source qualifications — retained separately, never pooled

defaultauto-landing2-warm-q1 qualified signed 3ff / published 3f with 300 valid probes, same PID 1047, one plan/four renders/four maintenance requests and 18 → 19 degraded boundaries per phase. Both original prefixes matched; 69 raw files/two links were unchanged.

Metric Prior 3ff qualifier
Stream RPC median / p95 / p99 / max 5.485 / 8.092 / 56.596 / 314.547 ms
Stream / full maximum sampler gap 107 / 768 ms
Stream / full Gateway process CPU 23,569.405 / 106,636.022 ms
Full sampled maximum RSS 2,713,694,208 bytes
Full observed worker heap 153,459,776 bytes
Full worker large-JSON parse count / bytes 228,660 / 1,527,489,040
Whole-rig child CPU 201,379.135 ms

Earlier exact-623 stream max 13.764 ms/full gap 407 ms and c58/77 max 71.683 ms/full gap 1,388 ms remain separate, each with 300 valid probes and the same degraded class/four maintenance requests. Every earlier CPU/RSS/parsing/failure cell, the 267/162 overlapping checks and all-19-file cost proof retain their original source scope. None is relabeled as current-source regression acceptance.

Open: exact-head CI/landing gates, formal paired cold/warm acceptance, live-provider follow-up, effective SDK window and per-worker/JIT warmth. No performance-win or no-regression conclusion is claimed.

Prospective acceptance protocol — draft, not an admitted cohort

Before acceptance, pin both production commits/build receipts, the signed controller, fixture, image and sampling manifests; freeze and read back the published rule. Previous diagnostics and qualifiers are ineligible.

Run five serial baseline/candidate cold pairs, then five separate process-warm pairs. Warm requires a distinct physical session to durably complete default maintenance in the same Gateway PID first; it does not establish per-worker/JIT warmth or global idle. Use unique immutable tags and stopped imports, auditing unchanged original prefixes, durable outcome class and maintenance request counts.

Keep all 300 scheduled slots and every error, timeout, suppression and cancellation. Retain full-stream and declared broad-window latency, sampler gaps, process/main CPU, RSS/heaps, parsing/transport and full-capture startup/warmup costs. No post-result window selection, outlier removal, replacement tags or diagnostic pooling.

Report n=5 per arm/population, median, nearest-rank p95, spread and paired rows. Incomplete capture or source/outcome mismatch stops the cohort with its prefix retained. A median/p95 metric worsening at least 20% stops before the next population. Every adverse cell remains visible; a worse user-facing metric needs explicit owner acceptance. Lower worst latency does not excuse higher CPU or memory.

No acceptance cohort has started under this draft. Qualification does not grant acceptance.

Contributor credit

Requested by @RomneyDa; publication authorized by @vincentkoc. Human contributor credit retained in the signed series: @RomneyDa, @vincentkoc and @jalehman.

Work sessions

Linked for team reference; these sessions aren’t public.

Worked on by

roboclaw-bot and others added 7 commits November 16, 2026 06:43
Keep checkpoint selection and definition projection independent of host tool policy and executable wrappers. Preserve pinned-tool refusals and canonical schema comparison.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: jalehman <[email protected]>
Move registry-owned authentication and request policy out of session assembly
while preserving the SDK stream behavior and runtime binding.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: jalehman <[email protected]>
Give native row framing and transcript decoding their internal data owners
while preserving snapshot custody and acknowledged host consumption.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: jalehman <[email protected]>
Move generic replay transforms and snapshot scanning into data owners
while preserving host provider hooks, session effects and request bytes.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: jalehman <[email protected]>
Share exact summary prompt and output policy with a single render-budget
completion loop while preserving the existing public preparation API.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: jalehman <[email protected]>
Prepare builtin summary facts and each actual render budget in the existing
transcript reader while keeping provider effects, hooks and guarded writes
on the host. Preserve the public four-argument preparation API.

Native performance acceptance remains separate from this implementation.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: jalehman <[email protected]>
Worked on by:
- @RomneyDa
- @vincentkoc
- @jalehman

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: jalehman <[email protected]>
OpenClaw-Publication: 2199d969-be5a-8b91-9cdf-517d3f575c0e
@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: XL labels Nov 16, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 16, 2026
@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head 99763a3b99feb80fca106fe269ecc6112adc4dc4, but the PR head is now 77a3bb2897de683a75a0c9a34810cc96e3293bfc. Its old verdict and PR readiness labels are no longer current.

Next step
Comment @clawsweeper re-review when the current head is ready; pushes after the first review are not reviewed automatically.

Review history (1 earlier review cycle)
  • reviewed 2026-11-16T13:34:08.966Z sha 99763a3 :: needs changes before merge. :: [P2] Preserve streaming before materializing oversized compaction windows

roboclaw-bot and others added 3 commits November 16, 2026 14:34
Merge current main without losing repeat-guard policy or announced compaction
identities. Admit private preparation and render cohorts before payload decoding,
preserving the complete acknowledged host stream above the optimization budget.

Keep the existing worker heap and public SDK/configuration unchanged.
Formal cold/warm performance acceptance remains separate.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: jalehman <[email protected]>
Worked on by:
- @RomneyDa
- @vincentkoc
- @jalehman

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: jalehman <[email protected]>
OpenClaw-Publication: 32977ebc-3bc1-860d-9f5c-82a1cf284be6
@clawsweeper clawsweeper Bot removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 16, 2026
roboclaw-bot and others added 3 commits November 16, 2026 14:52
Merge the current checkpoint replay identity contract into both moved compaction
owners without changing transport authentication or the existing bounded preparation,
preserving complete acknowledged host streaming above the optimization budget.

Keep the existing worker heap and public SDK/configuration unchanged.
Formal cold/warm performance acceptance remains separate.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: jalehman <[email protected]>
Worked on by:
- @RomneyDa
- @vincentkoc
- @jalehman

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: jalehman <[email protected]>
OpenClaw-Publication: 9b1036d0-4f2a-8612-be3c-4305681d25ce
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 16, 2026 14:57
roboclaw-bot and others added 2 commits November 16, 2026 16:00
Keep worker data contracts independent of host implementation imports and remove
unsafe replay casts without fabricating billing costs. Preserve the wrapper
decoder inventory and scope diagnostic test transport state to each fixture.

Keep the real long-history sender-policy proof and existing repeat guard intact.
Shrink obsolete assertion/mock debt and record the existing-fixture regression
allocation without adding a test file or changing execution limits.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: jalehman <[email protected]>
roboclaw-bot and others added 4 commits November 16, 2026 16:11
Worked on by:
- @RomneyDa
- @vincentkoc
- @jalehman

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: jalehman <[email protected]>
OpenClaw-Publication: 1cbca64a-ec86-8663-854f-d575c59be846
Supply complete inert plugin ports to the shallow transport-host input type.
Use SettingsManager directly after main retired the private compactionSettings
test export, preserving its exact configuration and all existing assertions.

Production inputs are unchanged; reuse their qualified build and native proof.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: jalehman <[email protected]>
Worked on by:
- @RomneyDa
- @vincentkoc
- @jalehman

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: jalehman <[email protected]>
OpenClaw-Publication: 473dfcfe-3e41-8b51-9488-61790dfb3aa0
@roboclaw-bot
roboclaw-bot merged commit 472cd0a into main Nov 16, 2026
147 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/nimble-crayfish branch November 16, 2026 17:01
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Landed source and prospective performance proof

PR #200114 is merged as 472cd0a after green exact-head CI. Its actual before-merge first parent is eba3bac. Contributor credit remains @RomneyDa, @vincentkoc and @jalehman.

This evidence comment supersedes only the PR body's stale CI/landing status and draft prospective protocol. All earlier source-scoped qualifications, failures and adverse metrics remain evidence, not acceptance. No performance acceptance sample has started. Both actual-source builds and separate native eligibility qualifiers completed; those qualifiers are not part of this cohort.

Rule SHA-256: 9809ca6950f80ce762c05b5b68e411b1e418ef80b7cbecc54488cbea9c3dba9c

Frozen post-merge comparison rule — cohort postmerge200114-paired1

This is a prospective rule, not performance acceptance. No acceptance observations precede publication/readback of these exact bytes. Qualification captures are ineligible and remain separate.

Flow: the real isolated OpenClaw Gateway/agent, actual new-config default safeguard post-reply maintenance, controlled local model HTTP, and unrelated-session RPCs. This does not establish live-provider semantic quality, natural pressure, exact effective SDK context, per-worker/JIT warmth, or global idle.

Sources and artifacts:

  • baseline: commit eba3bac058974422f21aba2ade5395989c777528; receipt formal-baseline1-build.json SHA-256 958311625de83b150428df51a7c9448eaf9679af9d4775c9ac35b7d7af1767f4.
  • candidate: commit 472cd0a2f542599eea763f013eba2d34033ca25f; receipt formal-candidate1-build.json SHA-256 02b79f379f573a7642dfbec95cdbbb3c0c41cd37bc8b1dd6f45dd022ad83562b.
  • The baseline is the verified squash merge's actual first parent, not a guessed current main. The candidate is the actual landed commit, not PR head 64c8697634496e5b1d55207befd9a00e2af68184.
  • Common normally signed workload: 99e9e235b2d801522cb71c80194c2277cb2df470; execute its committed scripts/perf/default-compaction-bench/run.py PLAN.json --output OUTPUT.
  • Fixture: long01, SHA-256 baf7bda201afd82216d3ad4ecdd0c967262a2d2047b8efdb859796c538ce9980. Both 47,184-row original imported prefixes must match their own recorded bytes/hash/last ID.
  • Image: 2a71ebdc9a48b3e70687752d2143e86423bb19e6ae273cc4a1835a45ff451c1b; Node24.22.1, 8 CPUs, 16 GiB RAM, zero swap, unchanged default heaps (including the product worker limit), network=none, cleared environment, read-only source/dependencies. No paid or live-provider resources.

Schedule and protocol: schedule-manifest SHA-256 c46541fc6b9b912f749eef3ecdb6a73ffaf98cdfc8ec4cbdc92d35b7641b5715; committed protocol README SHA-256 b0df8f4d8354eb055c881c95ed9c3a55fd0669588731541cd2e8b05b23f741ab. Exact ordered original tags:

  • postmerge200114-cold-p01-baseline
  • postmerge200114-cold-p01-candidate
  • postmerge200114-cold-p02-baseline
  • postmerge200114-cold-p02-candidate
  • postmerge200114-cold-p03-baseline
  • postmerge200114-cold-p03-candidate
  • postmerge200114-cold-p04-baseline
  • postmerge200114-cold-p04-candidate
  • postmerge200114-cold-p05-baseline
  • postmerge200114-cold-p05-candidate
  • postmerge200114-warm-p01-baseline
  • postmerge200114-warm-p01-candidate
  • postmerge200114-warm-p02-baseline
  • postmerge200114-warm-p02-candidate
  • postmerge200114-warm-p03-baseline
  • postmerge200114-warm-p03-candidate
  • postmerge200114-warm-p04-baseline
  • postmerge200114-warm-p04-candidate
  • postmerge200114-warm-p05-baseline
  • postmerge200114-warm-p05-candidate

Order and populations: five serial baseline/candidate process-cold pairs, then five separate process-warm pairs (n=5 per arm/population). Cold means a fresh Gateway process, not flushed OS/page caches. Each warm sample starts a fresh Gateway, imports both histories while stopped, and first durably settles maintenance in a distinct sacrificial physical session in that same PID before the measured-session ready/start barrier. Host load is recorded. No concurrent arms, outlier removal, pooled diagnostics, replacement tags, or replacement cohorts.

Native/fidelity gate: every measured target, and both sacrificial/measured targets when warm, must have the exact native owner/incarnation/store identity, running/settled/write-release/removal/zero-owner facts, a healthy later observer sample, one durable boundary (18→19 for this fixture), the same degraded outcome class and four maintenance HTTP200 requests. Do not invent pre-run entry counters or treat degraded fallback as normal-quality success. Candidate private plan/render path counts and outcomes are reported explicitly; eligibility qualifiers must establish the actual private path, not merely dispatched labels. Native settlement does not establish global idleness.

Slots and windows: keep all 300 scheduled slots and every valid/error/timeout/cancelled/suppressed outcome. Failed calls remain in latency statistics; suppressed slots have no fabricated latency. Fixed full-stream and broad pressure-release→native-settlement windows are both reported; no post-result window selection. Stream CPU uses immediate sample brackets with overhang recorded, no prorating. Full-capture startup/warmup and last-observed cumulative process CPU remain included; unsampled shutdown tails are unobserved. Process CPU already includes workers. Worker counters cover successful userland JSON strings ≥1024 UTF-16 units and overlapping tasks including overhang; host parsing is unobserved. Worker IDs are distinct observations, not simultaneous peaks.

Comparable metrics (the workload's complete PERFORMANCE set):

  • stream.rpc.median
  • stream.rpc.p95
  • stream.rpc.p99
  • stream.rpc.max
  • maintenance.rpc.median
  • maintenance.rpc.p95
  • maintenance.rpc.p99
  • maintenance.rpc.max
  • full.processCpuMs
  • full.mainCpuMs
  • full.rssBytes
  • full.mainHeapBytes
  • full.pulseGapMs
  • full.workerHeapBytes
  • full.workerThreads
  • stream.processCpuMs
  • stream.mainCpuMs
  • stream.rssBytes
  • stream.mainHeapBytes
  • stream.pulseGapMs
  • stream.workerHeapBytes
  • stream.workerThreads
  • full.rigTreeCpuMs

Report all arm/population n=5 values, paired rows, medians, nearest-rank p95 and spread. A primary measurable responsiveness win requires at least a 20% reduction in BOTH population median and nearest-rank p95 of stream.rpc.max, separately in cold and warm. Every other user-facing metric must hold or improve; every worse cell remains adverse and needs explicit owner acceptance before any acceptance claim. Lower worst latency never excuses CPU or memory regressions. No single qualifier is a win/no-regression verdict.

Hard stops: incomplete capture, original failed/started tag, native/source/outcome mismatch, missing expected comparable metric, or changed frozen plan/protocol/runtime inputs stops the original cohort with its completed prefix and failures retained. At each ten-observation population checkpoint, any comparable metric's median OR p95 worsening ≥20% (including a zero baseline increasing) stops before the next population. Smaller adverse changes are still adverse, not automatically accepted or dismissed as spread. A stopped cold population leaves warm unattempted; it is not replaced or reported as two-population acceptance.

Partial work/path counters (all retained separately, not whole-workflow work totals):

  • full.parsedBytes
  • full.parseCount
  • full.transport.chunks
  • full.transport.frames
  • full.transport.transferredBytes
  • full.transport.endOfEvent
  • stream.parsedBytes
  • stream.parseCount
  • stream.transport.chunks
  • stream.transport.frames
  • stream.transport.transferredBytes
  • stream.transport.endOfEvent
  • planCount
  • renderCount
  • modelRequestCount

Every counter increase is shown in counterAdverse, including intentional plan/render work moved into the worker. These partial counters do not stand in for total CPU/work or excuse worse user-facing cells. Model-request counts are scoped explicitly: the measured count includes its pressure request; maintenance counts remain independently four per phase. All raw slot/native/counter failures remain available; no filtering away adverse evidence.

The controller never grants performance acceptance. Publication fields are evidence bookkeeping, not authority. Managed GitHub readback must record the actual merged state, PR head and merge commit separately, plus the full body and rule hashes, before plan creation/admission. Freeze complete plan/protocol/common scripts/runtime fingerprints before the first formal observation; revalidate the same original bindings at each effect. All captures remain private; only sanitized metadata/results, never transcript or model-request contents, may be published.

@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Frozen cold comparison: stopped before warm

No performance acceptance. All five original cold pairs completed with 3,000/3,000 valid RPC slots and independently re-audited native/integrity proof. The controller exited 1 at the declared cold checkpoint: full-capture sampler-gap population p95 rose 562 → 833 ms (+48.221%), crossing the published 20% hard stop. All ten warm observations remain unattempted; no replacement cohort, discarded outlier, qualifier promotion or pooled diagnostic is used.

Frozen rule, rule SHA-256 9809ca6950f80ce762c05b5b68e411b1e418ef80b7cbecc54488cbea9c3dba9c. Plan SHA-256 ec132e80caf6dc1de99ad098f2b43176983de08e897f5c7ee9a5c8b415427075. Baseline eba3bac (actual before-merge first parent); candidate 472cd0a (actual landed squash); common signed workload 99e9e235b2d801522cb71c80194c2277cb2df470. Exact qualified builds, image, fixture, protocol and original schedule remain bound as published.

The worst-request responsiveness criterion is met for cold only: population median of stream maxima 258.306 → 77.758 ms (−69.897%); population p95 270.038 → 84.095 ms (−68.858%). This does not override adverse CPU, worker-heap, p95-latency or full-capture-pause cells, and warm is unmeasured.

All comparable performance cells

Each cell aggregates five observations per arm. NN p95 is nearest-rank population p95 (the maximum at n=5), not a request-level percentile unless the metric itself says so. RSS/heaps are bytes, CPU is ms, RPC/sampler gaps are ms, worker IDs are distinct observed counts—not simultaneous peaks.

Metric Baseline median / NN p95 / spread Candidate median / NN p95 / spread Median / p95 change
stream.rpc.median 4.79 / 5.661 / 2.028 4.158 / 4.726 / 0.865 -13.196% / -16.529%
stream.rpc.p95 6.594 / 8.356 / 1.873 6.909 / 7.774 / 1.98 4.778% / -6.962%
stream.rpc.p99 62.908 / 76.574 / 31.612 29.29 / 36.968 / 18.537 -53.44% / -51.722%
stream.rpc.max 258.306 / 270.038 / 45.242 77.758 / 84.095 / 23.952 -69.897% / -68.858%
maintenance.rpc.median 9.513 / 12.504 / 3.995 7.06 / 7.563 / 2.924 -25.786% / -39.513%
maintenance.rpc.p95 159.411 / 170.361 / 43.857 63.154 / 70.961 / 21.285 -60.383% / -58.347%
maintenance.rpc.p99 258.306 / 270.038 / 45.242 77.758 / 84.095 / 23.952 -69.897% / -68.858%
maintenance.rpc.max 258.306 / 270.038 / 45.242 77.758 / 84.095 / 23.952 -69.897% / -68.858%
full.processCpuMs 50040.883 / 51663.675 / 3351.811 50931.529 / 52980.6 / 3052.846 1.78% / 2.549%
full.mainCpuMs 12852.874 / 13183.809 / 1023.333 12203.197 / 12763.059 / 956.884 -5.055% / -3.191%
full.rssBytes 2676219904 / 2744201216 / 134901760 2649800704 / 2706223104 / 73388032 -0.987% / -1.384%
full.mainHeapBytes 691519048 / 696742656 / 11783744 628432464 / 642332432 / 20048560 -9.123% / -7.809%
full.pulseGapMs 404 / 562 / 162 400 / 833 / 435 -0.99% / 48.221%
full.workerHeapBytes 105110848 / 114391968 / 12301584 109186696 / 117792792 / 11017776 3.878% / 2.973%
full.workerThreads 11 / 12 / 1 11 / 11 / 0 0% / -8.333%
stream.processCpuMs 10714.127 / 11385.613 / 919.891 10582.124 / 11557.586 / 1333.049 -1.232% / 1.51%
stream.mainCpuMs 2679.431 / 3006.348 / 582.309 2156.265 / 2206.539 / 210.075 -19.525% / -26.604%
stream.rssBytes 2676219904 / 2744201216 / 134901760 2649800704 / 2706223104 / 73388032 -0.987% / -1.384%
stream.mainHeapBytes 691519048 / 696742656 / 11783744 628432464 / 642332432 / 20048560 -9.123% / -7.809%
stream.pulseGapMs 322 / 324 / 35 117 / 119 / 12 -63.665% / -63.272%
stream.workerHeapBytes 102090384 / 105523592 / 28564288 109186696 / 117792792 / 15964960 6.951% / 11.627%
stream.workerThreads 5 / 5 / 0 5 / 5 / 0 0% / 0%
full.rigTreeCpuMs 98095.89 / 100218.974 / 4919.197 100077.679 / 103160.856 / 5549.972 2.02% / 2.935%

Every adverse performance cell

  • stream.rpc.p95 population median: 6.594 → 6.909 (+4.778%).
  • full.processCpuMs population median: 50040.883 → 50931.529 (+1.78%).
  • full.processCpuMs population p95: 51663.675 → 52980.6 (+2.549%).
  • full.pulseGapMs population p95: 562 → 833 (+48.221%) HARD STOP.
  • full.workerHeapBytes population median: 105110848 → 109186696 (+3.878%).
  • full.workerHeapBytes population p95: 114391968 → 117792792 (+2.973%).
  • stream.processCpuMs population p95: 11385.613 → 11557.586 (+1.51%).
  • stream.workerHeapBytes population median: 102090384 → 109186696 (+6.951%).
  • stream.workerHeapBytes population p95: 105523592 → 117792792 (+11.627%).
  • full.rigTreeCpuMs population median: 98095.89 → 100077.679 (+2.02%).
  • full.rigTreeCpuMs population p95: 100218.974 → 103160.856 (+2.935%).

Paired original cold observations

Pair Stream max B / C (ms) Stream p95 B / C (ms) Stream sampler B / C (ms) Full sampler B / C (ms) Full Gateway CPU B / C (ms)
1 258.306 / 75.722 6.594 / 5.793 324 / 111 401 / 833 48805.084 / 51886.462
2 259.105 / 80.539 6.482 / 6.865 304 / 119 400 / 400 48311.864 / 50762.984
3 270.038 / 84.095 6.542 / 7.774 322 / 117 562 / 408 50749.09 / 52980.6
4 224.796 / 77.758 8.356 / 7.175 323 / 119 417 / 398 50040.883 / 49927.754
5 228.485 / 60.144 8.041 / 6.909 289 / 107 404 / 400 51663.675 / 50931.529

Partial work/path counters — kept separate

These worker-only counters are not whole-workflow work totals. Every increase remains adverse accounting; smaller host transport is not permission to ignore CPU or heap costs. Model-request count includes the pressure request; independent maintenance count is four per sample.

Counter Baseline median / NN p95 / spread Candidate median / NN p95 / spread Median / p95 change
full.parsedBytes 382390296 / 382401093 / 10797 407150804 / 407150804 / 0 6.475% / 6.472%
full.parseCount 57646 / 57648 / 2 63578 / 63578 / 0 10.29% / 10.287%
full.transport.chunks 39 / 39 / 0 1 / 1 / 0 -97.436% / -97.436%
full.transport.frames 4901 / 4901 / 0 8 / 8 / 0 -99.837% / -99.837%
full.transport.transferredBytes 16583038 / 16583038 / 0 333107 / 333107 / 0 -97.991% / -97.991%
full.transport.endOfEvent 4868 / 4868 / 0 4 / 4 / 0 -99.918% / -99.918%
stream.parsedBytes 298079031 / 298089828 / 10797 322839539 / 322839539 / 0 8.307% / 8.303%
stream.parseCount 42103 / 42105 / 2 48035 / 48035 / 0 14.089% / 14.084%
stream.transport.chunks 39 / 39 / 0 1 / 1 / 0 -97.436% / -97.436%
stream.transport.frames 4901 / 4901 / 0 8 / 8 / 0 -99.837% / -99.837%
stream.transport.transferredBytes 16583038 / 16583038 / 0 333107 / 333107 / 0 -97.991% / -97.991%
stream.transport.endOfEvent 4868 / 4868 / 0 4 / 4 / 0 -99.918% / -99.918%
planCount 0 / 0 / 0 1 / 1 / 0 n/a (zero baseline) / n/a (zero baseline)
renderCount 0 / 0 / 0 4 / 4 / 0 n/a (zero baseline) / n/a (zero baseline)
modelRequestCount 5 / 5 / 0 5 / 5 / 0 0% / 0%
All five original values per arm, in pair order

No value is omitted; display is rounded to three decimals. Full-precision source/checkpoint and original receipts remain unchanged.

Metric/counter Baseline p01, p02, p03, p04, p05 Candidate p01, p02, p03, p04, p05
stream.rpc.median 4.37, 3.633, 4.79, 5.661, 4.984 3.861, 3.888, 4.158, 4.726, 4.437
stream.rpc.p95 6.594, 6.482, 6.542, 8.356, 8.041 5.793, 6.865, 7.774, 7.175, 6.909
stream.rpc.p99 58.745, 62.908, 67.864, 76.574, 44.961 18.431, 36.968, 24.975, 35.532, 29.29
stream.rpc.max 258.306, 259.105, 270.038, 224.796, 228.485 75.722, 80.539, 84.095, 77.758, 60.144
maintenance.rpc.median 9.207, 8.509, 9.513, 11.199, 12.504 4.639, 7.06, 7.563, 7.241, 5.084
maintenance.rpc.p95 160.286, 159.411, 170.361, 126.504, 129.714 67.928, 63.154, 70.961, 61.933, 49.676
maintenance.rpc.p99 258.306, 259.105, 270.038, 224.796, 228.485 75.722, 80.539, 84.095, 77.758, 60.144
maintenance.rpc.max 258.306, 259.105, 270.038, 224.796, 228.485 75.722, 80.539, 84.095, 77.758, 60.144
full.processCpuMs 48805.084, 48311.864, 50749.09, 50040.883, 51663.675 51886.462, 50762.984, 52980.6, 49927.754, 50931.529
full.mainCpuMs 12386.968, 12160.476, 13183.809, 12852.874, 12997.08 12763.059, 11905.142, 12203.197, 11806.175, 12228.334
full.rssBytes 2684272640, 2676219904, 2609299456, 2663383040, 2744201216 2649800704, 2634571776, 2687520768, 2706223104, 2632835072
full.mainHeapBytes 685982312, 696742656, 684958912, 691519048, 693288168 623381264, 622283872, 642332432, 628432464, 637272400
full.pulseGapMs 401, 400, 562, 417, 404 833, 400, 408, 398, 400
full.workerHeapBytes 104703848, 102090384, 105523592, 105110848, 114391968 116836888, 109186696, 106775016, 107648824, 117792792
full.workerThreads 11, 11, 11, 11, 12 11, 11, 11, 11, 11
stream.processCpuMs 10473.306, 10465.722, 10714.127, 11385.613, 11150.971 10224.537, 11031.278, 11557.586, 10511.73, 10582.124
stream.mainCpuMs 2534.813, 2424.039, 2679.431, 3006.348, 2747.025 1996.464, 2124.165, 2196.947, 2206.539, 2156.265
stream.rssBytes 2684272640, 2676219904, 2609299456, 2663383040, 2744201216 2649800704, 2634571776, 2687520768, 2706223104, 2632835072
stream.mainHeapBytes 685982312, 696742656, 684958912, 691519048, 693288168 623381264, 622283872, 642332432, 628432464, 637272400
stream.pulseGapMs 324, 304, 322, 323, 289 111, 119, 117, 119, 107
stream.workerHeapBytes 76959304, 102090384, 105523592, 105110848, 99713384 116836888, 109186696, 103681208, 101827832, 117792792
stream.workerThreads 5, 5, 5, 5, 5 5, 5, 5, 5, 5
full.rigTreeCpuMs 97254.483, 95299.777, 99446.731, 98095.89, 100218.974 100457.407, 100077.679, 103160.856, 97610.884, 99291.191
full.parsedBytes 382401093, 382390296, 382390296, 382390296, 382390296 407150804, 407150804, 407150804, 407150804, 407150804
full.parseCount 57648, 57646, 57646, 57646, 57646 63578, 63578, 63578, 63578, 63578
full.transport.chunks 39, 39, 39, 39, 39 1, 1, 1, 1, 1
full.transport.frames 4901, 4901, 4901, 4901, 4901 8, 8, 8, 8, 8
full.transport.transferredBytes 16583038, 16583038, 16583038, 16583038, 16583038 333107, 333107, 333107, 333107, 333107
full.transport.endOfEvent 4868, 4868, 4868, 4868, 4868 4, 4, 4, 4, 4
stream.parsedBytes 298089828, 298079031, 298079031, 298079031, 298079031 322839539, 322839539, 322839539, 322839539, 322839539
stream.parseCount 42105, 42103, 42103, 42103, 42103 48035, 48035, 48035, 48035, 48035
stream.transport.chunks 39, 39, 39, 39, 39 1, 1, 1, 1, 1
stream.transport.frames 4901, 4901, 4901, 4901, 4901 8, 8, 8, 8, 8
stream.transport.transferredBytes 16583038, 16583038, 16583038, 16583038, 16583038 333107, 333107, 333107, 333107, 333107
stream.transport.endOfEvent 4868, 4868, 4868, 4868, 4868 4, 4, 4, 4, 4
planCount 0, 0, 0, 0, 0 1, 1, 1, 1, 1
renderCount 0, 0, 0, 0, 0 4, 4, 4, 4, 4
modelRequestCount 5, 5, 5, 5, 5 5, 5, 5, 5, 5

Native validity, scope and pause localization

Every original capture verifies the same default safeguard flow: exact 47,184-row imported prefix, durable 18 → 19 compaction boundaries, degraded-quality fallback and four HTTP 200 maintenance requests; native settlement/write release/removal, unchanged source/build/frozen inputs, immutable artifact re-audit and task cleanup all pass. Each candidate records one actual prepared result and four rendered results; baseline records none. Native success is not normal-quality summarization, live-provider semantic quality, effective SDK-window proof, per-worker/JIT warmth or global idleness.

The 833 ms maximum belongs to the first candidate’s setup/import process (PID 30), ending 48,564 ms before that sample’s measured phase begins. It is retained in full-capture accounting exactly as frozen, not removed or reclassified to rescue the run. Its source attribution is not established. The measured stream sampler is separately reported above; its improvement does not waive the full-capture hard stop.

Stream CPU uses immediate bracketing samples with recorded overhang and no prorating. Full CPU includes startup/import and is last-observed cumulative CPU across Gateway PIDs; unsampled shutdown tails remain unobserved. Process CPU already includes workers. Worker JSON counts cover successful strings ≥1,024 UTF-16 units, overlapping tasks include overhang, and host parsing remains unobserved. Raw captures and complete paired metrics stay private; this comment contains sanitized metadata only.

Disposition: cold responsiveness improved on this controlled workload, but the declared no-regression acceptance gate failed. Warm proof is blocked by that rule, not silently skipped or replaced. No rollback, further product change, threshold relaxation or repeat cohort is implied by this result. Contributor credit remains @RomneyDa, @vincentkoc and @jalehman.

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

Labels

agents Agent runtime and tooling gateway Gateway runtime P2 Normal backlog priority with limited blast radius. size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant