Skip to content

fix(resolver): break peer dep-path await cycles that span resolution passes - #12927

Merged
zkochan merged 1 commit into
mainfrom
fix-12921
Jul 11, 2026
Merged

zkochan merged 1 commit into
mainfrom
fix-12921

Conversation

@zkochan

@zkochan zkochan commented Jul 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes #12921 — pnpm install deadlocked on 11.11.0 (e.g. with [email protected]) after #12847 split the root peer-resolution pass into two resolvePeersOfChildren calls. Cycle detection only sees the children of a single call, so a peer cycle spanning a project's own dependencies and hoisted peer providers (or a provider resolved at its true tree position) was invisible, and the dep-path deferreds awaited each other forever.

The fix records the actual await edges between dep-path calculations — including waits that go through a peersCache hit, which borrow the cache owner's edges — and, after the traversal and before the finishing promises are awaited, breaks any remaining await cycle by resolving each member's dep-path promise to name@version, the same collapse in-call cycle detection applies. Installs that resolved before are untouched: the breaker only fires on await graphs that could never settle on their own.

pacquet's synchronous walker already performs global cycle detection and needs no code change; mirrored Rust tests pin the same dep paths for both scenarios. Verified end-to-end: the [email protected] repro from the issue now installs in ~6s with the fixed bundle, and the TypeScript CLI and pacquet produce byte-identical lockfiles for it.

Squash Commit Body

The dep path of a package with peer dependencies is computed after the
dep paths of its peers, and peer cycles are broken by collapsing the
suffix to name@version. That cycle detection only sees the children of
a single resolvePeersOfChildren call, and since hoisted peer providers
stopped being walked in the root context (commit fecfe8334b), a peer
cycle between a project's own dependency and a hoisted provider - or a
provider resolved at its true tree position - spans two calls, so the
dep path calculations awaited each other's promise forever and
pnpm install hung, e.g. with [email protected].

Record which dep path promise each calculation awaits (borrowing the
cache owner's edges for peers-cache hits) and, after the traversal,
resolve every promise on a remaining await cycle to name@version - the
same collapse in-call cycle detection applies. Installs that resolved
before are untouched: the breaker only fires on await graphs that could
never settle.

pacquet's synchronous walker already detects these cycles globally and
needs no code change; mirrored tests in both stacks pin the same dep
paths, and the electron-builder repro now produces byte-identical
lockfiles across the two implementations.

Fixes https://github.com/pnpm/pnpm/issues/12921

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting.
    (pacquet needs no code change — its global cycle detection already handles
    these shapes; mirrored tests added to prove parity.)
  • 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.
  • Updated the documentation if needed. (No documentation impact.)

Written by an agent (Claude Code, claude-fable-5).

Summary by CodeRabbit

  • Bug Fixes
    • Fixed a case where pnpm install could hang indefinitely due to circular peer-dependency resolution.
    • Improved peer dependency cycle handling, including scenarios involving direct dependencies and auto-installed provider packages.
  • Tests
    • Added regression tests covering peer cycles across multiple traversal levels and pruned hoisted providers.
  • Chores
    • Updated the dependency resolver and pnpm with a patch-level release.

Copilot AI review requested due to automatic review settings July 10, 2026 23:49

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 10, 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: 7a4c6208-b14b-4af1-aefc-42d440f69c40

📥 Commits

Reviewing files that changed from the base of the PR and between 9348bf6 and edb50d2.

📒 Files selected for processing (4)
  • .changeset/peer-await-cycle-deadlock.md
  • pnpm/crates/resolving-deps-resolver/src/resolve_peers/tests.rs
  • pnpm11/installing/deps-resolver/src/resolvePeers.ts
  • pnpm11/installing/deps-resolver/test/resolvePeers.ts
✅ Files skipped from review due to trivial changes (1)
  • .changeset/peer-await-cycle-deadlock.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • pnpm11/installing/deps-resolver/test/resolvePeers.ts
  • pnpm/crates/resolving-deps-resolver/src/resolve_peers/tests.rs
  • pnpm11/installing/deps-resolver/src/resolvePeers.ts

📝 Walkthrough

Walkthrough

The resolver tracks peer await edges across traversal calls, detects cross-call cycles, and resolves affected dependency paths. Rust and TypeScript regression tests cover pruned and hoisted peer-provider cycles, with a patch changeset for pnpm and the resolver package.

Changes

Peer cycle resolution

Layer / File(s) Summary
Cross-call await-cycle breaking
pnpm11/installing/deps-resolver/src/resolvePeers.ts
Shared await-edge, cache-owner, and cycle-broken state detects cross-call cycles and resolves affected dependency-path promises.
Peer-cycle regression coverage
pnpm/crates/resolving-deps-resolver/src/resolve_peers/tests.rs, pnpm11/installing/deps-resolver/test/resolvePeers.ts
Tests cover mutual cycles involving direct dependencies and pruned or hoisted peer providers.
Patch release metadata
.changeset/peer-await-cycle-deadlock.md
Adds patch release notes for pnpm and @pnpm/installing.deps-resolver.

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

Sequence Diagram(s)

sequenceDiagram
  participant resolvePeers
  participant resolvePeersOfChildren
  participant calculateDepPath
  participant pathsByNodeIdPromises
  resolvePeers->>resolvePeersOfChildren: share cycle-tracking state
  resolvePeersOfChildren->>calculateDepPath: calculate peer dep paths
  calculateDepPath->>pathsByNodeIdPromises: record pending await edges
  resolvePeers->>resolvePeers: detect cross-call cycles
  resolvePeers->>pathsByNodeIdPromises: resolve cycle paths
Loading

Assessment against linked issues

Objective Addressed Explanation
Install completes instead of deadlocking on cross-call peer cycles [#12921] ✅
Resolve cycles involving direct dependencies and hoisted or auto-installed peer providers [#12921] ✅
Preserve expected dependency graph and project mappings [#12921] ✅

Possibly related PRs

  • pnpm/pnpm#12018: Both modify peer-resolution cycle detection and dependency-path promise handling.
  • pnpm/pnpm#12847: Both modify resolution of hoisted or pruned peer providers in resolvePeers.

Suggested labels: product: pnpm@11

✨ 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-12921

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 peer dep-path deadlocks by breaking cross-pass await cycles

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Record actual dep-path promise await edges across peer resolution passes.
• Detect and break unresolved await cycles by collapsing dep paths to name@version.
• Add TS + Rust regression tests and a changeset for the deadlock fix.
Diagram

graph TD
  A["resolvePeers()"] --> B["resolvePeersOfChildren (direct)"] --> C["resolvePeersOfChildren (pruned providers)"] --> D["breakDepPathAwaitCycles()"] --> E["await finishingList"]
  B --> F["calculateDepPath() (DeferredPromise)"]
  C --> F
  F --> G[("peersCache")]
  G --> D
  D --> H{"analyzeGraph: cycles?"} --> I["resolve depPath to name@version"] --> E
  subgraph Legend
    direction LR
    _p["Process"] ~~~ _d[("Cache/Store")] ~~~ _c{"Decision"}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Re-merge traversal passes to keep cycle detection local
  • ➕ Avoids needing a global/post-pass cycle breaker
  • ➕ Keeps reasoning within existing resolvePeersOfChildren cycle logic
  • ➖ Reverts/complicates the prior change that split the root pass
  • ➖ May reintroduce performance or correctness issues the split was meant to address
2. Integrate a global await-graph into resolvePeersOfChildren directly
  • ➕ Single place for cycle detection rather than a post-pass breaker
  • ➕ Potentially clearer ownership of cycle handling semantics
  • ➖ Larger refactor of hot-path resolver logic
  • ➖ Harder to keep behavior identical to existing in-call collapse rules
3. Switch TS implementation to a synchronous/global-walk model (Rust/pacquet style)
  • ➕ Naturally enables global cycle detection without promise deadlocks
  • ➕ Aligns traversal semantics across implementations
  • ➖ Major architectural change with high regression risk
  • ➖ Likely performance and API-surface implications in the TS CLI

Recommendation: Keep the PR’s approach: explicitly recording await edges (including peers-cache ownership) and breaking only remaining cycles just before awaiting finishing promises is the smallest targeted fix. It preserves existing dep-path collapse semantics (name@version) and avoids reworking the two-pass traversal structure while ensuring installs cannot deadlock on cross-pass peer cycles.

Files changed (4) +392 / -0

Bug fix (1) +100 / -0
resolvePeers.tsTrack dep-path await graph and break cross-pass await cycles +100/-0

Track dep-path await graph and break cross-pass await cycles

• Extends peer resolution context to record which dep-path deferreds each node awaits and to track peers-cache ownership of dep-path resolution. Adds a post-traversal cycle breaker that analyzes the recorded await graph and resolves any remaining cycle members to 'name@version' before awaiting finishing promises, preventing deadlocks spanning multiple resolution passes.

pnpm11/installing/deps-resolver/src/resolvePeers.ts

Tests (2) +286 / -0
tests.rsAdd Rust regression tests for cross-pass peer-cycle dep paths +139/-0

Add Rust regression tests for cross-pass peer-cycle dep paths

• Adds two tests mirroring the TS scenarios behind #12921: (1) an own direct dependency mutually peering with a pruned hoisted provider, and (2) the same cycle when the provider is visited at its tree position. Asserts dep-path suffix collapse behavior for both sides of the cycle.

pnpm/crates/resolving-deps-resolver/src/resolve_peers/tests.rs

resolvePeers.tsAdd TS regression tests for peer-cycle deadlock across passes +147/-0

Add TS regression tests for peer-cycle deadlock across passes

• Adds tests reproducing the deadlock shape where a peer cycle spans an importer’s own direct dependencies and pruned hoisted provider fallback traversal. Adds a second test ensuring the same cycle resolves when the provider is walked at its true tree position, asserting expected dep paths and graph keys.

pnpm11/installing/deps-resolver/test/resolvePeers.ts

Documentation (1) +6 / -0
peer-await-cycle-deadlock.mdAdd changeset documenting peer-resolution deadlock fix +6/-0

Add changeset documenting peer-resolution deadlock fix

• Introduces a patch-level changeset for @pnpm/installing.deps-resolver and pnpm. Documents the deadlock scenario (cross-pass peer cycle) and cites the electron-builder repro and upstream issue.

.changeset/peer-await-cycle-deadlock.md

@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (1) 📎 Requirement gaps (0) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 18 rules

Grey Divider


Remediation recommended

1. Comment describes past deadlock 📘 Rule violation ⚙ Maintainability
Description
A new test comment describes historical behavior (the prior deadlock/hang) instead of stating the
current expected behavior/contract. This violates the requirement to keep comments focused on
current behavior and can become misleading as the implementation evolves.
Code

pnpm11/installing/deps-resolver/test/resolvePeers.ts[R1866-1869]

+  // Regression test for https://github.com/pnpm/pnpm/issues/12921: the peer
+  // cycle spans two resolvePeersOfChildren calls (the own direct children and
+  // the pruned-provider fallback), so neither call's cycle analysis sees it —
+  // the dep path calculations awaited each other forever.
Evidence
The checklist rule forbids historical phrasing in comments. The added comment explicitly explains
that the dep-path calculations "awaited each other forever" (the prior deadlock) rather than
describing the current invariant being tested.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm11/installing/deps-resolver/test/resolvePeers.ts[1866-1869]

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 newly added comment in a test explains the previous deadlock behavior (historical/regression narrative) rather than documenting the current expected behavior and invariant the test asserts.

## Issue Context
Comments should describe current behavior/expectations, not historical implementations or past bugs; the test name and linked issue already provide regression context.

## Fix Focus Areas
- pnpm11/installing/deps-resolver/test/resolvePeers.ts[1866-1869]

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


2. Global cycle analysis overhead 🐞 Bug ➹ Performance
Description
breakDepPathAwaitCycles builds a global await-edge graph and calls analyzeGraph (plus
cycles.flat()), which can add noticeable CPU/memory overhead on large peer-resolution workloads
even when there are no cross-pass deadlocks to break. This is on the install hot path and scales
with the number of unresolved dep-path await edges at that moment.
Code

pnpm11/installing/deps-resolver/src/resolvePeers.ts[R288-349]

+// Cycle analysis inside resolvePeersOfChildren only sees the children of a
+// single call, but a dep path calculation may await a node resolved in a
+// different call or at a different tree level (a hoisted peer provider and
+// a consumer that peer-depend on each other, https://github.com/pnpm/pnpm/issues/12921).
+// Such an await cycle never settles on its own, so before the finishing
+// promises are awaited, walk the recorded await edges and resolve every
+// dep path promise on a cycle to the peer's `name@version` — the same
+// collapse in-call cycle detection applies (see calculateDepPath).
+// A node that hit the peers cache awaits its dep path from the node that
+// created the cache entry, so it borrows that owner's await edges.
+function breakDepPathAwaitCycles<T extends PartialResolvedPackage> (
+  opts: {
+    awaitedPeerNodeIdsByNodeId: Map<NodeId, Set<NodeId>>
+    peersCacheOwnerByNodeId: Map<NodeId, NodeId>
+    cycleBrokenNodeIds: Set<NodeId>
+    pathsByNodeId: Map<NodeId, DepPath>
+    pathsByNodeIdPromises: Map<NodeId, DeferredPromise<DepPath>>
+    dependenciesTree: DependenciesTree<T>
+  }
+): void {
+  const isSettled = (nodeId: NodeId): boolean =>
+    opts.pathsByNodeId.has(nodeId) || opts.cycleBrokenNodeIds.has(nodeId)
+  const keysByNodeId = new Map<NodeId, string>()
+  const nodeIdsByKey = new Map<string, NodeId>()
+  function keyOf (nodeId: NodeId): string {
+    let key = keysByNodeId.get(nodeId)
+    if (key == null) {
+      key = String(keysByNodeId.size)
+      keysByNodeId.set(nodeId, key)
+      nodeIdsByKey.set(key, nodeId)
+    }
+    return key
+  }
+  const graphEntries: Array<[string, string[]]> = []
+  const awaitingNodeIds = new Set([
+    ...opts.awaitedPeerNodeIdsByNodeId.keys(),
+    ...opts.peersCacheOwnerByNodeId.keys(),
+  ])
+  for (const nodeId of awaitingNodeIds) {
+    if (isSettled(nodeId)) continue
+    const cacheOwnerNodeId = opts.peersCacheOwnerByNodeId.get(nodeId)
+    const awaitedNodeIds = opts.awaitedPeerNodeIdsByNodeId.get(nodeId) ??
+      (cacheOwnerNodeId == null ? undefined : opts.awaitedPeerNodeIdsByNodeId.get(cacheOwnerNodeId))
+    if (awaitedNodeIds == null) continue
+    const liveTargets: string[] = []
+    for (const awaitedNodeId of awaitedNodeIds) {
+      if (!isSettled(awaitedNodeId)) {
+        liveTargets.push(keyOf(awaitedNodeId))
+      }
+    }
+    if (liveTargets.length > 0) {
+      graphEntries.push([keyOf(nodeId), liveTargets])
+    }
+  }
+  if (graphEntries.length === 0) return
+  const { cycles } = analyzeGraph(graphEntries as unknown as Graph) as unknown as { cycles: string[][] }
+  for (const key of new Set(cycles.flat())) {
+    const nodeId = nodeIdsByKey.get(key)!
+    const { name, version } = opts.dependenciesTree.get(nodeId)!.resolvedPackage
+    opts.cycleBrokenNodeIds.add(nodeId)
+    opts.pathsByNodeIdPromises.get(nodeId)?.resolve(`${name}@${version}` as DepPath)
+  }
Evidence
The PR adds an unconditional call to breakDepPathAwaitCycles() immediately before awaiting all
finishing promises, and the helper constructs graphEntries over all still-unsettled await edges
and runs analyzeGraph followed by cycles.flat(). The same module explicitly flags
large-traversal memory pressure elsewhere, which makes extra whole-graph work in the resolver a
performance risk worth addressing.

pnpm11/installing/deps-resolver/src/resolvePeers.ts[230-238]
pnpm11/installing/deps-resolver/src/resolvePeers.ts[288-349]
pnpm11/installing/deps-resolver/src/resolvePeers.ts[1148-1152]

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

### Issue description
`breakDepPathAwaitCycles()` runs a whole-graph cycle analysis via `analyzeGraph(graphEntries)` and then materializes `new Set(cycles.flat())`. On large installs with many peer relationships, this adds extra work and allocations even when no deadlock exists.

### Issue Context
This runs before `await Promise.all(finishingList)`, so it executes in the normal install path whenever there are unresolved await edges. The resolver already has explicit commentary about large-traversal memory pressure.

### Fix Focus Areas
- Prefer a linear-time SCC/Tarjan/Kosaraju pass over `awaitedPeerNodeIdsByNodeId` (and the cache-owner edge borrowing) to find nodes that are in a cycle (SCC size > 1, or self-loop), rather than enumerating cycles.
- At minimum, avoid `cycles.flat()`; accumulate nodes in cycles incrementally to avoid large intermediate arrays.
- Consider gating/short-circuiting: if the unresolved await graph is very large, compute only SCC membership (nodes-in-cycles) rather than full cycle lists.

### Fix Focus Areas (code references)
- pnpm11/installing/deps-resolver/src/resolvePeers.ts[230-238]
- pnpm11/installing/deps-resolver/src/resolvePeers.ts[288-349]
- pnpm11/installing/deps-resolver/src/resolvePeers.ts[1148-1152]

ⓘ 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 edb50d2

Results up to commit 9348bf6


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


Remediation recommended
1. Comment describes past deadlock 📘 Rule violation ⚙ Maintainability
Description
A new test comment describes historical behavior (the prior deadlock/hang) instead of stating the
current expected behavior/contract. This violates the requirement to keep comments focused on
current behavior and can become misleading as the implementation evolves.
Code

pnpm11/installing/deps-resolver/test/resolvePeers.ts[R1866-1869]

+  // Regression test for https://github.com/pnpm/pnpm/issues/12921: the peer
+  // cycle spans two resolvePeersOfChildren calls (the own direct children and
+  // the pruned-provider fallback), so neither call's cycle analysis sees it —
+  // the dep path calculations awaited each other forever.
Evidence
The checklist rule forbids historical phrasing in comments. The added comment explicitly explains
that the dep-path calculations "awaited each other forever" (the prior deadlock) rather than
describing the current invariant being tested.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm11/installing/deps-resolver/test/resolvePeers.ts[1866-1869]

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 newly added comment in a test explains the previous deadlock behavior (historical/regression narrative) rather than documenting the current expected behavior and invariant the test asserts.

## Issue Context
Comments should describe current behavior/expectations, not historical implementations or past bugs; the test name and linked issue already provide regression context.

## Fix Focus Areas
- pnpm11/installing/deps-resolver/test/resolvePeers.ts[1866-1869]

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


2. Global cycle analysis overhead 🐞 Bug ➹ Performance
Description
breakDepPathAwaitCycles builds a global await-edge graph and calls analyzeGraph (plus
cycles.flat()), which can add noticeable CPU/memory overhead on large peer-resolution workloads
even when there are no cross-pass deadlocks to break. This is on the install hot path and scales
with the number of unresolved dep-path await edges at that moment.
Code

pnpm11/installing/deps-resolver/src/resolvePeers.ts[R288-349]

+// Cycle analysis inside resolvePeersOfChildren only sees the children of a
+// single call, but a dep path calculation may await a node resolved in a
+// different call or at a different tree level (a hoisted peer provider and
+// a consumer that peer-depend on each other, https://github.com/pnpm/pnpm/issues/12921).
+// Such an await cycle never settles on its own, so before the finishing
+// promises are awaited, walk the recorded await edges and resolve every
+// dep path promise on a cycle to the peer's `name@version` — the same
+// collapse in-call cycle detection applies (see calculateDepPath).
+// A node that hit the peers cache awaits its dep path from the node that
+// created the cache entry, so it borrows that owner's await edges.
+function breakDepPathAwaitCycles<T extends PartialResolvedPackage> (
+  opts: {
+    awaitedPeerNodeIdsByNodeId: Map<NodeId, Set<NodeId>>
+    peersCacheOwnerByNodeId: Map<NodeId, NodeId>
+    cycleBrokenNodeIds: Set<NodeId>
+    pathsByNodeId: Map<NodeId, DepPath>
+    pathsByNodeIdPromises: Map<NodeId, DeferredPromise<DepPath>>
+    dependenciesTree: DependenciesTree<T>
+  }
+): void {
+  const isSettled = (nodeId: NodeId): boolean =>
+    opts.pathsByNodeId.has(nodeId) || opts.cycleBrokenNodeIds.has(nodeId)
+  const keysByNodeId = new Map<NodeId, string>()
+  const nodeIdsByKey = new Map<string, NodeId>()
+  function keyOf (nodeId: NodeId): string {
+    let key = keysByNodeId.get(nodeId)
+    if (key == null) {
+      key = String(keysByNodeId.size)
+      keysByNodeId.set(nodeId, key)
+      nodeIdsByKey.set(key, nodeId)
+    }
+    return key
+  }
+  const graphEntries: Array<[string, string[]]> = []
+  const awaitingNodeIds = new Set([
+    ...opts.awaitedPeerNodeIdsByNodeId.keys(),
+    ...opts.peersCacheOwnerByNodeId.keys(),
+  ])
+  for (const nodeId of awaitingNodeIds) {
+    if (isSettled(nodeId)) continue
+    const cacheOwnerNodeId = opts.peersCacheOwnerByNodeId.get(nodeId)
+    const awaitedNodeIds = opts.awaitedPeerNodeIdsByNodeId.get(nodeId) ??
+      (cacheOwnerNodeId == null ? undefined : opts.awaitedPeerNodeIdsByNodeId.get(cacheOwnerNodeId))
+    if (awaitedNodeIds == null) continue
+    const liveTargets: string[] = []
+    for (const awaitedNodeId of awaitedNodeIds) {
+      if (!isSettled(awaitedNodeId)) {
+        liveTargets.push(keyOf(awaitedNodeId))
+      }
+    }
+    if (liveTargets.length > 0) {
+      graphEntries.push([keyOf(nodeId), liveTargets])
+    }
+  }
+  if (graphEntries.length === 0) return
+  const { cycles } = analyzeGraph(graphEntries as unknown as Graph) as unknown as { cycles: string[][] }
+  for (const key of new Set(cycles.flat())) {
+    const nodeId = nodeIdsByKey.get(key)!
+    const { name, version } = opts.dependenciesTree.get(nodeId)!.resolvedPackage
+    opts.cycleBrokenNodeIds.add(nodeId)
+    opts.pathsByNodeIdPromises.get(nodeId)?.resolve(`${name}@${version}` as DepPath)
+  }
Evidence
The PR adds an unconditional call to breakDepPathAwaitCycles() immediately before awaiting all
finishing promises, and the helper constructs graphEntries over all still-unsettled await edges
and runs analyzeGraph followed by cycles.flat(). The same module explicitly flags
large-traversal memory pressure elsewhere, which makes extra whole-graph work in the resolver a
performance risk worth addressing.

pnpm11/installing/deps-resolver/src/resolvePeers.ts[230-238]
pnpm11/installing/deps-resolver/src/resolvePeers.ts[288-349]
pnpm11/installing/deps-resolver/src/resolvePeers.ts[1148-1152]

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

### Issue description
`breakDepPathAwaitCycles()` runs a whole-graph cycle analysis via `analyzeGraph(graphEntries)` and then materializes `new Set(cycles.flat())`. On large installs with many peer relationships, this adds extra work and allocations even when no deadlock exists.

### Issue Context
This runs before `await Promise.all(finishingList)`, so it executes in the normal install path whenever there are unresolved await edges. The resolver already has explicit commentary about large-traversal memory pressure.

### Fix Focus Areas
- Prefer a linear-time SCC/Tarjan/Kosaraju pass over `awaitedPeerNodeIdsByNodeId` (and the cache-owner edge borrowing) to find nodes that are in a cycle (SCC size > 1, or self-loop), rather than enumerating cycles.
- At minimum, avoid `cycles.flat()`; accumulate nodes in cycles incrementally to avoid large intermediate arrays.
- Consider gating/short-circuiting: if the unresolved await graph is very large, compute only SCC membership (nodes-in-cycles) rather than full cycle lists.

### Fix Focus Areas (code references)
- pnpm11/installing/deps-resolver/src/resolvePeers.ts[230-238]
- pnpm11/installing/deps-resolver/src/resolvePeers.ts[288-349]
- pnpm11/installing/deps-resolver/src/resolvePeers.ts[1148-1152]

ⓘ 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.

Auto-approved notes - no code suggestions found
- 'approve_pr_on_self_review' flag enabled

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

github-actions Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
tarball/download_dependency    1.00      6.7±0.25ms   646.1 KB/sec    1.02      6.8±0.53ms   635.7 KB/sec

@codecov-commenter

codecov-commenter commented Jul 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.45%. Comparing base (4658133) to head (edb50d2).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #12927   +/-   ##
=======================================
  Coverage   85.45%   85.45%           
=======================================
  Files         474      474           
  Lines       74561    74561           
=======================================
+ Hits        63714    63716    +2     
+ Misses      10847    10845    -2     

☔ 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.

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results

# Scenario main HEAD
1 Isolated linker: fresh restore, hot cache + hot store 2.303s ± 0.138s 2.267s ± 0.045s
2 Isolated linker: fresh add new dep, hot cache + hot store 4.932s ± 0.063s 4.93s ± 0.056s
3 Isolated linker: fresh install, hot cache + hot store 5.98s ± 0.036s 5.945s ± 0.059s
4 Isolated linker: fresh restore, cold cache + cold store 7.272s ± 0.058s 7.249s ± 0.051s
5 Isolated linker: fresh install, cold cache + cold store 12.389s ± 0.193s 12.436s ± 0.374s
6 Isolated linker: fresh resolve, hot cache, offline 3.643s ± 0.032s 3.633s ± 0.031s
7 GVS linker: fresh restore, hot cache + hot store 1.104s ± 0.031s 1.097s ± 0.027s

Run 29131718681 · 10 runs per scenario · triggered by @zkochan

…passes

The dep path of a package with peer dependencies is computed after the
dep paths of its peers, and peer cycles are broken by collapsing the
suffix to name@version. That cycle detection only sees the children of
a single resolvePeersOfChildren call, and since hoisted peer providers
stopped being walked in the root context (commit fecfe83), a peer
cycle between a project's own dependency and a hoisted provider - or a
provider resolved at its true tree position - spans two calls, so the
dep path calculations awaited each other's promise forever and
pnpm install hung, e.g. with [email protected].

Record which dep path promise each calculation awaits (borrowing the
cache owner's edges for peers-cache hits) and, after the traversal,
resolve every promise on a remaining await cycle to name@version - the
same collapse in-call cycle detection applies. Installs that resolved
before are untouched: the breaker only fires on await graphs that could
never settle.

pacquet's synchronous walker already detects these cycles globally and
needs no code change; mirrored tests in both stacks pin the same dep
paths, and the electron-builder repro now produces byte-identical
lockfiles across the two implementations.

Fixes #12921

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings July 11, 2026 01:32

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 edb50d2

@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.

Auto-approved notes - no code suggestions found
- 'approve_pr_on_self_review' flag enabled

@github-actions

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: edb50d2ba6a5

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

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.088 ± 0.150 3.842 4.325 1.90 ± 0.12
pacquet@main 4.074 ± 0.122 3.936 4.294 1.90 ± 0.11
pnpr@HEAD 2.217 ± 0.135 1.996 2.406 1.03 ± 0.08
pnpr@main 2.148 ± 0.111 1.992 2.332 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.087596549020001,
      "stddev": 0.15042443732361643,
      "median": 4.0957265971200005,
      "user": 3.8821610399999997,
      "system": 3.3910047,
      "min": 3.84161512462,
      "max": 4.32488354962,
      "times": [
        4.19797220562,
        4.32488354962,
        4.04017091662,
        4.031039879620001,
        4.13323804862,
        4.10169279562,
        3.84161512462,
        4.238271135620001,
        3.87732143562,
        4.08976039862
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.073753952820001,
      "stddev": 0.12181172175088471,
      "median": 4.03294945712,
      "user": 3.86278104,
      "system": 3.400240299999999,
      "min": 3.93564846962,
      "max": 4.2940302176200005,
      "times": [
        4.191476633620001,
        4.03764597162,
        4.2283881796200005,
        4.2940302176200005,
        4.02825294262,
        3.93564846962,
        3.96312149562,
        3.99350253062,
        3.9955955036199997,
        4.06987758362
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.21696933082,
      "stddev": 0.1353207713902677,
      "median": 2.2489462096199997,
      "user": 2.76480674,
      "system": 2.9406299999999996,
      "min": 1.99601774262,
      "max": 2.40568997262,
      "times": [
        2.40568997262,
        2.2677830586199996,
        1.99601774262,
        2.1001789716199997,
        2.3542074436199996,
        2.24910405762,
        2.33966968862,
        2.14118603362,
        2.24878836162,
        2.06706797762
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 2.14836242142,
      "stddev": 0.11133834350221815,
      "median": 2.15326283962,
      "user": 2.75044934,
      "system": 2.9324688999999995,
      "min": 1.9924898206200001,
      "max": 2.3323326076199997,
      "times": [
        2.18217575062,
        2.3323326076199997,
        2.03272505562,
        2.1984946266199996,
        2.1243499286199996,
        2.1040008006199997,
        2.28756839762,
        2.0365999686199996,
        1.9924898206200001,
        2.19288725762
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 665.4 ± 9.8 647.9 678.2 1.00
pacquet@main 676.7 ± 66.6 639.3 857.8 1.02 ± 0.10
pnpr@HEAD 709.7 ± 17.5 688.7 744.6 1.07 ± 0.03
pnpr@main 720.7 ± 48.4 689.8 851.9 1.08 ± 0.07
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.66537285286,
      "stddev": 0.009779385061293862,
      "median": 0.6655426763600001,
      "user": 0.3911108200000001,
      "system": 1.33326986,
      "min": 0.6478571228600001,
      "max": 0.6781822698600001,
      "times": [
        0.66439645486,
        0.67321331886,
        0.6559408518600001,
        0.6592813228600001,
        0.6666888978600001,
        0.6603840628600001,
        0.6700467168600001,
        0.6781822698600001,
        0.6478571228600001,
        0.67773750986
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.67669343786,
      "stddev": 0.06657229169845558,
      "median": 0.65117591086,
      "user": 0.38532352,
      "system": 1.3392332599999999,
      "min": 0.6393257788600001,
      "max": 0.85779590386,
      "times": [
        0.6516344728600001,
        0.64503915986,
        0.64624428986,
        0.6470244848600001,
        0.65071734886,
        0.6393257788600001,
        0.6572470098600001,
        0.85779590386,
        0.7086536718600001,
        0.6632522578600001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.7096793802600001,
      "stddev": 0.017484533289625532,
      "median": 0.70874042536,
      "user": 0.40085061999999994,
      "system": 1.3713090600000002,
      "min": 0.6887428898600001,
      "max": 0.74460043586,
      "times": [
        0.69998176286,
        0.6887428898600001,
        0.7128880698600001,
        0.72660145586,
        0.70907822286,
        0.69013508186,
        0.74460043586,
        0.7207197628600001,
        0.69564349286,
        0.7084026278600001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.72074300706,
      "stddev": 0.048362087446246635,
      "median": 0.7116080923600001,
      "user": 0.40017552,
      "system": 1.3716034599999998,
      "min": 0.68981020686,
      "max": 0.8519112398600001,
      "times": [
        0.69074834886,
        0.71837318386,
        0.7048430008600001,
        0.72124466486,
        0.72472453386,
        0.68981020686,
        0.69321728386,
        0.7226766438600001,
        0.8519112398600001,
        0.6898809638600001
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.269 ± 0.037 4.212 4.331 1.97 ± 0.11
pacquet@main 4.286 ± 0.049 4.214 4.392 1.98 ± 0.11
pnpr@HEAD 2.164 ± 0.112 2.045 2.379 1.00 ± 0.08
pnpr@main 2.163 ± 0.118 2.000 2.356 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.269403645540001,
      "stddev": 0.03724113553815596,
      "median": 4.2645043654400006,
      "user": 3.8420495199999998,
      "system": 3.3259269199999997,
      "min": 4.21207693544,
      "max": 4.33061420344,
      "times": [
        4.32578085544,
        4.27591248544,
        4.25546874344,
        4.25988600344,
        4.26912272744,
        4.2576602134399995,
        4.21207693544,
        4.27940768544,
        4.33061420344,
        4.22810660244
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.286475916239999,
      "stddev": 0.04911525367072736,
      "median": 4.281647168939999,
      "user": 3.8445148199999997,
      "system": 3.31064122,
      "min": 4.214322731439999,
      "max": 4.39217338744,
      "times": [
        4.2800042204399995,
        4.25668329844,
        4.291261320439999,
        4.214322731439999,
        4.299559341439999,
        4.28329011744,
        4.27640616544,
        4.39217338744,
        4.330783214439999,
        4.24027536544
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.1642876911399997,
      "stddev": 0.11180186798735738,
      "median": 2.12703795794,
      "user": 2.5740595199999996,
      "system": 2.8548162199999996,
      "min": 2.0445956724400003,
      "max": 2.3793663894400003,
      "times": [
        2.3793663894400003,
        2.12413474444,
        2.11999665744,
        2.0544539964400004,
        2.24547770744,
        2.0445956724400003,
        2.31467544744,
        2.12994117144,
        2.1380426094400002,
        2.0921925154400003
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 2.1631377784400003,
      "stddev": 0.11800482251635784,
      "median": 2.1565955909400003,
      "user": 2.56427792,
      "system": 2.8399040199999996,
      "min": 1.99950451444,
      "max": 2.3557341324400003,
      "times": [
        2.2130827014400003,
        2.10428661644,
        2.3557341324400003,
        2.31954715044,
        1.99950451444,
        2.07518491244,
        2.03594786744,
        2.1099189264400002,
        2.21489870744,
        2.2032722554400004
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.398 ± 0.016 1.369 1.426 2.08 ± 0.05
pacquet@main 1.424 ± 0.046 1.372 1.532 2.12 ± 0.08
pnpr@HEAD 0.688 ± 0.050 0.656 0.829 1.02 ± 0.08
pnpr@main 0.672 ± 0.013 0.655 0.702 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.3980166431800003,
      "stddev": 0.016227439877742188,
      "median": 1.40081689788,
      "user": 1.3421503000000001,
      "system": 1.71770876,
      "min": 1.3692218813800001,
      "max": 1.4256402483800001,
      "times": [
        1.39408214838,
        1.38685310138,
        1.4023711283800002,
        1.40164407238,
        1.4152468023800002,
        1.38148637438,
        1.4256402483800001,
        1.39998972338,
        1.3692218813800001,
        1.40363095138
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.42352474098,
      "stddev": 0.046058913894797264,
      "median": 1.4191359243800001,
      "user": 1.3393441,
      "system": 1.7695483600000004,
      "min": 1.3722731353800002,
      "max": 1.53193298238,
      "times": [
        1.3722731353800002,
        1.53193298238,
        1.4415630693800001,
        1.4219213963800001,
        1.4133555503800002,
        1.4163504523800001,
        1.42484236338,
        1.38989468038,
        1.37406204238,
        1.44905173738
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.6879912225800001,
      "stddev": 0.05025094331661332,
      "median": 0.6759349288800001,
      "user": 0.34637290000000004,
      "system": 1.28520586,
      "min": 0.65630065338,
      "max": 0.82933515838,
      "times": [
        0.6729902223800001,
        0.6775115163800001,
        0.66260721138,
        0.82933515838,
        0.67519284138,
        0.67667701638,
        0.66952768538,
        0.67930268138,
        0.68046723938,
        0.65630065338
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.67158373198,
      "stddev": 0.012968547102834616,
      "median": 0.67083116588,
      "user": 0.3346862,
      "system": 1.29409536,
      "min": 0.65507847638,
      "max": 0.7022841493800001,
      "times": [
        0.67091942938,
        0.6599131593800001,
        0.68145943738,
        0.65507847638,
        0.67159491438,
        0.66416093838,
        0.7022841493800001,
        0.6686877973800001,
        0.67074290238,
        0.67099611538
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 3.148 ± 0.065 3.084 3.318 4.68 ± 0.10
pacquet@main 3.198 ± 0.031 3.154 3.246 4.75 ± 0.06
pnpr@HEAD 0.673 ± 0.005 0.667 0.684 1.00
pnpr@main 0.674 ± 0.027 0.648 0.744 1.00 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 3.14831757982,
      "stddev": 0.06534447002694702,
      "median": 3.13757951732,
      "user": 1.8287088399999998,
      "system": 2.0303002,
      "min": 3.08383729782,
      "max": 3.31807903282,
      "times": [
        3.13089867782,
        3.13685853882,
        3.10086264682,
        3.10211955282,
        3.08383729782,
        3.14825418782,
        3.15310383482,
        3.1383004958200003,
        3.31807903282,
        3.17086153282
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 3.19751572912,
      "stddev": 0.031192512825143626,
      "median": 3.19674528482,
      "user": 1.8591214399999996,
      "system": 2.0786018,
      "min": 3.15448572682,
      "max": 3.24579840082,
      "times": [
        3.23115957282,
        3.22723017082,
        3.20098554482,
        3.19250502482,
        3.15448572682,
        3.17416338782,
        3.15931995382,
        3.21060499282,
        3.24579840082,
        3.17890451582
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.6726359952200001,
      "stddev": 0.0054412366304333985,
      "median": 0.6714755923200001,
      "user": 0.34518304000000005,
      "system": 1.271722,
      "min": 0.6672877688200001,
      "max": 0.68409476282,
      "times": [
        0.6685798098200001,
        0.6760539438200001,
        0.66773293182,
        0.68409476282,
        0.6768795668200001,
        0.66894003982,
        0.6743663578200001,
        0.6672877688200001,
        0.6684136258200001,
        0.6740111448200001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.67397233222,
      "stddev": 0.026641330733031304,
      "median": 0.6680355948200001,
      "user": 0.34283133999999993,
      "system": 1.2789886000000004,
      "min": 0.64816738382,
      "max": 0.7437146808200001,
      "times": [
        0.6577849828200001,
        0.64816738382,
        0.6754600818200001,
        0.6824196488200001,
        0.66827309982,
        0.65810233382,
        0.6677980898200001,
        0.7437146808200001,
        0.6776754838200001,
        0.6603275368200001
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 655.9 ± 7.1 645.1 666.4 5.84 ± 0.07
pacquet@main 655.9 ± 6.8 641.9 668.5 5.84 ± 0.07
pnpr@HEAD 112.3 ± 0.5 110.1 113.3 1.00
pnpr@main 112.3 ± 0.4 111.4 113.0 1.00 ± 0.01
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6558576274200001,
      "stddev": 0.007129882177683561,
      "median": 0.65632884452,
      "user": 0.6126677,
      "system": 0.15342135999999998,
      "min": 0.64506501902,
      "max": 0.6663595800200001,
      "times": [
        0.6620156500200001,
        0.6620895290200001,
        0.65957975502,
        0.65251833002,
        0.64889687902,
        0.64506501902,
        0.66036240702,
        0.6663595800200001,
        0.6486111910200001,
        0.65307793402
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.65588681762,
      "stddev": 0.00682307193302192,
      "median": 0.65584492002,
      "user": 0.6167014,
      "system": 0.15017735999999998,
      "min": 0.64185181902,
      "max": 0.66848630202,
      "times": [
        0.64185181902,
        0.65478872802,
        0.6591531270200001,
        0.66848630202,
        0.6514793520200001,
        0.65690111202,
        0.66058419802,
        0.6574000720200001,
        0.6537413910200001,
        0.65448207502
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.11226795533999999,
      "stddev": 0.0005352366676887523,
      "median": 0.11229963402000001,
      "user": 0.028619379999999993,
      "system": 0.021536239999999998,
      "min": 0.11014882802000002,
      "max": 0.11334191802000002,
      "times": [
        0.11014882802000002,
        0.11236325702000001,
        0.11194522202000001,
        0.11223196402000002,
        0.11284761102000002,
        0.11192215202000001,
        0.11224841802000002,
        0.11229963402000001,
        0.11236363802000002,
        0.11224373102000001,
        0.11217817402000001,
        0.11222202002000001,
        0.11254236502000002,
        0.11254355202000002,
        0.11200013202000002,
        0.11211698902000002,
        0.11251257302000002,
        0.11236890602000002,
        0.11230626402000002,
        0.11240789302000001,
        0.11212544702000002,
        0.11229424502000002,
        0.11232828602000001,
        0.11334191802000002,
        0.11279566402000002
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.11232879547833334,
      "stddev": 0.0003515503600512628,
      "median": 0.11236729352000002,
      "user": 0.02841275833333334,
      "system": 0.02163571,
      "min": 0.11136335502000001,
      "max": 0.11302561202000001,
      "times": [
        0.11136335502000001,
        0.11239711702000002,
        0.11211560302000001,
        0.11240191402000001,
        0.11216566702000001,
        0.11258150802000001,
        0.11237305202000002,
        0.11192278902000001,
        0.11274994702000002,
        0.11224441302000002,
        0.11302561202000001,
        0.11199400402000001,
        0.11236153502000001,
        0.11226089202000002,
        0.11261861302000001,
        0.11209698602000001,
        0.11212199702000002,
        0.11244902302000001,
        0.11254410902000002,
        0.11283684002000001,
        0.11185194502000001,
        0.11235122002000002,
        0.11254604102000001,
        0.11251690902000001
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 6.913 ± 0.125 6.729 7.155 1.42 ± 0.03
pacquet@main 6.914 ± 0.134 6.762 7.204 1.42 ± 0.03
pnpr@HEAD 4.956 ± 0.113 4.826 5.170 1.02 ± 0.03
pnpr@main 4.872 ± 0.055 4.780 4.932 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 6.913344263400001,
      "stddev": 0.12464101341436151,
      "median": 6.8917305736,
      "user": 4.1763832,
      "system": 3.6554537799999998,
      "min": 6.7285616701,
      "max": 7.1546174471,
      "times": [
        6.8798124571,
        6.9323496081,
        6.9084998501,
        7.0848782581,
        6.7285616701,
        6.8963295521,
        6.8611972511,
        6.8871315951000005,
        7.1546174471,
        6.8000649451
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 6.913906572499999,
      "stddev": 0.1335755852121497,
      "median": 6.9185282736,
      "user": 4.1664156,
      "system": 3.66518648,
      "min": 6.7622787791,
      "max": 7.2035698681,
      "times": [
        6.9371714641,
        6.9601504931000004,
        6.8111919891,
        6.7799494741,
        6.8118331751,
        6.7622787791,
        7.2035698681,
        6.8998850831,
        7.0125104171,
        6.9605249821
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 4.9556658493,
      "stddev": 0.11303701993267942,
      "median": 4.9539304021,
      "user": 2.85737,
      "system": 3.1463928799999996,
      "min": 4.8257505361,
      "max": 5.1704063951,
      "times": [
        4.9733291711000005,
        4.9070076331,
        4.8536228281,
        4.9624669651,
        5.1704063951,
        4.9542265681,
        4.9536342361,
        5.1156802521,
        4.8405339081,
        4.8257505361
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 4.872215778999999,
      "stddev": 0.05512754095054939,
      "median": 4.893523285600001,
      "user": 2.8453836999999997,
      "system": 3.1281055799999997,
      "min": 4.7801216091,
      "max": 4.9318624961,
      "times": [
        4.8973580471,
        4.9318624961,
        4.7801216091,
        4.914411003100001,
        4.8896885241,
        4.8534746771,
        4.9154797431,
        4.8372483461,
        4.9155613701,
        4.7869519741
      ]
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/12927
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
4,269.40 ms
(-0.37%)Baseline: 4,285.08 ms
5,142.09 ms
(83.03%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
3,148.32 ms
(+3.87%)Baseline: 3,031.07 ms
3,637.29 ms
(86.56%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
1,398.02 ms
(+2.92%)Baseline: 1,358.29 ms
1,629.94 ms
(85.77%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
655.86 ms
(+2.00%)Baseline: 643.00 ms
771.60 ms
(85.00%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
4,087.60 ms
(-0.94%)Baseline: 4,126.34 ms
4,951.60 ms
(82.55%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
6,913.34 ms
(-4.57%)Baseline: 7,244.29 ms
8,693.15 ms
(79.53%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
665.37 ms
(+3.54%)Baseline: 642.64 ms
771.16 ms
(86.28%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/12927
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
2,164.29 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
672.64 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
687.99 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
112.27 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
2,216.97 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
4,955.67 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
709.68 ms
🐰 View full continuous benchmarking report in Bencher

@spencerbeggs

spencerbeggs commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Sorry! This is related to my last PR. After it released it fixed poisoning in the root, but not in workspaces above root with transitive peers that resolved first. This might only half fix it, too, or at least it might only fix the problem it caused. I am going to branch off from here and check. But you might wait to merge this for a moment.

@spencerbeggs

Copy link
Copy Markdown
Contributor

@zkochan I have opened a PR into this branch with a fix of the original fix that cause the regression in this branch PR addresses. I see why my original PR caused this, but my fix of the fix is not exactly related to the targeted portion. I can pull it out into it's own PR into main if you want.

Again, I am very sorry for cause Electron problems. This reminds me of the time I worked at AOL and broke everyone's homescreen world wide by pasting a control character into the CMS.

@spencerbeggs

Copy link
Copy Markdown
Contributor

I moved the PR to be against main as the fix doesn't affect this code either way.

@zkochan
zkochan merged commit 3c6718b into main Jul 11, 2026
36 checks passed
@zkochan
zkochan deleted the fix-12921 branch July 11, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pnpm@11 reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm install deadlocks in peer resolution on 11.11.0 with [email protected] (regression from #12847)

4 participants