Skip to content

test(pacquet): complete the patchedDependencies port (stage 4) - #13149

Merged
zkochan merged 2 commits into
mainfrom
stage-4
Jul 19, 2026
Merged

zkochan merged 2 commits into
mainfrom
stage-4

Conversation

@zkochan

@zkochan zkochan commented Jul 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Stage 4 of #13146 — patching completion. Ports every remaining item in the plan's Support patchedDependencies section, plus the four patch entries cross-referenced from Support Side-Effects Cache and the four from the hoisted node linker section: patch.ts :297, :386, :269, :475, :508, :530, :552, and the side-effects / frozen-hoisted tails of :24 and :120. deps-restorer/test/index.ts:848 becomes a known_failures stub — enableModulesDir: false is not a pacquet config setting (the NAPI binding accepts it and aliases it onto the lockfile-only path, but pacquet_config::Config has no such field, so the CLI can't express it).

The four full install scenarios (:24, :120, :297, :386) share one helper that ports the whole upstream shape rather than the abridged version that was there before: patched file on disk, lockfile patchedDependencies entry and (patch_hash=…) snapshot key, the ;patch=<hash> side-effects-cache row whose cached index.js digest differs from the pristine one, the frozen reinstall, the frozen hoisted reinstall, and the offline unpatched-sibling project. Like upstream it pins packageImportMethod: hardlink — that turned out to be load-bearing, not incidental: under the default auto a copy-on-write filesystem reflinks, and a patch that mutates the shared store inode goes undetected.

The hoisted ports surfaced a pacquet-only bug, fixed here. BuildModules resolved a single pkgRoot per snapshot, so under nodeLinker: hoisted a package the walker nests under several consumers (a version conflict keeps it out of the root) was patched at only one of them — every other copy silently ran the code the patch existed to replace. A cache-warm reinstall had the same gap on the side-effects overlay re-import. Reproduced with [email protected] + [email protected] both needing [email protected] while the root pins [email protected]: pacquet patched finalhandler's copy only, while TypeScript pnpm 11.13.1 patches both — so this is a pacquet-side parity fix, no TS change needed. pkg_roots_by_key now carries every location; the head still runs lifecycle scripts and seeds the cache (contents are identical across copies), while patch application and overlay re-imports walk the list.

Every port was verified to catch its regression by temporarily breaking the implementation and confirming the expected tests failed for the expected reason — skipping patch application (all 9 fail), dropping the patched-only cache-write gate (exactly the 4 scenario tests fail), renaming the ;patch= key segment (same 4), disabling the patch-mtime invalidation (only the modified-patch test), replacing the temp+rename write with a truncating one (only the sibling check, and only once hardlink was pinned), and reverting the multi-location fix (only the new hoisted test). All breakages reverted with git restore.

Verification: pacquet-cli::patch 46/46, pacquet-package-manager 775/775, full just ready green (typos, fmt, check, workspace test, clippy) plus just dylint.

Squash Commit Body

Port the remaining "Support patchedDependencies" items from
plans/TEST_PORTING.md, plus the patch entries cross-referenced from the
side-effects-cache and hoisted-linker sections: patch.ts :297, :386,
:269, :475, :508, :530, :552, and the side-effects / frozen-hoisted
tails of :24 and :120. deps-restorer index.ts:848 becomes a
known_failures stub — enableModulesDir is not a pacquet config setting.

The four full install scenarios (:24, :120, :297, :386) share one
helper covering the whole upstream shape: patched file, lockfile
patchedDependencies entry and (patch_hash=...) snapshot key, the
;patch=<hash> side-effects row, the frozen reinstall, the frozen
hoisted reinstall, and the offline unpatched-sibling project. Like
upstream it pins packageImportMethod: hardlink, without which the
sibling check cannot catch a patch that corrupts the shared store copy.

The hoisted ports surfaced a pacquet-only bug, fixed here: BuildModules
resolved a single pkgRoot per snapshot, so a package the hoisted walker
nests under several consumers (version conflict) was patched at only
one of them, and a cache-warm reinstall re-imported the side-effects
overlay at only one of them. Every other copy silently ran the code the
patch existed to replace. TypeScript pnpm patches all of them
(verified against 11.13.1). pkg_roots_by_key now carries every
location; the head still runs scripts and seeds the cache, while patch
application and overlay re-imports walk the list.

Each port was verified to catch its regression by temporarily breaking
the implementation: skipping patch application, dropping the
patched-only cache-write gate, renaming the ;patch= key segment,
disabling the patch-mtime invalidation, replacing the temp+rename write
with a truncating one, and reverting the multi-location fix.

Related to pnpm/pnpm#13146.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting. (The
    multi-location hoisted patching fix is pacquet-only — TypeScript pnpm
    already behaves correctly, verified empirically against 11.13.1. The rest
    is Rust test porting of existing TypeScript tests.)
  • 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.
    (pacquet patch, for the hoisted patching fix.)
  • Added or updated tests.
  • Updated the documentation if needed. (plans/TEST_PORTING.md ticks,
    the stub reference, and a port note recording the bug the hoisted ports
    surfaced.)

Written by an agent (Claude Code, claude-opus-4-8).


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed patched dependencies on nodeLinker=hoisted so every installed copy is patched, including nested copies caused by version conflicts.
    • Ensured patches are correctly restored for frozen reinstalls and installs driven by the side-effects cache.
    • Improved patch apply failure handling and related error/diagnostic output.
  • Tests

    • Expanded patch-install and hoisted-linking scenarios, including caching, frozen behavior, patch reapplication, version ranges, and “unpatched sibling” validation.
  • Documentation

    • Updated internal test/porting guidance for the revised patch-install scenarios.

Port the remaining "Support patchedDependencies" items from
plans/TEST_PORTING.md, plus the patch entries cross-referenced from the
side-effects-cache and hoisted-linker sections: patch.ts :297, :386,
:269, :475, :508, :530, :552, and the side-effects / frozen-hoisted
tails of :24 and :120. deps-restorer index.ts:848 becomes a
known_failures stub — enableModulesDir is not a pacquet config setting.

The four full install scenarios (:24, :120, :297, :386) share one
helper covering the whole upstream shape: patched file, lockfile
patchedDependencies entry and (patch_hash=...) snapshot key, the
;patch=<hash> side-effects row, the frozen reinstall, the frozen
hoisted reinstall, and the offline unpatched-sibling project. Like
upstream it pins packageImportMethod: hardlink, without which the
sibling check cannot catch a patch that corrupts the shared store copy.

The hoisted ports surfaced a pacquet-only bug, fixed here: BuildModules
resolved a single pkgRoot per snapshot, so a package the hoisted walker
nests under several consumers (version conflict) was patched at only
one of them, and a cache-warm reinstall re-imported the side-effects
overlay at only one of them. Every other copy silently ran the code the
patch existed to replace. TypeScript pnpm patches all of them
(verified against 11.13.1). pkg_roots_by_key now carries every
location; the head still runs scripts and seeds the cache, while patch
application and overlay re-imports walk the list.

Each port was verified to catch its regression by temporarily breaking
the implementation: skipping patch application, dropping the
patched-only cache-write gate, renaming the ;patch= key segment,
disabling the patch-mtime invalidation, replacing the temp+rename write
with a truncating one, and reverting the multi-location fix.
Copilot AI review requested due to automatic review settings July 19, 2026 16:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 19, 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: 80d38169-5689-4027-b15d-666e2df6ee86

📥 Commits

Reviewing files that changed from the base of the PR and between 701a7ef and 985c902.

📒 Files selected for processing (2)
  • pnpm/crates/cli/tests/patch.rs
  • pnpm/plans/TEST_PORTING.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • pnpm/plans/TEST_PORTING.md
  • pnpm/crates/cli/tests/patch.rs

📝 Walkthrough

Walkthrough

Changes

Hoisted patch propagation

Layer / File(s) Summary
Track all hoisted package roots
pnpm/crates/package-manager/src/install_frozen_lockfile.rs, pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
Hoisted linker and build-phase state now retain every package root per snapshot key.
Apply overlays to every copy
pnpm/crates/package-manager/src/build_modules.rs, pnpm/crates/package-manager/src/build_modules/tests.rs
Side-effects-cache overlays and patches are applied across all hoisted copies, while isolated installs retain single-directory resolution.
Validate patch installation scenarios
pnpm/crates/cli/tests/patch.rs
Tests cover cached and frozen reinstalls, linker modes, nested conflicts, patch reapplication, failure modes, and known failures.
Record coverage and behavior
.changeset/hoisted-patch-every-nested-copy.md, pnpm/plans/TEST_PORTING.md
Project records describe the nested-copy fix and updated porting coverage.

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

Sequence Diagram(s)

sequenceDiagram
  participant HoistedLinker
  participant InstallPipeline
  participant BuildModules
  participant PackageCopies
  HoistedLinker->>InstallPipeline: return all roots per PackageKey
  InstallPipeline->>BuildModules: pass hoisted_pkg_roots_by_key
  BuildModules->>PackageCopies: apply patch or cached overlay to each root
  PackageCopies-->>BuildModules: patched copies available
Loading

Possibly related issues

  • pnpm/pnpm#11633 — Related to patched dependency and side-effects-cache support across hoisted copies.
  • pnpm/pnpm#13146 — Covers overlapping patch test-porting, hoisted reinstalls, and cache coverage.

Possibly related PRs

  • pnpm/pnpm#13145 — Updates related patch and hoisted/side-effects-cache porting records.

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 stage-4

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix hoisted patchedDependencies to patch every nested copy + complete Stage 4 ports

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Complete remaining patchedDependencies test ports, including side-effects cache and frozen hoisted
 replay.
• Fix hoisted linker patching to apply patches and cached overlays to every nested package copy.
• Document the parity fix and stub a blocked test as a known failure due to missing CLI config.
Diagram

graph TD
  T["cli patch tests"] --> I["pacquet install"] --> L["lockfile (patchedDeps)"]
  I --> H["hoisted linker walk"] --> BM["BuildModules"]
  I --> BM --> NM["node_modules copies"]
  BM --> S[("store index / side-effects")]
  subgraph Legend
    direction LR
    _test["Test"] ~~~ _proc["Process/Module"] ~~~ _db[("Data store")]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Patch only the canonical pkgRoot and rely on linking to fan out
  • ➕ Less I/O during patch application (single directory mutation).
  • ➕ Keeps behavior closer to pre-existing BuildModules assumption (1 root per snapshot).
  • ➖ Incorrect under hoisted conflicts: nested copies remain unpatched.
  • ➖ Warm (side-effects-cache) reimports still miss non-canonical copies.
  • ➖ Risks silent behavior divergence vs pnpm and isolated linker.
2. Materialize patched output into a shared store artifact (avoid per-copy patching)
  • ➕ Could reduce duplicate work when many hoisted copies exist.
  • ➕ Centralizes patched content generation.
  • ➖ Easy to accidentally mutate/poison the pristine store content shared by other projects.
  • ➖ Requires new store keying/GC semantics for patched variants.
  • ➖ Bigger architectural change than needed for parity fix.

Recommendation: Keep the PR’s approach: track all hoisted locations per snapshot (pkg_roots_by_key) and iterate them for patch application and side-effects overlay materialization, while still treating the first location as canonical for running scripts and seeding cache. This is the minimal change that restores correctness and matches pnpm/isolated behavior without re-architecting store semantics.

Files changed (7) +619 / -157

Bug fix (3) +139 / -91
build_modules.rsFix hoisted patching/overlay materialization by tracking all pkg roots per snapshot +104/-58

Fix hoisted patching/overlay materialization by tracking all pkg roots per snapshot

• Changes BuildModules input from a single hoisted pkgRoot override to a per-snapshot list of directories (pkg_roots_by_key). Applies patches and side-effects-cache overlays to every existing hoisted copy while keeping the first directory as the canonical location for scripts/cache seeding.

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

install_frozen_lockfile.rsThread hoisted pkg_roots_by_key through frozen install build phase +30/-28

Thread hoisted pkg_roots_by_key through frozen install build phase

• Renames hoisted build-phase input from hoisted_pkg_root_by_key to hoisted_pkg_roots_by_key and updates comments/structs accordingly. Ensures frozen installs provide BuildModules with all on-disk hoisted locations so patching and cache overlay reimports reach every copy.

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

install_with_fresh_lockfile.rsThread hoisted pkg_roots_by_key through fresh install build phase +5/-5

Thread hoisted pkg_roots_by_key through fresh install build phase

• Updates fresh-install wiring to capture and pass the hoisted snapshot→locations map into the build phase. Aligns fresh and frozen install paths so hoisted patching behavior is consistent.

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

Tests (2) +451 / -45
patch.rsComplete patchedDependencies install-level test ports and add hoisted regression test +429/-23

Complete patchedDependencies install-level test ports and add hoisted regression test

• Adds shared helpers asserting the full upstream patch scenario: lockfile patchedDependencies + patch_hash snapshots, side-effects-cache ;patch=<hash> overlay, frozen reinstall under isolated and hoisted, and an offline unpatched sibling project. Ports additional upstream cases (ignoreScripts, allowBuilds-empty, modified patch reapply, multi-reach snapshot, apply-failure variants) and adds a dedicated hoisted nested-copy regression test. Introduces a known-failures stub for enableModulesDir=false because the CLI config cannot express it.

pnpm/crates/cli/tests/patch.rs

tests.rsUpdate BuildModules tests for pkg_roots_by_key API rename and shape change +22/-22

Update BuildModules tests for pkg_roots_by_key API rename and shape change

• Renames the BuildModules field in tests and updates hoisted override maps to store Vec<PathBuf> per snapshot key. Keeps existing behavior assertions intact while matching the new data model.

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

Documentation (2) +29 / -21
hoisted-patch-every-nested-copy.mdAdd changeset documenting hoisted patching correctness fix +5/-0

Add changeset documenting hoisted patching correctness fix

• Introduces a release note describing a hoisted-linker bug where only one nested copy of a patched package was updated. Calls out parity with pnpm and that cached-overlay reinstalls are included.

.changeset/hoisted-patch-every-nested-copy.md

TEST_PORTING.mdMark patchedDependencies stage-4 ports complete and record hoisted parity bug fix +24/-21

Mark patchedDependencies stage-4 ports complete and record hoisted parity bug fix

• Updates the test-porting plan to reflect newly ported patch scenarios, side-effects cache assertions, and frozen-hoisted coverage. Documents the discovered pacquet-only hoisted bug (single pkgRoot) and the fix (multiple roots), and stubs the enableModulesDir=false case as blocked.

pnpm/plans/TEST_PORTING.md

@github-actions

github-actions Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
lockfile/parse_pnpm_lock       1.00     10.8±0.03ms    34.5 MB/sec    1.06     11.5±0.03ms    32.5 MB/sec
packument/parse                1.06     40.2±0.13µs  1648.3 MB/sec    1.00     38.0±0.11µs  1747.7 MB/sec
tarball/download_dependency    1.00      2.2±0.10ms  1986.8 KB/sec    1.03      2.2±0.05ms  1930.8 KB/sec

@greptile-apps

greptile-apps Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge. The change is self-contained to the hoisted-linker path, isolated-linker behavior is unchanged, and the bug fix is directly pinned by a dedicated regression test.

The fix is mechanically straightforward: accumulate all walker-assigned directories rather than only the first, then iterate them wherever writes must reach every copy. Patch application and cache-overlay re-import are the only two write paths affected, both are covered by tests that were verified to catch the regression when the implementation was temporarily broken. Isolated-linker tests pass unchanged since pkg_roots_for_key returns a single-element list for the isolated path.

No files require special attention.

Reviews (2): Last reviewed commit: "docs(pacquet): cite the tracking issue i..." | Re-trigger Greptile

@codecov-commenter

codecov-commenter commented Jul 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.47059% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.86%. Comparing base (ebacfa6) to head (985c902).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pnpm/crates/package-manager/src/build_modules.rs 71.92% 16 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13149   +/-   ##
=======================================
  Coverage   85.85%   85.86%           
=======================================
  Files         505      505           
  Lines       84029    84047   +18     
=======================================
+ Hits        72147    72166   +19     
+ Misses      11882    11881    -1     

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

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

@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. allow_known_failure! skips failing test ✗ Dismissed 📘 Rule violation ☼ Reliability
Description
A new test is stubbed via allow_known_failure!, causing it to exit early instead of asserting
behavior. This violates the requirement to fix failing tests rather than skipping/ignoring them.
Code

pnpm/crates/cli/tests/patch.rs[R1587-1589]

+    #[test]
+    fn installing_with_no_modules_directory_and_a_patched_dependency() {
+        allow_known_failure!(enable_modules_dir_setting());
Evidence
PR Compliance ID 3 requires that tests not be skipped/ignored. The added test
installing_with_no_modules_directory_and_a_patched_dependency calls allow_known_failure!, and
the porting plan explicitly documents that this case is stubbed rather than implemented.

CLAUDE.md: All Tests Must Pass (Do Not Ignore or Skip Failing Tests)
pnpm/crates/cli/tests/patch.rs[1561-1590]
pnpm/plans/TEST_PORTING.md[198-198]

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

## Issue description
A newly-added test is being bypassed via `allow_known_failure!`, which effectively skips coverage for `enableModulesDir: false` + patched dependencies.

## Issue Context
The compliance checklist disallows leaving failing tests unresolved or skipped. The PR currently documents that pacquet CLI cannot express `enableModulesDir: false`, and uses a known-failure stub instead of implementing the config surface.

## Fix Focus Areas
- pnpm/crates/cli/tests/patch.rs[1561-1590]
- pnpm/plans/TEST_PORTING.md[198-198]

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



Remediation recommended

2. Repeated patch parsing 🐞 Bug ➹ Performance ⭐ New
Description
In hoisted mode, patch fan-out calls apply_patch_to_dir once per package location, and each call
re-reads and re-parses the patch file, multiplying I/O and PatchSet parsing cost by the number of
copies. This can become noticeable when a version conflict creates many hoisted copies of the same
snapshot.
Code

pnpm/crates/package-manager/src/build_modules.rs[R1054-1064]

+        // Every copy is patched, not just `pkg_dir`. Under the hoisted
+        // linker a version conflict nests further copies under their
+        // consumers; leaving those unpatched would silently run the very
+        // code the patch replaces.
+        for patched_dir in pkg_roots_for_key(layout, pkg_roots_by_key, snapshot_key) {
+            if !patched_dir.exists() {
+                continue;
+            }
+            apply_patch_to_dir(&patched_dir, patch_file_path)
+                .map_err(BuildModulesError::PatchApply)?;
+        }
Evidence
BuildModules iterates every package directory for the snapshot and calls apply_patch_to_dir per
directory; apply_patch_to_dir reads the patch file and parses it on every call, so the fan-out
multiplies patch parsing work by the number of hoisted copies.

pnpm/crates/package-manager/src/build_modules.rs[1050-1065]
pnpm/crates/patching/src/apply.rs[86-120]

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

### Issue description
`BuildModules` now applies patches to every hoisted directory for a snapshot, but it calls `apply_patch_to_dir()` for each directory. `apply_patch_to_dir()` performs `fs::read()` and `PatchSet::parse()` internally, so the same patch file is read and parsed repeatedly (once per copy).

### Issue Context
This overhead is introduced specifically by the new multi-root patch application loop in `build_modules.rs`.

### Fix Focus Areas
- pnpm/crates/package-manager/src/build_modules.rs[1054-1064]
- pnpm/crates/patching/src/apply.rs[86-120]

### Suggested fix
1. Add a patching API that separates “read+parse” from “apply”, e.g.:
  - `parse_patch_file(patch_file_path) -> PatchSet` (or an internal representation)
  - `apply_parsed_patch_to_dir(patched_dir, &PatchSet)`
2. In `BuildModules`, read/parse the patch once per snapshot, then apply the parsed representation to each `patched_dir`.
3. Ensure the parsed representation is either cheaply clonable or shareable by reference, and that error messages still report `patch_file_path` and `patched_dir`.

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


3. Fallback rebuild skips copies 🐞 Bug ☼ Reliability ⭐ New
Description
When side-effects cache overlay materialization fails for one hoisted package directory, the code
breaks out and falls back to rebuilding, but lifecycle scripts and cache upload still run only
against the canonical pkg_dir. A non-canonical hoisted copy that failed overlay import can
therefore remain without lifecycle/build side-effects for the rest of that install (even though
patch application is fanned out later).
Code

pnpm/crates/package-manager/src/build_modules.rs[R930-954]

+            let mut satisfied = true;
+            for pkg_dir in pkg_roots_for_key(layout, pkg_roots_by_key, snapshot_key) {
+                // No slot to materialize into (skipped / never linked) —
+                // nothing for the build phase to do either.
+                if !pkg_dir.exists() {
+                    continue;
+                }
+                match materialize_side_effects::<Reporter>(
+                    logged_methods,
+                    import_method,
+                    &pkg_dir,
+                    overlay,
+                ) {
+                    Ok(()) => {}
+                    Err(error) if pkg_dir.join("package.json").exists() => {
+                        tracing::warn!(
+                            target: "pacquet::build",
+                            ?snapshot_key,
+                            cache_key = key,
+                            %error,
+                            "failed to materialize side-effects cache overlay; rebuilding",
+                        );
+                        satisfied = false;
+                        break;
+                    }
Evidence
The cache-hit path now loops over all pkg_dir roots but breaks on the first materialization
failure, then proceeds into a rebuild path that uses only the canonical pkg_dir for
run_postinstall_hooks and upload, with no subsequent loop to repair other roots.

pnpm/crates/package-manager/src/build_modules.rs[924-978]
pnpm/crates/package-manager/src/build_modules.rs[1025-1087]
pnpm/crates/package-manager/src/build_modules.rs[1136-1157]

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

### Issue description
In the side-effects cache hit path, `build_one_snapshot` now materializes the overlay into every hoisted package directory. If materialization fails for one directory (with `package.json` still present), it sets `satisfied = false` and breaks to rebuild.

However, the rebuild path (patch + lifecycle scripts + side-effects upload) operates only on the canonical `pkg_dir` from `pkg_root_for_key()`. There is no follow-up step to bring other hoisted copies—especially the one that failed materialization—into the rebuilt/built state.

### Issue Context
This is specifically a multi-root failure-mode regression: previously there was only one directory to rebuild. Now there can be many, and the fallback rebuild only repairs one.

### Fix Focus Areas
- pnpm/crates/package-manager/src/build_modules.rs[927-977]
- pnpm/crates/package-manager/src/build_modules.rs[1028-1115]
- pnpm/crates/package-manager/src/build_modules.rs[1136-1157]

### Suggested fix options
Pick one (ordered by preserving current “scripts run once” behavior):

1) **Track failed dirs and re-materialize after rebuild**
- During the cache-hit loop, collect `failed_pkg_dirs` (don’t just `break`).
- After rebuild completes and the side-effects cache has been (re)seeded, re-import the overlay into *every* pkg root (or at least the failed ones) using the same `materialize_side_effects()` path.
 - This likely requires deriving an overlay map from the newly-uploaded side-effects row (or reusing the existing overlay when the failure was per-dir IO).

2) **Fallback: rebuild in each affected dir**
- If any non-canonical dir fails overlay import, run `run_postinstall_hooks` (and any other required build steps) in those dirs too (only in this exceptional path), ensuring the install ends with consistent copies.

Also ensure patch fan-out remains intact, and add a regression test that simulates per-dir overlay import failure (e.g., make one target unwritable) and verifies all copies end up with expected side effects.

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


4. pkg_roots_for_key clones Vec 📘 Rule violation ➹ Performance
Description
pkg_roots_for_key clones and returns an owned Vec<PathBuf> from a `HashMap<PackageKey,
Vec<PathBuf>>, causing repeated per-call allocations and PathBuf` clones in performance-sensitive
build/install loops (notably when overlays/patches are applied under hoisted installs). This adds
avoidable repeated work in a hot path and should be replaced with a borrowed slice/iterator (and
ideally a representation that avoids heap allocation in the common single-root case).
Code

pnpm/crates/package-manager/src/build_modules.rs[R1228-1236]

+fn pkg_roots_for_key(
+    layout: &crate::VirtualStoreLayout,
+    pkg_roots_by_key: Option<&HashMap<PackageKey, Vec<PathBuf>>>,
+    key: &PackageKey,
+) -> Vec<PathBuf> {
+    match pkg_roots_by_key {
+        Some(map) => map.get(key).cloned().unwrap_or_default(),
+        None => vec![virtual_store_dir_for_key(layout, key)],
+    }
Evidence
PR Compliance ID 14 emphasizes avoiding repeated work inside loops, and the current
pkg_roots_for_key implementation uses .cloned().unwrap_or_default(), which clones the stored
vector and all contained PathBufs on every call rather than iterating borrowed paths. The function
is invoked during build-phase logic that iterates snapshot keys, including the patched/side-effects
paths, so the cloning happens repeatedly during installs. Additionally, the hoisted linker builds
pkg_roots_by_key by creating/pushing into a fresh Vec per key, implying a heap allocation for
each non-empty entry even when there is only a single location, increasing allocator churn and
memory footprint for hoisted installs.

CLAUDE.md: Async and Loop Practices: Prefer Async FS, async/await, Parallelize Independent Work, and Hoist Invariants Out of Loops
pnpm/crates/package-manager/src/build_modules.rs[924-977]
pnpm/crates/package-manager/src/build_modules.rs[1228-1236]
pnpm/crates/package-manager/src/build_modules.rs[1221-1237]
pnpm/crates/package-manager/src/build_modules.rs[1051-1064]
pnpm/crates/package-manager/src/install_frozen_lockfile.rs[1728-1744]

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

## Issue description
`pkg_roots_for_key()` currently returns an owned `Vec<PathBuf>` by cloning the stored list from `pkg_roots_by_key` (`map.get(key).cloned().unwrap_or_default()`), which clones every `PathBuf` and allocates on each call. Because this helper is used in performance-sensitive build/install paths (including patch application and side-effects overlay materialization under `nodeLinker: hoisted`), it introduces avoidable repeated work and allocator churn.

## Issue Context
The PR adds multi-root support for hoisted installs by tracking multiple on-disk locations per snapshot via `HashMap<PackageKey, Vec<PathBuf>>`. However, the chosen API (returning an owned `Vec`) forces per-call cloning inside build-phase logic that iterates many snapshot keys, conflicting with the compliance performance rule to avoid repeated work inside loops. Separately, the representation (`Vec<PathBuf>` for every key) implies a heap allocation even for the common single-root case.

## Fix Focus Areas
- pnpm/crates/package-manager/src/build_modules.rs[931-932]
- pnpm/crates/package-manager/src/build_modules.rs[1221-1237]
- pnpm/crates/package-manager/src/build_modules.rs[1228-1236]
- pnpm/crates/package-manager/src/install_frozen_lockfile.rs[1728-1744]

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


Grey Divider

Previous review results

Review updated until commit 985c902

Results up to commit 701a7ef ⚖️ Balanced


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


Action required
1. allow_known_failure! skips failing test ✗ Dismissed 📘 Rule violation ☼ Reliability
Description
A new test is stubbed via allow_known_failure!, causing it to exit early instead of asserting
behavior. This violates the requirement to fix failing tests rather than skipping/ignoring them.
Code

pnpm/crates/cli/tests/patch.rs[R1587-1589]

+    #[test]
+    fn installing_with_no_modules_directory_and_a_patched_dependency() {
+        allow_known_failure!(enable_modules_dir_setting());
Evidence
PR Compliance ID 3 requires that tests not be skipped/ignored. The added test
installing_with_no_modules_directory_and_a_patched_dependency calls allow_known_failure!, and
the porting plan explicitly documents that this case is stubbed rather than implemented.

CLAUDE.md: All Tests Must Pass (Do Not Ignore or Skip Failing Tests)
pnpm/crates/cli/tests/patch.rs[1561-1590]
pnpm/plans/TEST_PORTING.md[198-198]

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

## Issue description
A newly-added test is being bypassed via `allow_known_failure!`, which effectively skips coverage for `enableModulesDir: false` + patched dependencies.

## Issue Context
The compliance checklist disallows leaving failing tests unresolved or skipped. The PR currently documents that pacquet CLI cannot express `enableModulesDir: false`, and uses a known-failure stub instead of implementing the config surface.

## Fix Focus Areas
- pnpm/crates/cli/tests/patch.rs[1561-1590]
- pnpm/plans/TEST_PORTING.md[198-198]

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



Remediation recommended
2. pkg_roots_for_key clones Vec 📘 Rule violation ➹ Performance
Description
pkg_roots_for_key clones and returns an owned Vec<PathBuf> from a `HashMap<PackageKey,
Vec<PathBuf>>, causing repeated per-call allocations and PathBuf` clones in performance-sensitive
build/install loops (notably when overlays/patches are applied under hoisted installs). This adds
avoidable repeated work in a hot path and should be replaced with a borrowed slice/iterator (and
ideally a representation that avoids heap allocation in the common single-root case).
Code

pnpm/crates/package-manager/src/build_modules.rs[R1228-1236]

+fn pkg_roots_for_key(
+    layout: &crate::VirtualStoreLayout,
+    pkg_roots_by_key: Option<&HashMap<PackageKey, Vec<PathBuf>>>,
+    key: &PackageKey,
+) -> Vec<PathBuf> {
+    match pkg_roots_by_key {
+        Some(map) => map.get(key).cloned().unwrap_or_default(),
+        None => vec![virtual_store_dir_for_key(layout, key)],
+    }
Evidence
PR Compliance ID 14 emphasizes avoiding repeated work inside loops, and the current
pkg_roots_for_key implementation uses .cloned().unwrap_or_default(), which clones the stored
vector and all contained PathBufs on every call rather than iterating borrowed paths. The function
is invoked during build-phase logic that iterates snapshot keys, including the patched/side-effects
paths, so the cloning happens repeatedly during installs. Additionally, the hoisted linker builds
pkg_roots_by_key by creating/pushing into a fresh Vec per key, implying a heap allocation for
each non-empty entry even when there is only a single location, increasing allocator churn and
memory footprint for hoisted installs.

CLAUDE.md: Async and Loop Practices: Prefer Async FS, async/await, Parallelize Independent Work, and Hoist Invariants Out of Loops
pnpm/crates/package-manager/src/build_modules.rs[924-977]
pnpm/crates/package-manager/src/build_modules.rs[1228-1236]
pnpm/crates/package-manager/src/build_modules.rs[1221-1237]
pnpm/crates/package-manager/src/build_modules.rs[1051-1064]
pnpm/crates/package-manager/src/install_frozen_lockfile.rs[1728-1744]

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

## Issue description
`pkg_roots_for_key()` currently returns an owned `Vec<PathBuf>` by cloning the stored list from `pkg_roots_by_key` (`map.get(key).cloned().unwrap_or_default()`), which clones every `PathBuf` and allocates on each call. Because this helper is used in performance-sensitive build/install paths (including patch application and side-effects overlay materialization under `nodeLinker: hoisted`), it introduces avoidable repeated work and allocator churn.

## Issue Context
The PR adds multi-root support for hoisted installs by tracking multiple on-disk locations per snapshot via `HashMap<PackageKey, Vec<PathBuf>>`. However, the chosen API (returning an owned `Vec`) forces per-call cloning inside build-phase logic that iterates many snapshot keys, conflicting with the compliance performance rule to avoid repeated work inside loops. Separately, the representation (`Vec<PathBuf>` for every key) implies a heap allocation even for the common single-root case.

## Fix Focus Areas
- pnpm/crates/package-manager/src/build_modules.rs[931-932]
- pnpm/crates/package-manager/src/build_modules.rs[1221-1237]
- pnpm/crates/package-manager/src/build_modules.rs[1228-1236]
- pnpm/crates/package-manager/src/install_frozen_lockfile.rs[1728-1744]

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


Qodo Logo

Comment thread pnpm/crates/cli/tests/patch.rs Resolved
@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 19, 2026
@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 `known_failures` stub for `installing with no modules directory and
a patched dependency` explained why the CLI cannot express
`enableModulesDir: false` but did not say where support is tracked.
Point it (and the plan entry) at #12042, which lists the
setting among pacquet's unsupported installation settings, so the stub
carries an unstub trigger rather than only a rationale.

Raised in review of #13149.
Copilot AI review requested due to automatic review settings July 19, 2026 16:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 985c902

@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

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 985c9023ad71

Each scenario reports direct installs and pnpr installs. 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.513 ± 0.175 2.326 2.766 1.72 ± 0.16
pacquet@main 2.455 ± 0.105 2.343 2.696 1.68 ± 0.13
pnpr@HEAD 1.499 ± 0.148 1.349 1.711 1.03 ± 0.12
pnpr@main 1.459 ± 0.092 1.351 1.646 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.51266881384,
      "stddev": 0.1745631619826431,
      "median": 2.43180635164,
      "user": 1.4928043999999998,
      "system": 1.2860489400000001,
      "min": 2.32604345914,
      "max": 2.7657562591400002,
      "times": [
        2.42619999514,
        2.32604345914,
        2.69052089014,
        2.7657562591400002,
        2.43741270814,
        2.3499079211400002,
        2.7413752861400003,
        2.4022990541400002,
        2.63303012814,
        2.35414243714
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.4553868018400005,
      "stddev": 0.10466557724558746,
      "median": 2.4298018911400003,
      "user": 1.4802073999999998,
      "system": 1.28828614,
      "min": 2.3432847281400004,
      "max": 2.6955423841400004,
      "times": [
        2.3432847281400004,
        2.40401740214,
        2.5048536731400004,
        2.36787965214,
        2.41632768814,
        2.36399809114,
        2.6955423841400004,
        2.4432760941400002,
        2.5169817981400002,
        2.49770650714
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.4991530221400002,
      "stddev": 0.14822978514717228,
      "median": 1.45964300714,
      "user": 0.9903568999999999,
      "system": 1.13058644,
      "min": 1.34901722714,
      "max": 1.71087353114,
      "times": [
        1.34901722714,
        1.36744932314,
        1.67597843514,
        1.71087353114,
        1.70537005414,
        1.35982948014,
        1.52818594514,
        1.37554021114,
        1.4767831221399998,
        1.44250289214
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.45938460894,
      "stddev": 0.09246653907865701,
      "median": 1.45233451414,
      "user": 1.0417629999999998,
      "system": 1.1640595400000002,
      "min": 1.35090512814,
      "max": 1.64560259814,
      "times": [
        1.3858548151399999,
        1.53967233214,
        1.52576771414,
        1.4038701251399999,
        1.44412525914,
        1.48051019314,
        1.35699415514,
        1.64560259814,
        1.35090512814,
        1.46054376914
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 248.8 ± 8.3 236.1 264.3 1.00
pacquet@main 251.0 ± 10.7 230.1 268.1 1.01 ± 0.05
pnpr@HEAD 258.0 ± 6.7 248.9 266.8 1.04 ± 0.04
pnpr@main 265.1 ± 3.9 256.9 272.0 1.07 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2488197436,
      "stddev": 0.008322717419265201,
      "median": 0.2496329854,
      "user": 0.18738845999999998,
      "system": 0.53414312,
      "min": 0.23614644740000001,
      "max": 0.2643406764,
      "times": [
        0.2531913044,
        0.23614644740000001,
        0.24366122340000002,
        0.24855338240000002,
        0.2429964544,
        0.24024411440000001,
        0.2507125884,
        0.2643406764,
        0.2522135874,
        0.2561376574
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.25095184440000007,
      "stddev": 0.010709555652022952,
      "median": 0.25275131240000004,
      "user": 0.19688555999999996,
      "system": 0.52183722,
      "min": 0.2301048994,
      "max": 0.2681201264,
      "times": [
        0.2523312084,
        0.24971436240000003,
        0.2554592544,
        0.2681201264,
        0.2535032694,
        0.2531714164,
        0.2515828534,
        0.2588789374,
        0.23665211640000003,
        0.2301048994
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.2580102637,
      "stddev": 0.006679521973608779,
      "median": 0.25722284289999997,
      "user": 0.20099385999999994,
      "system": 0.5084816199999999,
      "min": 0.24893994140000003,
      "max": 0.2668139804,
      "times": [
        0.2583197074,
        0.2668139804,
        0.2513732514,
        0.24893994140000003,
        0.2511804804,
        0.2536905744,
        0.2648996964,
        0.2640904554,
        0.2646685714,
        0.2561259784
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.2651391731,
      "stddev": 0.003907061085061587,
      "median": 0.2650911009,
      "user": 0.20483526,
      "system": 0.54162322,
      "min": 0.2569149094,
      "max": 0.2720092184,
      "times": [
        0.2569149094,
        0.2638380124,
        0.2637206514,
        0.2656473104,
        0.2720092184,
        0.2692553774,
        0.2648340234,
        0.2657497434,
        0.26534817839999997,
        0.2640743064
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.688 ± 0.024 2.647 2.717 1.76 ± 0.15
pacquet@main 2.691 ± 0.022 2.650 2.737 1.77 ± 0.15
pnpr@HEAD 1.587 ± 0.169 1.387 1.786 1.04 ± 0.14
pnpr@main 1.524 ± 0.133 1.377 1.754 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.6877806590600004,
      "stddev": 0.023608266530156654,
      "median": 2.6865344534599997,
      "user": 1.5922094199999999,
      "system": 1.2601663,
      "min": 2.64698225846,
      "max": 2.71747314046,
      "times": [
        2.64698225846,
        2.70042611346,
        2.65582909446,
        2.6875386194599997,
        2.6826257924599997,
        2.6855302874599998,
        2.71549207046,
        2.67818924046,
        2.71747314046,
        2.7077199734599997
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.6912510895599997,
      "stddev": 0.02233688383682308,
      "median": 2.68533008996,
      "user": 1.57541922,
      "system": 1.2899447,
      "min": 2.65030693146,
      "max": 2.73709299346,
      "times": [
        2.69444152446,
        2.68449031346,
        2.73709299346,
        2.68319826446,
        2.68446593546,
        2.70697019346,
        2.68109617546,
        2.70427869746,
        2.65030693146,
        2.6861698664599998
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5866496391600002,
      "stddev": 0.16902153372711376,
      "median": 1.61569559446,
      "user": 1.00530652,
      "system": 1.0877832999999997,
      "min": 1.38651469546,
      "max": 1.7861338324600002,
      "times": [
        1.4199268464600001,
        1.6950443534600002,
        1.4193947664600002,
        1.74421691246,
        1.6799466784600001,
        1.55144451046,
        1.7861338324600002,
        1.38651469546,
        1.7854819574600003,
        1.39839183846
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.52418769366,
      "stddev": 0.1326635216448427,
      "median": 1.51083908396,
      "user": 0.9927276199999999,
      "system": 1.1010183999999998,
      "min": 1.3766400424600003,
      "max": 1.75410824446,
      "times": [
        1.3766400424600003,
        1.6198836764600002,
        1.44296396646,
        1.3968391524600001,
        1.5787142014600002,
        1.3903945834600002,
        1.60234266746,
        1.75410824446,
        1.42974919446,
        1.6502412074600001
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 543.2 ± 6.9 532.3 554.3 1.86 ± 0.03
pacquet@main 535.7 ± 9.3 526.1 551.9 1.83 ± 0.04
pnpr@HEAD 292.1 ± 4.0 286.2 297.8 1.00
pnpr@main 293.9 ± 7.4 283.8 305.9 1.01 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.54322714206,
      "stddev": 0.006930600194513148,
      "median": 0.5454001013600001,
      "user": 0.66034012,
      "system": 0.64881198,
      "min": 0.53226190886,
      "max": 0.55431809586,
      "times": [
        0.53226190886,
        0.54566460786,
        0.54921819486,
        0.54528247086,
        0.5417431108599999,
        0.53406825186,
        0.54551773186,
        0.55431809586,
        0.53714306886,
        0.54705397886
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.5357171682599999,
      "stddev": 0.009322339186037299,
      "median": 0.53425946136,
      "user": 0.6485224199999999,
      "system": 0.6567981799999999,
      "min": 0.52612607086,
      "max": 0.55189989286,
      "times": [
        0.52648961386,
        0.53448968386,
        0.52977998586,
        0.52707255986,
        0.52612607086,
        0.54619869286,
        0.55189989286,
        0.54655804686,
        0.53452789686,
        0.53402923886
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29206663056000004,
      "stddev": 0.004005888038032748,
      "median": 0.29312969686,
      "user": 0.18355381999999998,
      "system": 0.5084353799999999,
      "min": 0.28623439286,
      "max": 0.29775212086,
      "times": [
        0.28623439286,
        0.29360868686,
        0.29665600086000005,
        0.28687960386,
        0.29271808386000003,
        0.28864013286,
        0.29489409186000004,
        0.28974188186000005,
        0.29775212086,
        0.29354130986000004
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.29391735756,
      "stddev": 0.007420771182017009,
      "median": 0.29302147286,
      "user": 0.17822071999999997,
      "system": 0.5290024799999999,
      "min": 0.28377819786,
      "max": 0.30588590186000003,
      "times": [
        0.30208105486000003,
        0.29367386886,
        0.28838557386,
        0.28377819786,
        0.29236907686,
        0.28515963286,
        0.29369261486000003,
        0.30223057486000005,
        0.30588590186000003,
        0.29191707886
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.849 ± 0.011 1.834 1.873 6.36 ± 0.13
pacquet@main 1.832 ± 0.016 1.808 1.869 6.31 ± 0.14
pnpr@HEAD 0.290 ± 0.006 0.279 0.296 1.00
pnpr@main 0.292 ± 0.004 0.287 0.298 1.01 ± 0.02
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.84874960972,
      "stddev": 0.011029130371707404,
      "median": 1.8467526477200003,
      "user": 0.86328818,
      "system": 0.7539079599999999,
      "min": 1.83380599472,
      "max": 1.8729640297200003,
      "times": [
        1.8406361447200001,
        1.8462801997200002,
        1.8439013427200002,
        1.8505512427200002,
        1.8600645047200002,
        1.8472250957200003,
        1.8414870547200002,
        1.83380599472,
        1.8729640297200003,
        1.8505804877200003
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.8316303769200004,
      "stddev": 0.015546431661853415,
      "median": 1.8287093947200002,
      "user": 0.8695700799999999,
      "system": 0.7187391599999999,
      "min": 1.8082157277200002,
      "max": 1.8690474917200002,
      "times": [
        1.8276180797200001,
        1.8690474917200002,
        1.8298007097200002,
        1.8366652647200001,
        1.8306897907200002,
        1.8082157277200002,
        1.8262422537200003,
        1.8274243357200002,
        1.8383930917200002,
        1.8222070237200003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29047877192,
      "stddev": 0.005719592348721356,
      "median": 0.29293504272000004,
      "user": 0.17712197999999998,
      "system": 0.51728776,
      "min": 0.27868991572,
      "max": 0.29606850372,
      "times": [
        0.28412340272000003,
        0.29346743772,
        0.28855396672,
        0.28720851772,
        0.27868991572,
        0.29572219472,
        0.29475150972,
        0.29240264772,
        0.29379962272,
        0.29606850372
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.29223888082,
      "stddev": 0.004287921918645627,
      "median": 0.29217715322000004,
      "user": 0.18900078,
      "system": 0.51992726,
      "min": 0.28656949972,
      "max": 0.29797658872,
      "times": [
        0.29021037772,
        0.28961993872,
        0.28656949972,
        0.29414392872,
        0.28741650072,
        0.28813828672,
        0.29566387472,
        0.29797658872,
        0.29688096072000003,
        0.29576885172
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 329.5 ± 14.9 318.1 371.0 3.96 ± 0.19
pacquet@main 315.3 ± 7.8 305.4 329.4 3.79 ± 0.12
pnpr@HEAD 83.2 ± 1.6 80.9 86.4 1.00
pnpr@main 84.3 ± 2.1 81.1 87.8 1.01 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.32952437874000007,
      "stddev": 0.014927948641703177,
      "median": 0.32656841854000007,
      "user": 0.32274992,
      "system": 0.05521095999999999,
      "min": 0.31809429604000006,
      "max": 0.37101627204000004,
      "times": [
        0.37101627204000004,
        0.32624821204000004,
        0.32673239104000007,
        0.32737273404000006,
        0.32760479904000006,
        0.31809429604000006,
        0.32773515504000006,
        0.32640444604,
        0.32135009204000003,
        0.32268539004
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.31529534784,
      "stddev": 0.0077911926401607505,
      "median": 0.31278897104000003,
      "user": 0.31065162,
      "system": 0.05104976,
      "min": 0.30541501004000005,
      "max": 0.32939379104000005,
      "times": [
        0.31248605204,
        0.30908862104000007,
        0.31202421404,
        0.30541501004000005,
        0.31806869904000007,
        0.31572262004000007,
        0.32763714104,
        0.31002544004000004,
        0.32939379104000005,
        0.31309189004000004
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08324464982787878,
      "stddev": 0.0015806566422650464,
      "median": 0.08264211404,
      "user": 0.01877903818181818,
      "system": 0.009105861818181817,
      "min": 0.08094890404,
      "max": 0.08641511104,
      "times": [
        0.08532051604,
        0.08422527804,
        0.08543411904,
        0.08129294004,
        0.08551239604,
        0.08530171904,
        0.08219715904,
        0.08200717304,
        0.08173031104,
        0.08322953704,
        0.08148986104,
        0.08368503304,
        0.08150278404,
        0.08420009104,
        0.08547678904,
        0.08348923604,
        0.08632575304,
        0.08248179304,
        0.08237697604,
        0.08223217404,
        0.08208911604,
        0.08240940803999999,
        0.08373807304,
        0.08641511104,
        0.08094890404,
        0.08305521104,
        0.08241009804,
        0.08293262004,
        0.08166398704,
        0.08209904504,
        0.08264211404,
        0.08202348204,
        0.08513463604
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.08427435582125,
      "stddev": 0.0021055575121455513,
      "median": 0.08350159454,
      "user": 0.01971997,
      "system": 0.008251848749999999,
      "min": 0.08108924703999999,
      "max": 0.08784518804,
      "times": [
        0.08754010504,
        0.08633003104,
        0.08688882204,
        0.08255106304,
        0.08730260704,
        0.08108924703999999,
        0.08487693204,
        0.08444616304,
        0.08291569704,
        0.08182109204,
        0.08340725204,
        0.08359593704,
        0.08754353004,
        0.08655764804,
        0.08701334504,
        0.08326128804,
        0.08581013404,
        0.08239118304,
        0.08217495804,
        0.08263077404,
        0.08367559504,
        0.08677783304,
        0.08618454804,
        0.08261958204,
        0.08233360504,
        0.08196204704,
        0.08312626304,
        0.08261059504,
        0.08196345904,
        0.08284681904,
        0.08468604304,
        0.08784518804
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.503 ± 0.086 4.419 4.659 1.29 ± 0.03
pacquet@main 4.557 ± 0.164 4.410 4.834 1.30 ± 0.05
pnpr@HEAD 3.565 ± 0.115 3.437 3.781 1.02 ± 0.04
pnpr@main 3.503 ± 0.062 3.438 3.606 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.503234191420001,
      "stddev": 0.08617549269844561,
      "median": 4.459921184620001,
      "user": 1.65006466,
      "system": 1.3538066999999998,
      "min": 4.41895781712,
      "max": 4.6588886051200005,
      "times": [
        4.45256226212,
        4.63169035812,
        4.467280107120001,
        4.44975533012,
        4.55732467312,
        4.42905792212,
        4.44423260512,
        4.41895781712,
        4.52259223412,
        4.6588886051200005
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.55688856292,
      "stddev": 0.16392222854510216,
      "median": 4.46281434962,
      "user": 1.6722179599999998,
      "system": 1.3355469999999998,
      "min": 4.40998498212,
      "max": 4.83413591112,
      "times": [
        4.45532575912,
        4.83413591112,
        4.65173437612,
        4.72973752812,
        4.40998498212,
        4.42160489812,
        4.42008831912,
        4.7425059131200005,
        4.43346500212,
        4.47030294012
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.5650745833200004,
      "stddev": 0.11524772425390223,
      "median": 3.53294833112,
      "user": 1.1505068599999997,
      "system": 1.2263483999999998,
      "min": 3.4371878161200002,
      "max": 3.78116650212,
      "times": [
        3.51780109212,
        3.60874081512,
        3.4371878161200002,
        3.5288444671200003,
        3.78116650212,
        3.5370521951200002,
        3.6444050311200002,
        3.6962374811200003,
        3.45700077512,
        3.44230965812
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.50265952042,
      "stddev": 0.06153459924243668,
      "median": 3.4828453996200004,
      "user": 1.13908426,
      "system": 1.2249538999999998,
      "min": 3.4379410471200003,
      "max": 3.6060727001200004,
      "times": [
        3.49454046512,
        3.44214446312,
        3.46076368112,
        3.5738317521200003,
        3.4711503341200003,
        3.4379410471200003,
        3.6060727001200004,
        3.56576505812,
        3.44723360312,
        3.5271521001200004
      ]
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/13149
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,646.98 ms
(-2.16%)Baseline: 2,705.54 ms
3,246.65 ms
(81.53%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,833.81 ms
(-0.99%)Baseline: 1,852.10 ms
2,222.51 ms
(82.51%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
532.26 ms
(-3.26%)Baseline: 550.19 ms
660.23 ms
(80.62%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
318.09 ms
(-3.87%)Baseline: 330.89 ms
397.07 ms
(80.11%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,326.04 ms
(-2.94%)Baseline: 2,396.51 ms
2,875.81 ms
(80.88%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,418.96 ms
(-1.13%)Baseline: 4,469.30 ms
5,363.16 ms
(82.39%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
236.15 ms
(-6.69%)Baseline: 253.08 ms
303.69 ms
(77.76%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/13149
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,386.51 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
278.69 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
286.23 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
80.95 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,349.02 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,437.19 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
248.94 ms
🐰 View full continuous benchmarking report in Bencher

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