Skip to content

fix(resolver): don't fail on changed overrides when an optional peer is locked to an npm alias - #16658

Merged
zkochan merged 1 commit into
mainfrom
altaywtf/fix-16654-override-alias-optional-peer
Oct 6, 2026
Merged

zkochan merged 1 commit into
mainfrom
altaywtf/fix-16654-override-alias-optional-peer

Conversation

@altaywtf

@altaywtf altaywtf commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Changing a ranged override no longer fails when an old lockfile locks a dependency to an npm alias of another package through an optional peer. Closes #16654

Issue repro (--lockfile-only) main this PR
v12 (pnpm/) ERR_PNPM_NO_MATCHING_VERSION for [email protected] same lockfile as a fresh resolve
v11 (pnpm11/) ERR_PNPM_NO_MATCHING_VERSION for [email protected] same lockfile as a fresh resolve
new tests, fix reverted fail with the same error pass

Squash Commit Body

Lockfiles written before pnpm/pnpm#15503 record an optional peer that the
package also depends on as the peer's provider. When that provider is an
npm alias of another package, the snapshot keeps it, for example
`[email protected](@redocly/[email protected])` with
`optionalDependencies: { ajv: '@redocly/[email protected]' }`.

Since pnpm/pnpm#15503 the name is resolved as a regular dependency again,
from its plain range (`ajv: ^8.0.0`). The check that decides whether the
locked ref still satisfies that range compared only the version, so the
alias was accepted. The resolver then either kept the other package under
the alias or, when it looks the locked version up in the registry as the
default minimumReleaseAge makes it do, asked for `[email protected]` and failed
with ERR_PNPM_NO_MATCHING_VERSION. Overrides with a version range in the
selector reach this path because they skip the fast override rewrite.

A plain range now requires the locked package to have the alias's own
name, in both the TypeScript resolver (getRangeOfLockedPackage) and the
Rust resolver (prior_child_key). Non-range specifiers such as git and
tarball URLs keep their existing handling.

Closes pnpm/pnpm#16654

Checklist

  • I checked the referenced issue and verified that none of the PRs
    already linked to it solves it.
  • New features are implemented only in the Rust pnpm v12 CLI. Bug fixes
    are implemented in every affected version.
  • 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 (Claude Code, claude-opus-5-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

  • Bug Fixes
    • Fixed installs failing with ERR_PNPM_NO_MATCHING_VERSION after an override changes when an optional peer dependency is resolved through an npm alias.
    • Lockfile-only installs now correctly re-resolve aliased optional peer dependencies when overrides change, instead of reusing a lockfile entry for a different package name.

Lockfiles written before #15503 record an optional peer that the
package also depends on as the peer's provider. When that provider is an
npm alias of another package, the snapshot keeps it, for example
`[email protected](@redocly/[email protected])` with
`optionalDependencies: { ajv: '@redocly/[email protected]' }`.

Since #15503 the name is resolved as a regular dependency again,
from its plain range (`ajv: ^8.0.0`). The check that decides whether the
locked ref still satisfies that range compared only the version, so the
alias was accepted. The resolver then either kept the other package under
the alias or, when it looks the locked version up in the registry as the
default minimumReleaseAge makes it do, asked for `[email protected]` and failed
with ERR_PNPM_NO_MATCHING_VERSION. Overrides with a version range in the
selector reach this path because they skip the fast override rewrite.

A plain range now requires the locked package to have the alias's own
name, in both the TypeScript resolver (getRangeOfLockedPackage) and the
Rust resolver (prior_child_key). Non-range specifiers such as git and
tarball URLs keep their existing handling.

Closes #16654
Copilot AI balanced review requested due to automatic review settings October 6, 2026 14:27
@altaywtf
altaywtf requested a review from zkochan as a code owner October 6, 2026 14:27
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: pnpm/pnpm/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8e178d29-7286-4f8d-8ef7-a4cc683523ad
📥 Commits

Reviewing files that changed from the base of the PR and between 156f29d and b88c37a.

📒 Files selected for processing (8)
  • .changeset/aliased-optional-peer-in-old-lockfile.md
  • pnpm/crates/cli/tests/suite/install/peers.rs
  • pnpm/crates/resolving-deps-resolver/src/lockfile_reuse.rs
  • pnpm/crates/resolving-deps-resolver/src/lockfile_reuse/tests.rs
  • pnpm11/installing/deps-installer/test/install/peerDependencies.ts
  • pnpm11/installing/deps-resolver/src/getDepsToResolve.ts
  • pnpr/.fixtures/packages/@pnpm.e2e/aliases-optional-peer-of-dep/1.0.0/package.json
  • pnpr/.fixtures/packages/@pnpm.e2e/has-optional-peer-range-also-in-deps/1.0.0/package.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

Resolver matching now checks package names when a bare semver range is compared with a lockfile entry. Regression tests cover aliased optional peers during lockfile reuse and lockfile-only installs after an override changes.

Changes

Aliased optional peer resolution

Layer / File(s) Summary
Resolver matching and focused coverage
pnpm/crates/resolving-deps-resolver/src/lockfile_reuse.rs, pnpm/crates/resolving-deps-resolver/src/lockfile_reuse/tests.rs, pnpm11/installing/deps-resolver/src/getDepsToResolve.ts
The Rust and TypeScript resolvers now require a package-name match for bare semver ranges against unqualified lockfile entries. The Rust unit test verifies that a bare range does not match an aliased optional dependency.
Override re-resolution regression coverage
pnpr/.fixtures/packages/@pnpm.e2e/*/1.0.0/package.json, pnpm/crates/cli/tests/suite/install/peers.rs, pnpm11/installing/deps-installer/test/install/peerDependencies.ts, .changeset/aliased-optional-peer-in-old-lockfile.md
Package fixtures and install tests cover aliased optional peers when an override changes. The changeset declares patch releases for @pnpm/installing.deps-resolver, pnpm, and pacquet.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Assessment against linked issues

Objective Addressed Explanation
Prevent an override change from resolving a peer alias as a package with the peer’s name and the alias target’s version [#16654] ✅

Suggested labels: product: pnpm@11, product: pacquet, product: pnpr

Merge Risk: ⚪ Minimal · up to b88c3

No merge-blocking issue is identified; the change is mergeable after normal checks.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

pnpm11/installing/deps-installer/test/install/peerDependencies.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

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

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

pnpr/.fixtures/packages/@pnpm.e2e/aliases-optional-peer-of-dep/1.0.0/package.json

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

  • 1 others

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.

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

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 review overview

🔵 Needs a closer look

It alters the lockfile-reuse gate in both the v11 and v12 resolver hot paths, where subtle reuse regressions are high-impact and cannot be fully verified without running the complete test suites, so it warrants final human review.

Review effort: Balanced
Findings: None

What changed in this PR

This PR fixes a resolver regression where changing a ranged override caused pnpm install to fail with ERR_PNPM_NO_MATCHING_VERSION. The trigger is an old lockfile (written before #15503) that records an optional peer dependency — which the package also depends on by a plain range — as the peer's provider, where that provider is an npm: alias of a different package. The lockfile-reuse gate compared only the version and accepted the alias, so the resolver later looked up a non-existent version. The fix tightens the gate in both the TypeScript v11 resolver and the Rust v12 resolver so a plain semver range only reuses a locked ref whose package name matches the alias, while git and tarball specifiers keep their existing handling.

Changes:

  • Require the locked package's name to equal the alias before a bare range reuses a locked ref, in getRangeOfLockedPackage (TS) and prior_child_key (Rust).
  • Add regression tests across both stacks (a Rust unit test, and e2e tests driving --lockfile-only with a changed override), plus two shared registry fixtures.
  • Add a changeset describing the user-visible fix.
File Description
pnpm11/​installing/​deps-resolver/​src/​getDepsToResolve.ts Bare range now requires name === wantedDep.alias; git/tarball specs still return the bare specifier.
pnpm/​crates/​resolving-deps-resolver/​src/​lockfile_reuse.rs prior_child_key adds key.name == name to the bare-range satisfaction check; updated doc comment.
pnpm/​crates/​resolving-deps-resolver/​src/​lockfile_reuse/​tests.rs Unit test asserting an alias ref is rejected for a bare range.
pnpm11/​installing/​deps-installer/​test/​install/​peerDependencies.ts e2e regression test simulating the pre-#15503 lockfile and re-resolving on changed overrides.
pnpm/​crates/​cli/​tests/​suite/​install/​peers.rs Equivalent e2e regression test in the Rust CLI suite.
pnpr/​.fixtures/​packages/​@pnpm.e2e/​has-optional-peer-range-also-in-deps/​1.0.0/​package.json Fixture whose dep and optional peer are the same ranged package.
pnpr/​.fixtures/​packages/​@pnpm.e2e/​aliases-optional-peer-of-dep/​1.0.0/​package.json Fixture aliasing that peer to another package via npm:.
.changeset/​aliased-optional-peer-in-old-lockfile.md Release note targeting @pnpm/installing.deps-resolver, pnpm, and pacquet.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.00     14.0±0.44ms    26.8 MB/sec    1.23     17.2±2.90ms    21.8 MB/sec
packument/parse                                  1.00     47.6±2.54µs  1393.1 MB/sec    1.21     57.6±8.99µs  1152.0 MB/sec
tarball/download_dependency                      1.00      4.5±0.19ms   958.3 KB/sec    1.26      5.7±1.03ms   761.5 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00   248.3±13.77ms 64.4 KElem/sec    1.31   324.4±22.27ms 49.3 KElem/sec
version_pick/repeated_ranges_file                1.00      4.9±0.20ms  6.3 KElem/sec    1.13      5.6±0.63ms  5.6 KElem/sec
version_pick/repeated_ranges_raw                 1.00      5.0±0.17ms  6.2 KElem/sec    1.16      5.8±0.73ms  5.4 KElem/sec
workspace_resolution/hoist_heavy                 1.00    248.5±5.33ms        ? ?/sec    1.42   351.8±41.90ms        ? ?/sec
workspace_sort/chained_projects                  1.00     17.0±2.94ms        ? ?/sec    1.31     22.3±4.35ms        ? ?/sec

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.34%. Comparing base (9f2e8ea) to head (b88c37a).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16658      +/-   ##
==========================================
- Coverage   92.34%   92.34%   -0.01%     
==========================================
  Files        1590     1590              
  Lines      210019   210028       +9     
==========================================
+ Hits       193947   193949       +2     
- Misses      16072    16079       +7     

☔ 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

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Same-run regression check

HEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval.

Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.

Scenario Engine main median HEAD median Change Tolerance Result
isolated-fresh-restore-cold-cache-cold-store pacquet 2415.73 ms 2761.80 ms 14.3% 120.79 ms Inconclusive (overlapping samples)
isolated-fresh-restore-cold-cache-cold-store pnpr 1459.15 ms 1414.48 ms -3.1% 72.96 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 338.51 ms 304.08 ms -10.2% 16.93 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 338.84 ms 373.89 ms 10.3% 16.94 ms Inconclusive (overlapping samples)
isolated-repeat-install-hot-cache-hot-store pacquet 31.01 ms 19.47 ms -37.2% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 23.68 ms 27.54 ms 16.3% 2.00 ms Inconclusive (overlapping samples)
isolated-repeat-install-cold-cache-hot-store pacquet 18.82 ms 20.19 ms 7.3% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 19.36 ms 19.35 ms -0.1% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2654.84 ms 2699.05 ms 1.7% 132.74 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1587.45 ms 1673.26 ms 5.4% 79.37 ms Inconclusive (overlapping samples)
isolated-fresh-install-hot-cache-hot-store pacquet 581.85 ms 712.97 ms 22.5% 29.09 ms Inconclusive (overlapping samples)
isolated-fresh-install-hot-cache-hot-store pnpr 377.63 ms 359.21 ms -4.9% 18.88 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1987.19 ms 2074.16 ms 4.4% 99.36 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 440.45 ms 463.55 ms 5.2% 22.02 ms Inconclusive (overlapping samples)
isolated-fresh-resolve-hot-cache-offline pacquet 417.09 ms 417.31 ms 0.1% 20.85 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 137.35 ms 144.03 ms 4.9% 6.87 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 383.55 ms 370.68 ms -3.4% 19.18 ms Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet 227.24 ms 232.23 ms 2.2% 11.36 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 5334.85 ms 5845.16 ms 9.6% 266.74 ms Inconclusive (overlapping samples)
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3824.56 ms 3908.32 ms 2.2% 191.23 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 184.24 ms 144.80 ms -21.4% 9.21 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 192.81 ms 202.21 ms 4.9% 9.64 ms Within tolerance

Integrated-Benchmark Report (Linux)

Commit: b88c37ad2af1

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked-workspace scenario compares current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs.

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.718 ± 0.196 2.409 2.951 1.87 ± 0.18
pacquet@main 2.494 ± 0.165 2.346 2.758 1.72 ± 0.16
pnpr@HEAD 1.452 ± 0.095 1.325 1.622 1.00
pnpr@main 1.505 ± 0.135 1.314 1.725 1.04 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.7181126393599997,
      "stddev": 0.19600868413386469,
      "median": 2.76180018046,
      "user": 2.10102658,
      "system": 2.0733923600000006,
      "min": 2.40916079396,
      "max": 2.95117894196
    },
    {
      "command": "pacquet@main",
      "mean": 2.49357458246,
      "stddev": 0.16459624027113878,
      "median": 2.41573037996,
      "user": 1.7515905799999998,
      "system": 1.66642176,
      "min": 2.34550823296,
      "max": 2.75782315396
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.45247672336,
      "stddev": 0.09538084148548849,
      "median": 1.41448131946,
      "user": 1.7151152799999998,
      "system": 1.6155967599999996,
      "min": 1.3253142989600002,
      "max": 1.62165347796
    },
    {
      "command": "pnpr@main",
      "mean": 1.50502456736,
      "stddev": 0.13486778987487014,
      "median": 1.45915373146,
      "user": 1.5754863799999999,
      "system": 1.59318706,
      "min": 1.31433450396,
      "max": 1.7246849449600001
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 307.9 ± 19.0 282.3 352.6 1.00
pacquet@main 346.6 ± 69.2 257.2 458.4 1.13 ± 0.24
pnpr@HEAD 373.6 ± 37.6 319.9 450.8 1.21 ± 0.14
pnpr@main 338.7 ± 24.1 308.8 395.1 1.10 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.30790479428,
      "stddev": 0.018972745927099716,
      "median": 0.30407876438000003,
      "user": 0.36855004,
      "system": 0.6929109999999998,
      "min": 0.28233813488000004,
      "max": 0.35262706488
    },
    {
      "command": "pacquet@main",
      "mean": 0.34659206468,
      "stddev": 0.06915088308760876,
      "median": 0.33850604738,
      "user": 0.40083724,
      "system": 0.7495088,
      "min": 0.25716949088,
      "max": 0.45837349388000004
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.37356461508,
      "stddev": 0.037638895356806555,
      "median": 0.37388536838,
      "user": 0.4215852399999999,
      "system": 0.7584284,
      "min": 0.31986958788000003,
      "max": 0.45082859288000005
    },
    {
      "command": "pnpr@main",
      "mean": 0.33867541628000003,
      "stddev": 0.02414914633194478,
      "median": 0.33883806588000004,
      "user": 0.38800164,
      "system": 0.7108112,
      "min": 0.30878917688,
      "max": 0.39505882288000005
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 20.2 ± 3.3 14.3 34.1 1.00
pacquet@main 32.5 ± 11.2 15.8 71.6 1.61 ± 0.61
pnpr@HEAD 29.9 ± 8.8 17.3 54.6 1.48 ± 0.50
pnpr@main 25.7 ± 6.6 16.7 47.6 1.27 ± 0.39
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.020213452349830505,
      "stddev": 0.0032517745379965807,
      "median": 0.01946520846,
      "user": 0.010900679661016948,
      "system": 0.01149818559322034,
      "min": 0.01428539296,
      "max": 0.03413229996000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.03254982171912409,
      "stddev": 0.011186680298614969,
      "median": 0.03101089096,
      "user": 0.01355902408759124,
      "system": 0.017570352992700725,
      "min": 0.01584716396,
      "max": 0.07157871296000001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.02985788859513515,
      "stddev": 0.008819755594726277,
      "median": 0.02753518396,
      "user": 0.014122508108108112,
      "system": 0.01566698972972973,
      "min": 0.01732228196,
      "max": 0.05457446296000001
    },
    {
      "command": "pnpr@main",
      "mean": 0.025671309616565652,
      "stddev": 0.006634353959131298,
      "median": 0.02367918296,
      "user": 0.01269422323232323,
      "system": 0.014176671515151522,
      "min": 0.01673716396,
      "max": 0.04760987296000001
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 20.7 ± 3.4 14.2 32.6 1.08 ± 0.25
pacquet@main 19.2 ± 3.2 12.9 27.2 1.00
pnpr@HEAD 19.4 ± 2.4 13.1 25.5 1.01 ± 0.21
pnpr@main 19.6 ± 3.5 13.8 40.8 1.02 ± 0.25
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.020681494285546217,
      "stddev": 0.003399554335607247,
      "median": 0.02018671042,
      "user": 0.010963297310924377,
      "system": 0.011371353949579834,
      "min": 0.014165707420000001,
      "max": 0.03255945742000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.01916177656393941,
      "stddev": 0.003200508067668096,
      "median": 0.01881673692,
      "user": 0.011315929090909088,
      "system": 0.009529524848484844,
      "min": 0.01292628342,
      "max": 0.02722656642
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.019398085915652168,
      "stddev": 0.0023520102377408564,
      "median": 0.01934965042,
      "user": 0.011231115652173917,
      "system": 0.00996975513043478,
      "min": 0.01310542942,
      "max": 0.02554203542
    },
    {
      "command": "pnpr@main",
      "mean": 0.019554380690491806,
      "stddev": 0.0034548609541295715,
      "median": 0.01936196842,
      "user": 0.011870306885245898,
      "system": 0.009360006557377046,
      "min": 0.013835888420000001,
      "max": 0.040839608420000006
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.723 ± 0.103 2.628 2.990 1.65 ± 0.13
pacquet@main 2.649 ± 0.048 2.575 2.721 1.61 ± 0.12
pnpr@HEAD 1.687 ± 0.114 1.519 1.872 1.02 ± 0.10
pnpr@main 1.650 ± 0.118 1.541 1.858 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.72295429886,
      "stddev": 0.10250521320029665,
      "median": 2.69904895326,
      "user": 2.6924848399999997,
      "system": 1.9631597599999995,
      "min": 2.62772178176,
      "max": 2.98989137576
    },
    {
      "command": "pacquet@main",
      "mean": 2.6490659772600003,
      "stddev": 0.04798543806578675,
      "median": 2.65484112976,
      "user": 2.33235794,
      "system": 1.8552397600000003,
      "min": 2.5752269177600002,
      "max": 2.72052270376
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.68665774366,
      "stddev": 0.11399105885377639,
      "median": 1.6732606852599998,
      "user": 1.71713834,
      "system": 1.81473366,
      "min": 1.51898855476,
      "max": 1.87206040576
    },
    {
      "command": "pnpr@main",
      "mean": 1.64968965286,
      "stddev": 0.11790580260199171,
      "median": 1.5874493052599998,
      "user": 1.7007574399999998,
      "system": 1.7296493599999998,
      "min": 1.54090926076,
      "max": 1.8584290007600002
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 710.7 ± 24.1 666.1 746.5 1.95 ± 0.18
pacquet@main 613.2 ± 81.9 534.5 790.3 1.68 ± 0.27
pnpr@HEAD 364.8 ± 31.5 323.5 438.8 1.00
pnpr@main 378.9 ± 42.0 330.6 454.4 1.04 ± 0.15
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.7107399674200001,
      "stddev": 0.024070140360241833,
      "median": 0.71296926662,
      "user": 1.0764417199999996,
      "system": 1.0218380999999999,
      "min": 0.6660903066200001,
      "max": 0.74649181362
    },
    {
      "command": "pacquet@main",
      "mean": 0.6132236326200001,
      "stddev": 0.08192713423832718,
      "median": 0.5818503676200001,
      "user": 0.8965565200000001,
      "system": 0.9401777000000001,
      "min": 0.5344711606200001,
      "max": 0.7903315196200001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.36475488992000005,
      "stddev": 0.03149458815246202,
      "median": 0.35920898562000003,
      "user": 0.35127132,
      "system": 0.6747325999999999,
      "min": 0.32349756162000004,
      "max": 0.43881019962
    },
    {
      "command": "pnpr@main",
      "mean": 0.3789270229200001,
      "stddev": 0.04198773886219056,
      "median": 0.37762535562,
      "user": 0.3582688199999999,
      "system": 0.7381228,
      "min": 0.33056337662,
      "max": 0.45444341962
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.084 ± 0.095 1.978 2.243 4.70 ± 0.28
pacquet@main 2.001 ± 0.079 1.878 2.166 4.51 ± 0.25
pnpr@HEAD 0.453 ± 0.029 0.403 0.487 1.02 ± 0.08
pnpr@main 0.444 ± 0.017 0.422 0.473 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.08410882258,
      "stddev": 0.09523732448325312,
      "median": 2.07416293668,
      "user": 1.7800348,
      "system": 1.51950966,
      "min": 1.97759530868,
      "max": 2.24349195668
    },
    {
      "command": "pacquet@main",
      "mean": 2.0006243917799997,
      "stddev": 0.07866514785332313,
      "median": 1.98718752868,
      "user": 1.684977,
      "system": 1.4361507600000003,
      "min": 1.87765977068,
      "max": 2.16590235368
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.45338622267999995,
      "stddev": 0.029330227645587396,
      "median": 0.46355161568000003,
      "user": 0.4447468,
      "system": 0.8124894599999999,
      "min": 0.40341019568,
      "max": 0.48694107868000003
    },
    {
      "command": "pnpr@main",
      "mean": 0.44372860098,
      "stddev": 0.017156077746587367,
      "median": 0.44045117918,
      "user": 0.4390834,
      "system": 0.81079316,
      "min": 0.42224560368,
      "max": 0.47313889068000003
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 424.0 ± 66.6 334.0 538.0 3.01 ± 0.59
pacquet@main 413.7 ± 48.3 338.7 492.2 2.93 ± 0.48
pnpr@HEAD 144.1 ± 15.1 121.4 172.6 1.02 ± 0.16
pnpr@main 141.0 ± 16.4 116.4 175.9 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.42395449464000007,
      "stddev": 0.06663306915962183,
      "median": 0.41731370034000004,
      "user": 0.4548621,
      "system": 0.16425605999999998,
      "min": 0.33404944134000003,
      "max": 0.53797945334
    },
    {
      "command": "pacquet@main",
      "mean": 0.4137274218400001,
      "stddev": 0.048255347944282906,
      "median": 0.41709243984,
      "user": 0.4346984,
      "system": 0.17048276,
      "min": 0.33869731434,
      "max": 0.49223806934000003
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.1441413527747826,
      "stddev": 0.0151307196409467,
      "median": 0.14403226034000002,
      "user": 0.07363822608695654,
      "system": 0.03165943391304348,
      "min": 0.12142709634000001,
      "max": 0.17264235334000003
    },
    {
      "command": "pnpr@main",
      "mean": 0.1410110427945455,
      "stddev": 0.016407829142870662,
      "median": 0.13734935284,
      "user": 0.06984426363636363,
      "system": 0.03040171454545454,
      "min": 0.11636942434000001,
      "max": 0.17588700334000001
    }
  ]
}

Scenario: Isolated linker: peer-heavy resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 364.4 ± 51.4 283.3 440.8 1.00
pacquet@main 383.7 ± 51.7 310.9 495.7 1.05 ± 0.21
pnpm@HEAD 4873.9 ± 312.9 4453.8 5430.0 13.37 ± 2.07
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.3644028382933333,
      "stddev": 0.051356247419154316,
      "median": 0.37068285596,
      "user": 0.39046076,
      "system": 0.0792618511111111,
      "min": 0.28333940696,
      "max": 0.44083517096
    },
    {
      "command": "pacquet@main",
      "mean": 0.3837223936266667,
      "stddev": 0.05169501658350176,
      "median": 0.38355169996,
      "user": 0.4170516488888889,
      "system": 0.07691451777777777,
      "min": 0.31092306996,
      "max": 0.49566456996
    },
    {
      "command": "pnpm@HEAD",
      "mean": 4.8738525819600005,
      "stddev": 0.31287181910625267,
      "median": 4.83678665696,
      "user": 7.55050376,
      "system": 0.5204055177777778,
      "min": 4.45381854796,
      "max": 5.42999848196
    }
  ]
}

Scenario: Isolated linker: linked-workspace resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 232.9 ± 10.7 211.0 249.4 1.04 ± 0.06
pacquet@main 224.3 ± 8.1 212.2 234.1 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.23292960325333334,
      "stddev": 0.010686271675440874,
      "median": 0.23223067792000002,
      "user": 0.20050735333333333,
      "system": 0.07808921333333334,
      "min": 0.21104515142000002,
      "max": 0.24935692242000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.22426981572769228,
      "stddev": 0.008131618781737255,
      "median": 0.22724475742,
      "user": 0.1821997123076923,
      "system": 0.08597030307692308,
      "min": 0.21217630542000002,
      "max": 0.23413821842000002
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 5.819 ± 0.301 5.194 6.172 1.52 ± 0.10
pacquet@main 5.300 ± 0.393 4.761 5.835 1.38 ± 0.12
pnpr@HEAD 3.834 ± 0.239 3.542 4.165 1.00 ± 0.07
pnpr@main 3.831 ± 0.148 3.679 4.139 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 5.818725758879999,
      "stddev": 0.300651897816325,
      "median": 5.845156945679999,
      "user": 2.86366852,
      "system": 3.0387225399999997,
      "min": 5.19418041418,
      "max": 6.17201229118
    },
    {
      "command": "pacquet@main",
      "mean": 5.300478441879998,
      "stddev": 0.39257714556475,
      "median": 5.33485060818,
      "user": 2.6266285199999997,
      "system": 2.4902647399999998,
      "min": 4.76125585318,
      "max": 5.83506693718
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.83389340608,
      "stddev": 0.2394535608758287,
      "median": 3.90831585968,
      "user": 2.1279815199999996,
      "system": 2.0711235400000003,
      "min": 3.54243827118,
      "max": 4.1652338231799995
    },
    {
      "command": "pnpr@main",
      "mean": 3.8313644436799996,
      "stddev": 0.1481932392751376,
      "median": 3.8245601446800004,
      "user": 2.1334429200000002,
      "system": 1.88594404,
      "min": 3.67893681018,
      "max": 4.13922613618
    }
  ]
}

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

Same install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 152.5 ± 23.2 131.0 216.1 1.00
pacquet@main 182.7 ± 25.5 146.4 256.6 1.20 ± 0.25
pnpr@HEAD 203.0 ± 21.7 174.6 246.0 1.33 ± 0.25
pnpr@main 192.0 ± 26.5 151.0 245.4 1.26 ± 0.26
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.15247936860444444,
      "stddev": 0.023213534958624375,
      "median": 0.14480397616000001,
      "user": 0.18627087777777776,
      "system": 0.14253451777777776,
      "min": 0.13096685866000002,
      "max": 0.21608883066
    },
    {
      "command": "pacquet@main",
      "mean": 0.18266631895411764,
      "stddev": 0.025460667757361836,
      "median": 0.18423957566000002,
      "user": 0.2292847470588235,
      "system": 0.15721265176470586,
      "min": 0.14642068566000002,
      "max": 0.25662896066
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.20299787296769237,
      "stddev": 0.021686175842549654,
      "median": 0.20221054966000002,
      "user": 0.24082986923076916,
      "system": 0.16258285538461534,
      "min": 0.17455134566000002,
      "max": 0.24600061866000003
    },
    {
      "command": "pnpr@main",
      "mean": 0.19199995304461542,
      "stddev": 0.026485711460739463,
      "median": 0.19281438666,
      "user": 0.22096994615384613,
      "system": 0.17138500923076924,
      "min": 0.15102322066,
      "max": 0.24538141366000002
    }
  ]
}

@zkochan
zkochan merged commit 5b87f8f into main Oct 6, 2026
72 checks passed
@zkochan
zkochan deleted the altaywtf/fix-16654-override-alias-optional-peer branch October 6, 2026 16:28
KSXGitHub pushed a commit that referenced this pull request Oct 7, 2026
Thirteen commits, none overlapping this branch's conversions.
#16658 touches `lockfile_reuse.rs` too, at `prior_child_key`,
which is far from the `ReusableResolution` conversion further down the
file, so both sides merge on their own.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QYTBQo8HY7xD2iz6hjo1CW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changing overrides fails when a peer dependency is resolved to an npm alias in the lockfile

4 participants