Skip to content

perf(test): reuse MCP archives and batch worker fixture copies - #157689

Merged
steipete merged 2 commits into
mainfrom
ci-burden/spdc-artifact-fixtures
Sep 24, 2026
Merged

steipete merged 2 commits into
mainfrom
ci-burden/spdc-artifact-fixtures

Conversation

@steipete

@steipete steipete commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

MCP integrity tests repeatedly repack nearly identical archives, while worker-artifact fixtures repeatedly decode unchanged generated JavaScript and copy checkout inputs serially.

User Impact

No product behavior changes. Paired Linux measurements show a 16.7% wall-time reduction for bundled MCP checks and 10.1% for worker-artifact checks. All cases and assertions remain.

Why This Change Was Made

Pack and validate one real reference archive, then create an independent corrupted archive for each integrity case using tar's public API. Real npm/pnpm packing, offline installations, byte comparisons, CLI probes, and all corrupt-payload checks remain. Each mutation proves it actually removed the intended original archive entry before checking the exact failure. The existing preparation deadline is unchanged.

Worker fixtures now avoid decoding JavaScript without a source URL to rebind, and copy every stale-checkout input in bounded batches with shared directory creation. Hash verification, URL rebinding, manifests, dependency junctions, process probes, and joining all started work remain. The generic package fixture and production checker are unchanged. This is the archive part of the area-C speed pass; declaration fixture work is in #157669 because its lifetime cutover exceeds 1,500 raw diff lines. No test-tier, timeout, retry, or assertion reductions.

Evidence

Three interleaved before/after runs on one Linux Blacksmith Testbox, Node 24.19.0, canonical tooling config, historical CI count of one worker:

File under test/scripts/ Fate Wall before → after Native before → after Reason / retained coverage
check-openclaw-package-tarball.bundled-mcp.test.ts FAST 27.823 → 23.166 s 26.272 → 21.276 s Reuse validated packed input; all 18 cases, including 12 independent corruptions, remain
vitest-worker-artifacts.test.ts FAST 69.574 → 62.513 s 66.709 → 60.721 s Avoid redundant decoding; batch complete fixture copies; all 35 cases remain
check-openclaw-package-tarball.test.ts Unchanged 24.292 s baseline — Real checker and npm metadata/dry-run cost belongs to production scripts outside this lane; no savings claimed
worker-deploy-build-plugin.test.ts Unchanged 78.574 s baseline 58.531 s baseline Already shares one real build; complete import-closure scanning belongs to the production owner outside this area
mac-elevation-host.test.ts Unchanged 1.936 s Linux baseline 0.426 s Linux baseline Portable subset: 55 passed, 97 native macOS cases skipped; no native speedup claimed

11.718 s wall saved across the two changed files (4.657 s MCP, 7.061 s worker artifacts). MCP passed 10/10 additional repetitions. Worker artifacts passed 10/10 additional repetitions. All four additional consumers of the prepared-worker helper passed, 189 cases, with no unhandled errors. The complete two-file family passed all 119 cases, 52.021 → 46.453 s wall. The final historical Windows job 5 tooling subgroup (4 files, 83 cases) passed 80.345 → 57.284 s on Linux with both archive and declaration candidates; that combined improvement is not attributable solely to this PR. The final subgroup proof includes the unchanged 60-second preparation budget.

Historical ranking uses broad PR run 36047699189 and hourly main run 36048371548. These Windows job times selected candidates; they are not used as Linux speed baselines. Native Windows behavior remains for PR CI.

Targeted type-aware lint, formatting, and git diff --check passed. Independent local review is P2-clean. The changed-lane plan was inspected and the authorized type-aware lint substitute passed; a root-test canary failed with the expected typed diagnostic before it was removed. Post-rebase branch review is also P2-clean. Exact-head CI will be recorded below. No auto-merge is requested.

The full 20-file cohort and unchanged UI/provider rationale are recorded in the declaration PR. Five measured candidates save 46.661 s (4.525% of the 1,031.156 s Linux baseline sum); the 30% aggregate target remains unmet. These are file-level measured savings, not measured overall CI critical-path savings. No PR/main tier membership changes or removed tests are claimed.

Complete historical tooling subgroup replays on Linux, one worker:

Subgroup Before → after command wall Result
Windows job 1 / tooling, 5 files 78.237 → 80.908 s Pass; unchanged family, no speedup claimed
Windows job 2 / tooling, 5 files 153.235 → 154.527 s Pass; whole subgroup effectively unchanged

Within subgroup 2, worker-artifact native time was 62.564 → 61.753 s. This is much smaller than the isolated three-run gain, so this PR does not claim a full-subgroup or overall CI speedup from worker copying. Every file and assertion remains selected.

Worker proof provider: Linux Blacksmith Testbox tbx_01m3aq9cg8y5fxehcvmw8n4c9s, https://github.com/openclaw/openclaw/actions/runs/36065536904. The fixture was tested through node scripts/run-vitest.mjs run --config test/vitest/vitest.tooling.config.ts --maxWorkers=1 with the explicit target files; all ten endurance runs, both owning subgroups, and all four helper consumers passed. Results were downloaded and the lease is confirmed stopped/completed.

Hosted CI

Exact-head run: https://github.com/openclaw/openclaw/actions/runs/36072695796, head 3fa46860376d63ee4ddd2c7e1caf545d2cc15478, attempt 1. The run completed success: 44 jobs passed, 20 skipped. Both changed files passed native Windows: MCP 18 cases; worker artifacts 30 passed / 5 existing platform skips (all 35 passed on Linux).

File Historical Windows job → current job Historical → PR job wall Historical → PR test-step wall Historical → PR native file time
worker artifacts 2 → 2 670 → 263 s 551 → 190 s 232.208 → 117.285 s
bundled MCP 5 → 4 984 → 381 s 848 → 286 s 107.547 → 42.947 s

Historical reference is hourly run 36048371548. Job inventories and main changed between these runs, so their entire reduction cannot be attributed to this patch. A closer unchanged-file control is the declaration PR's initial run 36071021696: MCP 70.492 → 42.947 s; worker artifacts 115.524 → 117.285 s. Thus no Windows gain is established for worker copying. Its measured improvement remains the isolated Linux median, with the flat full-subgroup result reported above. No retries or timeout changes were used.

This run's merge ref includes the owning update-type fix from #157659; it avoids the unrelated TS2459 that affected the declaration PR's initial run.

Keep all eighteen package cases and every corruption assertion while packing one validated reference archive. Paired Linux wall median falls from 27.823s to 23.166s; ten endurance runs and the full tarball family pass.
Avoid decoding unchanged generated JavaScript and batch every stale-checkout input copy through the existing fixture lifetime. Preserve all thirty-five cases, hashes, URL rebinding and joined failures. Linux wall median falls from 69.574s to 62.513s; ten endurance runs and all four additional helper consumers pass. Full subgroup wall remains effectively unchanged.
@clawsweeper

clawsweeper Bot commented Sep 24, 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.

@steipete
steipete marked this pull request as ready for review September 24, 2026 23:25
@steipete steipete changed the title perf(test): reuse archive and worker fixtures perf(test): reuse MCP archives and batch worker fixture copies Sep 24, 2026
@roboclaw-bot

roboclaw-bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

New Windows evidence relevant to the unchanged positive packaging path: hourly-main run 36062054946/1, job 107851787616, source 25f07e880f5d4e05375d14f07bfb6cc416295aeb, reports the npm pack/offline-install case at 63,455 ms against its 60,000 ms test deadline. The pnpm variant passed in 14,215 ms; all remaining 17 cases passed.

The callback is synchronous, including finally cleanup. Vitest 5.0.1 checks elapsed time when that callback resolves, so this generic deadline is not evidence of an unfinished offline install or a particular failed child. Four child limits are already 180 seconds from #155931; outer pack remains 30 seconds. No child-status assertion localizes the cost. At this PR's current 3fa46860376d head, the positive bodies/preparation helper remain unchanged; the archive optimization concerns the later corruption cases. This is adjacent evidence, not a claim that the optimization caused or fixes the failure. #155669 owns native failure-detail diagnostics, but that helper does not yet measure cumulative phase costs.

To avoid a competing patch or timeout increase, I started one unchanged native Windows tooling-cohort replay: 36074367470, frozen failing source, Node 24.20.0 / pnpm 12.4.2 / Vitest 5.0.1, one worker, existing assertions/deadlines, keepalive zero. The supported workflow accepts the six-file tooling cohort but not the original packages/ selector, so preceding unit-project context is absent; a pass will be non-reproduction, not whole-job or fix proof.

If timing remains unexplained, the next useful evidence is bounded monotonic phase timing (including assertions and cleanup), coordinated with these existing fixture/diagnostic owners—not weaker assertions, a longer deadline, or a duplicate PR. No source or owner-branch changes have been made. No full-main CI was dispatched.

Terminal replay result — September 25, 00:04 UTC

The unchanged native replay 36074367470/1 completed successfully: 172 passed, 9 existing skips across six tooling files; bundled MCP 18/18 passed. Npm positive took 47,082 ms, pnpm 13,094 ms, with the existing 60,000-ms case deadline unchanged. Dispatcher wall was 496.00 s. This is non-reproduction, not a fix.

Source 25f07e8, the twelve enumerated dependency-input hashes, Node 24.20.0/npm 11.19.0/pnpm 12.4.2/Vitest 5.0.1, worker count and actual tooling-file order were verified. Important limits: the replay image was 20260907.229.1, versus 20260922.246.2 in the original failure, and the preceding unit project was absent. No full historical-job, complete post-run source-tree or installed-payload equivalence is claimed.

Post-checkout/complete-job and Actions orphan-cleanup annotations are present; descendant settlement remains explicitly unverified, with five distinct retained-namespace warnings. These warnings are not proof of leaks, and no VM/file-erasure claim is made. The retained six-file native evidence artifact is 10839871613 (SHA256 53ee1ad26733a098584dde44d987b6f120bcb4a71f8b768641f9c6cd412ea6c3).

This PR has since merged as 36abfd8; the replay did not contain that patch and does not validate its Windows effect. Per-phase clocks, including cleanup, remain the missing evidence for the original cumulative cost. No timeout/assertion changes, failed-test retry, competing patch or additional full-main dispatch were made.

@steipete
steipete enabled auto-merge (squash) September 24, 2026 23:52
@steipete
steipete merged commit 36abfd8 into main Sep 24, 2026
152 of 153 checks passed
@steipete
steipete deleted the ci-burden/spdc-artifact-fixtures branch September 24, 2026 23:57
vincentkoc added a commit that referenced this pull request Sep 25, 2026
* commit 'ef2dd3235123371860c9154da7b47b2c1e940788': (41 commits)
  fix(ci): prevent Security Review checkout retry collisions (#157652)
  fix(ci): recover interrupted Security Review response bodies (#157651)
  test(ui): capture live operator authority in guest question fixture
  refactor(agents): deslop runners, harness and recovery (#157294)
  fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131)
  refactor(msteams): share stored service URL validation (#157706)
  fix(codex): honor configured tool PATH in native commands (#157290)
  refactor(msteams): share approval kind labels (#157705)
  fix(sessions): keep session results current during cold reads (#156121)
  fix(testing): capture bounded upgrade integrity diagnostics (#157535)
  refactor(i18n): reuse native branch candidate extraction (#157636)
  fix(update): preserve recovery files after ownership refusal (#148890)
  fix(test): prevent late announcements from contaminating registry tests (#157681)
  fix(e2e): scan full onboarding logs for prompts (#157624)
  refactor(session-tools): derive contracts from schemas (#156365)
  refactor(channels): derive config contracts from schemas (#156367)
  perf(test): reuse MCP archives and batch worker fixture copies (#157689)
  refactor: reuse prepared fixtures in slow core tests (#157685)
  refactor(codex): reuse marketplace reference selection (#157621)
  chore(ui): refresh control ui locales (#157710)
  ...
vincentkoc added a commit that referenced this pull request Sep 25, 2026
* commit '229ab8a1fe957d3d4822309a39ddf9c7ec616395': (25 commits)
  test(ui): capture live operator authority in guest question fixture
  refactor(agents): deslop runners, harness and recovery (#157294)
  fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131)
  refactor(msteams): share stored service URL validation (#157706)
  fix(codex): honor configured tool PATH in native commands (#157290)
  refactor(msteams): share approval kind labels (#157705)
  fix(sessions): keep session results current during cold reads (#156121)
  fix(testing): capture bounded upgrade integrity diagnostics (#157535)
  refactor(i18n): reuse native branch candidate extraction (#157636)
  fix(update): preserve recovery files after ownership refusal (#148890)
  fix(test): prevent late announcements from contaminating registry tests (#157681)
  fix(e2e): scan full onboarding logs for prompts (#157624)
  refactor(session-tools): derive contracts from schemas (#156365)
  refactor(channels): derive config contracts from schemas (#156367)
  perf(test): reuse MCP archives and batch worker fixture copies (#157689)
  refactor: reuse prepared fixtures in slow core tests (#157685)
  refactor(codex): reuse marketplace reference selection (#157621)
  chore(ui): refresh control ui locales (#157710)
  docs(gateway): show how we build OpenClaw on Team (#157675)
  refactor: verify IRC surrogate chunking over loopback (#157580)
  ...
vincentkoc added a commit that referenced this pull request Sep 25, 2026
* fix(ui): keep Stop available while drafts cannot send

* chore: integrate main fixes for Stop UI validation

* commit 'ef2dd3235123371860c9154da7b47b2c1e940788': (41 commits)
  fix(ci): prevent Security Review checkout retry collisions (#157652)
  fix(ci): recover interrupted Security Review response bodies (#157651)
  test(ui): capture live operator authority in guest question fixture
  refactor(agents): deslop runners, harness and recovery (#157294)
  fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131)
  refactor(msteams): share stored service URL validation (#157706)
  fix(codex): honor configured tool PATH in native commands (#157290)
  refactor(msteams): share approval kind labels (#157705)
  fix(sessions): keep session results current during cold reads (#156121)
  fix(testing): capture bounded upgrade integrity diagnostics (#157535)
  refactor(i18n): reuse native branch candidate extraction (#157636)
  fix(update): preserve recovery files after ownership refusal (#148890)
  fix(test): prevent late announcements from contaminating registry tests (#157681)
  fix(e2e): scan full onboarding logs for prompts (#157624)
  refactor(session-tools): derive contracts from schemas (#156365)
  refactor(channels): derive config contracts from schemas (#156367)
  perf(test): reuse MCP archives and batch worker fixture copies (#157689)
  refactor: reuse prepared fixtures in slow core tests (#157685)
  refactor(codex): reuse marketplace reference selection (#157621)
  chore(ui): refresh control ui locales (#157710)
  ...

Co-authored-by: Vincent Koc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 25, 2026
…law#157689)

* perf(test): reuse bundled MCP archive fixtures

Keep all eighteen package cases and every corruption assertion while packing one validated reference archive. Paired Linux wall median falls from 27.823s to 23.166s; ten endurance runs and the full tarball family pass.

* perf(test): reduce worker artifact fixture copying

Avoid decoding unchanged generated JavaScript and batch every stale-checkout input copy through the existing fixture lifetime. Preserve all thirty-five cases, hashes, URL rebinding and joined failures. Linux wall median falls from 69.574s to 62.513s; ten endurance runs and all four additional helper consumers pass. Full subgroup wall remains effectively unchanged.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 25, 2026
* fix(ui): keep Stop available while drafts cannot send

* chore: integrate main fixes for Stop UI validation

* commit '5dae23c843013fce2e0bb80037d232bbabfc70e5': (41 commits)
  fix(ci): prevent Security Review checkout retry collisions (openclaw#157652)
  fix(ci): recover interrupted Security Review response bodies (openclaw#157651)
  test(ui): capture live operator authority in guest question fixture
  refactor(agents): deslop runners, harness and recovery (openclaw#157294)
  fix(auth): preserve Copilot tenant credentials during Doctor repair (openclaw#139131)
  refactor(msteams): share stored service URL validation (openclaw#157706)
  fix(codex): honor configured tool PATH in native commands (openclaw#157290)
  refactor(msteams): share approval kind labels (openclaw#157705)
  fix(sessions): keep session results current during cold reads (openclaw#156121)
  fix(testing): capture bounded upgrade integrity diagnostics (openclaw#157535)
  refactor(i18n): reuse native branch candidate extraction (openclaw#157636)
  fix(update): preserve recovery files after ownership refusal (openclaw#148890)
  fix(test): prevent late announcements from contaminating registry tests (openclaw#157681)
  fix(e2e): scan full onboarding logs for prompts (openclaw#157624)
  refactor(session-tools): derive contracts from schemas (openclaw#156365)
  refactor(channels): derive config contracts from schemas (openclaw#156367)
  perf(test): reuse MCP archives and batch worker fixture copies (openclaw#157689)
  refactor: reuse prepared fixtures in slow core tests (openclaw#157685)
  refactor(codex): reuse marketplace reference selection (openclaw#157621)
  chore(ui): refresh control ui locales (openclaw#157710)
  ...

Co-authored-by: Vincent Koc <[email protected]>
vincentkoc added a commit that referenced this pull request Sep 25, 2026
* refactor(ui): share slash-command failure results

* Merge main to incorporate the upstream update type fix

* commit '0484d7a3ecf52589b0d3d98741e58e5f6b5bf661': (68 commits)
  fix(subagents): stop completion transcript retry loops (#157571)
  perf(sessions): remove duplicate foreground history reference scans (#157572)
  improve(typesafe): defer startup work until the first decision (#157380)
  fix(update): restore npm-pack helper typechecking (#157659)
  fix(packaging): avoid heap exhaustion on large bundles (#157471)
  refactor(infra): share process error handler registries (#157632)
  chore(ui): refresh control ui locales (#157573)
  fix(gateway): release remote Skills subscriptions when shutdown drains (#157592)
  perf(plugins): reuse declared tool membership during resolution (#156205)
  fix(ui): pasted text previews fail before sending (#157390)
  fix(agents): wait for database resources during deletion (#157631)
  improve: move operator profile database reads off the Gateway thread (#155800)
  fix: explain rejected settings without losing edits (#157549)
  fix: keep Gateway responsive while recording trajectory events (#157598)
  fix(auth): show SIWC email and selected model account identity (#157629)
  docs: explain Codex app approval precedence (#155089)
  refactor(wizard): share select prompt requests (#157607)
  fix(ui): omit empty sections from conversation Markdown exports (#157590)
  fix(doctor): explain update lint supervisor refusals (#156547)
  fix(ui): GitHub folder links lose repository context (#157619)
  ...

* Merge frozen main to include the question fixture authority fix

* commit '229ab8a1fe957d3d4822309a39ddf9c7ec616395': (25 commits)
  test(ui): capture live operator authority in guest question fixture
  refactor(agents): deslop runners, harness and recovery (#157294)
  fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131)
  refactor(msteams): share stored service URL validation (#157706)
  fix(codex): honor configured tool PATH in native commands (#157290)
  refactor(msteams): share approval kind labels (#157705)
  fix(sessions): keep session results current during cold reads (#156121)
  fix(testing): capture bounded upgrade integrity diagnostics (#157535)
  refactor(i18n): reuse native branch candidate extraction (#157636)
  fix(update): preserve recovery files after ownership refusal (#148890)
  fix(test): prevent late announcements from contaminating registry tests (#157681)
  fix(e2e): scan full onboarding logs for prompts (#157624)
  refactor(session-tools): derive contracts from schemas (#156365)
  refactor(channels): derive config contracts from schemas (#156367)
  perf(test): reuse MCP archives and batch worker fixture copies (#157689)
  refactor: reuse prepared fixtures in slow core tests (#157685)
  refactor(codex): reuse marketplace reference selection (#157621)
  chore(ui): refresh control ui locales (#157710)
  docs(gateway): show how we build OpenClaw on Team (#157675)
  refactor: verify IRC surrogate chunking over loopback (#157580)
  ...

* chore: merge frozen main prerequisite repairs

Co-authored-by: Vincent Koc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 26, 2026
* refactor(ui): share slash-command failure results

* Merge main to incorporate the upstream update type fix

* commit 'dda1f68bfa102cb804392c0e7cc22c0566a0944a': (68 commits)
  fix(subagents): stop completion transcript retry loops (openclaw#157571)
  perf(sessions): remove duplicate foreground history reference scans (openclaw#157572)
  improve(typesafe): defer startup work until the first decision (openclaw#157380)
  fix(update): restore npm-pack helper typechecking (openclaw#157659)
  fix(packaging): avoid heap exhaustion on large bundles (openclaw#157471)
  refactor(infra): share process error handler registries (openclaw#157632)
  chore(ui): refresh control ui locales (openclaw#157573)
  fix(gateway): release remote Skills subscriptions when shutdown drains (openclaw#157592)
  perf(plugins): reuse declared tool membership during resolution (openclaw#156205)
  fix(ui): pasted text previews fail before sending (openclaw#157390)
  fix(agents): wait for database resources during deletion (openclaw#157631)
  improve: move operator profile database reads off the Gateway thread (openclaw#155800)
  fix: explain rejected settings without losing edits (openclaw#157549)
  fix: keep Gateway responsive while recording trajectory events (openclaw#157598)
  fix(auth): show SIWC email and selected model account identity (openclaw#157629)
  docs: explain Codex app approval precedence (openclaw#155089)
  refactor(wizard): share select prompt requests (openclaw#157607)
  fix(ui): omit empty sections from conversation Markdown exports (openclaw#157590)
  fix(doctor): explain update lint supervisor refusals (openclaw#156547)
  fix(ui): GitHub folder links lose repository context (openclaw#157619)
  ...

* Merge frozen main to include the question fixture authority fix

* commit 'dc64cc3a3a3cf38fff1e44c1d7af42a32929d7e4': (25 commits)
  test(ui): capture live operator authority in guest question fixture
  refactor(agents): deslop runners, harness and recovery (openclaw#157294)
  fix(auth): preserve Copilot tenant credentials during Doctor repair (openclaw#139131)
  refactor(msteams): share stored service URL validation (openclaw#157706)
  fix(codex): honor configured tool PATH in native commands (openclaw#157290)
  refactor(msteams): share approval kind labels (openclaw#157705)
  fix(sessions): keep session results current during cold reads (openclaw#156121)
  fix(testing): capture bounded upgrade integrity diagnostics (openclaw#157535)
  refactor(i18n): reuse native branch candidate extraction (openclaw#157636)
  fix(update): preserve recovery files after ownership refusal (openclaw#148890)
  fix(test): prevent late announcements from contaminating registry tests (openclaw#157681)
  fix(e2e): scan full onboarding logs for prompts (openclaw#157624)
  refactor(session-tools): derive contracts from schemas (openclaw#156365)
  refactor(channels): derive config contracts from schemas (openclaw#156367)
  perf(test): reuse MCP archives and batch worker fixture copies (openclaw#157689)
  refactor: reuse prepared fixtures in slow core tests (openclaw#157685)
  refactor(codex): reuse marketplace reference selection (openclaw#157621)
  chore(ui): refresh control ui locales (openclaw#157710)
  docs(gateway): show how we build OpenClaw on Team (openclaw#157675)
  refactor: verify IRC surrogate chunking over loopback (openclaw#157580)
  ...

* chore: merge frozen main prerequisite repairs

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants