Skip to content

fix(cli): support parallel recursive runs - #13448

Merged
zkochan merged 3 commits into
mainfrom
fix-13443
Jul 27, 2026
Merged

zkochan merged 3 commits into
mainfrom
fix-13443

Conversation

@zkochan

@zkochan zkochan commented Jul 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #13443.

The Rust CLI now recognizes --parallel before recursive run commands instead of passing it through as the script name. It applies pnpm's recursive and no-sort shorthand settings, then starts every selected project's script concurrently.

The TypeScript CLI already has this behavior, so no TypeScript implementation change is needed.

Parser tests cover both sides of the forwarding boundary: --parallel before run is a pnpm option, while the same token after the script name is forwarded unchanged. The recursive-run regression test synchronizes two projects so it fails under sequential execution.

Squash Commit Body

Recognize `--parallel` as a recursive-run option in the Rust CLI instead
of forwarding it as the script name.

Apply the shorthand's recursive and no-sort settings during CLI
normalization, thread the parallel mode into recursive script dispatch,
and start all selected projects concurrently. Project results are
collected in selection order so summaries and failure reporting remain
deterministic.

Add parser-boundary coverage and a synchronization-based concurrency
regression test. The TypeScript CLI already implements this behavior.

Closes pnpm/pnpm#13443

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting.
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.

Written by an agent (Codex, GPT-5).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • New Features
    • Added a global --parallel flag for run-like script commands to start scripts concurrently across selected projects (recursive, unsorted).
  • Bug Fixes
    • Fixed --parallel being misread as a script name when placed before run in recursive commands.
    • Ensured --parallel placed after the script name is treated as a script argument.
    • Kept clean/purge and restart flows non-parallel, and propagated parallel behavior through recursive execution.
  • Tests
    • Added parsing and integration coverage verifying concurrent startup and correct --parallel placement/handling.

Copilot AI review requested due to automatic review settings July 27, 2026 21:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: dfc0e3df-c7cb-48b3-bc82-c85944a20c1b

📥 Commits

Reviewing files that changed from the base of the PR and between ca7af5f and f1cf9eb.

📒 Files selected for processing (1)
  • pnpm/crates/cli/src/cli_args/tests.rs

📝 Walkthrough

Walkthrough

Adds Rust CLI support for parsing --parallel before run, propagates the option through dispatch, executes recursive project scripts concurrently, and adds unit, integration, and release-note coverage.

Changes

Recursive parallel run

Layer / File(s) Summary
Parallel CLI contract
pnpm/crates/cli/src/cli_args/cli_command.rs, pnpm/crates/cli/src/cli_args/run.rs, pnpm/crates/cli/src/cli_args/tests.rs, pnpm/crates/cli/src/lib.rs
Defines and validates --parallel, promotes it to recursive unsorted execution, and verifies argument placement.
Parallel dispatch wiring
pnpm/crates/cli/src/cli_args/dispatch*.rs, pnpm/crates/cli/src/cli_args/clean.rs, pnpm/crates/cli/src/cli_args/restart.rs, pnpm/crates/cli/src/cli_args/script_shortcut.rs
Carries the parallel setting through RunCtx and initializes routed RunArgs values.
Concurrent recursive execution
pnpm/crates/cli/src/cli_args/run/recursive.rs, pnpm/crates/cli/tests/run_recursive.rs, .changeset/rust-parallel-recursive-run.md
Runs selected projects concurrently, aggregates statuses, preserves bail handling, and adds integration and release-note coverage.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant RunContext
  participant RecursiveRunner
  participant ProjectRunner
  CLI->>RunContext: Propagate --parallel
  RunContext->>RecursiveRunner: Configure recursive parallel run
  RecursiveRunner->>ProjectRunner: Start selected projects concurrently
  ProjectRunner-->>RecursiveRunner: Return execution status
  RecursiveRunner-->>CLI: Aggregate results and apply bail behavior
Loading

Assessment against linked issues

Objective Addressed Explanation
Parse --parallel as a recursive-run option before run and execute selected build scripts in parallel [#13443] ✅
Preserve --parallel as a script argument when placed after the script name [#13443] ✅

Possibly related PRs

  • pnpm/pnpm#13074: Shares Rust recursive run wiring and sequential/parallel option propagation.
  • pnpm/pnpm#13344: Touches the script shortcut and dispatch paths updated for RunArgs.parallel.
  • pnpm/pnpm#13440: Modifies the same Rust recursive-run control flow.

Suggested labels: product: pacquet

Suggested reviewers: copilot

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-13443

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix Rust CLI recursive run parsing and execution for --parallel

🐞 Bug fix 🧪 Tests 🕐 40+ Minutes

Grey Divider

AI Description

• Treat --parallel before recursive run as a pnpm option, not a script name.
• Normalize --parallel to imply --recursive and --no-sort, then run projects concurrently.
• Add parser-boundary and concurrency regression tests to prevent regressions.
Diagram

graph TD
A["CLI argv"] --> B["CliArgs (clap)"] --> C["normalize: apply_parallel_run_options"] --> D["dispatch: RunCtx"] --> E["dispatch_script: RunArgs"] --> F{"parallel?"}
F --> G["run_recursive: scoped threads"] --> H["ordered summary/results"]
F --> I["run_recursive: sequential chunks"] --> H
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Bounded concurrency via `--workspace-concurrency`
  • ➕ Avoids spawning one OS thread per selected project
  • ➕ Aligns with an existing CLI control for large workspaces
  • ➕ Reduces risk of resource exhaustion (file descriptors/CPU thrash)
  • ➖ Changes semantics vs pnpm’s --parallel shorthand (which is intentionally unbounded/disregards topo order)
  • ➖ Requires a concurrency limiter/queueing mechanism in the recursive runner
2. Use a threadpool (e.g., Rayon) instead of `std::thread::scope`
  • ➕ Simplifies fan-out/fan-in without creating many threads
  • ➕ Provides work-stealing and configurable parallelism
  • ➖ Adds/leans on additional concurrency abstractions and potential dependency concerns
  • ➖ May complicate deterministic ordering unless explicitly handled
3. Async execution with a runtime (Tokio)
  • ➕ Efficient for many subprocesses with structured task management
  • ➕ Easier to add cancellation/timeouts later
  • ➖ Introduces runtime coupling and broader refactor surface
  • ➖ Higher review/maintenance cost for a narrow CLI fix

Recommendation: The current approach is appropriate for matching pnpm’s --parallel shorthand semantics: it explicitly opts into concurrent execution and preserves deterministic reporting by collecting results in selection order. The main caveat is unbounded thread creation proportional to selected projects; consider a follow-up to map --workspace-concurrency (or a default cap) onto the parallel path for very large workspaces.

Files changed (13) +280 / -109

Enhancement (6) +192 / -109
cli_command.rsAdd global '--parallel' flag + validation + shorthand normalization +31/-0

Add global '--parallel' flag + validation + shorthand normalization

• Introduces a global '--parallel' flag, validates it only for script-like commands, and adds 'apply_parallel_run_options()' to translate it into '--recursive' and '--no-sort' behavior.

pnpm/crates/cli/src/cli_args/cli_command.rs

dispatch.rsThread 'parallel' into dispatch context for recursive runs +3/-0

Thread 'parallel' into dispatch context for recursive runs

• Adds 'recursive_parallel' to 'RunCtx' and wires it from parsed CLI args so downstream script dispatch can act on it.

pnpm/crates/cli/src/cli_args/dispatch.rs

dispatch_install.rsPass recursive 'parallel' setting into install/test RunArgs +1/-0

Pass recursive 'parallel' setting into install/test RunArgs

• Propagates 'ctx.recursive_parallel' into the RunArgs used by recursive install/test dispatch so script execution honors '--parallel'.

pnpm/crates/cli/src/cli_args/dispatch_install.rs

dispatch_script.rsPropagate recursive 'parallel' into script RunArgs +2/-0

Propagate recursive 'parallel' into script RunArgs

• Adds a default 'parallel: false' in fallback RunArgs and sets 'args.parallel' from 'RunCtx' during recursive option merging.

pnpm/crates/cli/src/cli_args/dispatch_script.rs

run.rsAdd 'parallel' field to RunArgs +4/-0

Add 'parallel' field to RunArgs

• Extends RunArgs with a 'parallel' boolean (skip-parsed) to control concurrent recursive execution behavior at runtime.

pnpm/crates/cli/src/cli_args/run.rs

recursive.rsImplement concurrent recursive script execution for 'parallel' mode +151/-109

Implement concurrent recursive script execution for 'parallel' mode

• Refactors per-project execution into a helper and adds a parallel execution path that spawns one scoped thread per selected project. Results are joined and recorded in selection order; bail behavior still reports deterministically.

pnpm/crates/cli/src/cli_args/run/recursive.rs

Bug fix (4) +4 / -0
clean.rsInitialize recursive run defaults with 'parallel: false' (clean) +1/-0

Initialize recursive run defaults with 'parallel: false' (clean)

• Extends the constructed RunArgs defaults to include the new 'parallel' field, ensuring a known default behavior.

pnpm/crates/cli/src/cli_args/clean.rs

restart.rsInitialize recursive run defaults with 'parallel: false' (restart) +1/-0

Initialize recursive run defaults with 'parallel: false' (restart)

• Updates restart’s recursive RunArgs construction to include the new 'parallel' default.

pnpm/crates/cli/src/cli_args/restart.rs

script_shortcut.rsInitialize script shortcut defaults with 'parallel: false' +1/-0

Initialize script shortcut defaults with 'parallel: false'

• Updates script shortcut RunArgs defaults to include the 'parallel' field to avoid accidental enablement.

pnpm/crates/cli/src/cli_args/script_shortcut.rs

lib.rsApply parallel shorthand normalization during CLI startup +1/-0

Apply parallel shorthand normalization during CLI startup

• Calls 'apply_parallel_run_options()' during CLI initialization so '--parallel' correctly influences recursive/no-sort behavior before later normalization steps.

pnpm/crates/cli/src/lib.rs

Tests (2) +79 / -0
tests.rsAdd parser-boundary tests for '--parallel' placement around 'run' +31/-0

Add parser-boundary tests for '--parallel' placement around 'run'

• Adds coverage that '--parallel' before 'run' is parsed as a pnpm option (and implies recursive/no-sort), while '--parallel' after the script name is forwarded as a script argument.

pnpm/crates/cli/src/cli_args/tests.rs

run_recursive.rsAdd regression test ensuring parallel recursive run is truly concurrent +48/-0

Add regression test ensuring parallel recursive run is truly concurrent

• Adds a two-project synchronization test that only succeeds when both projects start concurrently under '-r --parallel run <script>'.

pnpm/crates/cli/tests/run_recursive.rs

Documentation (1) +5 / -0
rust-parallel-recursive-run.mdAdd patch changeset for Rust CLI '--parallel' recursive run fix +5/-0

Add patch changeset for Rust CLI '--parallel' recursive run fix

• Adds a release note indicating that '--parallel' before 'run' is no longer treated as the script name in recursive commands.

.changeset/rust-parallel-recursive-run.md

@greptile-apps

greptile-apps Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the previously reported thread-creation panic path now returns a contextual diagnostic through fallible scoped spawning.

Reviews (3): Last reviewed commit: "test(cli): verify parallel promotes recu..." | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pnpm/crates/cli/src/cli_args/tests.rs`:
- Around line 175-194: Update
parallel_before_run_is_a_recursive_unsorted_run_option to remove -r and the
unnecessary --filter argument, then assert parsed.recursive is false immediately
after parsing. Keep applying parsed.apply_parallel_run_options() and assert
recursive becomes true afterward, alongside the existing no_sort and command
assertions, so the test verifies --parallel performs the promotion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4678aae8-27be-41f8-9e13-8dc54230f81e

📥 Commits

Reviewing files that changed from the base of the PR and between c59e2a4 and 147df81.

📒 Files selected for processing (13)
  • .changeset/rust-parallel-recursive-run.md
  • pnpm/crates/cli/src/cli_args/clean.rs
  • pnpm/crates/cli/src/cli_args/cli_command.rs
  • pnpm/crates/cli/src/cli_args/dispatch.rs
  • pnpm/crates/cli/src/cli_args/dispatch_install.rs
  • pnpm/crates/cli/src/cli_args/dispatch_script.rs
  • pnpm/crates/cli/src/cli_args/restart.rs
  • pnpm/crates/cli/src/cli_args/run.rs
  • pnpm/crates/cli/src/cli_args/run/recursive.rs
  • pnpm/crates/cli/src/cli_args/script_shortcut.rs
  • pnpm/crates/cli/src/cli_args/tests.rs
  • pnpm/crates/cli/src/lib.rs
  • pnpm/crates/cli/tests/run_recursive.rs

Comment thread pnpm/crates/cli/src/cli_args/tests.rs Resolved
@github-actions

github-actions Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.00     12.9±0.44ms    29.1 MB/sec    1.03     13.3±1.26ms    28.2 MB/sec
packument/parse                                  1.08     42.2±1.63µs  1571.4 MB/sec    1.00     38.9±0.38µs  1704.2 MB/sec
tarball/download_dependency                      1.00      2.4±0.14ms  1788.9 KB/sec    1.11      2.7±0.17ms  1615.4 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00   193.9±10.32ms 82.5 KElem/sec    1.11   215.3±11.98ms 74.3 KElem/sec

@codecov-commenter

codecov-commenter commented Jul 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.09589% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.65%. Comparing base (81411d3) to head (f1cf9eb).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pnpm/crates/cli/src/cli_args/run/recursive.rs 91.73% 10 Missing ⚠️
pnpm/crates/cli/src/cli_args/cli_command.rs 81.25% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #13448    +/-   ##
========================================
  Coverage   87.64%   87.65%            
========================================
  Files         545      545            
  Lines       93978    94102   +124     
========================================
+ Hits        82367    82481   +114     
- Misses      11611    11621    +10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@qodo-code-review

qodo-code-review Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (2) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 24 rules

Grey Divider


Action required

1. Unbounded thread fanout 🐞 Bug ⛨ Security
Description
run_recursive spawns one OS thread per selected project under --parallel, which can exhaust
memory/threads and crash/hang on large workspaces. This bypasses existing workspace concurrency
controls and diverges from pnpm’s TypeScript implementation that limits concurrency.
Code

pnpm/crates/cli/src/cli_args/run/recursive.rs[R166-191]

+    if args.parallel {
+        let roots = chunks.iter().flatten().collect::<Vec<_>>();
+        let executions = std::thread::scope(|scope| {
+            roots
+                .iter()
+                .map(|root| {
+                    scope.spawn(|| {
+                        run_project(RunProjectOptions {
+                            root,
+                            graph,
+                            selector: &selector,
+                            args,
+                            init_cwd: &init_cwd,
+                            config,
+                            extra_env: &extra_env,
+                            bail,
+                        })
+                    })
+                })
+                .collect::<Vec<_>>()
+                .into_iter()
+                .map(|handle| {
+                    handle.join().unwrap_or_else(|panic| std::panic::resume_unwind(panic))
+                })
+                .collect::<miette::Result<Vec<_>>>()
+        })?;
Relevance

⭐⭐ Medium

Some history favors bounding unbounded fanout (partially accepted concurrency-limit suggestion in
#13207), but no direct prior on thread-per-project.

PR-#13207

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new --parallel branch flattens all selected roots and spawns one scoped thread per root, then
joins them all; there is no concurrency bound. The repo defines a default bounded
workspace_concurrency (min(4, availableParallelism)) and pnpm’s TS runRecursive uses a limiter
derived from workspaceConcurrency, indicating the expected approach is bounded concurrency rather
than unbounded OS thread fanout.

pnpm/crates/cli/src/cli_args/run/recursive.rs[85-207]
pnpm/crates/cli/src/cli_args/dispatch.rs[240-276]
pnpm/crates/config/src/defaults.rs[275-303]
pnpm11/exec/commands/src/runRecursive.ts[62-80]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`--parallel` currently uses `std::thread::scope` and `scope.spawn(...)` once per selected project. On large workspaces this can create hundreds/thousands of OS threads, causing high memory usage, thread creation failures, or process crashes.

### Issue Context
- `chunks` is derived from the full `--filter` selection; `roots = chunks.iter().flatten()` is therefore “all selected projects”.
- The config model already has a bounded `workspace_concurrency` default (and overrides), and pnpm’s TS implementation uses a limiter (`pLimit(getWorkspaceConcurrency(...))`) rather than 1-thread-per-project.

### Fix Focus Areas
- pnpm/crates/cli/src/cli_args/run/recursive.rs[128-235]
- pnpm/crates/cli/src/cli_args/dispatch.rs[240-276]
- pnpm/crates/config/src/defaults.rs[275-303]

### Suggested fix approach
Implement bounded concurrency for `args.parallel`:
- Use `config.workspace_concurrency` (already available in `run_recursive`) as the maximum in-flight project executions.
- Replace per-project `scope.spawn` with a fixed-size worker pool (scoped threads) that pulls project roots from an atomic counter/queue.
- Preserve deterministic summary ordering by storing results into a `Vec<Option<ProjectExecution>>` indexed by the original `roots` order, then applying them back into `result` in that order.
- Keep current error semantics (propagate hidden-script errors; if `bail` then stop *within a project*; for cross-project bail, return first-failing prefix in selection order after all in-flight work completes).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Fragile parallel regression test 🐞 Bug ☼ Reliability
Description
The new concurrency regression test uses a ~1s polling window (100×10ms sleeps) to detect concurrent
start, which can time out on slow/loaded CI and fail intermittently even when parallel execution is
correct. This can introduce noisy, non-actionable CI failures.
Code

pnpm/crates/cli/tests/run_recursive.rs[R117-123]

+                "build": format!(
+                    "touch ../{name}.started; \
+                     attempts=0; \
+                     while [ ! -f ../{peer}.started ] && [ \"$attempts\" -lt 100 ]; do \
+                       sleep 0.01; attempts=$((attempts + 1)); \
+                     done; \
+                     test -f ../{peer}.started"
Relevance

⭐⭐⭐ High

Team has accepted avoiding timing-based/flaky concurrency assertions in tests (e.g. #13074) and
other test-hardening changes (#13425).

PR-#13074
PR-#13425

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The test script’s while loop caps waiting to 100 iterations and sleeps 0.01s each iteration, so it
gives the peer only about ~1 second to start and create its marker file; under slow runners this can
fail spuriously.

pnpm/crates/cli/tests/run_recursive.rs[109-124]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The new E2E concurrency test relies on a short polling loop (100 iterations × 10ms sleep) to wait for a peer marker file. Under CI load or slow startup, the peer script may not create the marker within ~1s, causing flaky failures.

### Issue Context
The test’s intent is good (it fails under sequential execution), but the synchronization budget is tight and depends on scheduling.

### Fix Focus Areas
- pnpm/crates/cli/tests/run_recursive.rs[109-155]

### Suggested fix approach
Make the synchronization more robust:
- Increase the overall deadline substantially (e.g. 10–30s) and/or reduce polling frequency.
- Prefer a deadline-based loop (`start=$(date +%s)` / `SECONDS`) over a fixed small iteration count, so slow environments still pass.
- Optionally replace the shell loop with a small `node -e` script that waits for the peer marker with a longer timeout (more portable and clearer failure messages).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. No TS test for recursive parallel 📘 Rule violation ▣ Testability
Description
The PR adds a Rust regression test asserting --parallel starts recursive-run projects
concurrently, but there is no mirrored TypeScript test covering the same recursive-parallel
concurrency contract. This weakens cross-stack parity assurance for a shared user-visible behavior.
Code

pnpm/crates/cli/tests/run_recursive.rs[R109-155]

+#[test]
+fn parallel_before_run_starts_selected_projects_concurrently() {
+    let CommandTempCwd { pacquet, root, workspace, .. } = CommandTempCwd::init();
+    let waits_for_peer = |name: &str, peer: &str| {
+        json!({
+            "name": name,
+            "version": "1.0.0",
+            "scripts": {
+                "build": format!(
+                    "touch ../{name}.started; \
+                     attempts=0; \
+                     while [ ! -f ../{peer}.started ] && [ \"$attempts\" -lt 100 ]; do \
+                       sleep 0.01; attempts=$((attempts + 1)); \
+                     done; \
+                     test -f ../{peer}.started"
+                ),
+            },
+        })
+    };
+    write_workspace(
+        &workspace,
+        &[
+            ("project-1", waits_for_peer("project-1", "project-2")),
+            ("project-2", waits_for_peer("project-2", "project-1")),
+        ],
+    );
+
+    pacquet
+        .with_arg("-r")
+        .with_arg("--filter=./project-*")
+        .with_arg("--parallel")
+        .with_arg("run")
+        .with_arg("build")
+        .assert()
+        .success();
+
+    assert!(
+        workspace.join("project-1.started").exists(),
+        "project-1 should start while project-2 is waiting",
+    );
+    assert!(
+        workspace.join("project-2.started").exists(),
+        "project-2 should start while project-1 is waiting",
+    );
+
+    drop(root);
+}
Relevance

⭐⭐ Medium

Repo values Rust/TS parity in some areas (#13074, #13132), but no clear precedent requiring mirrored
TS tests when TS code unchanged.

PR-#13074
PR-#13132

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2255044 requires cross-stack behavior changes to have mirrored tests in Rust and
TypeScript. This PR adds a Rust test that specifically validates concurrent recursive execution,
while the existing TypeScript tests shown only validate --parallel behavior for a single project
(not recursive multi-project concurrency).

Rule 2255044: Cross-stack behavior changes must have mirrored tests in Rust and TypeScript
pnpm/crates/cli/tests/run_recursive.rs[109-155]
pnpm11/pnpm/test/run.ts[224-254]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A new Rust integration test asserts recursive `run` concurrency under `--parallel`, but there is no equivalent TypeScript test covering the same scenario.

## Issue Context
This PR changes pacquet (Rust) behavior to match pnpm (TypeScript) for `--parallel` with recursive `run`. Compliance requires mirrored automated tests across stacks for shared behavior contracts.

## Fix Focus Areas
- pnpm/crates/cli/tests/run_recursive.rs[109-155]
- pnpm11/pnpm/test/run.ts[224-254]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

4. Brittle recursive assertion 🐞 Bug ⚙ Maintainability ⭐ New
Description
The new test asserts !parsed.recursive immediately after parsing --parallel, which encodes the
current parse/normalization timing rather than the user-visible contract. A refactor that applies
the --parallel shorthand during parsing (instead of in apply_parallel_run_options) could break
this test while preserving correct CLI behavior.
Code

pnpm/crates/cli/src/cli_args/tests.rs[R177-180]

+    let mut parsed = CliArgs::try_parse_from(["pacquet", "--parallel", "run", "build"])
+        .expect("parses --parallel before run");
+    assert!(parsed.parallel);
+    assert!(!parsed.recursive);
Relevance

⭐⭐⭐ High

Team often accepts making tests less brittle/more contract-focused (regression-proving,
deterministic assertions).

PR-#13076
PR-#13441

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The test currently asserts a pre-normalization recursive state (assert!(!parsed.recursive)).
However, production sets recursive/no_sort as part of the --parallel shorthand in
apply_parallel_run_options(), which is invoked in run_cli() after validation; therefore, whether
recursive is set during parsing or during normalization is not inherently part of the user-facing
contract.

pnpm/crates/cli/src/cli_args/tests.rs[175-188]
pnpm/crates/cli/src/lib.rs[93-100]
pnpm/crates/cli/src/cli_args/cli_command.rs[236-277]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The test `parallel_before_run_is_a_recursive_unsorted_run_option` asserts `!parsed.recursive` right after `try_parse_from(...)`. This checks an internal sequencing detail (when shorthand normalization is applied) rather than the observable behavior you care about (that `--parallel` results in recursive + no-sort once normalization runs).

### Issue Context
In production, normalization currently happens after validation (`run_cli` calls `apply_parallel_run_options()` after `validate_command_scoped_global_options()`), but that ordering is an implementation detail and could change without affecting the intended CLI contract.

### Fix Focus Areas
- pnpm/crates/cli/src/cli_args/tests.rs[175-188]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Changeset missing pnpm entry 📘 Rule violation § Compliance
Description
The new changeset only declares a bump for pacquet and omits pnpm, violating the requirement
that changesets explicitly include the pnpm package with a valid bump type. This can cause release
tooling to miss the intended pnpm bump classification.
Code

.changeset/rust-parallel-recursive-run.md[R1-3]

+---
+"pacquet": patch
+---
Relevance

⭐ Low

Similar “add pnpm entry to changeset” findings repeatedly rejected in recent PRs (e.g. #13347,
#13416, #13417).

PR-#13347
PR-#13416
PR-#13417

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires that newly added/modified changeset files include an explicit
pnpm entry with a valid bump type. The added changeset front-matter currently lists only
pacquet.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/rust-parallel-recursive-run.md[1-3]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new changeset `.changeset/rust-parallel-recursive-run.md` is missing a `pnpm` entry in its front-matter.

## Issue Context
Compliance requires changeset front-matter to explicitly declare the `pnpm` package and a valid bump type (`patch`/`minor`/`major`).

## Fix Focus Areas
- .changeset/rust-parallel-recursive-run.md[1-3]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Previous review results

Review updated until commit f1cf9eb

Results up to commit 147df81 ⚖️ Balanced


🐞 Bugs (2) 📘 Rule violations (2) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required
1. Unbounded thread fanout 🐞 Bug ⛨ Security
Description
run_recursive spawns one OS thread per selected project under --parallel, which can exhaust
memory/threads and crash/hang on large workspaces. This bypasses existing workspace concurrency
controls and diverges from pnpm’s TypeScript implementation that limits concurrency.
Code

pnpm/crates/cli/src/cli_args/run/recursive.rs[R166-191]

+    if args.parallel {
+        let roots = chunks.iter().flatten().collect::<Vec<_>>();
+        let executions = std::thread::scope(|scope| {
+            roots
+                .iter()
+                .map(|root| {
+                    scope.spawn(|| {
+                        run_project(RunProjectOptions {
+                            root,
+                            graph,
+                            selector: &selector,
+                            args,
+                            init_cwd: &init_cwd,
+                            config,
+                            extra_env: &extra_env,
+                            bail,
+                        })
+                    })
+                })
+                .collect::<Vec<_>>()
+                .into_iter()
+                .map(|handle| {
+                    handle.join().unwrap_or_else(|panic| std::panic::resume_unwind(panic))
+                })
+                .collect::<miette::Result<Vec<_>>>()
+        })?;
Relevance

⭐⭐ Medium

Some history favors bounding unbounded fanout (partially accepted concurrency-limit suggestion in
#13207), but no direct prior on thread-per-project.

PR-#13207

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new --parallel branch flattens all selected roots and spawns one scoped thread per root, then
joins them all; there is no concurrency bound. The repo defines a default bounded
workspace_concurrency (min(4, availableParallelism)) and pnpm’s TS runRecursive uses a limiter
derived from workspaceConcurrency, indicating the expected approach is bounded concurrency rather
than unbounded OS thread fanout.

pnpm/crates/cli/src/cli_args/run/recursive.rs[85-207]
pnpm/crates/cli/src/cli_args/dispatch.rs[240-276]
pnpm/crates/config/src/defaults.rs[275-303]
pnpm11/exec/commands/src/runRecursive.ts[62-80]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`--parallel` currently uses `std::thread::scope` and `scope.spawn(...)` once per selected project. On large workspaces this can create hundreds/thousands of OS threads, causing high memory usage, thread creation failures, or process crashes.

### Issue Context
- `chunks` is derived from the full `--filter` selection; `roots = chunks.iter().flatten()` is therefore “all selected projects”.
- The config model already has a bounded `workspace_concurrency` default (and overrides), and pnpm’s TS implementation uses a limiter (`pLimit(getWorkspaceConcurrency(...))`) rather than 1-thread-per-project.

### Fix Focus Areas
- pnpm/crates/cli/src/cli_args/run/recursive.rs[128-235]
- pnpm/crates/cli/src/cli_args/dispatch.rs[240-276]
- pnpm/crates/config/src/defaults.rs[275-303]

### Suggested fix approach
Implement bounded concurrency for `args.parallel`:
- Use `config.workspace_concurrency` (already available in `run_recursive`) as the maximum in-flight project executions.
- Replace per-project `scope.spawn` with a fixed-size worker pool (scoped threads) that pulls project roots from an atomic counter/queue.
- Preserve deterministic summary ordering by storing results into a `Vec<Option<ProjectExecution>>` indexed by the original `roots` order, then applying them back into `result` in that order.
- Keep current error semantics (propagate hidden-script errors; if `bail` then stop *within a project*; for cross-project bail, return first-failing prefix in selection order after all in-flight work completes).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended
2. Fragile parallel regression test 🐞 Bug ☼ Reliability
Description
The new concurrency regression test uses a ~1s polling window (100×10ms sleeps) to detect concurrent
start, which can time out on slow/loaded CI and fail intermittently even when parallel execution is
correct. This can introduce noisy, non-actionable CI failures.
Code

pnpm/crates/cli/tests/run_recursive.rs[R117-123]

+                "build": format!(
+                    "touch ../{name}.started; \
+                     attempts=0; \
+                     while [ ! -f ../{peer}.started ] && [ \"$attempts\" -lt 100 ]; do \
+                       sleep 0.01; attempts=$((attempts + 1)); \
+                     done; \
+                     test -f ../{peer}.started"
Relevance

⭐⭐⭐ High

Team has accepted avoiding timing-based/flaky concurrency assertions in tests (e.g. #13074) and
other test-hardening changes (#13425).

PR-#13074
PR-#13425

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The test script’s while loop caps waiting to 100 iterations and sleeps 0.01s each iteration, so it
gives the peer only about ~1 second to start and create its marker file; under slow runners this can
fail spuriously.

pnpm/crates/cli/tests/run_recursive.rs[109-124]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The new E2E concurrency test relies on a short polling loop (100 iterations × 10ms sleep) to wait for a peer marker file. Under CI load or slow startup, the peer script may not create the marker within ~1s, causing flaky failures.

### Issue Context
The test’s intent is good (it fails under sequential execution), but the synchronization budget is tight and depends on scheduling.

### Fix Focus Areas
- pnpm/crates/cli/tests/run_recursive.rs[109-155]

### Suggested fix approach
Make the synchronization more robust:
- Increase the overall deadline substantially (e.g. 10–30s) and/or reduce polling frequency.
- Prefer a deadline-based loop (`start=$(date +%s)` / `SECONDS`) over a fixed small iteration count, so slow environments still pass.
- Optionally replace the shell loop with a small `node -e` script that waits for the peer marker with a longer timeout (more portable and clearer failure messages).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. No TS test for recursive parallel 📘 Rule violation ▣ Testability
Description
The PR adds a Rust regression test asserting --parallel starts recursive-run projects
concurrently, but there is no mirrored TypeScript test covering the same recursive-parallel
concurrency contract. This weakens cross-stack parity assurance for a shared user-visible behavior.
Code

pnpm/crates/cli/tests/run_recursive.rs[R109-155]

+#[test]
+fn parallel_before_run_starts_selected_projects_concurrently() {
+    let CommandTempCwd { pacquet, root, workspace, .. } = CommandTempCwd::init();
+    let waits_for_peer = |name: &str, peer: &str| {
+        json!({
+            "name": name,
+            "version": "1.0.0",
+            "scripts": {
+                "build": format!(
+                    "touch ../{name}.started; \
+                     attempts=0; \
+                     while [ ! -f ../{peer}.started ] && [ \"$attempts\" -lt 100 ]; do \
+                       sleep 0.01; attempts=$((attempts + 1)); \
+                     done; \
+                     test -f ../{peer}.started"
+                ),
+            },
+        })
+    };
+    write_workspace(
+        &workspace,
+        &[
+            ("project-1", waits_for_peer("project-1", "project-2")),
+            ("project-2", waits_for_peer("project-2", "project-1")),
+        ],
+    );
+
+    pacquet
+        .with_arg("-r")
+        .with_arg("--filter=./project-*")
+        .with_arg("--parallel")
+        .with_arg("run")
+        .with_arg("build")
+        .assert()
+        .success();
+
+    assert!(
+        workspace.join("project-1.started").exists(),
+        "project-1 should start while project-2 is waiting",
+    );
+    assert!(
+        workspace.join("project-2.started").exists(),
+        "project-2 should start while project-1 is waiting",
+    );
+
+    drop(root);
+}
Relevance

⭐⭐ Medium

Repo values Rust/TS parity in some areas (#13074, #13132), but no clear precedent requiring mirrored
TS tests when TS code unchanged.

PR-#13074
PR-#13132

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2255044 requires cross-stack behavior changes to have mirrored tests in Rust and
TypeScript. This PR adds a Rust test that specifically validates concurrent recursive execution,
while the existing TypeScript tests shown only validate --parallel behavior for a single project
(not recursive multi-project concurrency).

Rule 2255044: Cross-stack behavior changes must have mirrored tests in Rust and TypeScript
pnpm/crates/cli/tests/run_recursive.rs[109-155]
pnpm11/pnpm/test/run.ts[224-254]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A new Rust integration test asserts recursive `run` concurrency under `--parallel`, but there is no equivalent TypeScript test covering the same scenario.

## Issue Context
This PR changes pacquet (Rust) behavior to match pnpm (TypeScript) for `--parallel` with recursive `run`. Compliance requires mirrored automated tests across stacks for shared behavior contracts.

## Fix Focus Areas
- pnpm/crates/cli/tests/run_recursive.rs[109-155]
- pnpm11/pnpm/test/run.ts[224-254]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational
4. Changeset missing pnpm entry 📘 Rule violation § Compliance
Description
The new changeset only declares a bump for pacquet and omits pnpm, violating the requirement
that changesets explicitly include the pnpm package with a valid bump type. This can cause release
tooling to miss the intended pnpm bump classification.
Code

.changeset/rust-parallel-recursive-run.md[R1-3]

+---
+"pacquet": patch
+---
Relevance

⭐ Low

Similar “add pnpm entry to changeset” findings repeatedly rejected in recent PRs (e.g. #13347,
#13416, #13417).

PR-#13347
PR-#13416
PR-#13417

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires that newly added/modified changeset files include an explicit
pnpm entry with a valid bump type. The added changeset front-matter currently lists only
pacquet.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/rust-parallel-recursive-run.md[1-3]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new changeset `.changeset/rust-parallel-recursive-run.md` is missing a `pnpm` entry in its front-matter.

## Issue Context
Compliance requires changeset front-matter to explicitly declare the `pnpm` package and a valid bump type (`patch`/`minor`/`major`).

## Fix Focus Areas
- .changeset/rust-parallel-recursive-run.md[1-3]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

Copilot AI review requested due to automatic review settings July 27, 2026 21:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit ca7af5f

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

Copilot AI review requested due to automatic review settings July 27, 2026 21:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit f1cf9eb

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: f1cf9eb95269

Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time).

Scenario: Isolated linker: fresh restore, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.572 ± 0.148 2.404 2.814 1.64 ± 0.16
pacquet@main 2.688 ± 0.160 2.402 2.907 1.71 ± 0.17
pnpr@HEAD 1.608 ± 0.115 1.438 1.775 1.02 ± 0.11
pnpr@main 1.572 ± 0.125 1.431 1.818 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5720367927399996,
      "stddev": 0.14811090755765663,
      "median": 2.52483046814,
      "user": 1.8058751200000003,
      "system": 1.4839115,
      "min": 2.40357942764,
      "max": 2.81357540264,
      "times": [
        2.5216642656399997,
        2.40357942764,
        2.5341689446399998,
        2.52799667064,
        2.4536282956399997,
        2.46002278764,
        2.81357540264,
        2.69802059464,
        2.81033830664,
        2.4973732316399997
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.6879212549399996,
      "stddev": 0.1598648436718133,
      "median": 2.7443724186400003,
      "user": 1.9484623200000002,
      "system": 1.5808329,
      "min": 2.4023300016399998,
      "max": 2.90702555164,
      "times": [
        2.73180146864,
        2.57056711264,
        2.80793041664,
        2.4023300016399998,
        2.7650549026399998,
        2.75694336864,
        2.57735936064,
        2.52634344664,
        2.90702555164,
        2.83385691964
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.6076034635399998,
      "stddev": 0.11517370084745965,
      "median": 1.60658984114,
      "user": 1.33002152,
      "system": 1.4182212,
      "min": 1.43826168864,
      "max": 1.7748592046399998,
      "times": [
        1.43826168864,
        1.74726203164,
        1.6195175436399998,
        1.52144217264,
        1.71772681764,
        1.6072510216399998,
        1.7748592046399998,
        1.58837863864,
        1.45540685564,
        1.60592866064
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.57162012564,
      "stddev": 0.12473460512957513,
      "median": 1.53280350464,
      "user": 1.3744131200000003,
      "system": 1.4720700000000002,
      "min": 1.43134212164,
      "max": 1.8181638116399998,
      "times": [
        1.65169241564,
        1.44310007364,
        1.52337042464,
        1.52230401064,
        1.43134212164,
        1.8181638116399998,
        1.45466664064,
        1.6613166586399999,
        1.6680085146399999,
        1.54223658464
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 314.8 ± 23.9 267.9 356.8 1.05 ± 0.11
pacquet@main 300.9 ± 21.6 263.1 333.2 1.00
pnpr@HEAD 319.9 ± 22.9 281.9 346.6 1.06 ± 0.11
pnpr@main 316.0 ± 19.3 275.7 345.5 1.05 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.3147566379400001,
      "stddev": 0.02386441537309899,
      "median": 0.31112368424000003,
      "user": 0.26575188,
      "system": 0.5824079799999999,
      "min": 0.26789594424,
      "max": 0.35678712724,
      "times": [
        0.31014856724,
        0.32458528824,
        0.35678712724,
        0.34162336224,
        0.29904506624,
        0.31162552124000004,
        0.26789594424,
        0.30811475924000004,
        0.31711889624,
        0.31062184724
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.30092852604,
      "stddev": 0.021634298847873136,
      "median": 0.30068016774000006,
      "user": 0.25680778,
      "system": 0.5818435799999999,
      "min": 0.26314972124,
      "max": 0.33316987824,
      "times": [
        0.30371950524,
        0.32700385924,
        0.30538629524,
        0.31943964424000004,
        0.29764083024000004,
        0.29266126924,
        0.33316987824,
        0.28607803724,
        0.28103622024,
        0.26314972124
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.31987895254,
      "stddev": 0.022943008625163394,
      "median": 0.32335794724,
      "user": 0.26541158,
      "system": 0.5861158799999999,
      "min": 0.28186692924,
      "max": 0.34660495724,
      "times": [
        0.32042327124000003,
        0.31986957224,
        0.28186692924,
        0.29626450524000003,
        0.34373913524,
        0.34660495724,
        0.34184798324000004,
        0.32629262324,
        0.29135174024,
        0.33052880824
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.31604714434,
      "stddev": 0.01929018436973897,
      "median": 0.31436595774000003,
      "user": 0.27390857999999996,
      "system": 0.55615068,
      "min": 0.27574096524,
      "max": 0.34546862324,
      "times": [
        0.33803787924,
        0.31443626024000004,
        0.30931586424,
        0.34546862324,
        0.30772856324000003,
        0.31675446324,
        0.33013436724,
        0.30855880224000004,
        0.31429565524,
        0.27574096524
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 3.066 ± 0.117 2.948 3.358 1.95 ± 0.22
pacquet@main 3.136 ± 0.071 3.027 3.241 1.99 ± 0.22
pnpr@HEAD 1.573 ± 0.169 1.452 1.923 1.00
pnpr@main 1.682 ± 0.158 1.491 1.900 1.07 ± 0.15
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 3.06569320916,
      "stddev": 0.11668577704650401,
      "median": 3.01914942916,
      "user": 2.4022228399999994,
      "system": 1.7209474399999998,
      "min": 2.94769120766,
      "max": 3.3577096606600003,
      "times": [
        2.99950686866,
        2.94769120766,
        3.01592011966,
        3.0004363846600004,
        3.02237873866,
        3.00973295166,
        3.3577096606600003,
        3.08462180966,
        3.0705614966600003,
        3.14837285366
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 3.13591132216,
      "stddev": 0.07052338719483939,
      "median": 3.12185470116,
      "user": 2.5604673399999998,
      "system": 1.84093384,
      "min": 3.02745262566,
      "max": 3.2413091296600003,
      "times": [
        3.18857266466,
        3.1191143196600004,
        3.2347449366600003,
        3.1245950826600004,
        3.08179967066,
        3.02745262566,
        3.16826673066,
        3.2413091296600003,
        3.07934830666,
        3.0939097546600003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.57326101466,
      "stddev": 0.16872039326870605,
      "median": 1.50983974566,
      "user": 1.21103984,
      "system": 1.24706984,
      "min": 1.45203003666,
      "max": 1.92258280966,
      "times": [
        1.51594985066,
        1.45236986466,
        1.51018426266,
        1.92258280966,
        1.85458624866,
        1.51922434166,
        1.50726973966,
        1.48891776366,
        1.45203003666,
        1.50949522866
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.68222674736,
      "stddev": 0.15790318628347635,
      "median": 1.66246452366,
      "user": 1.26053784,
      "system": 1.4132072399999998,
      "min": 1.49113036966,
      "max": 1.90048316566,
      "times": [
        1.90048316566,
        1.76119432366,
        1.58672789666,
        1.85628911666,
        1.87314421166,
        1.6448507536599999,
        1.68007829366,
        1.52571943966,
        1.50264990266,
        1.49113036966
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 664.3 ± 30.3 608.2 711.3 1.81 ± 0.21
pacquet@main 787.8 ± 106.2 642.7 948.3 2.15 ± 0.37
pnpr@HEAD 366.0 ± 39.4 320.8 466.8 1.00
pnpr@main 392.8 ± 35.1 360.9 457.6 1.07 ± 0.15
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.66428376808,
      "stddev": 0.030319199495792256,
      "median": 0.66663987028,
      "user": 0.8022200599999998,
      "system": 0.71159334,
      "min": 0.6082291457800001,
      "max": 0.7113027647800001,
      "times": [
        0.6839134257800001,
        0.6796183497800001,
        0.6082291457800001,
        0.6914412927800001,
        0.6569019767800001,
        0.6632789227800001,
        0.62899396378,
        0.64915702078,
        0.6700008177800001,
        0.7113027647800001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.7877902591800001,
      "stddev": 0.1062281035199773,
      "median": 0.78942093978,
      "user": 0.98102736,
      "system": 0.7965500399999998,
      "min": 0.64274185378,
      "max": 0.9482874747800001,
      "times": [
        0.64274185378,
        0.6791307127800001,
        0.6570834777800001,
        0.7918666977800001,
        0.7869751817800001,
        0.8807600447800001,
        0.8264603367800001,
        0.9089539537800001,
        0.7556428577800001,
        0.9482874747800001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.36601362258000003,
      "stddev": 0.03940899624382405,
      "median": 0.36235114478,
      "user": 0.25129086,
      "system": 0.61911674,
      "min": 0.32080785278,
      "max": 0.46675600178000004,
      "times": [
        0.36823246978,
        0.37903007878,
        0.33980357778000003,
        0.36744489078000003,
        0.32080785278,
        0.46675600178000004,
        0.36612152578,
        0.35438643678000004,
        0.35858076378000003,
        0.33897262778000004
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.39277219348000003,
      "stddev": 0.035105144782844704,
      "median": 0.38648928728,
      "user": 0.28762385999999995,
      "system": 0.64015954,
      "min": 0.36085184778,
      "max": 0.45757545078,
      "times": [
        0.45757545078,
        0.39300229878000004,
        0.39324132678,
        0.36589398678,
        0.36445635878000004,
        0.38103132678,
        0.45243971578000003,
        0.36728237478000003,
        0.39194724778,
        0.36085184778
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.266 ± 0.112 2.132 2.442 6.45 ± 0.42
pacquet@main 2.175 ± 0.095 2.080 2.403 6.19 ± 0.37
pnpr@HEAD 0.351 ± 0.015 0.328 0.379 1.00
pnpr@main 0.356 ± 0.024 0.327 0.387 1.01 ± 0.08
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.265585415,
      "stddev": 0.11245908835367852,
      "median": 2.2644034184,
      "user": 1.5112307,
      "system": 0.9760106999999998,
      "min": 2.1322249024,
      "max": 2.4424903954,
      "times": [
        2.1322249024,
        2.1435533174,
        2.1350869074000003,
        2.1958088754,
        2.3622486174,
        2.2626935674,
        2.3296501454,
        2.4424903954,
        2.3859841524000003,
        2.2661132694000004
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.1745947249000004,
      "stddev": 0.09487928611059016,
      "median": 2.1437261549000004,
      "user": 1.4037209000000002,
      "system": 0.9176002999999998,
      "min": 2.0801580354,
      "max": 2.4031890954,
      "times": [
        2.1722009474,
        2.4031890954,
        2.1209273434,
        2.2701386994,
        2.1668997514,
        2.1462824604,
        2.1079517234000003,
        2.0801580354,
        2.1411698494,
        2.1370293434
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.35108442100000004,
      "stddev": 0.014705149950065987,
      "median": 0.3528405874,
      "user": 0.24372599999999994,
      "system": 0.6026583999999999,
      "min": 0.3276642184,
      "max": 0.3787897864,
      "times": [
        0.3276642184,
        0.35672613940000003,
        0.3534755344,
        0.3634506584,
        0.3787897864,
        0.3558987254,
        0.3412508164,
        0.3478482664,
        0.33353442440000003,
        0.3522056404
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.3562944809,
      "stddev": 0.02412602005160089,
      "median": 0.3516672939,
      "user": 0.2554241,
      "system": 0.5800327,
      "min": 0.3267806604,
      "max": 0.3872017554,
      "times": [
        0.38263707140000003,
        0.3745011824,
        0.3267806604,
        0.3596940234,
        0.3351662194,
        0.33987492140000003,
        0.3293491334,
        0.3436405644,
        0.3840992774,
        0.3872017554
      ]
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 387.2 ± 17.6 362.2 412.0 4.43 ± 0.22
pacquet@main 515.2 ± 79.7 413.9 638.5 5.89 ± 0.92
pnpr@HEAD 91.0 ± 6.1 85.2 106.7 1.04 ± 0.07
pnpr@main 87.4 ± 1.6 85.1 91.7 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.38721431008,
      "stddev": 0.01758912125239543,
      "median": 0.39045694788,
      "user": 0.38763559999999997,
      "system": 0.055630900000000004,
      "min": 0.36221448138,
      "max": 0.41198770938,
      "times": [
        0.41198770938,
        0.40610134438000006,
        0.36555178938000005,
        0.39397470938,
        0.40132287938000005,
        0.36875002638000004,
        0.39582227938000003,
        0.37947869538000006,
        0.38693918638,
        0.36221448138
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.5151916308800001,
      "stddev": 0.07965983506047125,
      "median": 0.51964739988,
      "user": 0.4880362999999999,
      "system": 0.0978942,
      "min": 0.41387868938000005,
      "max": 0.63846530538,
      "times": [
        0.49186833938,
        0.44384017838000006,
        0.45052261938000004,
        0.41387868938000005,
        0.42811294138000006,
        0.63846530538,
        0.54742646038,
        0.57928032338,
        0.55811166638,
        0.60040978538
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09100532723185184,
      "stddev": 0.006073901311929836,
      "median": 0.08923363938000001,
      "user": 0.02286698148148148,
      "system": 0.01106696296296296,
      "min": 0.08520209738000001,
      "max": 0.10670547238,
      "times": [
        0.10361834438,
        0.10520274038,
        0.10670547238,
        0.10116289338000001,
        0.09192273938000001,
        0.09117876238,
        0.08923363938000001,
        0.08520209738000001,
        0.09171258538,
        0.09308158638000001,
        0.08945017638000001,
        0.09100779138000001,
        0.09059462538,
        0.09152336938000001,
        0.08647165238,
        0.08620466138,
        0.08760597238000001,
        0.08553944238000001,
        0.08887007738000001,
        0.08802945838000001,
        0.08529242838000001,
        0.08803284438,
        0.08909131238000001,
        0.09024667138,
        0.08589205338,
        0.08585871138000001,
        0.08841172638
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.08743687280424244,
      "stddev": 0.0016135850523698592,
      "median": 0.08711476938,
      "user": 0.021464045454545454,
      "system": 0.009946642424242425,
      "min": 0.08511189838000001,
      "max": 0.09168474338,
      "times": [
        0.08511189838000001,
        0.08712512938,
        0.08740366338000001,
        0.08696901738,
        0.08640666038,
        0.08655253438,
        0.08725021438000001,
        0.08747434538,
        0.08695152438,
        0.08549738338,
        0.08718241738,
        0.08765679838,
        0.08778895638,
        0.08630378638000001,
        0.08711476938,
        0.08795512938000001,
        0.09141207038,
        0.08678969938,
        0.08552957338,
        0.08699997438,
        0.09168474338,
        0.08657501638000001,
        0.08652868038,
        0.08683854138000001,
        0.08699743038,
        0.09011156938,
        0.09028599638000001,
        0.08542554738000001,
        0.08896796038,
        0.08989093438000001,
        0.08715043638,
        0.08607864338,
        0.08740575738
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.583 ± 0.103 4.459 4.760 1.28 ± 0.05
pacquet@main 4.617 ± 0.116 4.451 4.875 1.29 ± 0.05
pnpr@HEAD 3.637 ± 0.114 3.477 3.887 1.01 ± 0.04
pnpr@main 3.591 ± 0.100 3.480 3.772 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.582944854020001,
      "stddev": 0.10275859582872185,
      "median": 4.53682397572,
      "user": 2.0076315,
      "system": 1.4793128599999998,
      "min": 4.4590228527199995,
      "max": 4.76012444972,
      "times": [
        4.51059091072,
        4.4590228527199995,
        4.65958009072,
        4.69809874972,
        4.5184415837200005,
        4.66144156572,
        4.76012444972,
        4.52233633872,
        4.48850038572,
        4.55131161272
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.61713645692,
      "stddev": 0.11593662715757883,
      "median": 4.6176626897199995,
      "user": 2.2748405,
      "system": 1.7318401599999997,
      "min": 4.45086519672,
      "max": 4.87453452872,
      "times": [
        4.53182354572,
        4.45086519672,
        4.51797501672,
        4.64919523672,
        4.57652887072,
        4.65616463572,
        4.87453452872,
        4.58652705672,
        4.6789521587200005,
        4.64879832272
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.63669134962,
      "stddev": 0.11429678808724894,
      "median": 3.62974503022,
      "user": 1.4405740999999999,
      "system": 1.42433466,
      "min": 3.47661830272,
      "max": 3.88696401872,
      "times": [
        3.59046913672,
        3.64139535472,
        3.61809470572,
        3.68970656272,
        3.71060549072,
        3.88696401872,
        3.66014951472,
        3.5756119757200002,
        3.5172984337199997,
        3.47661830272
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.5911214402200002,
      "stddev": 0.09968104257093093,
      "median": 3.55965136672,
      "user": 1.3115384999999997,
      "system": 1.3336762599999996,
      "min": 3.47956219272,
      "max": 3.77151038572,
      "times": [
        3.77151038572,
        3.48137254272,
        3.56021008572,
        3.66194267872,
        3.7064002827199998,
        3.55909264772,
        3.50357560172,
        3.54670078472,
        3.47956219272,
        3.64084719972
      ]
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13448
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
2,947.69 ms
(+5.63%)Baseline: 2,790.48 ms
3,348.58 ms
(88.03%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
2,132.22 ms
(+9.26%)Baseline: 1,951.44 ms
2,341.72 ms
(91.05%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
608.23 ms
(-3.14%)Baseline: 627.95 ms
753.55 ms
(80.72%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
362.21 ms
(-6.26%)Baseline: 386.40 ms
463.67 ms
(78.12%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,403.58 ms
(-0.11%)Baseline: 2,406.27 ms
2,887.53 ms
(83.24%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,459.02 ms
(-0.27%)Baseline: 4,471.26 ms
5,365.52 ms
(83.11%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
267.90 ms
(-2.41%)Baseline: 274.52 ms
329.42 ms
(81.32%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13448
Testbedpnpr

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,452.03 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
327.66 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
320.81 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
85.20 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,438.26 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,476.62 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
281.87 ms
🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan merged commit 5534ee4 into main Jul 27, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rust pnpm treats --parallel as a script in recursive run

3 participants