Repository navigation
perf(lockfile): rewrite exact catalog version changes without resolving - #13689
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds fast exact-version catalog updates in the Rust and TypeScript installers. The flow reuses fast override rewriting, validates exclusive catalog references and dependency compatibility, updates lockfiles directly when safe, and falls back to full resolution otherwise. ChangesCatalog version fast update
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoFast-path lockfile rewrite for exact catalog version changes (no resolution)
AI Description
Diagram
High-Level Assessment
Files changed (11)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (5): Last reviewed commit: "fix(deps-installer): absorb satisfied ca..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts (1)
78-83: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse one options object for
applyFastRewrite.
applyFastRewritehas four arguments. Use one specific options object for these inputs. This follows the TypeScript argument-limit rule and makes shared call sites less error-prone.As per coding guidelines, functions must use an options object when they need more than three arguments.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts` around lines 78 - 83, Update applyFastRewrite to accept a single options object containing lockfile, fastOverrides, opts, and settings instead of four positional arguments. Adjust every call site and internal destructuring to use the new object shape while preserving existing behavior.Source: Coding guidelines
.changeset/exact-catalog-version-rewrite.md (1)
7-7: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReduce this changeset to the observable install behavior.
The shared override mechanism and graph-reference conditions are implementation details. Keep the release note concise and user-facing.
Proposed changeset text
-Changing a catalog entry to a different exact version no longer re-resolves the dependency graph. The package is replaced in `pnpm-lock.yaml` directly, reusing the same check the `pnpm.overrides` fast path applies: every locked dependency of the package must still satisfy the new version's manifest. Installs fall back to a full resolution when anything other than the catalog reaches the package — an importer that depends on it directly, or another package that depends on it — since the graph would then need both versions. +Changing a catalog entry to a different exact version can update compatible `pnpm-lock.yaml` entries without full dependency resolution.As per coding guidelines, changeset text must describe user-visible behavior and keep implementation rationale in commits. Based on learnings, avoid internal resolver details in Changeset entries.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.changeset/exact-catalog-version-rewrite.md at line 7, Rewrite the changeset to describe only the user-visible install behavior when changing a catalog entry to a different exact version: reuse the existing lockfile when the dependency graph remains compatible, otherwise perform a full resolution. Remove references to shared override logic, graph traversal, importers, manifests, and other resolver implementation details.Sources: Coding guidelines, Path instructions, Learnings
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm/crates/package-manager/src/fast_update_catalog_versions.rs`:
- Around line 27-34: Before rewriting entries in the fast catalog update helper,
invoke the same catalog-reference snapshot guard used by
try_fast_update_catalogs. Preserve its fallback behavior so unsupported snapshot
or key shapes return no reuse candidate and trigger full resolution, including
when another catalog reference lacks its required snapshot.
In `@pnpm11/installing/deps-installer/src/install/index.ts`:
- Around line 771-793: Update the catalog rewrite flow around
tryFastUpdateCatalogs and tryFastUpdateCatalogVersions so the exact-version
helper always runs after the range-only helper, even when the latter returns
true; return true when either helper succeeds, and only return the range-only
result when the exact-version helper declines. Preserve the overridesUseCatalogs
guard, and add an install-level regression covering a mixed update with both a
range-only catalog change and an exact-version package move.
In `@pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts`:
- Around line 78-83: Update applyFastRewrite and its manifest-processing flow to
rerun the complete safety validation on the manifest after readPackageHook,
rejecting changes to name, version, deprecated, bundled dependencies, and
engines.runtime consistently with Rust’s is_safe_registry_result behavior.
Preserve the existing fallback path for unsafe rewrites, and add matching
TypeScript and Rust tests covering hooks that introduce each protected field and
verify identical lockfile and fallback semantics.
---
Nitpick comments:
In @.changeset/exact-catalog-version-rewrite.md:
- Line 7: Rewrite the changeset to describe only the user-visible install
behavior when changing a catalog entry to a different exact version: reuse the
existing lockfile when the dependency graph remains compatible, otherwise
perform a full resolution. Remove references to shared override logic, graph
traversal, importers, manifests, and other resolver implementation details.
In `@pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts`:
- Around line 78-83: Update applyFastRewrite to accept a single options object
containing lockfile, fastOverrides, opts, and settings instead of four
positional arguments. Adjust every call site and internal destructuring to use
the new object shape while preserving existing behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: d15c2745-6296-4980-a92d-fdb23f979019
📒 Files selected for processing (11)
.changeset/exact-catalog-version-rewrite.mdpnpm/crates/package-manager/src/fast_update_catalog_versions.rspnpm/crates/package-manager/src/fast_update_catalog_versions/tests.rspnpm/crates/package-manager/src/fast_update_overrides.rspnpm/crates/package-manager/src/fast_update_overrides/tests.rspnpm/crates/package-manager/src/install_with_fresh_lockfile/resolve.rspnpm/crates/package-manager/src/lib.rspnpm11/installing/deps-installer/src/install/index.tspnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.tspnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.tspnpm11/installing/deps-installer/test/install/catalogVersionFastUpdate.ts
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Gate the rewrite on the same catalog-reference check the range-only path opens with. An importer pointing at a catalog entry with nothing recorded for it needs the resolver, and this path iterates the recorded entries, so it would never have looked at that one. Absorb the range-only entries a mixed update carries. The TypeScript range-only rewrite keeps the entries it cannot handle and still reports success, so returning early on it stranded the exact move and sent the install to a full resolution; run both and take either. pacquet declines a mixed update outright, so it now handles the range-only entries in the same pass. Re-run the whole manifest safety check after `readPackageHook`, which the TypeScript side only did for peer dependencies. pacquet validates after its hook, so a hook introducing a name, version, deprecation, bundled dependency, or runtime engine change took the fast path on one stack and not the other. Move the duplicate-name check into the shared plan builder, where it belongs to the plan rather than to overrides. Both callers already reject that case earlier for their own reasons -- verified by removing it -- so this is depth, not a fix. Reported by CodeRabbit and Greptile on #13689.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts (1)
323-324: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove the historical comment.
The validation condition documents the current fallback rule. The comment describes pacquet history and repeats the condition.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts` around lines 323 - 324, Remove the historical comment immediately above the validation condition in the fast-update override logic, leaving the condition and surrounding fallback behavior unchanged.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts`:
- Around line 323-324: Remove the historical comment immediately above the
validation condition in the fast-update override logic, leaving the condition
and surrounding fallback behavior unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: bde2059a-5590-43da-9860-c2916686fbc5
📒 Files selected for processing (9)
pnpm/crates/package-manager/src/fast_update_catalog_versions.rspnpm/crates/package-manager/src/fast_update_catalog_versions/tests.rspnpm/crates/package-manager/src/fast_update_catalogs.rspnpm/crates/package-manager/src/fast_update_overrides.rspnpm11/installing/deps-installer/src/install/index.tspnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.tspnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogs.tspnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.tspnpm11/installing/deps-installer/test/install/catalogVersionFastUpdate.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts
- pnpm11/installing/deps-installer/src/install/index.ts
- pnpm/crates/package-manager/src/fast_update_catalog_versions.rs
- pnpm/crates/package-manager/src/fast_update_overrides.rs
Micro-Benchmark ResultsLinux |
|
Code review by qodo was updated up to the latest commit f639db5 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13689 +/- ##
==========================================
+ Coverage 88.17% 88.19% +0.02%
==========================================
Files 613 614 +1
Lines 99833 99951 +118
==========================================
+ Hits 88024 88149 +125
+ Misses 11809 11802 -7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Integrated-Benchmark Report (Linux)Commit: 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
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.5046342079,
"stddev": 0.1312760511850856,
"median": 2.4848975455,
"user": 1.6206213999999999,
"system": 1.32184986,
"min": 2.34963525,
"max": 2.6698291490000003,
"times": [
2.506465654,
2.463329437,
2.34963525,
2.6698291490000003,
2.378779859,
2.6152652040000004,
2.65477402,
2.3893845380000003,
2.647511866,
2.3713671020000002
]
},
{
"command": "pacquet@main",
"mean": 2.4653394248000002,
"stddev": 0.1465293961163958,
"median": 2.3937521790000003,
"user": 1.5772532,
"system": 1.33979786,
"min": 2.3477404980000003,
"max": 2.778654038,
"times": [
2.4069820550000003,
2.353738071,
2.527733146,
2.3805223030000002,
2.469655211,
2.3477404980000003,
2.652541389,
2.3567751620000004,
2.379052375,
2.778654038
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5250881474,
"stddev": 0.11334466462088526,
"median": 1.5314956425000001,
"user": 1.0950748,
"system": 1.15368446,
"min": 1.3849477140000002,
"max": 1.7463287480000003,
"times": [
1.521195129,
1.437982882,
1.5873419100000001,
1.4673880990000001,
1.5417961560000002,
1.3849477140000002,
1.7463287480000003,
1.5427297650000003,
1.6355215740000002,
1.3856494970000002
]
},
{
"command": "pnpr@main",
"mean": 1.4954422285000002,
"stddev": 0.13320050372819314,
"median": 1.4296345525,
"user": 1.1589106,
"system": 1.13204206,
"min": 1.3720652560000002,
"max": 1.7301244750000002,
"times": [
1.3817264880000002,
1.6084042150000002,
1.659118373,
1.40571284,
1.5655174190000003,
1.7301244750000002,
1.3720652560000002,
1.4385866310000002,
1.3724841140000001,
1.4206824740000001
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2579037259,
"stddev": 0.009484061945358935,
"median": 0.2550604581,
"user": 0.21620932,
"system": 0.5032424799999999,
"min": 0.24907537210000003,
"max": 0.27568198909999997,
"times": [
0.2531219731,
0.2585773861,
0.24907537210000003,
0.27568198909999997,
0.2533809501,
0.2567399661,
0.25020178309999996,
0.2501740421,
0.2583326851,
0.27375111209999997
]
},
{
"command": "pacquet@main",
"mean": 0.2572380245,
"stddev": 0.008289384640179953,
"median": 0.2583862121,
"user": 0.20033381999999994,
"system": 0.5305596800000001,
"min": 0.24300112410000002,
"max": 0.2708298511,
"times": [
0.24904370210000001,
0.24300112410000002,
0.2502838081,
0.2565456611,
0.2542428441,
0.2615813541,
0.26182222709999997,
0.2708298511,
0.2602267631,
0.2648029101
]
},
{
"command": "pnpr@HEAD",
"mean": 0.275547277,
"stddev": 0.008983864561651598,
"median": 0.2785923846,
"user": 0.22908692,
"system": 0.51516608,
"min": 0.26255044909999997,
"max": 0.2873529781,
"times": [
0.2698501151,
0.27748356209999997,
0.2629789461,
0.26255044909999997,
0.2805525921,
0.2798820881,
0.2873529781,
0.2863559301,
0.2797012071,
0.2687649021
]
},
{
"command": "pnpr@main",
"mean": 0.2762511447,
"stddev": 0.007297910281831041,
"median": 0.2752374666,
"user": 0.21167631999999995,
"system": 0.5432668799999999,
"min": 0.2646793081,
"max": 0.2858273461,
"times": [
0.2855306061,
0.2728921351,
0.27559272009999997,
0.2748822131,
0.2858273461,
0.2646793081,
0.2689826121,
0.2702327061,
0.2821824601,
0.2817093401
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.6110711876200012,
"stddev": 0.016856724996600805,
"median": 2.6059184357200005,
"user": 1.56609166,
"system": 1.3306296000000002,
"min": 2.5810738247200002,
"max": 2.63998498772,
"times": [
2.5810738247200002,
2.60616819272,
2.6174736647200003,
2.6056686787200003,
2.5987822647200005,
2.62359743772,
2.6034251787200002,
2.6053510337200003,
2.63998498772,
2.6291866127200003
]
},
{
"command": "pacquet@main",
"mean": 2.6103509830200005,
"stddev": 0.018162144446555336,
"median": 2.6071464757200005,
"user": 1.55753696,
"system": 1.3511207,
"min": 2.5884022567200002,
"max": 2.64326325172,
"times": [
2.6228833227200004,
2.6184860917200004,
2.60782894072,
2.5905147947200002,
2.64326325172,
2.62968788672,
2.6064640107200003,
2.5884022567200002,
2.6045509887200002,
2.59142828572
]
},
{
"command": "pnpr@HEAD",
"mean": 1.6536620237200002,
"stddev": 0.16177094620190613,
"median": 1.6251938057200002,
"user": 1.07126476,
"system": 1.138349,
"min": 1.42910232572,
"max": 1.8894942787200002,
"times": [
1.42910232572,
1.6437985107200002,
1.6014938837200001,
1.45698535072,
1.6065891007200002,
1.52119763672,
1.75982396772,
1.86646605972,
1.76166912272,
1.8894942787200002
]
},
{
"command": "pnpr@main",
"mean": 1.5867134152199998,
"stddev": 0.15422675647754167,
"median": 1.50466777772,
"user": 1.06918446,
"system": 1.1316544000000002,
"min": 1.43505151372,
"max": 1.8513712637200002,
"times": [
1.44395261572,
1.51182194072,
1.43505151372,
1.8513712637200002,
1.49751361472,
1.49676149872,
1.70922591972,
1.45127647872,
1.76347889072,
1.70668041572
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.4184211123,
"stddev": 0.014823023994738288,
"median": 0.4158968739,
"user": 0.5276605199999999,
"system": 0.7259750599999999,
"min": 0.40206985840000004,
"max": 0.4391184804,
"times": [
0.40206985840000004,
0.40234956540000005,
0.41574859940000003,
0.4160451484,
0.42364978940000003,
0.4380623014,
0.4391184804,
0.40374672640000003,
0.40828310040000004,
0.43513755340000004
]
},
{
"command": "pacquet@main",
"mean": 0.4286723887,
"stddev": 0.01380242635647042,
"median": 0.43013620490000004,
"user": 0.5463052199999999,
"system": 0.6920574599999999,
"min": 0.40535036640000005,
"max": 0.45283955140000004,
"times": [
0.40535036640000005,
0.4330291424,
0.41682989540000004,
0.42886398740000004,
0.43964829040000003,
0.43722869340000003,
0.41365499840000003,
0.4278705394,
0.45283955140000004,
0.43140842240000005
]
},
{
"command": "pnpr@HEAD",
"mean": 0.31082856180000007,
"stddev": 0.006466885164386984,
"median": 0.3096464014,
"user": 0.20328142000000002,
"system": 0.54105076,
"min": 0.30460328940000003,
"max": 0.3242019184,
"times": [
0.3114773344,
0.31408343240000003,
0.3072362474,
0.30469271740000003,
0.30781879440000004,
0.30460328940000003,
0.30474592840000003,
0.3242019184,
0.31795194740000005,
0.3114740084
]
},
{
"command": "pnpr@main",
"mean": 0.30542350420000003,
"stddev": 0.008063286433517414,
"median": 0.30552707889999997,
"user": 0.20830272,
"system": 0.5147353599999999,
"min": 0.2940985064,
"max": 0.31715383540000003,
"times": [
0.31715383540000003,
0.3051596774,
0.3058944804,
0.3158902364,
0.29910246040000005,
0.2940985064,
0.30920188940000004,
0.31081495740000004,
0.2946414594,
0.3022775394
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.7359206573400001,
"stddev": 0.011994200297617595,
"median": 1.73473744254,
"user": 0.7668765399999999,
"system": 0.7714725599999999,
"min": 1.72357288154,
"max": 1.76747474754,
"times": [
1.72357288154,
1.73709462654,
1.73613056154,
1.73773011254,
1.73091947654,
1.73548147854,
1.73399340654,
1.72851191354,
1.72829736854,
1.76747474754
]
},
{
"command": "pacquet@main",
"mean": 1.7293030641399998,
"stddev": 0.010445398649244694,
"median": 1.72628877304,
"user": 0.7435578399999999,
"system": 0.79098746,
"min": 1.71734172954,
"max": 1.75560837254,
"times": [
1.72528524754,
1.73703149754,
1.72604634954,
1.7266587935400002,
1.72507812754,
1.72402143654,
1.71734172954,
1.72653119654,
1.72942789054,
1.75560837254
]
},
{
"command": "pnpr@HEAD",
"mean": 0.31127959144,
"stddev": 0.003135217485455133,
"median": 0.31131434954000003,
"user": 0.20153694,
"system": 0.5353288599999999,
"min": 0.30471109354000003,
"max": 0.31579867354,
"times": [
0.31295175254,
0.30471109354000003,
0.31044563354,
0.30982309954000004,
0.31361852854,
0.31218306554,
0.31395106454,
0.30911173054,
0.31579867354,
0.31020127254
]
},
{
"command": "pnpr@main",
"mean": 0.31682486223999995,
"stddev": 0.008756222312065817,
"median": 0.31685806904,
"user": 0.20207804000000001,
"system": 0.5518006599999999,
"min": 0.30161719654,
"max": 0.33565005754,
"times": [
0.31954566054,
0.33565005754,
0.30161719654,
0.32186794254,
0.31481963954000003,
0.30903997654,
0.31446513254,
0.31620321554,
0.31751292254,
0.31752687854
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2146663127566667,
"stddev": 0.010427486222722257,
"median": 0.21449026784000003,
"user": 0.17439708333333337,
"system": 0.06083563,
"min": 0.19624745784,
"max": 0.23235674884000002,
"times": [
0.23235674884000002,
0.22706121584,
0.21047520184000001,
0.20086781884000002,
0.21489647784000002,
0.21252201684,
0.22277394284000002,
0.21916661984,
0.21925674884000002,
0.20628744584,
0.21408405784,
0.19624745784
]
},
{
"command": "pacquet@main",
"mean": 0.21966549334000002,
"stddev": 0.016783040714105035,
"median": 0.21752625584000002,
"user": 0.1680349375,
"system": 0.06658713000000001,
"min": 0.18316205584,
"max": 0.25126776284,
"times": [
0.18316205584,
0.20612025084,
0.22609338384,
0.21795602984,
0.25126776284,
0.20247245184,
0.21121396284,
0.24948130684,
0.21876652484,
0.21603457184,
0.23725237884,
0.22622440084,
0.22034292384,
0.21427708184,
0.21709648184,
0.21688632484
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08762640268848486,
"stddev": 0.0018107740035222344,
"median": 0.08738858584,
"user": 0.02136272727272727,
"system": 0.008360372121212122,
"min": 0.08415311284000002,
"max": 0.09577527084000001,
"times": [
0.08627183384,
0.08732185084,
0.08679074084,
0.08790321584,
0.08706980684000001,
0.08798677384,
0.08801303184,
0.08739817484000001,
0.09089973884000001,
0.08415311284000002,
0.08753427084000001,
0.08818196084,
0.08713977784000002,
0.08726122684000001,
0.08708936284000002,
0.08738858584,
0.08762003184000001,
0.08734558584000002,
0.08866392784000002,
0.08638253284000001,
0.08728341884000002,
0.08747513984000001,
0.08744312984000001,
0.08765477784000002,
0.08799390684000001,
0.08642284884000001,
0.08718711684000001,
0.08917436884,
0.08641247784000002,
0.09577527084000001,
0.08622385384000002,
0.08751151784000001,
0.08669791684000001
]
},
{
"command": "pnpr@main",
"mean": 0.08732803341575757,
"stddev": 0.0007349006326384388,
"median": 0.08734763984,
"user": 0.019168090909090905,
"system": 0.010822095757575756,
"min": 0.08580924284000001,
"max": 0.08897834084000002,
"times": [
0.08621961584000001,
0.08714517784,
0.08659326884000002,
0.08737759584000002,
0.08812090584000001,
0.08639453484000001,
0.08788420984,
0.08804735784,
0.08639034784,
0.08734763984,
0.08795722784000001,
0.08718141684000001,
0.08750003684000002,
0.08751107684000001,
0.08696015984000001,
0.08762097484,
0.08841572084000002,
0.08666014484000001,
0.08897834084000002,
0.08580924284000001,
0.08702106384000001,
0.08717565484,
0.08706888484000001,
0.08763706484000001,
0.08768577684000001,
0.08690897384000001,
0.08818209184,
0.08727056484000001,
0.08686739484000001,
0.08746382884000001,
0.08738389784000002,
0.08880404284000001,
0.08624086584000001
]
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.7706880434666668,
"stddev": 0.10368536656609133,
"median": 0.7231687408,
"user": 0.71357296,
"system": 0.12145770666666664,
"min": 0.6746934218,
"max": 0.9610278998,
"times": [
0.9207823598,
0.9610278998,
0.7923386088000001,
0.6828976428,
0.6746934218,
0.7231687408,
0.7015565808,
0.7184244848,
0.7613026518
]
},
{
"command": "pacquet@main",
"mean": 0.8983499444666667,
"stddev": 0.21315808964072006,
"median": 0.8668730698,
"user": 0.8414626266666665,
"system": 0.13988348444444443,
"min": 0.6029905228,
"max": 1.1768376558,
"times": [
1.1768376558,
0.7111001718000001,
1.1689371378,
0.9969586028,
1.0546349468,
0.6029905228,
0.8348429508,
0.8668730698,
0.6719744418
]
},
{
"command": "pnpm@HEAD",
"mean": 3.013718705688889,
"stddev": 0.08160894642903954,
"median": 3.0037067538000004,
"user": 4.630787848888889,
"system": 0.26429604,
"min": 2.8863820818000003,
"max": 3.1486043608000003,
"times": [
3.0372110078000003,
3.1486043608000003,
3.1263574458,
3.0057462838,
2.9689313048000003,
2.9635371478000003,
2.9829919648000005,
2.8863820818000003,
3.0037067538000004
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.5609642011,
"stddev": 0.16286735359668947,
"median": 4.4712902808,
"user": 1.7693440799999998,
"system": 1.4443840399999999,
"min": 4.4187304668,
"max": 4.8464889718,
"times": [
4.4305166638,
4.7039262768,
4.6969307918,
4.4255411828,
4.4187304668,
4.4209318828,
4.4858699978,
4.7239952128,
4.4567105638,
4.8464889718
]
},
{
"command": "pacquet@main",
"mean": 4.607792191499999,
"stddev": 0.11549858393069166,
"median": 4.6047892948,
"user": 1.9875714799999997,
"system": 1.46129324,
"min": 4.4402221528,
"max": 4.7997478398,
"times": [
4.4402221528,
4.6918332128,
4.7082789138,
4.5457785678,
4.6352794498,
4.7997478398,
4.5082939267999995,
4.4834304428,
4.5742991398,
4.6907582688
]
},
{
"command": "pnpr@HEAD",
"mean": 3.5792354442000005,
"stddev": 0.12319951670936569,
"median": 3.5354302137999998,
"user": 1.2381940799999998,
"system": 1.26227224,
"min": 3.4646865077999998,
"max": 3.7971140558,
"times": [
3.7485983948,
3.4755850118,
3.6635897028,
3.4891771588,
3.4646865077999998,
3.4955828928,
3.5752775347999997,
3.6171225847999997,
3.7971140558,
3.4656205978
]
},
{
"command": "pnpr@main",
"mean": 3.5704277545,
"stddev": 0.14132387104881008,
"median": 3.5039939123,
"user": 1.2185741799999998,
"system": 1.23844294,
"min": 3.4539764687999996,
"max": 3.8089467388,
"times": [
3.5159898627999997,
3.8021725828,
3.4539764687999996,
3.8089467388,
3.4919979618,
3.4547065808,
3.4725127787999996,
3.5710870658,
3.4581191768,
3.6747683278
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13689 |
| Testbed | pnpr |
⚠️ 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-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,429.10 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 304.71 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 304.60 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 84.15 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,384.95 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,464.69 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 262.55 ms |
A catalog entry that moves to a version the locked one cannot satisfy left the range-only fast path with nothing to do, so the install fell back to a full resolution. Replacing the package is the same rewrite an exact `pnpm.overrides` entry performs, so reuse that machinery rather than growing a second rewriter: the same dependency-shape validation decides whether every locked child still fits the new version. Split the override path into its plan building and a shared apply step so the catalog caller can drive the rewrite without writing synthetic overrides into the lockfile, and record the updated catalog snapshot instead. An override moves a package everywhere it appears; a catalog entry only governs the importers that reference it. Fall back when anything else reaches the package -- an importer pinning it directly, or any package depending on it -- since the graph would then have to hold both versions. Related to #13474.
…cript CLI Same split as pacquet: the override path keeps its plan building and hands the rewrite to a shared apply step, which records whichever setting drove it rather than always writing `overrides`. The catalog caller builds the same plan from the entries whose version moved and records the updated catalog snapshot. Chained after the range-only catalog rewrite, which declines exactly the changes this handles, and guarded the same way: anything other than the catalog reaching the package sends the install back to the resolver.
Gate the rewrite on the same catalog-reference check the range-only path opens with. An importer pointing at a catalog entry with nothing recorded for it needs the resolver, and this path iterates the recorded entries, so it would never have looked at that one. Absorb the range-only entries a mixed update carries. The TypeScript range-only rewrite keeps the entries it cannot handle and still reports success, so returning early on it stranded the exact move and sent the install to a full resolution; run both and take either. pacquet declines a mixed update outright, so it now handles the range-only entries in the same pass. Re-run the whole manifest safety check after `readPackageHook`, which the TypeScript side only did for peer dependencies. pacquet validates after its hook, so a hook introducing a name, version, deprecation, bundled dependency, or runtime engine change took the fast path on one stack and not the other. Move the duplicate-name check into the shared plan builder, where it belongs to the plan rather than to overrides. Both callers already reject that case earlier for their own reasons -- verified by removing it -- so this is depth, not a fix. Reported by CodeRabbit and Greptile on #13689.
Summary
Closes the last stage of #13474, after #13477 (catalogs), #13482 (ignored optional dependencies), #13600 (setting-only updates), and #13680 (patched dependencies).
The existing catalog fast path only handles a specifier the locked version still satisfies: it updates the specifier and keeps the version. A catalog entry moved to a different exact version left it with nothing to do, so the install fell back to a full resolution.
Replacing the package is the same rewrite an exact
pnpm.overridesentry performs, so this reuses that machinery rather than growing a second rewriter — including the check that every locked child still satisfies the new version's manifest, and the existing refusals for peer-suffixed keys, registry-qualified keys, patched or optional snapshots, and packages declaring peer dependencies.tryFastUpdateCatalogVersions) and pacquet (fast_update_catalog_versions).The guard that makes this different from an override
An override moves a package everywhere it appears. A catalog entry only governs the importers that reference it, so if anything else reaches the package — an importer depending on it directly, or any package depending on it — the graph would have to hold both the old and the new version, which this rewrite cannot express. Both stacks fall back in that case, with a test for each direction.
Squash Commit Body
Checklist
already linked to it solves it.
pnpm/port, or the description notes what still needs porting.pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Claude Code, claude-opus-5).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
Performance
Bug Fixes
Tests