Repository navigation
perf(test): speed up declaration boundary checks - #157669
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 24, 2026, 7:56 PM ET / 23:56 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch runs up to two isolated declaration test cases concurrently through managed compiler processes and uses copy-on-write fixture copies. Merge readiness✅ Ready for maintainer review This PR remains useful: current main still runs the declaration checks serially, and the supplied measurements show a meaningful speedup without an identified loss of coverage. No patch defect was established. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s tooling tests build private checkout copies and run declaration compilers to check generated types, cache receipts, and package boundaries. Their results feed CI validation for build and plugin SDK changes. flowchart LR
A[Tooling CI] --> B[Declaration cases]
B --> C[Two-case limit]
C --> D[Private checkout copies]
D --> E[Managed compiler processes]
E --> F[Type and cache assertions]
F --> G[CI result]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +132. Total +132 across 5 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the bounded concurrency and case-owned cleanup, then land through the normal exact-head CI gate once deferred validation runs. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a tooling performance change rather than a bug report. The PR supplies paired real-run timings and suite outcomes. Is this the best way to solve the issue? Yes: it reuses the existing managed command owner, keeps private compiler inputs, and bounds concurrency while retaining the declaration assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against eca1706a533e. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Use the existing command lifetime for independent real compiler cases, cap active cases at two, and retain physical compiler inputs and every assertion. Paired Linux medians reduce the three-file wall sum from 96.013s to 61.070s; thirty endurance runs and helper consumers pass.
bebdc28 to
f3728e7
Compare
Use the existing command lifetime for independent real compiler cases, cap active cases at two, and retain physical compiler inputs and every assertion. Paired Linux medians reduce the three-file wall sum from 96.013s to 61.070s; thirty endurance runs and helper consumers pass.
What Problem This Solves
Declaration boundary tests repeatedly block the tooling worker while independent real compiler commands run, making packaging and build changes expensive to validate.
User Impact
No product behavior changes. The three declaration files run 36.39% faster in paired Linux measurements while retaining every case, all 144 assertions, and their existing deadlines.
Why This Change Was Made
Use the existing command-fixture owner for asynchronous child execution and case-local directory ownership, then allow at most two independent cases concurrently. Entire test bodies remain lifetime-owned so cancellation joins children and unwinding before deleting inputs. Cases that spy on global filesystem methods stay sequential. Native Node executes erasable tooling directly; the explicit loader-boundary case remains. Compiler inputs remain physical private copies, with copy-on-write where supported.
This is the declaration part of the area-C speed pass. The raw diff exceeds 1,500 lines because lifetime ownership indents the case bodies, so archive-fixture work is published in #157689. No test tier, worker-count configuration, timeout, assertion, or retry policy changes.
Evidence
Paired three-run medians on one Linux Blacksmith Testbox, Node 24.19.0, canonical tooling config and the historical CI count of one worker. Wall includes the wrapper; native is the reporter's file duration. Historical PR run 36047699189 and hourly main run 36048371548 selected the cohort across platforms; their Windows times are not used as Linux baselines.
test/scripts/tsdown-declaration-resolution.test.tswrite-plugin-sdk-entry-dts.test.tswrite-unified-entry-dts.test.tsAll three files passed ten further runs each (30/30). The additional shared-helper consumer
dist-artifact-ownership.test.tspassed. Peak whole-process-tree RSS was 2,479 MiB. Linux preserves four platform-specific skips in declaration resolution; native Windows coverage is supplied by PR CI, not claimed from Linux.Complete historical tooling subgroups were replayed on Linux at one worker:
These are the complete owning tooling subgroups, not all unrelated projects from the Windows jobs. Linux Testbox proof: https://github.com/openclaw/openclaw/actions/runs/36065184936 (the lease was stopped after successful proof).
An early pilot used a non-destructured extended-fixture callback and failed two alias cases; destructuring the command/skip fixtures fixed that test-harness integration. All figures and endurance results above are from the corrected candidate. No retries or timeout increases were added.
A disposable single-file probe through the actual shared fixture confirmed two simultaneous whole bodies (control: five); all 20 probe cases passed. The pinned Vitest 5 runner creates the group limiter after the setup hook. This resolves an initial review finding based on an older Vitest implementation.
Targeted type-aware lint, formatting, and
git diff --checkpassed. Independent local and post-rebase branch reviews are P2-clean. Exact-head CI results will be recorded below. The changed-lane plan was inspected; the authorized targeted type-aware lint substitute was used, with the existing negative canary confirming typed diagnostics. No auto-merge is requested.Full 20-file cohort disposition and remaining costs
The complete corrected cohort has 60 successful Linux baseline runs: 1,031.156 s summed file-wall medians. The five measured candidate changes save 46.661 s (4.525%) when all five files are selected; artifact-helper endurance and all shared consumers passed, as reported in the separate PR. This is credited file-level saving, not a measured post-change run of all twenty files or a claim about CI critical-path time. The requested 30% aggregate target is not met. No tests were removed from PR/main routing, and no tier change is claimed.
The two separately published artifact candidates are
test/scripts/vitest-worker-artifacts.test.ts(69.574 → 62.513 s) andtest/scripts/check-openclaw-package-tarball.bundled-mcp.test.ts(27.823 → 23.166 s). The following fifteen files are unchanged, with zero savings credited; these values are before medians, not invented after measurements.test/scripts/mac-elevation-host.test.tsui/src/e2e/chat-composer-websearch-kill-switch.real-gateway.e2e.test.tsui/src/e2e/chat-async-questions.e2e.test.tsui/src/e2e/new-session-page.transition.e2e.test.tstest/scripts/worker-deploy-build-plugin.test.tsui/src/e2e/chat-position-rail-layout.e2e.test.tstest/scripts/check-openclaw-package-tarball.test.tsui/src/e2e/chat-model-controls.e2e.test.tsui/src/e2e/agent-file-lifecycle.real-gateway.e2e.test.tsui/src/e2e/lazy-custom-element-recovery.e2e.test.tsui/src/e2e/chat-user-bubble-disclosure.e2e.test.tsextensions/codex/src/app-server/run-attempt.test.tsui/src/components/session-owner-chip.browser.test.tsui/src/e2e/chat-loading-performance.real-gateway.e2e.test.tsui/src/e2e/question-flow.e2e.test.tsNo named stronger sibling justified deleting these contracts. Ordinary UI/provider behavior was not reclassified as niche release coverage merely to reduce the total. Release candidates and dedicated Gateway/configuration owners were left to their coordinated lanes. Both release exclusion inventories were checked before committing.
Hosted CI
Current head
f3728e727ee2aa10da12c0f83ae4d18bf411513b: https://github.com/openclaw/openclaw/actions/runs/36073756132. This base refresh includes the landed owning fix #157659 (b5cfc8dd9221). Every measured declaration source hash and its critical fixture/command dependencies remain unchanged; the existing P2 review and Linux proof apply to the identical patch. The refreshed run is deferred for release priority:security-fastpassed, ordinary preflight/tests were skipped, and the aggregate gate failed withCI deferred while Full Release Validation 36073359097 holds hosted-runner priority. The active release run owns the hold. Its owner must restore deferred CI after sealing; deferred PR work is not automatically re-dispatched. This final-head ordinary CI remains outstanding, so this PR is not claimed fully green. No capacity variables or rulesets were changed.Initial exact-head CI: https://github.com/openclaw/openclaw/actions/runs/36071021696, head
bebdc282a1a849754b2d1d99b0b123f81ea7c13a, attempt 1. The run completed failure: 28 jobs passed, 20 skipped, and 16 failed. The fifteen failed implementation checks (production/root/core types, core lint, extension lint preparation, and package boundary) all trace to the same base-branch error; the sixteenth failure is the aggregate gate:src/infra/package-update-npm-pack.ts:7importsUpdateStepResultfrom./update-runner-types.js, which does not export it (TS2459). The changed diff contains nosrc/**edits, and the inspected main base also retains the bad import. The owning lane fixed this outside-area blocker in main; this PR then incorporated that real source fix by rebasing. No unchanged-head retry or timeout change was used. All three changed declaration files passed native Windows CI: resolution 24 passed / 1 existing platform skip; SDK writer 12 passed; unified writer 11 passed. Windows long-path, 8.3 and case-alias cases passed. The skipped cold workspace-output alias case passed on Linux.checks-windows-node-test-3checks-windows-node-test-4checks-windows-node-test-5Reference: hourly run 36048371548; after: this exact-head PR run. The three changed Windows file durations sum 604.324 → 182.800 s. This is a cross-run observation, not a controlled Windows median: intervening main changes and different overall job work prevent attributing the whole job/step reduction to this patch. The controlled Linux medians remain the speed comparison above. No Windows rerun was used to get these results.