Skip to content

feat: absorb a parent-scoped override into the fast lockfile update - #13797

Merged
zkochan merged 2 commits into
mainfrom
parent-overrides
Aug 11, 2026
Merged

zkochan merged 2 commits into
mainfrom
parent-overrides

Conversation

@zkochan

@zkochan zkochan commented Aug 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #13795 — the half of item 6 of #13696 left out when the range half landed in #13792.

A parent-scoped override ("parent>child": "2.0.0") bailed to the resolver in both stacks unless it was a removal. Measured what a full resolution actually does with one, before touching anything — parent and other both depending on [email protected], then overriding only parent's edge:

  • the named parent's edge moves to the new version;
  • the other dependents keep the version they had — no deduplication onto the new one, which was the open question on the issue;
  • the version left behind is pruned once nothing reaches it.

That turned out to be expressible with the plan as it stands. The apply step already inserts the new version alongside the old and leaves reachability to the shared prune, so the old key survives on its own whenever another dependent still points at it — I had expected to need per-edge plan entries and did not. What was actually missing is that the repoint ignored the selector's parent and moved every edge to the package.

It now consults the same predicate parent-scoped removals have always used, extracted so both share it (override_applies_to / overrideApplies). Importer edges keep the exit removals take there, since a parent>child selector never names an importer.

Both stacks are tested at the handler level: the named parent moves while the other dependent does not and both versions survive; the version left behind is pruned when it becomes unreachable. The pacquet scoping is break-tested — removing the parent check makes the "moves only that parent's edge" test fail.

Squash Commit Body

A parent-scoped override (parent>child) bailed to the resolver in both
stacks unless it was a removal. Measured what a full resolution does
with one: only the named parent's edge moves, the other dependents keep
the version they had, and the version left behind is pruned when
nothing reaches it any more.

That is expressible. The plan already inserts the new version alongside
the old and leaves reachability to the shared prune, so the old key
survives on its own whenever another dependent still points at it. What
was missing is that the repoint ignored the selector's parent and moved
every edge; it now consults the same predicate parent-scoped removals
already use, extracted so both share it. Importer edges keep the exit
removals take there, since a parent selector never names an importer.

Closes pnpm/pnpm#13795.

Checklist

  • I checked the referenced issue and verified that none of the PRs
    already linked to it solves it.
  • 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 (Claude Code, claude-opus-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
    • Improved handling of dependency overrides using semver ranges by selecting the highest compatible locked version when available.
    • Parent-scoped overrides now update only the specified dependency relationship while preserving versions used elsewhere.
    • Obsolete package versions are removed when no longer referenced.
  • Tests
    • Added coverage for range-based overrides, parent-scoped updates, shared dependencies, fallback behavior, and package cleanup.

Copilot AI lite review requested due to automatic review settings August 10, 2026 23:45

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 Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d9df99ed-1a1b-4a4c-87bb-9e44c09b14d0

📥 Commits

Reviewing files that changed from the base of the PR and between 8931c79 and 04ba1a0.

📒 Files selected for processing (1)
  • pnpm11/installing/deps-installer/test/install/overrideRangeFastUpdate.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • pnpm11/installing/deps-installer/test/install/overrideRangeFastUpdate.ts

📝 Walkthrough

Walkthrough

Fast override updates now resolve compatible semver ranges from locked versions and support parent-scoped replacements in the Rust and TypeScript paths. The changes include selective dependency rewrites, graph pruning, and coverage for shared dependencies.

Changes

Fast override lockfile updates

Layer / File(s) Summary
Locked version selection and validation
pnpm/crates/package-manager/src/fast_update_overrides.rs, pnpm/crates/package-manager/src/fast_update_overrides/tests.rs, pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts
Override ranges select the highest compatible locked version. Unsupported registry- or peer-qualified entries remain excluded.
Rust parent-scoped override planning
pnpm/crates/package-manager/src/fast_update_overrides.rs, pnpm/crates/package-manager/src/fast_update_overrides/tests.rs
Parent selectors now control replacement matching for importer and snapshot edges. Tests cover selective updates, retained versions, and pruning.
TypeScript override rewriting and validation
pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts, pnpm11/installing/deps-installer/test/install/overrideRangeFastUpdate.ts, .changeset/parent-scoped-overrides.md
The installer passes lockfile data into override processing, tracks scoped moves separately from removals, rewrites matching edges, and tests shared-dependency behavior. A patch changeset documents the update.

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

Sequence Diagram(s)

sequenceDiagram
  participant Installer
  participant OverrideProcessor
  participant Lockfile
  participant Tests
  Installer->>OverrideProcessor: pass lockfile and override configuration
  OverrideProcessor->>Lockfile: select highest compatible locked version
  OverrideProcessor->>Lockfile: repoint matching parent dependency edges
  Lockfile-->>Installer: updated package graph
  Tests->>Lockfile: verify retained and pruned package entries
Loading

Assessment against linked issues

Objective Addressed Explanation
Support parent-scoped replacement overrides in the Rust and TypeScript fast-update paths [#13795] ✅
Repoint only the selected parent edges while retaining other dependent versions [#13795] ✅
Prune the old package when no remaining dependency reaches it [#13795] ✅
Preserve existing unsupported-entry guards [#13795] ✅

Possibly related PRs

  • pnpm/pnpm#13792: Adds the related range-based override resolution in the same Rust and TypeScript paths.
  • pnpm/pnpm#13464: Extends the same fast override-update implementations and tests.
  • pnpm/pnpm#12741: Modifies parent-scoped override matching and selective dependency updates.

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

Suggested reviewers: greptile-apps

✨ 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 parent-overrides

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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fast lockfile rewrite: support range + parent-scoped overrides without full resolve

✨ Enhancement 🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Allow range-valued overrides to fast-update when a satisfying locked version exists.
• Apply parent-scoped overrides by repointing only the named parent's dependency edge.
• Add Rust/TS handler-level tests and changesets documenting both behaviors.
Diagram

graph TD
  A["pnpm overrides change"] --> B["TS: tryFastUpdateOverrides"] --> C["Fast override plan"] --> D[("Lockfile (packages/snapshots)")] --> E{"Eligible for rewrite?"} --> F["Rewrite deps (scoped edges)"] --> G["Prune unreachable"]
  E --> H["Fallback: full resolver"]

  subgraph Legend
    direction LR
    _in["Entry point"] ~~~ _db[("Lockfile data")] ~~~ _dec{"Decision"}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Per-edge rewrite plan entries
  • ➕ Could model parent-scoped overrides explicitly per dependent edge.
  • ➕ Potentially clearer mapping from selector to rewritten edges.
  • ➖ More complex plan representation and application code.
  • ➖ Redundant with current behavior where insertion+prune already supports coexistence.
2. Partial resolver for affected subgraph
  • ➕ Leverages existing resolution semantics directly (less bespoke logic).
  • ➕ Could handle more override forms beyond current fast-update expressibility.
  • ➖ Higher runtime cost and more integration complexity.
  • ➖ Harder to guarantee it remains "fast" and deterministic vs full resolve.

Recommendation: The PR’s approach is the best tradeoff: keep the existing replacement+prune architecture, but (1) map ranges to an already-locked concrete version and (2) scope edge repointing/removal via a shared parent-selector predicate. This preserves fast-update performance while matching full-resolution behavior, without introducing a heavier plan model or partial resolution machinery.

Files changed (8) +507 / -36

Enhancement (2) +134 / -31
fast_update_overrides.rsSupport range and parent-scoped overrides in fast rewrite plan/application +67/-17

Support range and parent-scoped overrides in fast rewrite plan/application

• Maps override values to a concrete target version (exact semver or highest locked satisfying range) and applies replacements/removals only when the override selector matches the parent edge owner. Extracts shared parent matching into override_applies_to and uses it for both removals and replacements; importer rewrites preserve the existing removal behavior since a parent selector never targets an importer.

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

tryFastUpdateOverrides.tsImplement TS fast-update for range and parent-scoped overrides +67/-14

Implement TS fast-update for range and parent-scoped overrides

• Adds range-to-concrete-version mapping by scanning lockfile packages and rejecting ambiguous peer-suffixed/registry-qualified cases. Tracks move overrides separately and scopes dependency rewriting via overrideApplies so parent>child selectors only repoint matching parent-owned edges.

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

Bug fix (1) +6 / -4
fast_update_importers.rsReject range selection when alias spans peer-suffixed or named-registry keys +6/-4

Reject range selection when alias spans peer-suffixed or named-registry keys

• Makes the locked-version scan public for reuse and tightens eligibility: if the alias appears under a peer-suffixed or registry-qualified key, fast selection returns None to avoid ambiguous rewrites.

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

Tests (3) +353 / -1
tests.rsAdd Rust test for named-registry ambiguity in range overrides +15/-1

Add Rust test for named-registry ambiguity in range overrides

• Extends fast-update importer tests to ensure the range-to-locked-version scan bails when the same alias appears under a named-registry-qualified key.

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

tests.rsAdd Rust handler-level tests for range and parent-scoped override behavior +208/-0

Add Rust handler-level tests for range and parent-scoped override behavior

• Introduces tests verifying that range overrides prefer already-locked satisfying versions and bail when none exist, and that parent-scoped overrides move only the named parent's edge while allowing both versions to coexist until pruning removes unreachable versions.

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

overrideRangeFastUpdate.tsAdd TS tests for range mapping and parent-scoped override fast-update entry +130/-0

Add TS tests for range mapping and parent-scoped override fast-update entry

• Adds Jest tests ensuring range overrides request the highest already-locked satisfying version (not the registry's highest) and that unsatisfied ranges bail before resolution. Adds a regression test showing parent-scoped overrides now reach the resolution step (instead of bailing early).

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

Documentation (2) +14 / -0
override-range-fast-update.mdDocument fast-update support for range-valued overrides +7/-0

Document fast-update support for range-valued overrides

• Adds a changeset noting that changing an override value to a semver range can now update the lockfile in place when a satisfying locked version exists, avoiding full graph re-resolution.

.changeset/override-range-fast-update.md

parent-scoped-overrides.mdDocument fast-update support for parent-scoped overrides +7/-0

Document fast-update support for parent-scoped overrides

• Adds a changeset describing in-place lockfile updates for parent-scoped selectors (parent>child) and clarifies that only the named parent's edge moves.

.changeset/parent-scoped-overrides.md

A parent-scoped override (parent>child) bailed to the resolver in both
stacks unless it was a removal. Measured what a full resolution does
with one: only the named parent's edge moves, the other dependents keep
the version they had, and the version left behind is pruned when
nothing reaches it any more.

That is expressible. The plan already inserts the new version alongside
the old and leaves reachability to the shared prune, so the old key
survives on its own whenever another dependent still points at it. What
was missing is that the repoint ignored the selector's parent and moved
every edge; it now consults the same predicate parent-scoped removals
already use, extracted so both share it. Importer edges keep the exit
removals take there, since a parent selector never names an importer.

Closes #13795.
@greptile-apps

greptile-apps Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (2): Last reviewed commit: "test: assert the parent-scoped rewrite, ..." | Re-trigger Greptile

greptile-apps[bot]
greptile-apps Bot previously approved these changes Aug 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pnpm/crates/package-manager/src/fast_update_overrides.rs (1)

545-552: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Honor the parent selector when rebuilding replacement dependencies.

Line 551 rewrites every matching old key in this path. For a parent>target override, parent_key can name the replacement package instead of parent. This can rewrite an unrelated target edge and violate the scoped-override contract.

Gate this assignment with should_replace_dependency(&name, Some(parent_key), &plan.overrides), as rewrite_snapshot_dependency_map already does.

Proposed fix
                 if let Some(old_key) = dep_ref.resolve(&name)
                     && let Some(new_key) = plan.replacements.get(&old_key)
+                    && should_replace_dependency(&name, Some(parent_key), &plan.overrides)
                 {
                     dep_ref = SnapshotDepRef::Plain(new_key.suffix.clone());
                 }

As per path instructions, pacquet and the TypeScript CLI must remain behaviorally identical for lockfile behavior.

🤖 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/package-manager/src/fast_update_overrides.rs` around lines 545 -
552, In the replacement-dependency rebuild around `SnapshotDepRef::resolve`,
guard the `dep_ref = SnapshotDepRef::Plain(...)` assignment with
`should_replace_dependency(&name, Some(parent_key), &plan.overrides)`, matching
`rewrite_snapshot_dependency_map`. Preserve unscoped replacement behavior while
preventing parent-scoped overrides from rewriting unrelated target edges, and
keep pacquet and the TypeScript CLI lockfile behavior identical.

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.

Inline comments:
In `@pnpm11/installing/deps-installer/test/install/overrideRangeFastUpdate.ts`:
- Around line 110-129: The test around tryFastUpdateOverrides must complete
successfully and assert the rewritten lockfile for parent-scoped overrides.
Replace the requestPackage rejection with successful resolution fixtures, then
verify parent uses [email protected], other remains on [email protected], and the old
target version is pruned when unreachable; cover both shared-dependent and
sole-dependent cases, and remove the historical assertion comment.

---

Outside diff comments:
In `@pnpm/crates/package-manager/src/fast_update_overrides.rs`:
- Around line 545-552: In the replacement-dependency rebuild around
`SnapshotDepRef::resolve`, guard the `dep_ref = SnapshotDepRef::Plain(...)`
assignment with `should_replace_dependency(&name, Some(parent_key),
&plan.overrides)`, matching `rewrite_snapshot_dependency_map`. Preserve unscoped
replacement behavior while preventing parent-scoped overrides from rewriting
unrelated target edges, and keep pacquet and the TypeScript CLI lockfile
behavior identical.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 76e1e357-b889-45fa-ab0c-c33148e611b4

📥 Commits

Reviewing files that changed from the base of the PR and between 7bed697 and 8931c79.

📒 Files selected for processing (8)
  • .changeset/override-range-fast-update.md
  • .changeset/parent-scoped-overrides.md
  • pnpm/crates/package-manager/src/fast_update_importers.rs
  • pnpm/crates/package-manager/src/fast_update_importers/tests.rs
  • pnpm/crates/package-manager/src/fast_update_overrides.rs
  • pnpm/crates/package-manager/src/fast_update_overrides/tests.rs
  • pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts
  • pnpm11/installing/deps-installer/test/install/overrideRangeFastUpdate.ts

@greptile-apps
greptile-apps Bot dismissed their stale review August 10, 2026 23:50

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

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

The TypeScript test stopped at the resolution step, so it proved only
that the parent-scoped form no longer bails — it never checked what the
rewrite produced, while the pacquet tests did. It now resolves through
a stub and asserts the same two outcomes: the named parent moves to the
new version while the other dependent stays put and both survive, and
the version left behind is pruned when nothing else holds it.
Copilot AI review requested due to automatic review settings August 10, 2026 23:52

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

PR Code Suggestions ✨

Warning

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

No code suggestions found for the PR.

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

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.00     12.5±0.14ms    29.9 MB/sec    1.07     13.4±1.47ms    28.0 MB/sec
packument/parse                                  1.04     41.7±0.36µs  1590.7 MB/sec    1.00     40.0±1.69µs  1660.1 MB/sec
tarball/download_dependency                      1.12      2.7±0.28ms  1608.2 KB/sec    1.00      2.4±0.13ms  1794.2 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.02    212.8±6.40ms 75.2 KElem/sec    1.00   208.1±19.60ms 76.9 KElem/sec
workspace_resolution/hoist_heavy                 1.00   306.8±18.25ms        ? ?/sec    1.01   310.3±47.24ms        ? ?/sec

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. rewriteReference has 4 params 📘 Rule violation ⚙ Maintainability
Description
rewriteReference was changed to accept four positional parameters, exceeding the 3-parameter
limit. This makes call sites harder to read and increases the chance of argument-order mistakes.
Code

pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts[R628-631]

function rewriteReference (
  alias: string,
  reference: string,
-  { changedNames, replacements }: RewriteContext
+  { changedNames, replacements, moves }: RewriteContext,
Relevance

●● Moderate

Mixed precedent: 4-parameter TS function refactors sometimes accepted, but also explicitly rejected
in similar fast-update code.

PR-#13464
PR-#13792

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713433 limits TypeScript functions to three parameters or fewer. The updated
rewriteReference signature includes four positional parameters (including the new
parentDepPath), exceeding that limit.

Rule 713433: Limit TypeScript functions to three parameters or fewer
pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts[628-633]

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

## Issue description
`rewriteReference` now takes four positional parameters (`alias`, `reference`, `rewriteContext`, `parentDepPath`), violating the 3-parameter limit.

## Issue Context
This was introduced when scoping replacements for `parent>child` overrides.

## Fix Focus Areas
- pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts[628-645]

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



Informational

2. Missing trailing commas in params 📘 Rule violation ⚙ Maintainability
Description
Multi-line TypeScript parameter lists were added/modified without trailing commas on the last
parameter. This causes inconsistent formatting and noisier diffs.
Code

pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts[R609-612]

+function overrideApplies (
+  alias: string,
+  parentDepPath: DepPath | undefined,
+  overrides: FastOverride[]
Relevance

● Weak

Trailing-comma-in-TS-params suggestions are often rejected; same file had this exact suggestion
rejected.

PR-#13792

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713434 requires trailing commas for multi-line TypeScript constructs. The modified
signatures for overrideApplies and rewriteReference have multi-line parameter lists where the
last parameter line does not end with a comma.

Rule 713434: Require trailing commas in TypeScript collections and multi-line constructs
pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts[609-613]
pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts[628-633]

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 parameter lists are missing trailing commas on the last parameter.

## Issue Context
This appears in newly introduced/modified helper signatures related to parent-scoped overrides.

## Fix Focus Areas
- pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts[609-613]
- pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts[628-633]

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


3. Test helpers declared too early 📘 Rule violation ⚙ Maintainability
Description
New top-level function declarations in the test file appear before their first usage, violating the
required declaration order. This reduces local readability by forcing readers to scroll past helpers
before seeing the test cases that use them.
Code

pnpm11/installing/deps-installer/test/install/overrideRangeFastUpdate.ts[R87-90]

+function makeSharedDependencyLockfile (): LockfileObject {
+  return {
+    lockfileVersion: LOCKFILE_VERSION,
+    importers: {
Relevance

● Weak

Very close precedent: same test file had “helpers declared too early” reorder suggestion rejected.

PR-#13792

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713432 requires that top-level TypeScript function declarations be declared only
after their first usage in the same file. makeSharedDependencyLockfile and parentScopedOpts are
declared earlier in the file, but their first usages occur later in the added tests.

Rule 713432: Declare TypeScript functions only after their first usage
pnpm11/installing/deps-installer/test/install/overrideRangeFastUpdate.ts[87-108]
pnpm11/installing/deps-installer/test/install/overrideRangeFastUpdate.ts[121-135]
pnpm11/installing/deps-installer/test/install/overrideRangeFastUpdate.ts[137-141]

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

## Issue description
Top-level function declarations should appear after their first usage within the same TypeScript file.

## Issue Context
The new parent-scoped override tests add helper functions that are only used later in the file.

## Fix Focus Areas
- pnpm11/installing/deps-installer/test/install/overrideRangeFastUpdate.ts[83-160]

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


4. Uncached parent scope checks 🐞 Bug ➹ Performance
Description
Parent-scoped move/removal checks are evaluated inside per-edge rewrite loops and repeatedly
re-evaluate the same parent selector (including parsing/evaluating a parent version range) for many
dependency edges, adding avoidable CPU work on large lockfiles. This is especially relevant when
overrides use parent@<range> > child selectors, because the range work is done repeatedly rather
than once per override.
Code

pnpm/crates/package-manager/src/fast_update_overrides.rs[R518-521]

+        Some(range) => parent_key
+            .suffix
+            .version_semver()
+            .is_some_and(|version| Range::parse(range).is_ok_and(|range| range.satisfies(version))),
Relevance

● Weak

Close precedent rejected memoizing Range::parse to avoid repeated semver parsing in hot loop.

PR-#13527

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The Rust parent applicability check parses the parent range inside override_applies_to(), and this
predicate is called from the dependency rewrite loops (rewrite_snapshot_dependency_map /
rewrite_importer_dependencies). The TS path similarly calls overrideApplies() from
rewriteReference() while rewriting dependency maps, and it parses the parent depPath plus runs a
semver range satisfaction check per edge.

pnpm/crates/package-manager/src/fast_update_overrides.rs[463-523]
pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts[578-645]

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

### Issue description
Parent-scoped override applicability is checked repeatedly during dependency rewrites. For selectors with a parent version range, the current code ends up re-parsing / re-evaluating the parent-range check many times across dependency edges.

### Issue Context
This impacts the fast lockfile rewrite path, which can touch a very large number of dependency edges in big workspaces.

### Fix Focus Areas
- pnpm/crates/package-manager/src/fast_update_overrides.rs[491-523]
- pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts[603-645]

### Suggested fix approach
- Pre-index overrides by `name` (target package) so edge checks don’t scan the full overrides list.
- Pre-parse the parent selector once per override:
 - Rust: store `PkgName` for `parent.name` and (optionally) a pre-parsed `Range` for `parent.bare_specifier` in `FastOverride` (or an internal compiled form), so `override_applies_to()` becomes mostly comparisons.
 - TS: cache a compiled `semver.Range` (or at least validate+memoize range parsing) per override, and avoid calling `dp.parse(parentDepPath)` more than once per edge when multiple overrides share the same parent check.
- Keep behavior identical; this should be a pure perf refactor.

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


Grey Divider

Context used
✅ Compliance rules (platform): 26 rules

Grey Divider

Tip of the day
💡 Did you know, you can group findings by type and pick your Finding display, from Minimal to Full

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

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.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.96970% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.23%. Comparing base (7bed697) to head (04ba1a0).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...rates/package-manager/src/fast_update_overrides.rs 96.96% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13797      +/-   ##
==========================================
- Coverage   88.23%   88.23%   -0.01%     
==========================================
  Files         624      624              
  Lines      101779   101798      +19     
==========================================
+ Hits        89809    89819      +10     
- Misses      11970    11979       +9     

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

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

@github-actions

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 04ba1a055b51

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.554 ± 0.174 2.344 2.783 1.71 ± 0.18
pacquet@main 2.494 ± 0.100 2.365 2.677 1.67 ± 0.16
pnpr@HEAD 1.633 ± 0.208 1.356 1.946 1.09 ± 0.17
pnpr@main 1.491 ± 0.125 1.364 1.711 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5543600944,
      "stddev": 0.17419670433355894,
      "median": 2.5235488055,
      "user": 1.7442681399999997,
      "system": 1.4103818199999998,
      "min": 2.3439924320000003,
      "max": 2.783331279,
      "times": [
        2.372167567,
        2.749211398,
        2.4527148480000003,
        2.7345591320000002,
        2.3439924320000003,
        2.370428131,
        2.690098546,
        2.783331279,
        2.459132553,
        2.587965058
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.4940958201,
      "stddev": 0.09952753805763632,
      "median": 2.4796953245,
      "user": 1.7938792399999997,
      "system": 1.3990373199999997,
      "min": 2.3646094460000002,
      "max": 2.677006244,
      "times": [
        2.5074309550000002,
        2.413428413,
        2.451959694,
        2.6173794150000003,
        2.677006244,
        2.553268568,
        2.509991165,
        2.4493003890000002,
        2.396583912,
        2.3646094460000002
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.6327352836000002,
      "stddev": 0.20838000849272403,
      "median": 1.642477101,
      "user": 1.20675314,
      "system": 1.1704952199999998,
      "min": 1.3561628860000001,
      "max": 1.9458710220000002,
      "times": [
        1.9458710220000002,
        1.4124851170000001,
        1.7232225650000002,
        1.7927662070000001,
        1.3561628860000001,
        1.858928181,
        1.394712575,
        1.538368844,
        1.7431038020000003,
        1.561731637
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.4914352358,
      "stddev": 0.12478599074657605,
      "median": 1.4357677945,
      "user": 1.1479911399999998,
      "system": 1.1698117199999998,
      "min": 1.363978257,
      "max": 1.7109457860000001,
      "times": [
        1.4108257990000002,
        1.3944548390000002,
        1.5314588750000002,
        1.418009104,
        1.453526485,
        1.3859506060000002,
        1.363978257,
        1.7109457860000001,
        1.676657783,
        1.568544824
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 278.3 ± 7.9 266.9 288.6 1.00
pacquet@main 279.7 ± 27.5 245.1 334.2 1.01 ± 0.10
pnpr@HEAD 318.8 ± 33.3 273.9 375.4 1.15 ± 0.12
pnpr@main 293.7 ± 17.3 270.5 321.5 1.06 ± 0.07
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.27831394789999997,
      "stddev": 0.007852197615230348,
      "median": 0.2768156465,
      "user": 0.23238437999999997,
      "system": 0.5510115,
      "min": 0.26685056700000004,
      "max": 0.288593064,
      "times": [
        0.27473970200000003,
        0.275373237,
        0.28648795600000004,
        0.26685056700000004,
        0.26786550000000003,
        0.288259545,
        0.281635766,
        0.288593064,
        0.275076086,
        0.27825805600000003
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.27973639060000005,
      "stddev": 0.02754149037342047,
      "median": 0.277912673,
      "user": 0.25912208,
      "system": 0.5261465999999999,
      "min": 0.245149472,
      "max": 0.33416517300000004,
      "times": [
        0.28506287,
        0.30774596800000004,
        0.27096753300000004,
        0.29551539800000004,
        0.284857813,
        0.25810198500000003,
        0.26427242900000003,
        0.245149472,
        0.251525265,
        0.33416517300000004
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.31882983630000006,
      "stddev": 0.03334828023791243,
      "median": 0.310960079,
      "user": 0.28978958,
      "system": 0.5824449999999999,
      "min": 0.27387912200000003,
      "max": 0.375389701,
      "times": [
        0.30478173000000003,
        0.301136236,
        0.317138428,
        0.375389701,
        0.37185987600000003,
        0.322887207,
        0.332767847,
        0.29885535500000004,
        0.27387912200000003,
        0.28960286100000004
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.2936646955,
      "stddev": 0.017285404064300142,
      "median": 0.2894240625,
      "user": 0.24342608000000004,
      "system": 0.5567388,
      "min": 0.27045383500000003,
      "max": 0.32153322500000003,
      "times": [
        0.27045383500000003,
        0.276114897,
        0.284541798,
        0.28710172300000003,
        0.299808954,
        0.302889892,
        0.282540875,
        0.31991535400000004,
        0.291746402,
        0.32153322500000003
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.686 ± 0.037 2.638 2.767 1.64 ± 0.15
pacquet@main 2.664 ± 0.041 2.614 2.743 1.63 ± 0.15
pnpr@HEAD 1.634 ± 0.144 1.459 1.870 1.00
pnpr@main 1.665 ± 0.104 1.552 1.869 1.02 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.6860237871200003,
      "stddev": 0.036761909718584326,
      "median": 2.6867202605200005,
      "user": 1.8028075600000002,
      "system": 1.50298618,
      "min": 2.63803509902,
      "max": 2.76694013002,
      "times": [
        2.7003537300200002,
        2.76694013002,
        2.6784148450200003,
        2.6795732200200004,
        2.69386730102,
        2.6534117310200003,
        2.69742750302,
        2.7039991750200003,
        2.63803509902,
        2.64821513702
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.6641573023200005,
      "stddev": 0.04064641248052928,
      "median": 2.66864434752,
      "user": 1.80812526,
      "system": 1.4298483800000001,
      "min": 2.61417427902,
      "max": 2.74318164702,
      "times": [
        2.74318164702,
        2.6862012940200004,
        2.6972238490200002,
        2.65217518302,
        2.6745792880200003,
        2.6163910500200003,
        2.66343757002,
        2.61417427902,
        2.67385112502,
        2.62035773802
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.63357369202,
      "stddev": 0.14447184887462874,
      "median": 1.6292684260199999,
      "user": 1.24704756,
      "system": 1.3443213799999998,
      "min": 1.45901001002,
      "max": 1.86995518202,
      "times": [
        1.82420145902,
        1.73661412302,
        1.6764846820200001,
        1.65260174902,
        1.60593510302,
        1.48145048302,
        1.86995518202,
        1.45901001002,
        1.50490899602,
        1.5245751330200001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.6650132295200002,
      "stddev": 0.10355553481010672,
      "median": 1.61659246152,
      "user": 1.38185346,
      "system": 1.44515868,
      "min": 1.55213426002,
      "max": 1.86881572602,
      "times": [
        1.55213426002,
        1.7419150840200002,
        1.61593384502,
        1.60776705102,
        1.86881572602,
        1.58131712202,
        1.66373944102,
        1.60364503002,
        1.61725107802,
        1.7976136580200002
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 506.3 ± 34.6 467.2 586.8 1.42 ± 0.11
pacquet@main 499.8 ± 13.0 475.6 516.4 1.40 ± 0.07
pnpr@HEAD 358.5 ± 8.7 342.7 374.3 1.00 ± 0.05
pnpr@main 356.8 ± 14.8 335.3 380.4 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.50631853484,
      "stddev": 0.03461894889249712,
      "median": 0.50822716964,
      "user": 0.68915668,
      "system": 0.8011041399999999,
      "min": 0.46715794814,
      "max": 0.58678369714,
      "times": [
        0.49087446314000005,
        0.46715794814,
        0.52959896114,
        0.50946814314,
        0.47151234614000004,
        0.58678369714,
        0.51212607414,
        0.50787893714,
        0.47920937614000003,
        0.5085754021400001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.49984494524,
      "stddev": 0.012953823649335137,
      "median": 0.50409498064,
      "user": 0.69871818,
      "system": 0.77313984,
      "min": 0.47562334614,
      "max": 0.51638477214,
      "times": [
        0.50535659414,
        0.49355968614,
        0.48892190414000003,
        0.48835883214000003,
        0.51638477214,
        0.50589553014,
        0.5060080421400001,
        0.50283336714,
        0.51550737814,
        0.47562334614
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.35851449734,
      "stddev": 0.00872947866097982,
      "median": 0.35890879464000003,
      "user": 0.26860158,
      "system": 0.6145335399999999,
      "min": 0.34274554614,
      "max": 0.37426175514000004,
      "times": [
        0.36218657514,
        0.34274554614,
        0.35531089214,
        0.35379115814,
        0.35960583814,
        0.35821175114000003,
        0.37426175514000004,
        0.36589647614000004,
        0.35025151514,
        0.36288346614
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.35675261523999996,
      "stddev": 0.014814332985546977,
      "median": 0.35830951514000003,
      "user": 0.27765578,
      "system": 0.60069954,
      "min": 0.33532084014,
      "max": 0.38037238414,
      "times": [
        0.34481314314,
        0.33959489714,
        0.33532084014,
        0.37601917914000005,
        0.34926463514,
        0.36071602214000004,
        0.35590300814000003,
        0.38037238414,
        0.36116027914000004,
        0.36436176414000004
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.849 ± 0.030 1.799 1.888 5.47 ± 0.15
pacquet@main 1.827 ± 0.025 1.786 1.864 5.41 ± 0.14
pnpr@HEAD 0.338 ± 0.007 0.325 0.347 1.00
pnpr@main 0.345 ± 0.016 0.321 0.364 1.02 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.8486658336200001,
      "stddev": 0.03038338933825285,
      "median": 1.8443127817200002,
      "user": 0.9679795599999999,
      "system": 0.8992142999999999,
      "min": 1.7991001477200002,
      "max": 1.8884528707200001,
      "times": [
        1.87892431072,
        1.8400155767200002,
        1.8876495367200001,
        1.84860998672,
        1.8341320947200002,
        1.83142247772,
        1.86230317872,
        1.8884528707200001,
        1.8160481557200001,
        1.7991001477200002
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.8272021063200001,
      "stddev": 0.02492986736562671,
      "median": 1.8226288102200001,
      "user": 0.97516196,
      "system": 0.9054871,
      "min": 1.78611461072,
      "max": 1.86408859372,
      "times": [
        1.85970264572,
        1.86408859372,
        1.81266844572,
        1.8498179137200002,
        1.8327603097200003,
        1.8138447717200001,
        1.81149826972,
        1.83141284872,
        1.78611461072,
        1.81011265372
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.33775176832000003,
      "stddev": 0.007058959512674958,
      "median": 0.33671521472,
      "user": 0.22769275999999997,
      "system": 0.6053336,
      "min": 0.32515339072,
      "max": 0.34669749972,
      "times": [
        0.34548404072,
        0.33324656972,
        0.34669749972,
        0.34565557572,
        0.33408872572000003,
        0.34187352472,
        0.32515339072,
        0.33638381472,
        0.33704661472,
        0.33188792672
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.34459641741999997,
      "stddev": 0.015886173494397055,
      "median": 0.34526672222,
      "user": 0.23666026,
      "system": 0.6270143999999999,
      "min": 0.32136270372000003,
      "max": 0.36442201872,
      "times": [
        0.35641542172,
        0.36442201872,
        0.35906979672,
        0.36334496772,
        0.34784807972000004,
        0.32136270372000003,
        0.33193227072000003,
        0.34268536472,
        0.32805135372,
        0.33083219672
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 245.5 ± 15.8 223.1 276.2 2.67 ± 0.18
pacquet@main 241.7 ± 11.0 229.0 260.8 2.63 ± 0.13
pnpr@HEAD 91.8 ± 1.7 87.6 95.3 1.00
pnpr@main 93.0 ± 2.7 88.5 99.9 1.01 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2454791817366667,
      "stddev": 0.015799552949004127,
      "median": 0.24064275382,
      "user": 0.2222940766666667,
      "system": 0.06327845666666666,
      "min": 0.22307417532,
      "max": 0.27620874532000006,
      "times": [
        0.23170100032000002,
        0.23473519032,
        0.24481710932,
        0.24243172132000002,
        0.23754144232000002,
        0.26122523532,
        0.27620874532000006,
        0.23885378632,
        0.24837880432,
        0.22307417532,
        0.23764127032000001,
        0.26914170032000007
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.2417246924109091,
      "stddev": 0.01098191418406938,
      "median": 0.23960205632,
      "user": 0.2122738418181818,
      "system": 0.06332635818181818,
      "min": 0.22898188332,
      "max": 0.26078835132000006,
      "times": [
        0.25309473632,
        0.24541501632,
        0.24642162432,
        0.23881419232,
        0.23119941432000002,
        0.22915308632,
        0.26078835132000006,
        0.23960205632,
        0.25350600132000006,
        0.23199525432,
        0.22898188332
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09184890902967743,
      "stddev": 0.0016658956876101656,
      "median": 0.09188370732,
      "user": 0.02311378903225806,
      "system": 0.011298264516129029,
      "min": 0.08762846432,
      "max": 0.09532023732,
      "times": [
        0.09060285232,
        0.09316816932,
        0.08985139632,
        0.09162884832,
        0.09186133532,
        0.09119413732,
        0.09296289232,
        0.09213254832,
        0.09532023732,
        0.09305201032,
        0.09121940532,
        0.09282452132,
        0.09087181032,
        0.09131047732,
        0.09236205932,
        0.09238455232,
        0.09188370732,
        0.09077906632,
        0.09499901232,
        0.08762846432,
        0.09311596032,
        0.09322850332,
        0.08835039632,
        0.09206602132,
        0.09154013032,
        0.09404675632,
        0.09047143532,
        0.09107697732,
        0.08997204332,
        0.09223143332,
        0.09317901932
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.0929520263533333,
      "stddev": 0.002733391169298659,
      "median": 0.09270632781999999,
      "user": 0.02304389333333333,
      "system": 0.011969188666666668,
      "min": 0.08846402032,
      "max": 0.09987380232,
      "times": [
        0.09325584532,
        0.08846402032,
        0.09373394632,
        0.09981440032,
        0.09179385832,
        0.09497144932,
        0.09411205932,
        0.09139136932,
        0.09333787932,
        0.09987380232,
        0.09353943932,
        0.09573766332,
        0.08867719132,
        0.09295251332,
        0.09079460532,
        0.09407324632,
        0.09509954132,
        0.09014311632,
        0.09234326432,
        0.09093104232,
        0.09120994832,
        0.09128996832,
        0.09186045332,
        0.09227486532,
        0.08967744832,
        0.09264541332,
        0.09098704732,
        0.09276724232,
        0.09339899532,
        0.09740915532
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 793.2 ± 187.0 623.4 1189.4 1.00
pacquet@main 824.2 ± 91.9 726.3 1030.5 1.04 ± 0.27
pnpm@HEAD 3410.2 ± 227.7 3029.1 3760.6 4.30 ± 1.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.7932404128755556,
      "stddev": 0.18695511212235583,
      "median": 0.71871015532,
      "user": 0.7624992711111109,
      "system": 0.11467857555555556,
      "min": 0.62337857632,
      "max": 1.18943490232,
      "times": [
        0.8867361623200001,
        1.18943490232,
        0.65428444732,
        0.94534773932,
        0.62337857632,
        0.71871015532,
        0.68547841032,
        0.80182213432,
        0.63397118832
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.8241572759866668,
      "stddev": 0.09192262645970174,
      "median": 0.8192950683200001,
      "user": 0.7882038266666666,
      "system": 0.11631079777777775,
      "min": 0.72626806432,
      "max": 1.03051027532,
      "times": [
        0.83487996332,
        0.7569632283200001,
        0.75780242032,
        0.8192950683200001,
        0.87859736732,
        0.72626806432,
        0.84392523732,
        0.76917385932,
        1.03051027532
      ]
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.410191807764444,
      "stddev": 0.22771369576071013,
      "median": 3.50169329832,
      "user": 5.1778317155555555,
      "system": 0.31596568666666663,
      "min": 3.02906368932,
      "max": 3.76059785932,
      "times": [
        3.21700796032,
        3.02906368932,
        3.2916046353199997,
        3.24457058832,
        3.76059785932,
        3.53406573332,
        3.50169329832,
        3.53004174632,
        3.58308075932
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.655 ± 0.154 4.537 4.952 1.31 ± 0.06
pacquet@main 4.655 ± 0.136 4.495 4.829 1.31 ± 0.05
pnpr@HEAD 3.604 ± 0.125 3.464 3.791 1.02 ± 0.05
pnpr@main 3.549 ± 0.104 3.464 3.817 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.6548104421600005,
      "stddev": 0.15438492791764727,
      "median": 4.5710563868600005,
      "user": 2.3749100800000003,
      "system": 1.7640214999999997,
      "min": 4.537461099360001,
      "max": 4.952269724360001,
      "times": [
        4.59768575036,
        4.855589123360001,
        4.56638910836,
        4.5529909473600005,
        4.80603956836,
        4.57572366536,
        4.537461099360001,
        4.56257263136,
        4.952269724360001,
        4.54138280336
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.654750686360001,
      "stddev": 0.13555180685835522,
      "median": 4.62341131536,
      "user": 2.26328568,
      "system": 1.6411003000000002,
      "min": 4.49469941136,
      "max": 4.829118488360001,
      "times": [
        4.50250359436,
        4.80361505736,
        4.7954395643600005,
        4.66808632536,
        4.49469941136,
        4.5496325863600005,
        4.5787363053600005,
        4.829118488360001,
        4.77919563936,
        4.546479891360001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.60385818226,
      "stddev": 0.12478129622611492,
      "median": 3.5688279068599997,
      "user": 1.3343822799999998,
      "system": 1.317903,
      "min": 3.4643055933599998,
      "max": 3.7911260053599998,
      "times": [
        3.7911260053599998,
        3.4745132373599996,
        3.5472030643599997,
        3.48487589336,
        3.59045274936,
        3.4643055933599998,
        3.75602566336,
        3.7316946933599997,
        3.5224717903599996,
        3.67591313236
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.54880048586,
      "stddev": 0.10370647987734036,
      "median": 3.51682207936,
      "user": 1.30924938,
      "system": 1.3674515,
      "min": 3.46361644436,
      "max": 3.8166677973599996,
      "times": [
        3.51580216636,
        3.5178419923599997,
        3.4956372503599997,
        3.47504486936,
        3.5383140353599996,
        3.49565893236,
        3.8166677973599996,
        3.6160114443599998,
        3.46361644436,
        3.55340992636
      ]
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13797
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,638.04 ms
(-0.88%)Baseline: 2,661.57 ms
3,193.89 ms
(82.60%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,799.10 ms
(+0.54%)Baseline: 1,789.46 ms
2,147.35 ms
(83.78%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
467.16 ms
(+4.72%)Baseline: 446.10 ms
535.33 ms
(87.27%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
223.07 ms
(-1.59%)Baseline: 226.68 ms
272.01 ms
(82.01%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,343.99 ms
(-2.89%)Baseline: 2,413.78 ms
2,896.53 ms
(80.92%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,537.46 ms
(+0.68%)Baseline: 4,506.85 ms
5,408.22 ms
(83.90%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
266.85 ms
(-7.04%)Baseline: 287.06 ms
344.47 ms
(77.47%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
623.38 ms
(-10.67%)Baseline: 697.85 ms
837.42 ms
(74.44%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13797
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,459.01 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
325.15 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
342.75 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
87.63 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,356.16 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,464.31 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
273.88 ms
🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan merged commit ac97bc1 into main Aug 11, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fast lockfile update: absorb parent-scoped overrides (parent>child)

3 participants