Skip to content

fix(resolver): process workspace importers in project-id order - #13895

Merged
zkochan merged 1 commit into
mainfrom
importer-order-invariance
Aug 13, 2026
Merged

zkochan merged 1 commit into
mainfrom
importer-order-invariance

Conversation

@zkochan

@zkochan zkochan commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes the two follow-ups recorded on #13866: the resolved graph and lockfile are now a function of the workspace's project set, independent of the order projects are listed or discovered.

Both resolve_workspace and resolve_peers_workspace sort importers by project id up front. That one ordering decision canonicalizes everything downstream that was first-writer-wins: children-owner claims (ranked by importer position), the auto-install hoist loop's first-walk missing scope, deprecation-warning attribution, and which context first realizes a shared cycle back-edge occurrence. Per-importer options are still built in the caller's listing order before the sort, so positional options callbacks keep lining up.

Validation:

  • An explicit reversed packages listing of the 5-importer bit fixture produces a byte-identical lockfile — the residual importer-order axis of Lockfile is not reproducible: four identical installs produce four different lockfiles #13846.
  • Both bit fixtures are byte-identical to current main's output (single-importer 0d5c2ec7c0, 5-importer 6565464007), at unchanged speed and memory (ws resolve 0.73 s / 0.60 GB) — production callers already supply id-sorted importers, so the sort only pins what discovery order made incidental.
  • Two new regression tests fail without the sort and pass with it: backedge_bindings_do_not_depend_on_importer_order (peers level) and deprecation_attribution_does_not_depend_on_importer_listing_order (workspace level).
  • Two tests that pinned a non-production importer order (a non-root importer walking before the root) are re-pinned with their intent preserved: the ownership-handover fixture now routes the shared subtree through the peer-hoist round — the only way a handover can occur under root-first order — and still asserts the wanted-lockfile subtree survives it.
  • Suites: resolver 334/334, package-manager + CLI 3,202/3,202; fmt/clippy clean.

An earlier design (binding back-edge occurrences at bare workspace-root context) was measured and rejected: +18.6% lockfile on the 5-importer fixture. The id-sort achieves the same invariance at zero output change.

Not mirrored in the TypeScript CLI: this hardens v12's canonical-resolution guarantee (#13866); the v11 TypeScript CLI keeps v11 semantics.

Squash Commit Body

Process workspace importers in project-id order in resolve_workspace
and resolve_peers_workspace. Children-owner claims rank by importer
position, hoist rounds run sequentially in list order, and shared
canonical back-edge occurrences bind whichever importer's walk
realizes them first — so the caller's listing order leaked into
ownership, the first-walk missing scope, auto-install decisions,
deprecation attribution, and cycle back-edge bindings (Closes
pnpm/pnpm#13846). Per-importer options are still built in the
caller's order first, so positional options callbacks line up.

A reversed packages listing of the 5-importer bit fixture now
produces a byte-identical lockfile, and both bit fixtures are
byte-identical to the unsorted resolver's output at unchanged
speed and memory. Regression tests pin both levels; two tests that
pinned a non-root importer walking before the root are re-pinned
with their scenarios preserved.

Checklist

  • I checked the referenced issue and verified that none of the PRs already linked to it solves it.
  • The change is implemented in both the TypeScript CLI and the Rust pnpm/ port, or the description notes what still needs porting. (v12-only: hardens the canonical-resolution guarantee introduced in feat(resolver)!: break dependency cycles canonically #13866.)

Written by an agent (Claude Code, claude-fable-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

    • Dependency resolution now produces consistent results regardless of workspace project ordering.
    • Lockfiles and dependency graphs use deterministic peer dependency placement, including cyclic dependencies.
    • Deprecation notices are attributed consistently across different importer orders.
  • Tests

    • Added coverage to verify identical dependency outcomes when workspace projects are listed in different orders.

Children-owner claims rank by importer position, the hoist rounds run
sequentially in list order, and shared canonical back-edge occurrences
bind whichever importer's walk realizes them first — so the caller's
importer listing order leaked into ownership, the first-walk missing
scope, every auto-install decision, and cycle back-edge bindings
(#13846). Both resolve_workspace and resolve_peers_workspace
now sort importers by id up front, making the output a function of the
importer set alone; per-importer options are still built in the
caller's order first, so positional options callbacks keep lining up.

An explicit reversed `packages` listing of the 5-importer bit fixture
now produces a byte-identical lockfile, and both bit fixtures are
byte-identical to the unsorted resolver's output — production callers
already supply id-sorted importers, so this only pins what discovery
order made incidental. Two tests that pinned a non-root importer
walking before the root are re-pinned: deprecation attribution keys the
first occurrence by id order, and the ownership-handover fixture routes
the shared subtree through the peer-hoist round, which is the only way
a handover can reach a root-first walk.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings August 13, 2026 15:15

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 13, 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: 59fc65b8-59e1-4bd6-bd10-b265e6bb640d

📥 Commits

Reviewing files that changed from the base of the PR and between 9b80df8 and e09a2b4.

📒 Files selected for processing (5)
  • .changeset/importer-order-invariance.md
  • pnpm/crates/resolving-deps-resolver/src/resolve_peers.rs
  • pnpm/crates/resolving-deps-resolver/src/resolve_peers/tests.rs
  • pnpm/crates/resolving-deps-resolver/src/resolve_workspace.rs
  • pnpm/crates/resolving-deps-resolver/src/resolve_workspace/tests.rs

📝 Walkthrough

Walkthrough

The resolver now sorts workspace importers by ID before workspace and peer dependency processing. Tests verify stable graph keys, peer-cycle back-edge bindings, deprecation attribution, and lockfile results across importer input orders.

Changes

Importer-order resolution invariance

Layer / File(s) Summary
Deterministic workspace processing
.changeset/importer-order-invariance.md, pnpm/crates/resolving-deps-resolver/src/resolve_workspace.rs, pnpm/crates/resolving-deps-resolver/src/resolve_workspace/tests.rs
Workspace importers are sorted by ID before cutoff calculation and dependency resolution. Tests verify identical deprecation attribution for reversed input orders.
Deterministic peer traversal
pnpm/crates/resolving-deps-resolver/src/resolve_peers.rs, pnpm/crates/resolving-deps-resolver/src/resolve_peers/tests.rs
Peer root selection, traversal, and direct-dependency path reconstruction use sorted importers. A cyclic workspace test verifies stable graph keys and deterministic back-edge provider binding.

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

Mergeability Score: ⚪ Minimal · up to e09a2

The Rust v12 resolver now produces lockfiles and peer graphs independently of workspace importer listing order, while v11 intentionally keeps its existing behavior. The supplied tests and checks pass, so no actionable merge-blocking risk remains beyond normal review.

Sequence Diagram(s)

sequenceDiagram
  participant WorkspaceResolver
  participant PeerResolver
  participant DependencyGraph
  WorkspaceResolver->>PeerResolver: pass importers in ID order
  PeerResolver->>DependencyGraph: resolve peers and reconstruct dependency paths
  DependencyGraph-->>PeerResolver: return deterministic graph keys and cycle bindings
Loading

Possibly related PRs

  • pnpm/pnpm#13866: Modifies peer-resolution ordering and cycle handling for deterministic graph results.
  • pnpm/pnpm#13432: Modifies workspace and peer-resolution traversal ordering.
  • pnpm/pnpm#13584: Enforces deterministic traversal in the Rust dependency resolver.

Suggested labels: product: pacquet

Suggested reviewers: sensei-woo

✨ 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 importer-order-invariance

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

Canonicalize workspace resolution by sorting importers by project id

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Sort workspace importers by project id to make resolution deterministic across discovery order.
• Stabilize first-writer-wins behaviors (hoisting, ownership, deprecation attribution, back-edge
 binding).
• Add regression tests to ensure lockfile/graph invariance under reversed importer listing.
Diagram

graph TD
  A["Workspace project discovery"] --> B["resolve_workspace"] --> C["Sort importers by id"] --> D["Workspace walk / hoist"] --> E[("Lockfile / graph")]
  A --> F["resolve_peers_workspace"] --> C
  D --> G["Deprecation attribution"] --> E
  D --> H["Cycle back-edge binding"] --> E

  subgraph Legend
    direction LR
    _in(["Function/module"]) ~~~ _out[("Persistent output")]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Enforce sorted importers at the call sites only
  • ➕ Keeps resolver code minimal (no extra sort/unzip logic)
  • ➕ Makes ordering responsibility explicit at API boundaries
  • ➖ Brittle: any new caller or discovery mechanism can reintroduce nondeterminism
  • ➖ Harder to reason about invariants since correctness depends on external discipline
2. Rework caches/bindings to be order-independent (e.g., deterministic tie-breaking per event)
  • ➕ Avoids relying on global importer ordering
  • ➕ Can target only the specific first-writer-wins sites
  • ➖ More invasive: many subtle first-writer-wins behaviors across hoisting/ownership/back-edges
  • ➖ Higher risk of behavior drift; prior attempt noted output bloat (lockfile growth)

Recommendation: Keep the current approach: sorting importers by project id at the resolver entrypoints is the smallest, safest way to canonicalize all downstream first-writer-wins behaviors without changing output for existing (already-sorted) production callers. The added regression tests appropriately lock in the determinism guarantee.

Files changed (5) +209 / -10

Bug fix (2) +28 / -5
resolve_peers.rsSort peer-workspace importers by id before walking +13/-3

Sort peer-workspace importers by id before walking

• Canonicalizes the importer walk order in 'resolve_peers_workspace' by sorting inputs by 'importer.id'. Adjusts iteration and root-importer lookup to work with the sorted vector of references, stabilizing first-writer-wins occurrence/binding behavior.

pnpm/crates/resolving-deps-resolver/src/resolve_peers.rs

resolve_workspace.rsSort workspace importers (and options) by id for deterministic resolution +15/-2

Sort workspace importers (and options) by id for deterministic resolution

• Pairs 'WorkspaceImporter' values with their per-importer options, sorts by importer id, and unzips to maintain correct option association after ordering. Updates 'compute_time_based_cutoff' to accept the new importer reference slice, ensuring all downstream phases run in stable order.

pnpm/crates/resolving-deps-resolver/src/resolve_workspace.rs

Tests (2) +176 / -5
tests.rsAdd regression test for back-edge binding invariance +96/-0

Add regression test for back-edge binding invariance

• Adds 'backedge_bindings_do_not_depend_on_importer_order', constructing a shared cycle with conflicting overlays and asserting identical graph keys under swapped importer order. Ensures back-edge occurrence binding is deterministic due to id-ordered importer processing.

pnpm/crates/resolving-deps-resolver/src/resolve_peers/tests.rs

tests.rsAdd/adjust tests for deterministic deprecation attribution and ownership handover +80/-5

Add/adjust tests for deterministic deprecation attribution and ownership handover

• Re-pins an existing deprecation test to align with id-ordered walking and adds 'deprecation_attribution_does_not_depend_on_importer_listing_order' to validate invariance under reversed listing. Adjusts the ownership-handover fixture so the handover can still occur under root-first/id-ordered processing while preserving the intended subtree reuse assertion.

pnpm/crates/resolving-deps-resolver/src/resolve_workspace/tests.rs

Documentation (1) +5 / -0
importer-order-invariance.mdAdd changeset for importer-order invariance +5/-0

Add changeset for importer-order invariance

• Introduces a patch changeset documenting that workspace resolution and lockfile output are now independent of project listing/discovery order. Notes related behavioral stabilizations (peer placement, deprecation attribution, back-edge bindings) and references the tracking issue.

.changeset/importer-order-invariance.md

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. Changeset missing pnpm entry 📘 Rule violation § Compliance
Description
The new changeset lists only pacquet and does not declare a bump for pnpm, which violates the
changeset-frontmatter requirement and can lead to incomplete versioning/release metadata.
Code

.changeset/importer-order-invariance.md[R1-3]

+---
+"pacquet": patch
+---
Relevance

●●● Strong

Very similar changeset frontmatter missing pnpm was fixed and accepted recently.

PR-#13748
PR-#13403

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires newly added/modified changeset files to include an explicit pnpm
entry with a valid bump type. The added changeset front-matter includes only pacquet and therefore
does not meet that requirement.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/importer-order-invariance.md[1-3]

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

## Issue description
The changeset front-matter is missing a `pnpm` entry.

## Issue Context
Per the compliance rule, each added/modified changeset must explicitly declare a bump type for `pnpm` (`patch`/`minor`/`major`).

## Fix Focus Areas
- .changeset/importer-order-invariance.md[1-3]

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


Grey Divider

Context
✅ Compliance rules (platform): 26 rules

Grey Divider

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

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

No code suggestions found for the PR.

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

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.00     15.6±0.69ms    24.0 MB/sec    1.09     17.0±1.26ms    22.1 MB/sec
packument/parse                                  1.00     48.8±4.12µs  1358.6 MB/sec    1.01     49.2±2.30µs  1346.9 MB/sec
tarball/download_dependency                      1.00      3.5±0.23ms  1243.8 KB/sec    1.15      4.0±0.54ms  1085.1 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.03   251.7±16.99ms 63.6 KElem/sec    1.00   244.7±12.42ms 65.4 KElem/sec
workspace_resolution/hoist_heavy                 1.00   363.6±26.31ms        ? ?/sec    1.23   447.7±50.51ms        ? ?/sec

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.31%. Comparing base (9b80df8) to head (e09a2b4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13895   +/-   ##
=======================================
  Coverage   88.31%   88.31%           
=======================================
  Files         628      628           
  Lines      103990   103999    +9     
=======================================
+ Hits        91835    91846   +11     
+ Misses      12155    12153    -2     

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

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

@github-actions

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: e09a2b436e76

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.684 ± 0.127 2.564 2.955 1.65 ± 0.19
pacquet@main 2.748 ± 0.163 2.574 2.979 1.69 ± 0.21
pnpr@HEAD 1.630 ± 0.177 1.435 1.858 1.00
pnpr@main 1.678 ± 0.177 1.483 1.913 1.03 ± 0.16
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.68449869562,
      "stddev": 0.12699167251521903,
      "median": 2.63965398772,
      "user": 2.3483153399999996,
      "system": 1.9807446399999997,
      "min": 2.56421849372,
      "max": 2.95460435172,
      "times": [
        2.61146021072,
        2.59363278172,
        2.60311794372,
        2.56421849372,
        2.70914612872,
        2.59612051272,
        2.66784776472,
        2.95460435172,
        2.85411382272,
        2.69072494572
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.7484524711199994,
      "stddev": 0.16314709006267344,
      "median": 2.65673485672,
      "user": 2.2257044400000003,
      "system": 1.94907334,
      "min": 2.5736727947199998,
      "max": 2.97927522472,
      "times": [
        2.91611315472,
        2.90084004072,
        2.65225881072,
        2.66121090272,
        2.58069891172,
        2.6408916687199997,
        2.93878246272,
        2.64078073972,
        2.97927522472,
        2.5736727947199998
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.63046199232,
      "stddev": 0.17678861063744739,
      "median": 1.57325258572,
      "user": 1.47323734,
      "system": 1.5405630399999999,
      "min": 1.43454977172,
      "max": 1.85795086272,
      "times": [
        1.59616516072,
        1.5503400107199998,
        1.44178019472,
        1.82068524772,
        1.43454977172,
        1.84750770572,
        1.78217138072,
        1.47381148372,
        1.85795086272,
        1.49965810472
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.67788122982,
      "stddev": 0.17653336826688645,
      "median": 1.6894340367199998,
      "user": 1.50819274,
      "system": 1.64626564,
      "min": 1.4828422507199999,
      "max": 1.91346714272,
      "times": [
        1.60673861872,
        1.83532123072,
        1.84030640172,
        1.4892037867199999,
        1.4828422507199999,
        1.8342789607199999,
        1.4959948917199999,
        1.50852955972,
        1.91346714272,
        1.77212945472
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 343.1 ± 9.4 332.0 362.6 1.00
pacquet@main 346.8 ± 18.3 330.7 388.1 1.01 ± 0.06
pnpr@HEAD 360.7 ± 13.6 339.2 381.7 1.05 ± 0.05
pnpr@main 354.0 ± 12.9 324.3 377.9 1.03 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.34305651041999996,
      "stddev": 0.009419812026702452,
      "median": 0.34137895922,
      "user": 0.26986005999999996,
      "system": 0.6444894999999999,
      "min": 0.33203293922,
      "max": 0.36259644222000004,
      "times": [
        0.35540565722,
        0.34281062522,
        0.33778464622,
        0.34446289522,
        0.34184170222,
        0.33203293922,
        0.34091621622,
        0.36259644222000004,
        0.33343196422,
        0.33928201622000004
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.34675594162,
      "stddev": 0.018271904663299886,
      "median": 0.33666142622000006,
      "user": 0.26946795999999995,
      "system": 0.6767272999999999,
      "min": 0.33068780822,
      "max": 0.38813719022000004,
      "times": [
        0.33353281822,
        0.33650692922000003,
        0.33681592322000004,
        0.35196994322,
        0.33552716622,
        0.33524278922,
        0.35502640322,
        0.38813719022000004,
        0.36411244522,
        0.33068780822
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.36066735072000006,
      "stddev": 0.013599688171136964,
      "median": 0.36304944422,
      "user": 0.26732825999999993,
      "system": 0.6572508,
      "min": 0.33915825722000004,
      "max": 0.38172682322,
      "times": [
        0.33915825722000004,
        0.35065790522,
        0.36438289322,
        0.38172682322,
        0.37697314822,
        0.36804312522,
        0.36268535422000003,
        0.36341353422,
        0.35602262022000003,
        0.34360984622
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.35400624131999997,
      "stddev": 0.012910424391821496,
      "median": 0.35498431922,
      "user": 0.28221145999999997,
      "system": 0.6530462,
      "min": 0.32426860422000003,
      "max": 0.37789646422,
      "times": [
        0.35670652122,
        0.35003604322000004,
        0.37789646422,
        0.35300499422000003,
        0.32426860422000003,
        0.35447009722,
        0.35408183622,
        0.35697011722,
        0.35549854122,
        0.35712919422
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.854 ± 0.024 2.818 2.895 1.60 ± 0.11
pacquet@main 2.863 ± 0.066 2.811 3.025 1.60 ± 0.12
pnpr@HEAD 1.789 ± 0.123 1.635 1.978 1.00
pnpr@main 1.818 ± 0.184 1.550 2.078 1.02 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.85383519768,
      "stddev": 0.023575182730014316,
      "median": 2.85772886348,
      "user": 1.8943112599999998,
      "system": 1.8518040399999998,
      "min": 2.81841534498,
      "max": 2.8946537129800003,
      "times": [
        2.81841534498,
        2.8946537129800003,
        2.8234682809800002,
        2.8568939439800003,
        2.8789708649800003,
        2.83572315898,
        2.84834376998,
        2.86440511798,
        2.85856378298,
        2.8589139989800003
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.8634331028800006,
      "stddev": 0.06569134428028547,
      "median": 2.83714623998,
      "user": 1.9872652599999996,
      "system": 1.7907077399999998,
      "min": 2.81067441198,
      "max": 3.0251963719800004,
      "times": [
        2.8317789619800005,
        2.8126457459800003,
        2.81067441198,
        2.8296947129800003,
        2.83895485598,
        2.91775014898,
        2.8459737999800003,
        2.83533762398,
        2.88632439498,
        3.0251963719800004
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.7886373677800003,
      "stddev": 0.1227513294968571,
      "median": 1.7332654719799998,
      "user": 1.6271007599999998,
      "system": 1.7977135399999997,
      "min": 1.63481459298,
      "max": 1.97820741298,
      "times": [
        1.7013805659799999,
        1.94371544798,
        1.97820741298,
        1.74935907398,
        1.63481459298,
        1.78625235698,
        1.71290842098,
        1.7171718699799998,
        1.71228195898,
        1.95028197698
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.8177894495799998,
      "stddev": 0.1838242097905827,
      "median": 1.79478623048,
      "user": 1.63661416,
      "system": 1.8157325399999997,
      "min": 1.55044626098,
      "max": 2.07848717998,
      "times": [
        1.79589070598,
        2.05218895298,
        1.7371442659799998,
        1.79368175498,
        1.91907457998,
        1.55044626098,
        1.60515938798,
        2.07848717998,
        1.6701753279799998,
        1.9756460789799999
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 707.1 ± 78.8 593.0 850.8 1.88 ± 0.21
pacquet@main 672.5 ± 64.7 564.4 810.9 1.79 ± 0.18
pnpr@HEAD 395.4 ± 17.8 381.4 430.4 1.05 ± 0.05
pnpr@main 375.5 ± 8.7 365.0 388.5 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.7071434776200001,
      "stddev": 0.07875161292579914,
      "median": 0.7170630267200001,
      "user": 0.9205304,
      "system": 1.1623177400000002,
      "min": 0.5930175132200001,
      "max": 0.8508221052200001,
      "times": [
        0.74472403222,
        0.7313698512200001,
        0.7775711542200001,
        0.6978171822200001,
        0.5930175132200001,
        0.7212704282200001,
        0.6245959292200001,
        0.7128556252200001,
        0.8508221052200001,
        0.6173909552200001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.67246714402,
      "stddev": 0.06468656776988821,
      "median": 0.6641948212200001,
      "user": 0.9368055,
      "system": 1.0773678400000002,
      "min": 0.5644235092200001,
      "max": 0.8109435542200001,
      "times": [
        0.5644235092200001,
        0.69778291522,
        0.8109435542200001,
        0.6666863462200001,
        0.65376306922,
        0.66170329622,
        0.6097800412200001,
        0.7033114972200001,
        0.6591039192200001,
        0.69717329222
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.39541864772000007,
      "stddev": 0.01776010415993772,
      "median": 0.38636028272000006,
      "user": 0.23891819999999994,
      "system": 0.69146464,
      "min": 0.38141922322000005,
      "max": 0.43041832522000006,
      "times": [
        0.43041832522000006,
        0.41960041822000005,
        0.40849744522000003,
        0.3936860152200001,
        0.38258906522,
        0.38256774322000003,
        0.38760243422000007,
        0.38511813122000005,
        0.38141922322000005,
        0.38268767622000005
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.37550454732,
      "stddev": 0.00870726438613025,
      "median": 0.37179789122000007,
      "user": 0.24059399999999997,
      "system": 0.6346534399999999,
      "min": 0.36495930322000003,
      "max": 0.38846772422000003,
      "times": [
        0.38837628122000006,
        0.37652631122,
        0.36915707522,
        0.37299920422000005,
        0.37037127422000005,
        0.36495930322000003,
        0.37059657822000003,
        0.3850431522200001,
        0.36854856922000007,
        0.38846772422000003
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.012 ± 0.092 1.931 2.253 5.27 ± 0.29
pacquet@main 1.971 ± 0.031 1.926 2.026 5.16 ± 0.17
pnpr@HEAD 0.382 ± 0.011 0.357 0.396 1.00
pnpr@main 0.385 ± 0.014 0.374 0.419 1.01 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.0124803628000003,
      "stddev": 0.09240969318128713,
      "median": 2.003667084,
      "user": 0.9934095199999999,
      "system": 1.0382014800000001,
      "min": 1.930863869,
      "max": 2.252567817,
      "times": [
        1.9664873729999999,
        2.048002625,
        2.252567817,
        2.01402291,
        1.951322673,
        2.0134291920000003,
        1.940773001,
        1.995460308,
        2.01187386,
        1.930863869
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.9713691285000003,
      "stddev": 0.03085076202728358,
      "median": 1.9723868685,
      "user": 0.9582366200000001,
      "system": 0.97358578,
      "min": 1.925781767,
      "max": 2.0259356470000003,
      "times": [
        1.969834119,
        2.002968627,
        1.965893189,
        1.984202585,
        2.0259356470000003,
        1.927626153,
        1.981838799,
        1.925781767,
        1.9749396179999998,
        1.954670781
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.38180927130000003,
      "stddev": 0.011210628598279872,
      "median": 0.38442088100000005,
      "user": 0.24119861999999997,
      "system": 0.65288548,
      "min": 0.357420155,
      "max": 0.395674055,
      "times": [
        0.387110991,
        0.381730771,
        0.357420155,
        0.37520689100000004,
        0.387676008,
        0.39192598600000006,
        0.372340769,
        0.38846583100000004,
        0.38054125600000005,
        0.395674055
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.38484832650000006,
      "stddev": 0.013608320372305688,
      "median": 0.380087253,
      "user": 0.23992431999999994,
      "system": 0.6556905799999999,
      "min": 0.373851774,
      "max": 0.41877304400000004,
      "times": [
        0.37938963900000006,
        0.37657968100000005,
        0.37687827200000007,
        0.385165338,
        0.37747401500000005,
        0.373851774,
        0.39731923100000005,
        0.41877304400000004,
        0.38226740400000003,
        0.380784867
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 291.9 ± 34.2 249.5 375.6 2.80 ± 0.37
pacquet@main 314.8 ± 44.6 260.9 392.8 3.02 ± 0.47
pnpr@HEAD 104.1 ± 6.3 95.7 116.6 1.00
pnpr@main 106.1 ± 7.6 95.3 128.7 1.02 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2918507493,
      "stddev": 0.03415099316846303,
      "median": 0.28509412170000004,
      "user": 0.23970718,
      "system": 0.09192938,
      "min": 0.24946750920000002,
      "max": 0.37558612420000004,
      "times": [
        0.2856147612,
        0.37558612420000004,
        0.26711535620000004,
        0.27586075820000006,
        0.29869114620000004,
        0.24946750920000002,
        0.29247314920000006,
        0.28457348220000006,
        0.2762950282,
        0.31283017820000003
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.31483236670000003,
      "stddev": 0.04458631394305016,
      "median": 0.3075617197,
      "user": 0.26770818,
      "system": 0.11262697999999997,
      "min": 0.26086788120000004,
      "max": 0.39283435820000007,
      "times": [
        0.30654165720000004,
        0.3460617012,
        0.30858178220000004,
        0.29227342720000005,
        0.33066280220000005,
        0.39283435820000007,
        0.26086788120000004,
        0.2795500322,
        0.3693578652,
        0.26159216020000003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.10411785216000002,
      "stddev": 0.0063173406972005805,
      "median": 0.1019495722,
      "user": 0.02749406,
      "system": 0.01732324,
      "min": 0.0956520802,
      "max": 0.11656071220000001,
      "times": [
        0.11252606920000001,
        0.1043234172,
        0.0987480502,
        0.09910229620000001,
        0.0987148332,
        0.1097526562,
        0.1131734862,
        0.1102460162,
        0.11286945520000001,
        0.11017742320000001,
        0.11656071220000001,
        0.11092315520000001,
        0.10698737420000001,
        0.10109507020000001,
        0.10524111720000001,
        0.10013500720000001,
        0.09896920320000001,
        0.0956520802,
        0.09596270920000001,
        0.0957940082,
        0.10023290320000001,
        0.0978433672,
        0.10497394620000002,
        0.1019495722,
        0.10099237520000001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.10611987419999998,
      "stddev": 0.00760858159604852,
      "median": 0.1048615392,
      "user": 0.02941622166666666,
      "system": 0.017217404999999998,
      "min": 0.09532605420000001,
      "max": 0.1286567482,
      "times": [
        0.11450114420000002,
        0.1078076262,
        0.10183682420000001,
        0.10608418320000002,
        0.09827776120000001,
        0.10674418420000001,
        0.1286567482,
        0.11882435420000001,
        0.10724191120000001,
        0.1002113012,
        0.10584205020000001,
        0.11417374120000001,
        0.09864017820000001,
        0.09532605420000001,
        0.09651548420000002,
        0.1038810282,
        0.1037101212,
        0.10125559120000001,
        0.1031697272,
        0.11184572420000001,
        0.10821423120000001,
        0.1107506862,
        0.10264780720000001,
        0.10071851820000001
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 664.1 ± 105.3 533.0 866.2 1.00
pacquet@main 745.1 ± 140.2 554.6 947.0 1.12 ± 0.28
pnpm@HEAD 4600.3 ± 409.6 3946.7 5291.9 6.93 ± 1.26
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6641485802600001,
      "stddev": 0.10529359183736432,
      "median": 0.68309904126,
      "user": 0.6377907222222222,
      "system": 0.15812254222222222,
      "min": 0.53297768026,
      "max": 0.86623680426,
      "times": [
        0.86623680426,
        0.7189433872600001,
        0.70804453826,
        0.58023134326,
        0.7051718662600001,
        0.53642583426,
        0.6462067272600001,
        0.53297768026,
        0.68309904126
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.7450895399266666,
      "stddev": 0.14021799362037507,
      "median": 0.79070814426,
      "user": 0.7244798333333331,
      "system": 0.18312976444444443,
      "min": 0.5545715452600001,
      "max": 0.9470186312600001,
      "times": [
        0.56378202726,
        0.5545715452600001,
        0.90365223526,
        0.9470186312600001,
        0.63678373326,
        0.80846097526,
        0.79070814426,
        0.79687840826,
        0.70395015926
      ]
    },
    {
      "command": "pnpm@HEAD",
      "mean": 4.600272732593333,
      "stddev": 0.409609215562517,
      "median": 4.56922921826,
      "user": 6.654746277777777,
      "system": 0.4644225422222223,
      "min": 3.9467296802600003,
      "max": 5.29189086926,
      "times": [
        4.46130097126,
        4.53954851326,
        5.29189086926,
        4.81394861126,
        4.10084015726,
        4.88001457126,
        4.79895200126,
        3.9467296802600003,
        4.56922921826
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 5.062 ± 0.120 4.813 5.261 1.29 ± 0.04
pacquet@main 5.167 ± 0.176 4.904 5.447 1.31 ± 0.05
pnpr@HEAD 4.132 ± 0.123 3.909 4.312 1.05 ± 0.04
pnpr@main 3.935 ± 0.083 3.840 4.053 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 5.06174277608,
      "stddev": 0.12023802709380539,
      "median": 5.06700359968,
      "user": 3.1946765800000003,
      "system": 2.5563873999999998,
      "min": 4.813499847679999,
      "max": 5.261243158679999,
      "times": [
        5.05153120468,
        4.9367939086799995,
        5.08090794368,
        5.12570155268,
        5.053099255679999,
        5.261243158679999,
        5.12019068268,
        5.130387338679999,
        5.04407286768,
        4.813499847679999
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 5.167408430979999,
      "stddev": 0.17566654262130174,
      "median": 5.16003556068,
      "user": 3.3231267800000004,
      "system": 2.7434738999999997,
      "min": 4.903834907679999,
      "max": 5.44652121868,
      "times": [
        4.914150354679999,
        5.18371315968,
        4.903834907679999,
        5.33581476768,
        5.06475017768,
        5.2574505586799996,
        5.13635796168,
        5.44652121868,
        5.134185598679999,
        5.29730560468
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 4.132443196679999,
      "stddev": 0.12286411581544408,
      "median": 4.118444780679999,
      "user": 2.23781868,
      "system": 2.4819123000000003,
      "min": 3.90933845868,
      "max": 4.3122760396799995,
      "times": [
        4.3122760396799995,
        4.10432973868,
        4.20874252168,
        4.132559822679999,
        4.06685478668,
        4.23461164868,
        4.259668327679999,
        4.0167719026799995,
        4.0792787196799996,
        3.90933845868
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.93475598858,
      "stddev": 0.08326908229152867,
      "median": 3.92000808618,
      "user": 2.08412648,
      "system": 2.2389829,
      "min": 3.83984445068,
      "max": 4.053361164679999,
      "times": [
        3.84624282468,
        3.86918375168,
        4.01464216668,
        3.85639368568,
        3.83984445068,
        4.053361164679999,
        3.9017759716800002,
        4.03665535668,
        3.93824020068,
        3.99122031268
      ]
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13895
Testbedpacquet

🚨 1 Alert

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
isolated-linker.fresh-install.hot-cache.hot-storeLatency
milliseconds (ms)
📈 plot
🚷 threshold
🚨 alert (🔔)
593.02 ms
(+30.94%)Baseline: 452.89 ms
543.46 ms
(109.12%)

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,818.42 ms
(+2.76%)Baseline: 2,742.70 ms
3,291.24 ms
(85.63%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,930.86 ms
(+3.99%)Baseline: 1,856.75 ms
2,228.10 ms
(86.66%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
🚨 view alert (🔔)
593.02 ms
(+30.94%)Baseline: 452.89 ms
543.46 ms
(109.12%)

isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
249.47 ms
(+11.71%)Baseline: 223.31 ms
267.97 ms
(93.09%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,564.22 ms
(+4.86%)Baseline: 2,445.48 ms
2,934.58 ms
(87.38%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,813.50 ms
(+6.84%)Baseline: 4,505.44 ms
5,406.53 ms
(89.03%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
332.03 ms
(+13.75%)Baseline: 291.91 ms
350.29 ms
(94.79%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
532.98 ms
(-11.28%)Baseline: 600.76 ms
720.91 ms
(73.93%)
🐰 View full continuous benchmarking report in Bencher

@zkochan

zkochan commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

Bencher alert: baseline drift, not a regression

The single alert (fresh-install.hot-cache.hot-store, min 593 ms vs 453 ms baseline) has the same signature as the alerts dispositioned on #13866:

  1. Same-run pacquet@main is elevated identically — min 564 ms, itself +25% over the Bencher baseline. HEAD vs same-run main: 593 vs 564 ms min, 707 ± 79 vs 673 ± 65 ms mean — within one σ on the suite's noisiest scenario (spread 564–851 ms). The baseline was recorded on quieter runner days; Bencher only thresholds the PR branch's series.
  2. This diff cannot reach the scenario: it sorts the workspace importer list, and the benchmark fixture is a single-project install — sorting a one-element list is a no-op, so the executed resolver path is identical to main's.
  3. The scenarios that could see multi-importer effects agree: peer-heavy-resolve is the only benchmark below its baseline (−11.3%) and beats same-run main 664 vs 745 ms; every restore/cold shape is at or better than same-run main.

Written by an agent (Claude Code, claude-fable-5).

@zkochan
zkochan merged commit c547d28 into main Aug 13, 2026
32 of 33 checks passed
@zkochan
zkochan deleted the importer-order-invariance branch August 13, 2026 16:01
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