Skip to content

perf: streamline check pipeline - #769

Merged
hxy91819 merged 2 commits into
mainfrom
feature/pnpm-check-performance
Jul 22, 2026
Merged

hxy91819 merged 2 commits into
mainfrom
feature/pnpm-check-performance

Conversation

@hxy91819

@hxy91819 hxy91819 commented Jul 22, 2026 •

Copy link
Copy Markdown
Member

Goal

Make the full validation gate materially faster without weakening coverage, duplicating test facts, or increasing cross-machine concurrency pressure.

The current gate rebuilds TypeScript outputs ten times and runs overlapping unit/repair suites four times. The repeated test processes dominate wall time and amplify Git fixture/subprocess contention; build and lint repetition is real but much smaller.

Changes

  • add one cross-platform scripts/run-node-tests.mjs target runner using node:fs glob expansion and sorted file lists
  • cap adaptive Node file concurrency at min(availableParallelism(), 16), with an explicit CLI override and visible selected value
  • retain standalone build contracts while adding internal *:no-build entries for the composed gate
  • build once, run read-only static/lint subcommands concurrently within their phases, and keep build/test phases serial
  • replace the broad changed-coverage repair selection with the direct compiled fix-prompt-builder test
  • use the full coverage run as the single complete test fact instead of repeating standalone unit and repair runs inside check

No runtime behavior, dependency, coverage threshold, or CI architecture changes are included.

Local benchmark

Merge base: 550316892d107815a36260356f623301393b4be0
Candidate: ab98f927bcb31a88caf27b17b267316b3890de68

Machine: Linux x64, AMD EPYC 7K62, 32 available logical CPUs, 62 GiB RAM
Toolchain: Node v24.15.0, pnpm 11.10.0, Git 2.52.0
Method: two detached/worktree checkouts, identical frozen dependency state, GNU /usr/bin/time -v, serialized samples with reversed ordering across rounds. Install time was measured separately (~0.7s) and excluded.

Gate sample 1 sample 2 median range
baseline pnpm run check 9:50.37 9:32.23 9:41.30 9:32.23–9:50.37
candidate pnpm run check 3:09.93 3:19.10 3:14.52 3:09.93–3:19.10

Median wall time improved 66.5%. Median user CPU fell from 1194.91s to 581.48s; median system CPU fell from 765.64s to 317.40s. Max RSS stayed comparable (baseline 369–384 MiB, candidate 371–374 MiB).

Final candidate phase sample:

Phase wall
parallel read-only static checks 1.72s
serial build:all 3.46s
parallel lint subcommands 1.60s
focused changed coverage 0.89s
full coverage / complete suite 173.95s

One extra baseline attempt was excluded after the third redundant repair-suite execution hit the existing state-lease ref race. The raw failure is retained locally; it did not affect either successful baseline sample. A pre-freeze candidate diagnostic run hit an existing apply-comment timing assertion; the focused test passed immediately, and the final two candidate gates plus the autoreview gate and phase full-coverage run all succeeded.

Coverage and test proof

  • changed coverage before/after: lines 100%, branches 88.61%, functions 100%
  • old changed selection: 1076 tests / 1:46.37; focused selection: 12 tests / 0:00.89
  • baseline full coverage: 2535 tests, 2531 pass, 4 skipped
  • candidate full coverage: 2541 tests, 2537 pass, 4 skipped (the six added runner contract tests account for the increase)
  • baseline/candidate full coverage: ~78.33–78.34% lines, ~73.29–73.32% branches, 86.41% functions; thresholds remain 49/66/57
  • runner tests cover 1/4/16/32 parallelism, glob selection, empty targets, CLI overrides, build/no-build contracts, child exit codes, and signals
  • final consecutive candidate gates both exited 0 and left no unexpected tracked changes

Autoreview

Command:

/data/code/openclaw/openclaw/.agents/skills/autoreview/scripts/autoreview \
  --mode local --parallel-tests "pnpm run check"

Result: autoreview clean: no accepted/actionable findings reported
Parallel test result: exit 0, 2541 tests. No findings were accepted or rejected because the reviewer reported no actionable defects.

An independent local-range regression review later found one P3 parser-contract issue: wrapper help detection also consumed --help/-h after the documented -- forwarding separator. The finding was accepted and fixed in ab98f927bc; a focused parser/CLI proof, full pnpm run check, and the final autoreview all passed. The final review result was again autoreview clean: no accepted/actionable findings reported with no remaining findings.

CI result

The PR CI is green: https://github.com/openclaw/clawsweeper/actions/runs/29887858197

Latest green main before the branch was https://github.com/openclaw/clawsweeper/actions/runs/29884056249.

@clawsweeper

clawsweeper Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: perf: streamline check pipeline This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@clawsweeper

clawsweeper Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: perf: streamline check pipeline This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@hxy91819
hxy91819 marked this pull request as ready for review July 22, 2026 03:51
@hxy91819
hxy91819 requested a review from a team as a code owner July 22, 2026 03:51
@hxy91819
hxy91819 merged commit 13c3e72 into main Jul 22, 2026
14 checks passed
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@hxy91819
hxy91819 deleted the feature/pnpm-check-performance branch July 22, 2026 03:51
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
* perf: streamline check pipeline

* fix: forward post-separator help options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant