Skip to content

perf: prune newly ignored optional dependencies without resolution - #13482

Merged
zkochan merged 5 commits into
mainfrom
fix-13474-ignored-optional
Aug 6, 2026
Merged

zkochan merged 5 commits into
mainfrom
fix-13474-ignored-optional

Conversation

@zkochan

@zkochan zkochan commented Jul 29, 2026 •

Copy link
Copy Markdown
Member

Summary

Related to #13474.

  • Add a TypeScript and pacquet fast path for additions to ignoredOptionalDependencies.
  • Remove newly ignored optional edges from the lockfile and prune package snapshots that are no longer reachable, while retaining snapshots shared with non-ignored dependencies.
  • Fall back to normal resolution for removals, newly added exclusion patterns, and transitions from exclusion-only matcher sets. Pacquet also avoids seeding a fresh resolution from a lockfile pruned under different ignored-optional settings.
  • Make pacquet's current-version package-manager pin tests independent of whether the just-released pnpm version is already available from the public registry.

Validation includes focused TypeScript verifier and installer tests, pacquet unit and lifecycle tests, the complete 7,463-test pacquet suite, clippy, dylint, TypeScript compilation, linting, metadata validation, and bundling.

Squash Commit Body

Changing ignoredOptionalDependencies previously forced dependency resolution
even when the change only added ignore patterns. Detect monotonic additions,
remove matching optional importer edges, and prune package snapshots that are
no longer reachable. Preserve packages that remain reachable through another
dependency path.

Use the same optimization in the TypeScript CLI and pacquet. Keep removals and
new exclusion patterns on the safe resolution path, and prevent pacquet from
using a pruned lockfile as the seed when ignored-optional settings differ.

Make current-version package-manager pin tests use a static local registry so
release commits can be tested before their version is published.

Related to pnpm/pnpm#13474.

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

  • Performance

    • Faster installs when ignoredOptionalDependencies changes by safely updating the lockfile without resolving the full dependency graph.
    • Automatically removes newly ignored optional dependencies and prunes unreachable lockfile entries.
  • Bug Fixes

    • Lockfile validation and reuse now correctly account for ignoredOptionalDependencies.
    • Changes to ignored dependency patterns consistently update installed packages and lockfile contents.
  • Tests

    • Expanded coverage for fast lockfile updates, dependency restoration, lockfile reuse, and version verification using mocked registries.

Copilot AI lite review requested due to automatic review settings July 29, 2026 08:30

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 29, 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: b4f3bfc7-d535-430c-b2ad-186ffceb0383

📥 Commits

Reviewing files that changed from the base of the PR and between f2fa9c9 and 60ac9aa.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !pnpm-lock.yaml
📒 Files selected for processing (27)
  • .changeset/quick-oranges-ignore-optionals.md
  • pnpm/crates/cli/tests/lockfile_resolution_reuse.rs
  • pnpm/crates/cli/tests/package_manager_check.rs
  • pnpm/crates/cli/tests/version.rs
  • pnpm/crates/package-manager/src/fast_update_ignored_optional_dependencies.rs
  • pnpm/crates/package-manager/src/fast_update_ignored_optional_dependencies/tests.rs
  • pnpm/crates/package-manager/src/fast_update_lockfile.rs
  • pnpm/crates/package-manager/src/fast_update_overrides.rs
  • pnpm/crates/package-manager/src/install.rs
  • pnpm/crates/package-manager/src/install/lockfile_freshness.rs
  • pnpm/crates/package-manager/src/install/run.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile/resolve.rs
  • pnpm/crates/package-manager/src/lib.rs
  • pnpm/crates/testing-utils/src/bin.rs
  • pnpm/crates/testing-utils/src/registry.rs
  • pnpm11/deps/status/src/checkDepsStatus.ts
  • pnpm11/installing/deps-installer/src/install/index.ts
  • pnpm11/installing/deps-installer/src/install/tryFastUpdateIgnoredOptionalDependencies.ts
  • pnpm11/installing/deps-installer/test/install/ignoredOptionalDependencies.ts
  • pnpm11/lockfile/verification/package.json
  • pnpm11/lockfile/verification/src/allProjectsAreUpToDate.ts
  • pnpm11/lockfile/verification/src/satisfiesPackageManifest.ts
  • pnpm11/lockfile/verification/test/satisfiesPackageManifest.ts
  • pnpm11/lockfile/verification/tsconfig.json
  • pnpr/.fixtures/packages/@pnpm/exe/0.0.0/package.json
  • pnpr/.fixtures/packages/pnpm/0.0.0/package.json
🚧 Files skipped from review as they are similar to previous changes (22)
  • pnpm11/lockfile/verification/src/allProjectsAreUpToDate.ts
  • pnpr/.fixtures/packages/pnpm/0.0.0/package.json
  • .changeset/quick-oranges-ignore-optionals.md
  • pnpm11/lockfile/verification/package.json
  • pnpm11/lockfile/verification/tsconfig.json
  • pnpm11/deps/status/src/checkDepsStatus.ts
  • pnpm/crates/cli/tests/package_manager_check.rs
  • pnpm11/lockfile/verification/test/satisfiesPackageManifest.ts
  • pnpm/crates/package-manager/src/fast_update_lockfile.rs
  • pnpm/crates/testing-utils/src/registry.rs
  • pnpm/crates/package-manager/src/lib.rs
  • pnpm11/lockfile/verification/src/satisfiesPackageManifest.ts
  • pnpm/crates/cli/tests/version.rs
  • pnpm11/installing/deps-installer/src/install/tryFastUpdateIgnoredOptionalDependencies.ts
  • pnpm/crates/package-manager/src/fast_update_ignored_optional_dependencies/tests.rs
  • pnpm11/installing/deps-installer/test/install/ignoredOptionalDependencies.ts
  • pnpm/crates/package-manager/src/fast_update_ignored_optional_dependencies.rs
  • pnpr/.fixtures/packages/@pnpm/exe/0.0.0/package.json
  • pnpm/crates/cli/tests/lockfile_resolution_reuse.rs
  • pnpm/crates/package-manager/src/fast_update_overrides.rs
  • pnpm11/installing/deps-installer/src/install/index.ts
  • pnpm/crates/testing-utils/src/bin.rs

📝 Walkthrough

Walkthrough

The PR adds fast lockfile updates for ignoredOptionalDependencies in TypeScript and Rust. It prunes unreachable packages, updates manifest and freshness checks, adds integration coverage, and introduces static mocked-registry support for pinned pnpm tests.

Changes

Ignored optional dependency handling

Layer / File(s) Summary
Manifest verification and TypeScript fast update
pnpm11/deps/status/..., pnpm11/installing/deps-installer/..., pnpm11/lockfile/verification/...
Manifest checks filter configured optional dependencies. The installer removes matching lockfile entries and prunes the result.
Rust filtering, pruning, and installer integration
pnpm/crates/package-manager/src/fast_update_*.rs, pnpm/crates/package-manager/src/install*.rs
Rust fast updates remove ignored optional edges, reject unsupported pattern changes, share reachability pruning, and select safe lockfile candidates.
Lockfile reuse and integration coverage
pnpm/crates/cli/tests/lockfile_resolution_reuse.rs
CLI coverage verifies dependency removal and restoration while resolution is skipped when appropriate.
Static registry test support
pnpm/crates/testing-utils/src/{bin,registry}.rs, pnpm/crates/cli/tests/{package_manager_check,version}.rs, pnpr/.fixtures/packages/*
Testing utilities provide static registries and pinned pnpm fixtures.
Release metadata
.changeset/quick-oranges-ignore-optionals.md
The changeset records patch releases and the fast-install behavior.

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

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant Installer
  participant Lockfile
  participant Registry

  CLI->>Installer: install with ignoredOptionalDependencies
  Installer->>Lockfile: validate freshness and select fast-update path
  Lockfile-->>Installer: filtered lockfile or no safe update
  alt Fast update succeeds
    Installer-->>CLI: install without dependency resolution
  else Fast update is unavailable
    Installer->>Registry: resolve dependencies
    Registry-->>Installer: dependency metadata
    Installer-->>CLI: complete installation
  end
Loading

Possibly related PRs

  • pnpm/pnpm#13464: Both changes share unreachable-package pruning and lockfile fast-update logic.
  • pnpm/pnpm#13081: Both changes update lockfile freshness and install validation for ignoredOptionalDependencies.
  • pnpm/pnpm#13600: Both changes integrate a setting-specific fast-update path through generalized lockfile update APIs.

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

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-13474-ignored-optional

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

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

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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.

@greptile-apps

greptile-apps Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge because no eligible blocking failure remains in this follow-up review.

No blocking failure remains.

Reviews (3): Last reviewed commit: "fix: reject unsafe ignored optional matc..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.00     12.5±0.19ms    30.0 MB/sec    1.00     12.5±0.11ms    30.0 MB/sec
packument/parse                                  1.03     38.4±0.84µs  1725.9 MB/sec    1.00     37.4±0.15µs  1771.5 MB/sec
tarball/download_dependency                      1.06      2.4±0.19ms  1828.6 KB/sec    1.00      2.2±0.09ms  1938.5 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00    187.1±3.43ms 85.5 KElem/sec    1.00    186.2±2.97ms 85.9 KElem/sec
workspace_resolution/hoist_heavy                 1.02    267.1±6.11ms        ? ?/sec    1.00    260.8±1.56ms        ? ?/sec

@codecov-commenter

codecov-commenter commented Jul 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.85714% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.13%. Comparing base (f2fa9c9) to head (60ac9aa).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...r/src/fast_update_ignored_optional_dependencies.rs 93.50% 5 Missing ⚠️
...crates/package-manager/src/fast_update_lockfile.rs 91.30% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13482      +/-   ##
==========================================
+ Coverage   88.11%   88.13%   +0.01%     
==========================================
  Files         609      611       +2     
  Lines       99150    99265     +115     
==========================================
+ Hits        87366    87483     +117     
+ Misses      11784    11782       -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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Perf: fast-path ignoredOptionalDependencies additions by pruning optional edges

✨ Enhancement 🧪 Tests ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Skip dependency resolution when ignoredOptionalDependencies only gains new ignore patterns.
• Remove newly ignored optional edges and prune unreachable lockfile snapshots/packages while
 preserving shared nodes.
• Make pacquet’s current-version package-manager pin tests hermetic via a static local registry.
Diagram

graph TD
  A["Install"] --> B{"Only setting change?"} --> C{"ignoredOptional added?"} --> D["Fast update lockfile"] --> E["Remove optional edges"] --> F["Prune unreachable"] --> G["Write lockfile"]
  C --> H["Full resolution"]
  D --> I["TS deps-installer"]
  D --> J["Rust pacquet pm"]

  subgraph Legend
    direction LR
    _p["Process"] ~~~ _d{"Decision"}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Always resolve when ignoredOptionalDependencies changes
  • ➕ Simplest correctness story; no rewrite/prune corner cases
  • ➖ Loses the primary perf win for common “add ignore pattern” workflows
  • ➖ Requires registry access even when lockfile can be safely rewritten
2. Support new exclusion patterns ('!') in the fast path
  • ➕ More changes take the no-resolution path
  • ➖ Harder to prove safety (exclusions can reintroduce edges)
  • ➖ Increased risk of lockfile drift vs resolver semantics; more test surface
3. Defer pruning to a later cleanup step instead of doing it during fast update
  • ➕ Less invasive lockfile mutation; smaller fast-update logic
  • ➖ Leaves dead snapshots/packages bloating lockfile and virtual store
  • ➖ May still require additional work later; weaker performance benefits

Recommendation: The PR’s conservative monotonic-additions gate is the best tradeoff: it’s easy to reason about, provides a meaningful speedup, and preserves safety by falling back to full resolution for removals and exclusion-pattern additions. Centralizing reachability pruning into a shared helper is also a solid maintainability move.

Files changed (25) +741 / -86

Enhancement (4) +166 / -9
fast_update_ignored_optional_dependencies.rsRust fast path to rewrite lockfile for ignored optional additions +78/-0

Rust fast path to rewrite lockfile for ignored optional additions

• Implements monotonic-add detection (no removals, no new '!' exclusions), removes matching optional edges from importers and snapshots (and specifiers), records the new setting, and prunes unreachable packages via a shared pruning helper.

pnpm/crates/package-manager/src/fast_update_ignored_optional_dependencies.rs

install.rsGeneralize fast-update gate to include ignored-optional updates +17/-9

Generalize fast-update gate to include ignored-optional updates

• Renames importer-only fast update plumbing to a lockfile-level fast update attempt, and selects the fast path only when exactly one candidate (importer specifiers vs ignored optionals) applies; otherwise falls back to normal behavior.

pnpm/crates/package-manager/src/install.rs

index.tsEnable ignored-optional fast update in TS installer pipeline +11/-0

Enable ignored-optional fast update in TS installer pipeline

• Threads 'ignoredOptionalDependencies' through up-to-date checks, treats it as a fast-update-eligible changed setting, and invokes 'tryFastUpdateIgnoredOptionalDependencies' when it is the only changed setting.

pnpm11/installing/deps-installer/src/install/index.ts

tryFastUpdateIgnoredOptionalDependencies.tsTS fast path: remove ignored optionals + prune lockfile +60/-0

TS fast path: remove ignored optionals + prune lockfile

• Adds a monotonic-additions-only fast path that removes ignored optional deps from importer/package snapshots (and specifiers), records sorted patterns, and prunes unreachable packages via 'pruneSharedLockfile', rejecting removals and new '!' exclusions.

pnpm11/installing/deps-installer/src/install/tryFastUpdateIgnoredOptionalDependencies.ts

Bug fix (4) +43 / -5
install_with_fresh_lockfile.rsAvoid reusing a wanted lockfile when ignored-optional settings differ +14/-3

Avoid reusing a wanted lockfile when ignored-optional settings differ

• Adds a set-based equality check for ignored optional patterns to prevent seeding a fresh resolution from a lockfile that was pruned under different ignored-optional settings.

pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs

checkDepsStatus.tsInclude ignoredOptionalDependencies in status up-to-date checks +1/-0

Include ignoredOptionalDependencies in status up-to-date checks

• Passes 'ignoredOptionalDependencies' into lockfile freshness comparisons so status reflects ignored optional configuration.

pnpm11/deps/status/src/checkDepsStatus.ts

allProjectsAreUpToDate.tsPropagate ignoredOptionalDependencies into manifest satisfaction checks +2/-0

Propagate ignoredOptionalDependencies into manifest satisfaction checks

• Extends verification inputs to carry ignored optional patterns into 'satisfiesPackageManifest'.

pnpm11/lockfile/verification/src/allProjectsAreUpToDate.ts

satisfiesPackageManifest.tsIgnore configured optional deps when comparing manifest vs importer snapshot +26/-2

Ignore configured optional deps when comparing manifest vs importer snapshot

• Uses '@pnpm/config.matcher' to find ignored optional dependencies in the manifest and omits them from dependency comparisons (except dev deps), preventing false lockfile mismatch signals.

pnpm11/lockfile/verification/src/satisfiesPackageManifest.ts

Refactor (3) +62 / -58
fast_update_lockfile.rsExtract shared reachability pruning helper (Rust) +58/-0

Extract shared reachability pruning helper (Rust)

• Introduces 'prune_unreachable_packages' that walks snapshot reachability from importer roots and prunes both snapshots and package metadata, dropping empty sections to 'None'.

pnpm/crates/package-manager/src/fast_update_lockfile.rs

fast_update_overrides.rsReuse shared pruning helper from overrides fast path +2/-58

Reuse shared pruning helper from overrides fast path

• Removes the local prune implementation and calls 'crate::fast_update_lockfile::prune_unreachable_packages' to share behavior across fast-update modules.

pnpm/crates/package-manager/src/fast_update_overrides.rs

lib.rsWire new fast-update modules into Rust package-manager +2/-0

Wire new fast-update modules into Rust package-manager

• Registers the new fast-update modules ('fast_update_ignored_optional_dependencies', 'fast_update_lockfile') in the crate module list.

pnpm/crates/package-manager/src/lib.rs

Tests (6) +401 / -8
lockfile_resolution_reuse.rsIntegration test: ignored optional add is fast, remove is safe fallback +130/-0

Integration test: ignored optional add is fast, remove is safe fallback

• Adds a test that (1) installs, (2) adds an ignored optional pattern and verifies install skips resolution even with a dead registry, and (3) confirms the optional edge/snapshots/packages and on-disk module are removed. Then removes the ignore pattern and asserts the next install does run resolution and restores the optional dependency.

pnpm/crates/cli/tests/lockfile_resolution_reuse.rs

package_manager_check.rsHermetic registry setup for packageManager pin tests +8/-2

Hermetic registry setup for packageManager pin tests

• Uses a mocked registry seeded with the current pnpm version and sets 'PNPM_CONFIG_REGISTRY' so tests don’t depend on the public registry having the latest published pnpm.

pnpm/crates/cli/tests/package_manager_check.rs

version.rsUse mocked registry seeded with current pnpm version +1/-1

Use mocked registry seeded with current pnpm version

• Switches the version test to 'add_mocked_registry_with_pnpm_version' to keep package-manager pin assertions independent of npm publication timing.

pnpm/crates/cli/tests/version.rs

tests.rsUnit tests for Rust ignored-optional fast update +123/-0

Unit tests for Rust ignored-optional fast update

• Adds coverage for removing ignored optional edges while keeping shared reachable snapshots, rejecting removals/exclusions, and recording additions even when no edges match.

pnpm/crates/package-manager/src/fast_update_ignored_optional_dependencies/tests.rs

ignoredOptionalDependencies.tsTests for TS fast update vs resolution fallback +112/-5

Tests for TS fast update vs resolution fallback

• Adds assertions that ignore-pattern additions avoid fetching packages, removals fall back to resolution (requests the optional), and unit-style checks validate pruning behavior and exclusion-pattern rejection.

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

satisfiesPackageManifest.tsAdd test: satisfiesPackageManifest ignores configured optionals +27/-0

Add test: satisfiesPackageManifest ignores configured optionals

• Adds a regression test ensuring ignored optional dependencies do not cause 'satisfiesPackageManifest' to report unsatisfied.

pnpm11/lockfile/verification/test/satisfiesPackageManifest.ts

Documentation (1) +9 / -0
quick-oranges-ignore-optionals.mdAdd changeset for ignored-optional fast path +9/-0

Add changeset for ignored-optional fast path

• Adds a patch changeset for pnpm/pacquet packages describing faster installs when adding 'ignoredOptionalDependencies' patterns via lockfile pruning without resolution.

.changeset/quick-oranges-ignore-optionals.md

Other (7) +60 / -6
pnpm-lock.yamlUpdate workspace lockfile for matcher dependency +3/-0

Update workspace lockfile for matcher dependency

• Adds a workspace link entry for '@pnpm/config.matcher' to keep workspace dependency graphs consistent with new imports.

pnpm-lock.yaml

bin.rsAdd static-registry mode and pnpm-version substitution helper +25/-2

Add static-registry mode and pnpm-version substitution helper

• Extends test utilities to optionally start a static registry and substitute placeholder version strings with the actual pnpm version for hermetic tests.

pnpm/crates/testing-utils/src/bin.rs

registry.rsSupport proxy vs static registry modes in test registry +20/-4

Support proxy vs static registry modes in test registry

• Introduces 'RegistryMode' and adds 'start_static_with_storage', allowing tests to run without proxying upstream npm when asserting “current pnpm version” behaviors.

pnpm/crates/testing-utils/src/registry.rs

package.jsonAdd @pnpm/config.matcher to verification package deps +1/-0

Add @pnpm/config.matcher to verification package deps

• Adds the matcher workspace dependency so verification can filter ignored optional dependencies consistently.

pnpm11/lockfile/verification/package.json

tsconfig.jsonReference config/matcher TS project +3/-0

Reference config/matcher TS project

• Adds the config/matcher project reference for correct TypeScript build wiring.

pnpm11/lockfile/verification/tsconfig.json

package.jsonAdd fixture for @pnpm/exe with placeholder current version +4/-0

Add fixture for @pnpm/exe with placeholder current version

• Adds a fixture package whose version is replaced during test setup to represent the current pnpm version in the local registry.

pnpr/.fixtures/packages/@pnpm/exe/0.0.0/package.json

package.jsonAdd pnpm fixture with placeholder current version +4/-0

Add pnpm fixture with placeholder current version

• Adds a fixture 'pnpm' package versioned as '0.0.0-test-current-pnpm' for hermetic current-version pin tests.

pnpr/.fixtures/packages/pnpm/0.0.0/package.json

@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. Unsafe ignore-only fast path ✓ Resolved 🐞 Bug ≡ Correctness
Description
The new fast-update path can run when the prior lockfile had only exclusion patterns (e.g.
["!foo"]) and the new config adds a non-! pattern, but that transition can shrink the ignored
set and requires resolution to restore previously-pruned transitive optional subtrees. Because the
fast path only removes edges and prunes snapshots, and freshness checks validate only
importer↔manifest satisfaction (not transitive optional closure), installs can incorrectly omit
now-unignored optional packages while still treating the lockfile as up to date.
Code

pnpm/crates/package-manager/src/fast_update_ignored_optional_dependencies.rs[R9-20]

+    let previous: BTreeSet<_> = lockfile
+        .ignored_optional_dependencies
+        .as_deref()
+        .unwrap_or_default()
+        .iter()
+        .cloned()
+        .collect();
+    let current: BTreeSet<_> = ignored_optional_dependencies.iter().cloned().collect();
+    let added_exclusion = current.difference(&previous).any(|pattern| pattern.starts_with('!'));
+    if previous == current || !previous.is_subset(&current) || added_exclusion {
+        return None;
+    }
Relevance

●●● Strong

Team favors conservative fast-path fallbacks for unsafe config transitions; similar “don’t reuse
lockfile when settings differ” accepted.

PR-#13477
PR-#13081

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Both Rust and TS matchers treat the “no include patterns” case specially (match everything unless
excluded). Adding any include pattern changes matcher mode and can shrink the set of ignored
optional deps, but the fast-update implementation only deletes/prunes and never restores missing
transitive optional snapshots; importer/manifest freshness checks don’t verify transitive optional
closure, so the stale transitive graph can still pass.

pnpm/crates/package-manager/src/fast_update_ignored_optional_dependencies.rs[9-47]
pnpm/crates/config/src/matcher.rs[87-124]
pnpm11/installing/deps-installer/src/install/tryFastUpdateIgnoredOptionalDependencies.ts[9-39]
pnpm11/config/matcher/src/index.ts[16-66]
pnpm/crates/lockfile/src/freshness.rs[537-556]
pnpm11/lockfile/verification/src/allProjectsAreUpToDate.ts[37-71]

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

### Issue description
`try_fast_update_ignored_optional_dependencies()` (and the mirrored TS helper) treats “added non-`!` patterns” as safe, but if the previous lockfile patterns contain **only** `!`-prefixed rules, the matcher semantics change from `AllIgnore` (matches *everything except* exclusions) to `Mixed` (matches only explicit includes not later excluded). That can **reduce** the set of ignored optional deps, which requires re-resolution to **restore** previously removed transitive optional edges/snapshots; the fast path cannot do that.

### Issue Context
- Rust matcher has a distinct `AllIgnore` mode when there are no include patterns.
- Fast-update logic only rejects newly added `!` patterns; it does not reject adding includes to an ignore-only previous state.
- Importer-level freshness checks do not validate the transitive optional-dependency closure, so this can slip through.

### Fix Focus Areas
- pnpm/crates/package-manager/src/fast_update_ignored_optional_dependencies.rs[9-20]
- pnpm11/installing/deps-installer/src/install/tryFastUpdateIgnoredOptionalDependencies.ts[13-22]
- pnpm/crates/package-manager/src/fast_update_ignored_optional_dependencies/tests.rs[72-123]
- pnpm11/installing/deps-installer/test/install/ignoredOptionalDependencies.ts[167-175]

### Suggested fix
1. Add a guard to both Rust and TS fast-update helpers:
  - If the previous lockfile has `ignoredOptionalDependencies` **non-empty** and **all** patterns start with `'!'`, return `None`/`false` (force the safe resolution path).
  - (Optionally) also reject when the *current* set is still ignore-only but changed (already covered by the existing “added exclusion pattern” guard).
2. Add regression tests:
  - Unit test (Rust + TS): previous = `["!foo"]`, current = `["!foo", "bar"]` => fast update must be rejected.
  - Preferably add an integration-style test that demonstrates a transitive optional dep that was previously pruned under the ignore-only config would need to be restored after the change, ensuring the safe path is actually taken.

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



Informational

2. Per-edge string allocations ✓ Resolved 🐞 Bug ➹ Performance
Description
The new fast-update path allocates a fresh String for every optional dependency name via
name.to_string() just to call matcher.matches(), adding avoidable allocation/CPU overhead when
scanning large lockfiles. This is particularly wasteful for unscoped packages, where the bare name
could be matched without building a new owned string.
Code

pnpm/crates/package-manager/src/fast_update_ignored_optional_dependencies.rs[R55-61]

+    let removed: HashSet<_> = optional_dependencies
+        .as_ref()
+        .into_iter()
+        .flatten()
+        .filter(|(name, _)| matcher.matches(&name.to_string()))
+        .map(|(name, _)| name.clone())
+        .collect();
Relevance

● Weak

Repo often rejects micro-optimizations removing to_string()/allocations in hot loops as
non-priority/complexity tradeoff.

PR-#13455
PR-#13368

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The fast-update removal loop calls name.to_string() for each optional dependency key, and
PkgName is a structured type (scope/bare), so unscoped matches can avoid formatting/allocating the
full package name.

pnpm/crates/package-manager/src/fast_update_ignored_optional_dependencies.rs[55-61]
pnpm/crates/lockfile/src/pkg_name.rs[14-19]

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

### Issue description
`remove_ignored_optional_dependencies()` allocates a temporary `String` for each key just to match against patterns (`matcher.matches(&name.to_string())`). This adds allocation churn to the new fast-update path.

### Issue Context
`PkgName` stores `scope` and `bare` separately. Many packages are unscoped, so the bare string is already available without formatting.

### Fix Focus Areas
- pnpm/crates/package-manager/src/fast_update_ignored_optional_dependencies.rs[55-61]
- pnpm/crates/lockfile/src/pkg_name.rs[14-19]

### Suggested fix
- Avoid unconditional `to_string()`:
 - For unscoped names: match on `&name.bare`.
 - For scoped names: build a single temporary string (e.g. `format!("@{}/{}", scope, bare)`) or introduce a helper on `PkgName` that returns `Cow<'_, str>`.
- Keep this as a small, contained change; no need to redesign matcher unless profiling shows it’s hot.

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


3. omitIgnoredDependencies missing trailing commas 📘 Rule violation ⚙ Maintainability
Description
New multi-line TypeScript constructs added in satisfiesPackageManifest.ts and the fast-update
ignored-optional-dependencies helper omit required trailing commas, violating the trailing-comma
requirement and increasing future diff churn. This affects multi-line type literals as well as
multi-line parameter/argument (or type/parameter) lists in the newly introduced code.
Code

pnpm11/lockfile/verification/src/satisfiesPackageManifest.ts[R126-129]

+function omitIgnoredDependencies (
+  dependencies: Record<string, string> | undefined,
+  ignoredDependencies: Set<string>
+): Record<string, string> {
Relevance

● Weak

Trailing-comma rule violations are repeatedly flagged but usually rejected in prior reviews; low
enforcement signal.

PR-#13477
PR-#13289

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713434 requires trailing commas on the last item of multi-line TypeScript
constructs. The cited regions in pnpm11/lockfile/verification/src/satisfiesPackageManifest.ts
include newly added ignoredOptionalDependencies option/type changes and the new
omitIgnoredDependencies helper that introduce multi-line lists without a trailing comma, and the
cited regions in
pnpm11/installing/deps-installer/src/install/tryFastUpdateIgnoredOptionalDependencies.ts show
newly added functions that use multi-line parameter lists (and a multi-line type literal) where the
final items similarly lack trailing commas, directly demonstrating noncompliance.

Rule 713434: Require trailing commas in TypeScript collections and multi-line constructs
pnpm11/lockfile/verification/src/satisfiesPackageManifest.ts[15-19]
pnpm11/lockfile/verification/src/satisfiesPackageManifest.ts[30-33]
pnpm11/lockfile/verification/src/satisfiesPackageManifest.ts[126-129]
pnpm11/installing/deps-installer/src/install/tryFastUpdateIgnoredOptionalDependencies.ts[9-12]
pnpm11/installing/deps-installer/src/install/tryFastUpdateIgnoredOptionalDependencies.ts[42-47]

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

## Issue description
Multi-line TypeScript constructs introduced by the `ignoredOptionalDependencies` changes (including the new `omitIgnoredDependencies` helper and the fast-update helper) are missing required trailing commas on their last items.

## Issue Context
PR Compliance ID 713434 requires trailing commas in multi-line TypeScript constructs (e.g., type literals, collections, argument lists, and parameter lists) to keep formatting consistent and reduce noisy diffs when future edits add or reorder items.

## Fix Focus Areas
- pnpm11/lockfile/verification/src/satisfiesPackageManifest.ts[15-19]
- pnpm11/lockfile/verification/src/satisfiesPackageManifest.ts[30-33]
- pnpm11/lockfile/verification/src/satisfiesPackageManifest.ts[126-129]
- pnpm11/installing/deps-installer/src/install/tryFastUpdateIgnoredOptionalDependencies.ts[9-12]
- pnpm11/installing/deps-installer/src/install/tryFastUpdateIgnoredOptionalDependencies.ts[42-47]

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


Grey Divider

Context used
✅ Compliance rules (platform): 32 rules

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

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.

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

🧹 Nitpick comments (1)
pnpm/crates/testing-utils/src/registry.rs (1)

63-69: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Comment only documents Proxy, not the new Static mode.

The comment above the match mode block explains why Proxy mode falls through to npm upstream, but doesn't explain the invariant that makes Static mode useful here: no upstream fall-through at all, so pinned-version tests stay hermetic even if a package name isn't in the local fixture set. Worth a one-line addition for future maintainers.

✏️ Suggested comment addition
         let url = format!("http://{listen}/");
         // Proxy mode: `@pnpm.e2e` fixtures are served from local storage, while
         // real npm packages (`is-positive`, `is-negative`, etc.) fall through to
         // the npm upstream — matching how registry-mock served pacquet's tests.
+        // Static mode: every request is served from local storage only, with no
+        // upstream fall-through — used by tests that must stay hermetic (e.g. the
+        // pinned-package-manager-version fixtures) even against packages that
+        // don't exist upstream.
         let mut config = match mode {
             RegistryMode::Proxy => Config::proxy(listen, storage),
             RegistryMode::Static => Config::static_serve(listen, storage),
         };
As per path instructions, `pnpm/**` code style, comments, and conventions should follow `pnpm/AGENTS.md`, which values comments that explain non-obvious invariants.
🤖 Prompt for 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.

In `@pnpm/crates/testing-utils/src/registry.rs` around lines 63 - 69, Update the
comment above the `match mode` block to document the `RegistryMode::Static`
invariant: it never falls through to an npm upstream, keeping pinned-version
tests hermetic when packages are absent from local fixtures. Preserve the
existing `Proxy` explanation and follow the comment conventions in
`pnpm/AGENTS.md`.

Source: Path instructions

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

Nitpick comments:
In `@pnpm/crates/testing-utils/src/registry.rs`:
- Around line 63-69: Update the comment above the `match mode` block to document
the `RegistryMode::Static` invariant: it never falls through to an npm upstream,
keeping pinned-version tests hermetic when packages are absent from local
fixtures. Preserve the existing `Proxy` explanation and follow the comment
conventions in `pnpm/AGENTS.md`.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 303a89da-1184-4b6c-872a-cd2000cfa890

📥 Commits

Reviewing files that changed from the base of the PR and between 925c33d and 518c3b7.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !pnpm-lock.yaml
📒 Files selected for processing (24)
  • .changeset/quick-oranges-ignore-optionals.md
  • pnpm/crates/cli/tests/lockfile_resolution_reuse.rs
  • pnpm/crates/cli/tests/package_manager_check.rs
  • pnpm/crates/cli/tests/version.rs
  • pnpm/crates/package-manager/src/fast_update_ignored_optional_dependencies.rs
  • pnpm/crates/package-manager/src/fast_update_ignored_optional_dependencies/tests.rs
  • pnpm/crates/package-manager/src/fast_update_lockfile.rs
  • pnpm/crates/package-manager/src/fast_update_overrides.rs
  • pnpm/crates/package-manager/src/install.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
  • pnpm/crates/package-manager/src/lib.rs
  • pnpm/crates/testing-utils/src/bin.rs
  • pnpm/crates/testing-utils/src/registry.rs
  • pnpm11/deps/status/src/checkDepsStatus.ts
  • pnpm11/installing/deps-installer/src/install/index.ts
  • pnpm11/installing/deps-installer/src/install/tryFastUpdateIgnoredOptionalDependencies.ts
  • pnpm11/installing/deps-installer/test/install/ignoredOptionalDependencies.ts
  • pnpm11/lockfile/verification/package.json
  • pnpm11/lockfile/verification/src/allProjectsAreUpToDate.ts
  • pnpm11/lockfile/verification/src/satisfiesPackageManifest.ts
  • pnpm11/lockfile/verification/test/satisfiesPackageManifest.ts
  • pnpm11/lockfile/verification/tsconfig.json
  • pnpr/.fixtures/packages/@pnpm/exe/0.0.0/package.json
  • pnpr/.fixtures/packages/pnpm/0.0.0/package.json

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 29, 2026
Copilot AI review requested due to automatic review settings July 29, 2026 08:51

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 b67c786

@zkochan

zkochan commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

Review follow-up:

  • Fixed the unsafe exclusion-only matcher transition in b67c7868c2 and added mirrored regression tests.
  • Removed the per-edge allocation for unscoped pacquet package names in the same commit.
  • Did not add trailing commas to TypeScript function parameter lists: the repository ESLint formatter intentionally preserves this Standard-style form, and the package compile/lint check passes.

Validation after the fix: 8 focused TypeScript tests, 5 focused pacquet tests, all 7,463 pacquet tests, clippy, and the pre-push dylint/typecheck/bundle gates pass.


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

@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 commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 60ac9aa21a00

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm. 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.657 ± 0.132 2.489 2.851 1.71 ± 0.19
pacquet@main 2.759 ± 0.178 2.519 3.000 1.78 ± 0.21
pnpr@HEAD 1.671 ± 0.192 1.441 1.923 1.08 ± 0.16
pnpr@main 1.552 ± 0.157 1.387 1.819 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.6572480024200003,
      "stddev": 0.13155719172099964,
      "median": 2.6927765096200003,
      "user": 1.9760093199999997,
      "system": 1.7088303599999999,
      "min": 2.4886042131200004,
      "max": 2.85117697712,
      "times": [
        2.7519695681200003,
        2.85117697712,
        2.4886042131200004,
        2.7251889851200004,
        2.66036403412,
        2.5834186591200003,
        2.7712926671200004,
        2.49389007212,
        2.50356022812,
        2.7430146201200003
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.7593482883200005,
      "stddev": 0.17820963631842024,
      "median": 2.7490553246200005,
      "user": 2.32355032,
      "system": 1.84769996,
      "min": 2.51895313712,
      "max": 2.9996181711200003,
      "times": [
        2.51895313712,
        2.68123847912,
        2.5363409421200003,
        2.6492452451200004,
        2.64045017212,
        2.8336615071200004,
        2.8168721701200004,
        2.95535388012,
        2.9617491791200004,
        2.9996181711200003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.67090590912,
      "stddev": 0.19150533753053126,
      "median": 1.6853661741200001,
      "user": 1.4728754199999998,
      "system": 1.50798536,
      "min": 1.44101419812,
      "max": 1.9233958291200002,
      "times": [
        1.9233958291200002,
        1.88327759612,
        1.78496125812,
        1.7122995121200002,
        1.51961578412,
        1.65843283612,
        1.45446103212,
        1.46122937412,
        1.87037167112,
        1.44101419812
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.55190971682,
      "stddev": 0.156973151237027,
      "median": 1.50479957662,
      "user": 1.26266412,
      "system": 1.35175266,
      "min": 1.38728383712,
      "max": 1.81924895812,
      "times": [
        1.81924895812,
        1.79009689212,
        1.59096355112,
        1.38728383712,
        1.42543986212,
        1.40374007612,
        1.52315698012,
        1.4864421731200002,
        1.6507935411199999,
        1.44193129712
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 307.2 ± 17.4 281.6 332.7 1.12 ± 0.09
pacquet@main 275.3 ± 16.0 249.8 297.3 1.00
pnpr@HEAD 315.9 ± 29.9 289.3 389.9 1.15 ± 0.13
pnpr@main 307.7 ± 19.9 285.0 337.8 1.12 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.30722439856,
      "stddev": 0.01742813843826494,
      "median": 0.30465010076,
      "user": 0.25758874,
      "system": 0.60103312,
      "min": 0.28156344526,
      "max": 0.33268538626,
      "times": [
        0.30350027826000003,
        0.31554198326,
        0.33268538626,
        0.32712989126,
        0.32407914926000003,
        0.28156344526,
        0.30449089526,
        0.28820666126,
        0.29023698926,
        0.30480930626
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.27528551096,
      "stddev": 0.015999365011848572,
      "median": 0.26817543676,
      "user": 0.22501993999999997,
      "system": 0.5532708199999999,
      "min": 0.24980803926,
      "max": 0.29733667626,
      "times": [
        0.29292892526000003,
        0.26922393926,
        0.28951193226,
        0.29102739926000004,
        0.29733667626,
        0.26377133826,
        0.26712693426,
        0.26671981726,
        0.24980803926,
        0.26540010826
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.31589589976,
      "stddev": 0.02990388142907745,
      "median": 0.31116106176,
      "user": 0.25414534,
      "system": 0.59631422,
      "min": 0.28925928526,
      "max": 0.38991090626,
      "times": [
        0.31793198926,
        0.31399972426,
        0.29577753626000003,
        0.29026781826000003,
        0.30088620926000004,
        0.30951767326,
        0.28925928526,
        0.31280445026000003,
        0.33860340526,
        0.38991090626
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.30773486526000005,
      "stddev": 0.019915236667860912,
      "median": 0.30124718526000005,
      "user": 0.23727384,
      "system": 0.59453772,
      "min": 0.28496947326,
      "max": 0.33778997926000004,
      "times": [
        0.28496947326,
        0.29160270126000004,
        0.29485279326,
        0.28829182326,
        0.29542032426000003,
        0.33682899626,
        0.32422641426000004,
        0.33778997926000004,
        0.31629210126,
        0.30707404626
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.787 ± 0.034 2.751 2.853 1.58 ± 0.16
pacquet@main 2.848 ± 0.105 2.719 3.086 1.62 ± 0.17
pnpr@HEAD 1.759 ± 0.179 1.528 1.988 1.00
pnpr@main 1.787 ± 0.137 1.528 1.934 1.02 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.78709567222,
      "stddev": 0.03400028277287325,
      "median": 2.77373393852,
      "user": 2.029981,
      "system": 1.7350946,
      "min": 2.75067247002,
      "max": 2.85309215402,
      "times": [
        2.80684126502,
        2.83389714102,
        2.75539006202,
        2.85309215402,
        2.76908863302,
        2.75067247002,
        2.77113078602,
        2.7661210920199997,
        2.7883860280199997,
        2.77633709102
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.8482506978199997,
      "stddev": 0.10471498306480598,
      "median": 2.82147587602,
      "user": 2.1913141,
      "system": 1.7862291999999997,
      "min": 2.71945784502,
      "max": 3.08623679902,
      "times": [
        2.77499717202,
        2.87507484702,
        2.71945784502,
        2.77164455602,
        2.8123368850199997,
        2.79045176602,
        2.89174067702,
        2.83061486702,
        3.08623679902,
        2.92995156402
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.75909931752,
      "stddev": 0.17874336108618363,
      "median": 1.7940252190200003,
      "user": 1.4774527,
      "system": 1.4612228999999999,
      "min": 1.5275937140200002,
      "max": 1.98754362002,
      "times": [
        1.9862369130200002,
        1.5275937140200002,
        1.9114913320200002,
        1.8229936800200002,
        1.83505804602,
        1.5360677460200003,
        1.7650567580200003,
        1.5738316790200002,
        1.64511968702,
        1.98754362002
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.7872264065200003,
      "stddev": 0.1373117959986024,
      "median": 1.8294765175200003,
      "user": 1.4621571999999998,
      "system": 1.5670221999999998,
      "min": 1.5284734180200001,
      "max": 1.9342801380200003,
      "times": [
        1.71318357902,
        1.8818277980200002,
        1.89073999102,
        1.7039901130200001,
        1.7771252370200001,
        1.63823071102,
        1.9143542860200002,
        1.5284734180200001,
        1.8900587940200002,
        1.9342801380200003
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 689.3 ± 74.6 564.3 783.8 1.72 ± 0.23
pacquet@main 593.6 ± 48.0 538.2 695.7 1.48 ± 0.17
pnpr@HEAD 400.7 ± 32.3 354.7 459.7 1.00
pnpr@main 428.8 ± 29.9 389.9 490.8 1.07 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.68927069632,
      "stddev": 0.07458678485986026,
      "median": 0.6722246413200001,
      "user": 0.95769178,
      "system": 1.0743171999999999,
      "min": 0.56432615232,
      "max": 0.7838333753200001,
      "times": [
        0.56432615232,
        0.7833431993200001,
        0.7561784513200001,
        0.74563515032,
        0.6892252883200001,
        0.6447164603200001,
        0.6360424063200001,
        0.6341824853200001,
        0.6552239943200001,
        0.7838333753200001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.5936181083200001,
      "stddev": 0.04802053840971865,
      "median": 0.5855597773200001,
      "user": 0.81364448,
      "system": 0.9640472000000001,
      "min": 0.5382159753200001,
      "max": 0.6956694923200001,
      "times": [
        0.59079622732,
        0.6032755743200001,
        0.5776243323200001,
        0.6956694923200001,
        0.63464750432,
        0.58032332732,
        0.5382159753200001,
        0.55570784232,
        0.62022465932,
        0.53969614832
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.40069544462,
      "stddev": 0.03232440630190424,
      "median": 0.39019070432,
      "user": 0.2860228799999999,
      "system": 0.6728476999999999,
      "min": 0.35472464632,
      "max": 0.45973726332000003,
      "times": [
        0.40454525032,
        0.45973726332000003,
        0.39029131432,
        0.45391101732,
        0.38126636832,
        0.39009009432,
        0.39740832832,
        0.38731743132,
        0.38766273232,
        0.35472464632
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.42880357282,
      "stddev": 0.029875151464562835,
      "median": 0.42760227982,
      "user": 0.30938948,
      "system": 0.7284138999999998,
      "min": 0.38992113532,
      "max": 0.49075358132,
      "times": [
        0.43973397432,
        0.40797354132,
        0.41957772732,
        0.49075358132,
        0.45367057132,
        0.43790870932,
        0.39329192832,
        0.43390149532,
        0.42130306432000003,
        0.38992113532
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.865 ± 0.058 1.774 1.954 4.93 ± 0.30
pacquet@main 1.865 ± 0.070 1.799 1.967 4.93 ± 0.32
pnpr@HEAD 0.378 ± 0.020 0.352 0.407 1.00
pnpr@main 0.430 ± 0.037 0.350 0.472 1.14 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.8645813880800002,
      "stddev": 0.057581721118823904,
      "median": 1.86645655788,
      "user": 0.96889986,
      "system": 0.9498529999999998,
      "min": 1.77434241288,
      "max": 1.9543587818800001,
      "times": [
        1.8820067658800002,
        1.9543587818800001,
        1.8773516598800002,
        1.84875637088,
        1.88351547388,
        1.85556145588,
        1.82067597488,
        1.77434241288,
        1.8026798348800002,
        1.9465651498800003
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.8646322655800003,
      "stddev": 0.07040464164208667,
      "median": 1.83421312088,
      "user": 0.99296796,
      "system": 0.9236475999999998,
      "min": 1.7992544188800002,
      "max": 1.9666221708800002,
      "times": [
        1.9666221708800002,
        1.9553719148800002,
        1.9531043938800001,
        1.83475614288,
        1.8027515198800002,
        1.7992544188800002,
        1.7999790368800002,
        1.80792786188,
        1.83367009888,
        1.8928850968800002
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.37831183258,
      "stddev": 0.019529241294779134,
      "median": 0.37679613838000003,
      "user": 0.28918546,
      "system": 0.6195894999999999,
      "min": 0.35196355088000003,
      "max": 0.40698895988000006,
      "times": [
        0.39790705688000005,
        0.36707563488000006,
        0.35412749188000003,
        0.38510376688000003,
        0.39244563888000006,
        0.36408896388,
        0.35196355088000003,
        0.36848850988000004,
        0.40698895988000006,
        0.39492875188000004
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.42958421818000003,
      "stddev": 0.037124190049628907,
      "median": 0.44106271038,
      "user": 0.31054775999999995,
      "system": 0.7219966999999999,
      "min": 0.34990939788000003,
      "max": 0.47226743088000006,
      "times": [
        0.38398312388000005,
        0.34990939788000003,
        0.42230963688000006,
        0.43503817588000004,
        0.42533764688000003,
        0.47226743088000006,
        0.45935962388,
        0.45179380888000004,
        0.44875609188000004,
        0.44708724488
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 322.2 ± 57.1 249.4 424.8 3.17 ± 0.58
pacquet@main 265.2 ± 25.6 233.9 320.2 2.61 ± 0.27
pnpr@HEAD 103.1 ± 4.3 93.2 112.1 1.02 ± 0.06
pnpr@main 101.5 ± 4.0 94.1 108.0 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.32222579709818183,
      "stddev": 0.05714888159204099,
      "median": 0.32240283728,
      "user": 0.31016260545454544,
      "system": 0.10956023454545454,
      "min": 0.24944113027999998,
      "max": 0.42479726128,
      "times": [
        0.25191672828,
        0.24944113027999998,
        0.30436018928,
        0.32240283728,
        0.42479726128,
        0.37522935128,
        0.33168254428,
        0.35359887728,
        0.27271114628,
        0.37990440628,
        0.27843929628
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.2652392351890909,
      "stddev": 0.025563049135127504,
      "median": 0.25651425728,
      "user": 0.2464949690909091,
      "system": 0.0999028709090909,
      "min": 0.23388346728,
      "max": 0.32016952728000003,
      "times": [
        0.25653707028,
        0.25069685828,
        0.25504351428,
        0.30163153428,
        0.27195776628,
        0.24307784328,
        0.32016952728000003,
        0.25651425728,
        0.25397423828,
        0.27414551028,
        0.23388346728
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.10314389728,
      "stddev": 0.004267805561618402,
      "median": 0.10329318778000002,
      "user": 0.028708213846153848,
      "system": 0.015295703076923082,
      "min": 0.09323114028000001,
      "max": 0.11209237328000002,
      "times": [
        0.10626331228000001,
        0.10957767228000001,
        0.10182527528000002,
        0.11209237328000002,
        0.10478821228000001,
        0.09725631128000001,
        0.09870377028,
        0.09966990128000001,
        0.09805684928000001,
        0.09323114028000001,
        0.10190497528,
        0.10159395928,
        0.10129495528000002,
        0.10773608028000001,
        0.10319646028000001,
        0.10039888528000002,
        0.10477913428,
        0.10404641428000001,
        0.10338991528000001,
        0.09814841228000001,
        0.10243120728,
        0.10491992128000001,
        0.10525728628000001,
        0.10497328128000001,
        0.10951377228,
        0.10669185128000001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.1015178093953846,
      "stddev": 0.0039772335014886355,
      "median": 0.10117992378000001,
      "user": 0.02793494461538461,
      "system": 0.014964664615384612,
      "min": 0.09408308728,
      "max": 0.10804202728000001,
      "times": [
        0.10804202728000001,
        0.10015506628000001,
        0.10208494428,
        0.10292485828000002,
        0.10249693228000001,
        0.09747218828000001,
        0.10140577428000001,
        0.10525186528000001,
        0.10095407328000001,
        0.09854371728000001,
        0.10689921128000002,
        0.10007318128,
        0.10506060628000001,
        0.10707812928000002,
        0.10456960028000001,
        0.09978687128000001,
        0.10431624228000001,
        0.09721767728000001,
        0.10694433728000001,
        0.10565520628000001,
        0.09982930228,
        0.09519120728000001,
        0.09895434228000001,
        0.09913273828000001,
        0.09408308728,
        0.09533985728000001
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.182 ± 0.322 0.830 1.790 1.09 ± 0.43
pacquet@main 1.087 ± 0.309 0.674 1.560 1.00
pnpm@HEAD 4.126 ± 0.247 3.664 4.441 3.79 ± 1.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.1821627804488888,
      "stddev": 0.3215151984427692,
      "median": 1.21751112256,
      "user": 1.1227628688888887,
      "system": 0.21143762888888887,
      "min": 0.83008341756,
      "max": 1.7899062965599999,
      "times": [
        1.21751112256,
        1.3377732125600001,
        1.7899062965599999,
        0.9981285015600001,
        0.8696133595600001,
        0.8673251755600001,
        1.29045862956,
        0.83008341756,
        1.43866530856
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.0874002712266668,
      "stddev": 0.30893874227918744,
      "median": 1.09708796656,
      "user": 1.0354320911111108,
      "system": 0.1789379622222222,
      "min": 0.67442137156,
      "max": 1.55960362756,
      "times": [
        1.18975117156,
        1.55960362756,
        1.00457448556,
        1.50805932256,
        0.76546417056,
        0.82877992856,
        1.09708796656,
        0.67442137156,
        1.15886039656
      ]
    },
    {
      "command": "pnpm@HEAD",
      "mean": 4.126042260893333,
      "stddev": 0.2473732619834218,
      "median": 4.18204754256,
      "user": 6.417252757777778,
      "system": 0.3583439622222222,
      "min": 3.66397167556,
      "max": 4.44075003456,
      "times": [
        4.33895039856,
        4.44075003456,
        4.07815494956,
        4.32451938056,
        4.18204754256,
        4.21099786456,
        4.03656997956,
        3.85841852256,
        3.66397167556
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.619 ± 0.122 4.490 4.800 1.26 ± 0.05
pacquet@main 5.078 ± 0.580 4.608 6.373 1.38 ± 0.16
pnpr@HEAD 3.669 ± 0.089 3.537 3.844 1.00
pnpr@main 3.669 ± 0.076 3.550 3.822 1.00 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.618617187579999,
      "stddev": 0.12158213594246088,
      "median": 4.56074900768,
      "user": 2.0229082000000003,
      "system": 1.6083671,
      "min": 4.490324334179999,
      "max": 4.7997180541799995,
      "times": [
        4.5356514811799995,
        4.52716815618,
        4.76932663618,
        4.64021409618,
        4.490324334179999,
        4.5437994021799994,
        4.7997180541799995,
        4.517026556179999,
        4.7852445461799995,
        4.57769861318
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 5.07803648348,
      "stddev": 0.579731889368447,
      "median": 4.8751883521799995,
      "user": 3.2242438,
      "system": 2.3824910999999998,
      "min": 4.60759319418,
      "max": 6.37326140318,
      "times": [
        4.63571423218,
        4.689191334179999,
        4.60759319418,
        4.81977099218,
        5.85872581018,
        6.37326140318,
        4.96459164718,
        4.81686787718,
        4.930605712179999,
        5.08404263218
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.66870554698,
      "stddev": 0.08887760304688791,
      "median": 3.67803827168,
      "user": 1.7524053,
      "system": 1.677554,
      "min": 3.53658688818,
      "max": 3.84381818218,
      "times": [
        3.73553516218,
        3.69835555618,
        3.69936646218,
        3.84381818218,
        3.66332704618,
        3.6927494971800003,
        3.57319471518,
        3.65816553418,
        3.58595642618,
        3.53658688818
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.6692365696800002,
      "stddev": 0.07629851271912641,
      "median": 3.68273964718,
      "user": 1.8832263999999999,
      "system": 1.7834181999999998,
      "min": 3.5498652721800004,
      "max": 3.82177091518,
      "times": [
        3.82177091518,
        3.5498652721800004,
        3.66939840218,
        3.63267286218,
        3.67946740518,
        3.69435056318,
        3.6945919881800005,
        3.69966361118,
        3.56457278818,
        3.68601188918
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13482
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,750.67 ms
(+0.71%)Baseline: 2,731.29 ms
3,277.55 ms
(83.92%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,774.34 ms
(-3.62%)Baseline: 1,840.90 ms
2,209.08 ms
(80.32%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
564.33 ms
(+18.43%)Baseline: 476.50 ms
571.81 ms
(98.69%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
249.44 ms
(+12.90%)Baseline: 220.94 ms
265.13 ms
(94.08%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,488.60 ms
(+0.76%)Baseline: 2,469.89 ms
2,963.87 ms
(83.96%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,490.32 ms
(-0.80%)Baseline: 4,526.61 ms
5,431.93 ms
(82.67%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
281.56 ms
(-6.96%)Baseline: 302.63 ms
363.15 ms
(77.53%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
830.08 ms
(+12.40%)Baseline: 738.53 ms
886.24 ms
(93.66%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13482
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,527.59 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
351.96 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
354.72 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
93.23 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,441.01 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,536.59 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
289.26 ms
🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan merged commit f31c7ca into main Aug 6, 2026
37 checks passed
@zkochan
zkochan deleted the fix-13474-ignored-optional branch August 6, 2026 10:40
@coderabbitai coderabbitai Bot mentioned this pull request Aug 7, 2026
4 tasks done
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.

3 participants