Skip to content

refactor(deps-restorer): split the frozen install into its subsystems - #13659

Merged
zkochan merged 1 commit into
mainfrom
split-frozen-install
Aug 5, 2026
Merged

zkochan merged 1 commit into
mainfrom
split-frozen-install

Conversation

@zkochan

@zkochan zkochan commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

Summary

install_frozen_lockfile.rs was 1830 lines, carrying two subsystems that share nothing with the frozen install beyond being reachable from it:

Module Concern Lines
hoisted the flat-node_modules linker, its hoist plan, and the runtime-major probes that feed it 654
build_phase running package build scripts once the tree is materialized 285

What remains is the frozen install itself — its inputs, error type, and output — at 930 lines.

Re-exports are explicit rather than glob, and split by the visibility each item already had (pub use for the public API, pub(crate) use for the two internal helpers), so the crate's public surface is unchanged and internal helpers stay internal.

Squash Commit Body

Split the 1830-line install_frozen_lockfile.rs into hoisted (the flat-node_modules linker and hoist plan) and build_phase (build-script execution), leaving the frozen install itself at 930 lines. Pure code motion; the crate's public surface is unchanged.

Checklist

  • Pure code motion — no behaviour change, verified mechanically by comparing every content line of the original against the union of the new modules (the only difference is one rustfmt-reflowed signature that gained a visibility prefix)
  • No changeset — internal refactor with no user-visible effect
  • cargo clippy --workspace --all-targets -D warnings, cargo doc --document-private-items -D warnings, and cargo dylint --all all clean
  • 3266 tests pass across deps-restorer, package-manager, and cli

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 frozen-lockfile installations by reliably running package build steps and linking executable binaries.
    • Improved dependency hoisting and workspace linking, including cleanup of stale duplicate links.
    • Added handling for patched dependencies, ignored scripts, dependency groups, and runtime Node.js versions.
    • Improved diagnostics for patch conflicts, build failures, and binary-linking errors.

`install_frozen_lockfile.rs` carried two subsystems that share nothing
with the frozen install beyond being reachable from it:

- `build_phase` — running package build scripts once the tree exists
- `hoisted` — the flat-`node_modules` linker, its hoist plan, and the
  runtime-major probes that feed it

Both move out, leaving the frozen install itself — its inputs, error
type, and output — at 930 lines rather than 1830.

Re-exports are explicit and split by the visibility each item already
had, so the crate's public surface is unchanged and internal helpers
stay internal.

Pure code motion: no behaviour change, verified by comparing every
content line of the original against the union of the new modules.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI lite review requested due to automatic review settings August 5, 2026 09:16

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 5, 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: e4739fe7-d30c-45d9-aeaa-748c2b535b21

📥 Commits

Reviewing files that changed from the base of the PR and between 29b6da6 and 80bd510.

📒 Files selected for processing (3)
  • pnpm/crates/deps-restorer/src/install_frozen_lockfile.rs
  • pnpm/crates/deps-restorer/src/install_frozen_lockfile/build_phase.rs
  • pnpm/crates/deps-restorer/src/install_frozen_lockfile/hoisted.rs

📝 Walkthrough

Walkthrough

The frozen lockfile installer now separates lifecycle execution and hoisted linking into build_phase and hoisted modules. It re-exports their APIs while retaining the installer entry point and custom-fetcher loader.

Changes

Frozen installer phases

Layer / File(s) Summary
Build phase and top-level bin linking
pnpm/crates/deps-restorer/src/install_frozen_lockfile.rs, pnpm/crates/deps-restorer/src/install_frozen_lockfile/build_phase.rs
The build phase resolves patches, runs lifecycle scripts, reports ignored scripts, skips linking for virtual-store-only installs, and links applicable top-level binaries.
Hoisted dependency materialization
pnpm/crates/deps-restorer/src/install_frozen_lockfile/hoisted.rs
The hoisted linker builds dependency graphs, materializes CAS-backed packages, links direct dependencies and workspace packages, updates package maps, and removes stale links.
Hoist planning and runtime detection
pnpm/crates/deps-restorer/src/install_frozen_lockfile/hoisted.rs
The installer computes isolated-install hoist plans, collects public hoist targets, and extracts Node runtime major versions from snapshots.

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

Possibly related issues

  • pnpm/pacquet#460: The PR extracts the hoisted-linker implementation targeted by this issue.

Possibly related PRs

  • pnpm/pnpm#13173: Modifies the same frozen-install build, hoisting, and linking paths.
  • pnpm/pnpm#13176: Covers the extracted lifecycle and workspace-hoisting implementations.
  • pnpm/pnpm#13177: Modifies the same build_phase and hoisted components.

Suggested labels: product: pacquet

Suggested reviewers: copilot

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

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

deps-restorer: split frozen install into hoisted + build-phase modules

✨ Enhancement 🕐 20-40 Minutes

Grey Divider

AI Description

• Split frozen install internals into dedicated hoisted and build_phase modules.
• Keep the public API stable via explicit re-exports (no glob exports).
• Pure code motion to reduce file size and improve subsystem isolation.
Diagram

graph TD
  L[("pnpm-lock.yaml")] --> I["InstallFrozenLockfile"] --> H["hoisted subsystem"] --> HL["hoisted linker"]
  I["InstallFrozenLockfile"] --> B["build phase"] --> BM["BuildModules"] --> TL["top-level bin link"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Keep one file, add region markers + internal modules
  • ➕ Avoids new files and re-export plumbing
  • ➕ Reduces churn for tools that track symbol locations
  • ➖ Still leaves a very large file with mixed concerns
  • ➖ Harder for reviewers to isolate hoisted/link/build responsibilities
2. Extract hoisted/build-phase into separate crate(s)
  • ➕ Strongest boundary; clearer ownership and compilation units
  • ➕ Potentially faster iteration/testing for subsystems
  • ➖ More invasive refactor (Cargo wiring, public API decisions)
  • ➖ Harder to keep error-code surfaces and visibility identical

Recommendation: The chosen approach (two internal submodules + explicit pub use/pub(crate) use) is the best tradeoff: it materially improves separability/readability while preserving the crate’s public surface and existing error-code behavior. A separate crate boundary would be overkill for what is primarily code organization.

Files changed (3) +953 / -914

Refactor (3) +953 / -914
install_frozen_lockfile.rsExtract build/hoisted subsystems behind explicit module re-exports +14/-914

Extract build/hoisted subsystems behind explicit module re-exports

• Introduces 'build_phase' and 'hoisted' submodules and re-exports their public API explicitly. Removes the inlined build-phase and hoisted-linker implementations from this file, leaving the frozen install orchestration, input/output types, and error mapping in place.

pnpm/crates/deps-restorer/src/install_frozen_lockfile.rs

build_phase.rsNew build-phase module for lifecycle scripts + post-build bin linking +285/-0

New build-phase module for lifecycle scripts + post-build bin linking

• Moves the build-phase subsystem into its own module, including 'BuildPhaseInputs', 'BuildPhaseError', patch resolution, and 'run_build_phase'. Keeps behavior and error surfaces consistent by preserving the same types and transparent diagnostics.

pnpm/crates/deps-restorer/src/install_frozen_lockfile/build_phase.rs

hoisted.rsNew hoisted-linker module for hoist planning and materialization helpers +654/-0

New hoisted-linker module for hoist planning and materialization helpers

• Moves the hoisted node-linker subsystem into its own module, including hoisted linker inputs/outputs/errors, the hoisted materialization entrypoint, hoist-plan computation, public-hoist target collection, and runtime-major helpers. Retains internal helper visibility via 'pub(crate)' where applicable.

pnpm/crates/deps-restorer/src/install_frozen_lockfile/hoisted.rs

@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge because the subsystem split preserves the existing API and executable behavior.

The extracted build-phase and hoisted-linker implementations remain reachable through the same public paths, and no omitted, duplicated, or behavior-changing executable code was found.

Reviews (1): Last reviewed commit: "refactor(deps-restorer): split the froze..." | Re-trigger Greptile

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Informational

1. Unneeded pub(crate) helpers 🐞 Bug ⚙ Maintainability
Description
link_selected_hoisted_direct_dependencies and exclude_importer_groups are now pub(crate) in
install_frozen_lockfile/hoisted.rs even though all call sites are within the same module,
unnecessarily widening crate-internal visibility. This slightly weakens encapsulation and increases
the chance of other modules taking unintended dependencies on these helpers.
Code

pnpm/crates/deps-restorer/src/install_frozen_lockfile/hoisted.rs[R285-290]

+pub(crate) fn link_selected_hoisted_direct_dependencies(
+    config: &Config,
+    lockfile_dir: &Path,
+    project_manifests: &[(PathBuf, &pacquet_package_manifest::PackageManifest)],
+    direct_dependencies_by_importer_id: &crate::DirectDependenciesByImporterId,
+) -> Result<(), HoistedLinkerError> {
Relevance

●●● Strong

Team has accepted tightening visibility of internal helpers before; making these module-private is
low-risk encapsulation.

PR-#13141

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Both functions are declared pub(crate) but are only invoked from within run_hoisted_linker in
the same module, so module-private fn visibility is sufficient.

pnpm/crates/deps-restorer/src/install_frozen_lockfile/hoisted.rs[143-149]
pnpm/crates/deps-restorer/src/install_frozen_lockfile/hoisted.rs[211-216]
pnpm/crates/deps-restorer/src/install_frozen_lockfile/hoisted.rs[285-296]
pnpm/crates/deps-restorer/src/install_frozen_lockfile/hoisted.rs[402-418]

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

### Issue description
Two helper functions in `install_frozen_lockfile/hoisted.rs` are declared `pub(crate)` but are only used within the same module. Keeping them private (or at most `pub(super)` if the parent module needs access) preserves encapsulation and reduces accidental internal coupling.

### Issue Context
This PR is a refactor splitting a large module; during the split, these helpers became more visible than necessary.

### Fix Focus Areas
- pnpm/crates/deps-restorer/src/install_frozen_lockfile/hoisted.rs[285-290]
- pnpm/crates/deps-restorer/src/install_frozen_lockfile/hoisted.rs[402-406]

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


2. predates this rule comment 📘 Rule violation ⚙ Maintainability
Description
The newly added comment/doc comment uses historical framing (e.g., predates, had lost, `legacy
in-place block`) instead of describing the current behavior, invariants, and intent, which can
mislead readers and become stale after refactors. This violates the requirement that source comments
focus only on present behavior/contract rather than past implementations.
Code

pnpm/crates/deps-restorer/src/install_frozen_lockfile/hoisted.rs[R327-330]

+                // An install that predates this rule, or one where the
+                // version had lost the slot, leaves a link here. Left in
+                // place it keeps shadowing the root copy, which is the
+                // duplicate this skip exists to avoid. A real directory is
Relevance

● Weak

Exact same “predates this rule” comment rewrite request was previously rejected in this code area.

PR-#13306

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 772199 forbids historical phrasing and references to prior implementations in
source comments. The cited additions in hoisted.rs include explicit time-based/previous-state
language such as predates this rule and had lost the slot, and also label an implementation
detail as legacy in-place block, all of which document past arrangements rather than stating the
current invariant/contract the code enforces.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/crates/deps-restorer/src/install_frozen_lockfile/hoisted.rs[327-332]
pnpm/crates/deps-restorer/src/install_frozen_lockfile/hoisted.rs[433-438]

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

## Issue description
Comments were introduced that describe behavior using historical/legacy language (e.g., `predates`, `had lost`, `legacy in-place block`) rather than stating the current behavior, invariants, and intent, which is disallowed because it can become stale and mislead readers.

## Issue Context
PR Compliance ID 772199 requires inline documentation to be phrased in terms of the current code’s guarantees and relationships, avoiding references to prior states or past implementations; update the comments to describe the present-day contract/rationale without time-based framing.

## Fix Focus Areas
- pnpm/crates/deps-restorer/src/install_frozen_lockfile/hoisted.rs[327-332]
- pnpm/crates/deps-restorer/src/install_frozen_lockfile/hoisted.rs[433-438]

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


Grey Divider

Context used
✅ Compliance rules (platform): 24 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.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.00     14.1±1.00ms    26.6 MB/sec    1.05     14.8±0.53ms    25.3 MB/sec
packument/parse                                  1.00     38.5±0.53µs  1723.6 MB/sec    1.06     40.8±0.79µs  1624.6 MB/sec
tarball/download_dependency                      1.04      2.6±0.20ms  1686.8 KB/sec    1.00      2.5±0.19ms  1746.7 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.03   213.7±17.31ms 74.9 KElem/sec    1.00   207.2±14.64ms 77.2 KElem/sec
workspace_resolution/hoist_heavy                 1.00   269.1±11.13ms        ? ?/sec    1.20    324.1±8.90ms        ? ?/sec

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.19101% with 57 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.06%. Comparing base (29b6da6) to head (80bd510).

Files with missing lines Patch % Lines
...ps-restorer/src/install_frozen_lockfile/hoisted.rs 83.28% 55 Missing ⚠️
...estorer/src/install_frozen_lockfile/build_phase.rs 98.27% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13659      +/-   ##
==========================================
- Coverage   88.07%   88.06%   -0.01%     
==========================================
  Files         596      598       +2     
  Lines       98812    98815       +3     
==========================================
- Hits        87026    87023       -3     
- Misses      11786    11792       +6     

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

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

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 80bd5108fd2a

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.632 ± 0.151 2.469 2.949 1.70 ± 0.23
pacquet@main 2.595 ± 0.209 2.382 2.916 1.67 ± 0.24
pnpr@HEAD 1.573 ± 0.186 1.358 1.820 1.01 ± 0.17
pnpr@main 1.553 ± 0.186 1.359 1.850 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.6322107025600006,
      "stddev": 0.15066047385963993,
      "median": 2.6093163017600003,
      "user": 2.23664236,
      "system": 1.7225598799999997,
      "min": 2.4685903757600003,
      "max": 2.94872480176,
      "times": [
        2.72627178876,
        2.7610057567600004,
        2.5805000017600004,
        2.4685903757600003,
        2.94872480176,
        2.63813260176,
        2.5097620777600005,
        2.52599330376,
        2.6758593697600004,
        2.4872669477600002
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.5949490390600003,
      "stddev": 0.20926641053135822,
      "median": 2.4936075782600002,
      "user": 1.9193730600000003,
      "system": 1.49803858,
      "min": 2.38233756976,
      "max": 2.9157599027600005,
      "times": [
        2.81657271676,
        2.7561699867600002,
        2.45856607976,
        2.4694197417600003,
        2.83025408776,
        2.9157599027600005,
        2.51779541476,
        2.39067301776,
        2.4119418727600004,
        2.38233756976
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.57257113156,
      "stddev": 0.1857724860225065,
      "median": 1.54098659826,
      "user": 1.19042136,
      "system": 1.2485448799999999,
      "min": 1.35829404376,
      "max": 1.82045779976,
      "times": [
        1.60388897776,
        1.82045779976,
        1.37692001976,
        1.76767922476,
        1.81716382076,
        1.66330211976,
        1.47808421876,
        1.35829404376,
        1.45422051276,
        1.38570057776
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.5527443745600003,
      "stddev": 0.1861240042181152,
      "median": 1.51602799076,
      "user": 1.18148316,
      "system": 1.2252517799999998,
      "min": 1.35894793876,
      "max": 1.8503542747600001,
      "times": [
        1.47981375376,
        1.75238319476,
        1.35894793876,
        1.38238927576,
        1.37632151976,
        1.8503542747600001,
        1.36970429676,
        1.55224222776,
        1.73335746476,
        1.6719297987600001
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 291.9 ± 12.0 272.3 306.8 1.06 ± 0.07
pacquet@main 275.6 ± 14.4 259.4 302.6 1.00
pnpr@HEAD 293.7 ± 12.6 270.0 312.4 1.07 ± 0.07
pnpr@main 331.1 ± 31.1 294.3 393.4 1.20 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.29189430278000006,
      "stddev": 0.011959503738399728,
      "median": 0.29423890128,
      "user": 0.22759685999999996,
      "system": 0.5830469,
      "min": 0.27234241628,
      "max": 0.30680227628,
      "times": [
        0.28044039428,
        0.27234241628,
        0.29659078628,
        0.30171406028000003,
        0.30680227628,
        0.30287407928,
        0.29188701628,
        0.27965701528,
        0.30222561528,
        0.28440936828
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.27557862428,
      "stddev": 0.014433444630017056,
      "median": 0.27007575078,
      "user": 0.22192985999999992,
      "system": 0.5608891,
      "min": 0.25944129828,
      "max": 0.30255586828000003,
      "times": [
        0.26991441128,
        0.27572635428000003,
        0.25944129828,
        0.28353274228,
        0.27021815428,
        0.30255586828000003,
        0.26993334728,
        0.26295417128,
        0.26466470928,
        0.29684518628
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29373770017999995,
      "stddev": 0.012584437640949171,
      "median": 0.29533262628,
      "user": 0.23396925999999998,
      "system": 0.5574023,
      "min": 0.27002097328,
      "max": 0.31240035528,
      "times": [
        0.29031197228,
        0.30351786528,
        0.31240035528,
        0.30262275628,
        0.30130073928,
        0.30035328028,
        0.28793840028,
        0.28771732328,
        0.27002097328,
        0.28119333628
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.33110858628,
      "stddev": 0.03105320001244122,
      "median": 0.32426853728000005,
      "user": 0.26734056,
      "system": 0.620335,
      "min": 0.29429101428,
      "max": 0.39339849028,
      "times": [
        0.31591239528,
        0.31816454828,
        0.32362525728,
        0.33328216028,
        0.39339849028,
        0.37494982828,
        0.33335489728,
        0.32491181728,
        0.29429101428,
        0.29919545428
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.869 ± 0.135 2.683 3.083 1.80 ± 0.16
pacquet@main 2.667 ± 0.027 2.646 2.739 1.67 ± 0.12
pnpr@HEAD 1.593 ± 0.117 1.477 1.840 1.00
pnpr@main 1.751 ± 0.183 1.467 1.976 1.10 ± 0.14
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.8693042725,
      "stddev": 0.13458763346847302,
      "median": 2.8740271330000002,
      "user": 2.1209886399999998,
      "system": 1.7985679799999996,
      "min": 2.6834372555,
      "max": 3.0826435324999997,
      "times": [
        2.7986825695,
        2.9178406295,
        2.6834372555,
        2.7037207905,
        2.7661071314999996,
        2.8302136365,
        2.9287209224999997,
        3.0826435324999997,
        2.9524052185,
        3.0292710384999997
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.6669762742,
      "stddev": 0.02743739536242991,
      "median": 2.659036375,
      "user": 1.67117164,
      "system": 1.44867528,
      "min": 2.6460701204999997,
      "max": 2.7390930635,
      "times": [
        2.6555779305,
        2.6465303194999996,
        2.6696906444999997,
        2.7390930635,
        2.6755188185,
        2.6543598404999997,
        2.6492964115,
        2.6624948195,
        2.6460701204999997,
        2.6711307735
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.593210468,
      "stddev": 0.11731218014485431,
      "median": 1.5627729755000002,
      "user": 1.18988894,
      "system": 1.22933918,
      "min": 1.4774866245,
      "max": 1.8397432775,
      "times": [
        1.5550613215,
        1.7338972655000002,
        1.5704846295000001,
        1.5735568105000002,
        1.4774866245,
        1.5435752555000002,
        1.6568786175,
        1.4886815785,
        1.4927392995000002,
        1.8397432775
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.7506978977999998,
      "stddev": 0.18289060313963154,
      "median": 1.7681589895,
      "user": 1.36691584,
      "system": 1.4785320800000001,
      "min": 1.4672558585,
      "max": 1.9764797195000001,
      "times": [
        1.5259774515,
        1.4672558585,
        1.6155956375,
        1.8691863435000002,
        1.9764797195000001,
        1.7005366315000001,
        1.8357813475,
        1.9043074915000002,
        1.9600075805000001,
        1.6518509165000002
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 623.9 ± 41.5 533.1 672.6 1.52 ± 0.14
pacquet@main 550.4 ± 59.8 467.0 671.6 1.34 ± 0.17
pnpr@HEAD 409.5 ± 25.6 375.9 449.1 1.00
pnpr@main 422.6 ± 39.5 371.5 477.9 1.03 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.62393780438,
      "stddev": 0.041537609332489345,
      "median": 0.63683469108,
      "user": 0.8778638800000002,
      "system": 0.9475824599999999,
      "min": 0.53313265708,
      "max": 0.67262464108,
      "times": [
        0.64565723708,
        0.6371418210800001,
        0.57402928708,
        0.53313265708,
        0.67262464108,
        0.62210878908,
        0.63812757208,
        0.61885609808,
        0.63652756108,
        0.66117238008
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.55041580818,
      "stddev": 0.05975631687894652,
      "median": 0.53804361308,
      "user": 0.77362808,
      "system": 0.8444844600000001,
      "min": 0.46703824908,
      "max": 0.67164393308,
      "times": [
        0.5394343580800001,
        0.51026206308,
        0.53665286808,
        0.6258370320800001,
        0.67164393308,
        0.55944971708,
        0.56416359608,
        0.52101999408,
        0.50865627108,
        0.46703824908
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.40954699998,
      "stddev": 0.025606445618877,
      "median": 0.40623101858,
      "user": 0.32095938000000007,
      "system": 0.65252046,
      "min": 0.37585538108,
      "max": 0.44913423708,
      "times": [
        0.40024732208,
        0.42094286408000003,
        0.38648550008,
        0.37585538108,
        0.41221471508,
        0.38765240408,
        0.43125492108,
        0.44242884808,
        0.44913423708,
        0.38925380708
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.42261590228,
      "stddev": 0.039489497777722975,
      "median": 0.42156667658,
      "user": 0.32297118,
      "system": 0.6881125599999999,
      "min": 0.37147765608,
      "max": 0.47793550208,
      "times": [
        0.47793550208,
        0.47784963008000003,
        0.38962134108,
        0.41253979908,
        0.37147765608,
        0.37503653508,
        0.43059355408,
        0.39774722208,
        0.44937395008000003,
        0.44398383308
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.079 ± 0.065 1.977 2.186 5.38 ± 0.40
pacquet@main 2.040 ± 0.055 1.939 2.121 5.27 ± 0.39
pnpr@HEAD 0.423 ± 0.028 0.387 0.474 1.09 ± 0.10
pnpr@main 0.387 ± 0.026 0.341 0.436 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.079499139,
      "stddev": 0.06514765482765475,
      "median": 2.0593115528,
      "user": 1.3174806399999999,
      "system": 1.1434508599999997,
      "min": 1.9772520893,
      "max": 2.1856381703000003,
      "times": [
        2.0521488893,
        2.0861074623,
        2.0305932853,
        2.1544873993,
        2.0598699463,
        2.0587531593,
        2.1856381703000003,
        2.1515091173000003,
        2.0386318713000002,
        1.9772520893
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.0395641315000006,
      "stddev": 0.05525079158207924,
      "median": 2.0370800018,
      "user": 1.2705244399999998,
      "system": 1.11153216,
      "min": 1.9385775153,
      "max": 2.1207640223,
      "times": [
        2.0290673643000003,
        1.9385775153,
        2.0138897393,
        2.0450926393,
        2.0521122113000003,
        2.0892227843,
        2.0037182863000003,
        1.9982870122999998,
        2.1207640223,
        2.1049097403
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.4226570981000001,
      "stddev": 0.027514601586771485,
      "median": 0.41843946230000006,
      "user": 0.30359443999999997,
      "system": 0.7125788599999999,
      "min": 0.38695408030000006,
      "max": 0.47424790530000005,
      "times": [
        0.42778854330000005,
        0.46239877530000006,
        0.41429903630000003,
        0.41622903930000005,
        0.47424790530000005,
        0.41200007530000005,
        0.42162000630000007,
        0.4206498853,
        0.38695408030000006,
        0.39038363430000006
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.38683382590000004,
      "stddev": 0.02627643645296212,
      "median": 0.38859124030000003,
      "user": 0.26032674,
      "system": 0.66853446,
      "min": 0.3414111913,
      "max": 0.4362417813000001,
      "times": [
        0.4362417813000001,
        0.4006600363000001,
        0.40711254830000004,
        0.36681254330000007,
        0.38999774530000003,
        0.38407878130000006,
        0.3871847353,
        0.39341118030000005,
        0.36142771630000003,
        0.3414111913
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 198.2 ± 13.5 188.4 239.8 2.04 ± 0.17
pacquet@main 206.1 ± 24.8 176.0 265.5 2.12 ± 0.28
pnpr@HEAD 103.3 ± 9.0 91.6 130.6 1.06 ± 0.11
pnpr@main 97.3 ± 4.9 86.1 108.2 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.19818828862666663,
      "stddev": 0.013491826681360215,
      "median": 0.19546669245999998,
      "user": 0.18352791999999998,
      "system": 0.07801846666666666,
      "min": 0.18843212646,
      "max": 0.23979933446,
      "times": [
        0.23979933446,
        0.19591140646,
        0.19442723546,
        0.19276261146,
        0.18958233746,
        0.19535170046,
        0.20095603046,
        0.19593802646,
        0.19382586946,
        0.18843212646,
        0.19558168446,
        0.19569110046
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.20610364703142858,
      "stddev": 0.024791229785891038,
      "median": 0.19712670146,
      "user": 0.19274899142857144,
      "system": 0.07305265714285714,
      "min": 0.17601811946,
      "max": 0.26549025746000005,
      "times": [
        0.19911983446,
        0.18995573246,
        0.22580065546,
        0.19492122746,
        0.21906771446,
        0.26549025746000005,
        0.20255994946,
        0.18599991446,
        0.17601811946,
        0.19413546346,
        0.20135885146,
        0.19513356846,
        0.24608828746,
        0.18980148246
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.1032501837180645,
      "stddev": 0.008954722655407076,
      "median": 0.10191995646,
      "user": 0.026239565161290317,
      "system": 0.016962654838709675,
      "min": 0.09156433446000001,
      "max": 0.13058352046,
      "times": [
        0.09159052546,
        0.09620941446,
        0.09156433446000001,
        0.09960894346,
        0.10090339846,
        0.10948394746000001,
        0.10549874346,
        0.10958806346000001,
        0.10431781346,
        0.10224464946,
        0.09630162846000001,
        0.09984458846000001,
        0.10592346446,
        0.10136804346,
        0.09664662046000001,
        0.11510611046000001,
        0.10606472046000001,
        0.10191995646,
        0.10947802546,
        0.10678432046000001,
        0.11848685346000001,
        0.11501439746000001,
        0.13058352046,
        0.10511317446000001,
        0.11007502246,
        0.10048295246000001,
        0.10150295946000001,
        0.09259859846000001,
        0.09308896246000001,
        0.09166227046000001,
        0.09169967146
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.0972994768048276,
      "stddev": 0.0048976958278798615,
      "median": 0.09708707246,
      "user": 0.023627782068965517,
      "system": 0.015196048275862066,
      "min": 0.08613269046000001,
      "max": 0.10821237646000001,
      "times": [
        0.09666851146000001,
        0.09810347146000001,
        0.09885826646000001,
        0.09530651046000001,
        0.09442681046000001,
        0.08964524146000001,
        0.08613269046000001,
        0.10821237646000001,
        0.09230681646000001,
        0.09156169046000001,
        0.10189903646000001,
        0.10124843846,
        0.10566734146000001,
        0.09524767946000001,
        0.09787664346000001,
        0.10130831146000001,
        0.09447328746000001,
        0.09778446846000001,
        0.09393499046,
        0.09368140246000001,
        0.09708707246,
        0.09600675246000001,
        0.09972575346000001,
        0.09277788646000001,
        0.10618721246000001,
        0.09781581846000001,
        0.10254964446,
        0.09817030646000001,
        0.09702039546
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.135 ± 0.233 0.849 1.566 1.05 ± 0.26
pacquet@main 1.086 ± 0.147 0.876 1.318 1.00
pnpm@HEAD 4.318 ± 0.588 3.731 5.263 3.98 ± 0.76
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.1354107515533336,
      "stddev": 0.2328965120339256,
      "median": 1.10575528722,
      "user": 1.0623636799999998,
      "system": 0.2352275533333333,
      "min": 0.84896267822,
      "max": 1.5661349272200003,
      "times": [
        0.84896267822,
        1.5661349272200003,
        1.11356388822,
        1.10575528722,
        1.0113680092200001,
        0.92094229122,
        1.43456429922,
        1.02904427122,
        1.18836111222
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.0861570353311112,
      "stddev": 0.14703210040533898,
      "median": 1.05431331822,
      "user": 1.024079791111111,
      "system": 0.19992955333333332,
      "min": 0.8763157392200001,
      "max": 1.31819211522,
      "times": [
        1.16015668322,
        1.03383040622,
        0.8763157392200001,
        1.05431331822,
        1.31819211522,
        0.89067853422,
        1.16402069922,
        1.22838559722,
        1.04952022522
      ]
    },
    {
      "command": "pnpm@HEAD",
      "mean": 4.3181726559977776,
      "stddev": 0.5877335900273787,
      "median": 4.23376189022,
      "user": 6.661326902222222,
      "system": 0.4109761088888889,
      "min": 3.73121044622,
      "max": 5.26258808522,
      "times": [
        3.84525847022,
        3.73121044622,
        3.81630635122,
        4.23376189022,
        3.91848502822,
        4.2343176082200005,
        4.61489816022,
        5.26258808522,
        5.20672786422
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.859 ± 0.170 4.668 5.168 1.34 ± 0.07
pacquet@main 4.816 ± 0.142 4.611 5.003 1.33 ± 0.07
pnpr@HEAD 3.728 ± 0.141 3.576 4.012 1.03 ± 0.06
pnpr@main 3.629 ± 0.150 3.472 3.976 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.85911643306,
      "stddev": 0.16997815345070338,
      "median": 4.82546505926,
      "user": 2.81585876,
      "system": 2.0098122800000002,
      "min": 4.6675379887599995,
      "max": 5.167659875759999,
      "times": [
        4.9506285947599995,
        4.686271596759999,
        5.167659875759999,
        4.726354188759999,
        4.76187530176,
        4.79648350876,
        4.87900502476,
        5.100901640759999,
        4.85444660976,
        4.6675379887599995
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.816160765459999,
      "stddev": 0.14160390448569488,
      "median": 4.8458726172599995,
      "user": 2.7434347599999995,
      "system": 2.1160218799999995,
      "min": 4.61085645676,
      "max": 5.002556140759999,
      "times": [
        4.61085645676,
        4.65594791776,
        5.002556140759999,
        4.9182460697599995,
        4.88037355776,
        4.91557576676,
        4.721958540759999,
        4.811371676759999,
        4.67319335576,
        4.971528171759999
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.72827309826,
      "stddev": 0.14137091471534405,
      "median": 3.68947760026,
      "user": 1.67269936,
      "system": 1.6746706799999997,
      "min": 3.57623858576,
      "max": 4.012486494759999,
      "times": [
        3.94812419276,
        4.012486494759999,
        3.67428603476,
        3.71674946276,
        3.6751017847600003,
        3.72507761576,
        3.57623858576,
        3.62461367576,
        3.62619971976,
        3.70385341576
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.6290463003599998,
      "stddev": 0.1497698746399139,
      "median": 3.58144382876,
      "user": 1.62122386,
      "system": 1.55622098,
      "min": 3.47229928676,
      "max": 3.9757937607600002,
      "times": [
        3.70791674576,
        3.74917854676,
        3.58541996076,
        3.56243259176,
        3.9757937607600002,
        3.6238012517600002,
        3.57746769676,
        3.55526759576,
        3.48088556676,
        3.47229928676
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13659
Testbedpacquet

🚨 2 Alerts

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
isolated-linker.fresh-install.hot-cache.hot-storeLatency
milliseconds (ms)
📈 plot
🚷 threshold
🚨 alert (🔔)
533.13 ms
(+20.45%)Baseline: 442.62 ms
531.15 ms
(100.37%)

isolated-linker.peer-heavy-resolve.hot-cache.offlineLatency
milliseconds (ms)
📈 plot
🚷 threshold
🚨 alert (🔔)
848.96 ms
(+24.42%)Baseline: 682.36 ms
818.84 ms
(103.68%)

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,683.44 ms
(+0.29%)Baseline: 2,675.80 ms
3,210.96 ms
(83.57%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,977.25 ms
(+9.71%)Baseline: 1,802.23 ms
2,162.67 ms
(91.43%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
🚨 view alert (🔔)
533.13 ms
(+20.45%)Baseline: 442.62 ms
531.15 ms
(100.37%)

isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
188.43 ms
(-7.68%)Baseline: 204.10 ms
244.92 ms
(76.94%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,468.59 ms
(+2.14%)Baseline: 2,416.77 ms
2,900.12 ms
(85.12%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,667.54 ms
(+4.10%)Baseline: 4,483.79 ms
5,380.55 ms
(86.75%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
272.34 ms
(-2.91%)Baseline: 280.51 ms
336.62 ms
(80.91%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
🚨 view alert (🔔)
848.96 ms
(+24.42%)Baseline: 682.36 ms
818.84 ms
(103.68%)

🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan merged commit a92dc94 into main Aug 5, 2026
34 of 35 checks passed
@zkochan
zkochan deleted the split-frozen-install branch August 5, 2026 09:55
KSXGitHub pushed a commit that referenced this pull request Aug 6, 2026
Picks up sixteen commits, most of them module splits: the optimistic
repeat-install check (#13661), the frozen install and its build
phase (#13659, #13662), `create_virtual_store`
(#13649), the tarball crate root (#13652), and the
audit command (#13657). Also the move to the `rc` lane and
pacquet 12.0.0-rc.0 (#13666, #13667).

#13661 split `optimistic_repeat_install.rs` into per-concern
modules, moving one of this branch's two `build_workspace_state::<Host>`
call sites into the new `deps_status.rs`. The turbofish is re-applied at
both of its new homes.

# Conflicts:
#	pnpm/crates/package-manager/src/optimistic_repeat_install.rs
@coderabbitai coderabbitai Bot mentioned this pull request Aug 20, 2026
4 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants