Repository navigation
refactor(deps-resolver): pick hoisted peer providers through one tiered rule - #17023
Conversation
…ed rule The required and optional peer hoists each carried their own "highest qualifying version" loop and their own idea of which versions to try first. Both now go through one function that takes an ordered list of version tiers and a range check: - required: the versions this run resolved, then every version; includePrerelease against the one wanted range. - optional: locked and resolved, then resolved, then locked, then every version; strict against every recorded range and the root's range. In pnpm v12 the hoist module moves to `peer_provider.rs` and the tiers become a `ProviderTiers` type, replacing `optional_peer_version_tiers`. pnpm v11's `hoistPeers.ts` gets the same `pickProviderVersion` shape. The picks do not change, except that among equal versions that differ only in build metadata, the v12 optional picker now keeps the first selector, like the required one. This is the first step of pnpm/tasks#143. The pickers are now one place that later steps can grow into the single peer-provider owner. pnpm v11's optional picker still has no lockfile tiers. That is a parity difference this change keeps as it is. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17023 +/- ##
=======================================
Coverage 92.53% 92.54%
=======================================
Files 1775 1775
Lines 228551 228519 -32
=======================================
- Hits 211490 211478 -12
+ Misses 17061 17041 -20 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Micro-Benchmark ResultsLinux |
Same-run regression checkHEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval. Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.
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; the linked and injected workspace scenarios compare current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs. Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.35777829842,
"stddev": 0.10563919728286195,
"median": 2.32040937932,
"user": 1.3478356799999998,
"system": 1.2572318999999998,
"min": 2.26241253932,
"max": 2.57416258032
},
{
"command": "pacquet@main",
"mean": 2.3612500647200005,
"stddev": 0.12161113696520466,
"median": 2.31830040582,
"user": 1.3392406799999999,
"system": 1.2472933,
"min": 2.24823850732,
"max": 2.5870670433200003
},
{
"command": "pnpr@HEAD",
"mean": 1.43452382972,
"stddev": 0.15130808974081222,
"median": 1.35885885982,
"user": 1.2686907800000002,
"system": 1.1200314,
"min": 1.28649363532,
"max": 1.67535332232
},
{
"command": "pnpr@main",
"mean": 1.5016209824199998,
"stddev": 0.13878160347564555,
"median": 1.48992427032,
"user": 1.22950058,
"system": 1.1944727,
"min": 1.2903145923200001,
"max": 1.6701539913199999
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.22262449757999997,
"stddev": 0.011177118439721594,
"median": 0.21931574308000001,
"user": 0.25524304,
"system": 0.51876036,
"min": 0.21042206008,
"max": 0.24100347108
},
{
"command": "pacquet@main",
"mean": 0.23538103727999998,
"stddev": 0.010125581343390602,
"median": 0.23405182108,
"user": 0.25612083999999996,
"system": 0.5778565600000001,
"min": 0.22390234708,
"max": 0.25783977908
},
{
"command": "pnpr@HEAD",
"mean": 0.24809652588000003,
"stddev": 0.007471863914346505,
"median": 0.24655361508,
"user": 0.26636363999999996,
"system": 0.58592756,
"min": 0.23681500108,
"max": 0.26030823008
},
{
"command": "pnpr@main",
"mean": 0.24972102488,
"stddev": 0.013600215144006706,
"median": 0.25161786858,
"user": 0.25045003999999993,
"system": 0.5934887600000001,
"min": 0.23037319508,
"max": 0.27685227008
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.008178163765367404,
"stddev": 0.0003893022410698308,
"median": 0.00814279612,
"user": 0.00488716185303514,
"system": 0.004137635015974443,
"min": 0.00713475012,
"max": 0.009471495120000001
},
{
"command": "pacquet@main",
"mean": 0.00815485011382716,
"stddev": 0.0005817669505363993,
"median": 0.008083930120000003,
"user": 0.004826971234567903,
"system": 0.004127351851851852,
"min": 0.00692268212,
"max": 0.011678384120000001
},
{
"command": "pnpr@HEAD",
"mean": 0.011720834041686744,
"stddev": 0.0036585552714049024,
"median": 0.01214597362,
"user": 0.00689954891566265,
"system": 0.005812864759036146,
"min": 0.00693911312,
"max": 0.02016374812
},
{
"command": "pnpr@main",
"mean": 0.012884042306813191,
"stddev": 0.0018755475934302955,
"median": 0.012958014620000001,
"user": 0.007444292527472525,
"system": 0.006326887912087914,
"min": 0.008479109120000002,
"max": 0.01870723012
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.00792674160896104,
"stddev": 0.00044355970217200327,
"median": 0.007885924820000001,
"user": 0.004664089220779218,
"system": 0.003951134025974026,
"min": 0.00708227582,
"max": 0.01140717382
},
{
"command": "pacquet@main",
"mean": 0.008163847129608543,
"stddev": 0.00039556910348858713,
"median": 0.00813047482,
"user": 0.004960780640569394,
"system": 0.00397014896797153,
"min": 0.00720431482,
"max": 0.011211144820000001
},
{
"command": "pnpr@HEAD",
"mean": 0.014642106276747413,
"stddev": 0.003119080586149275,
"median": 0.01542112582,
"user": 0.008091549619377171,
"system": 0.007707326712802769,
"min": 0.007463531820000001,
"max": 0.020663864820000002
},
{
"command": "pnpr@main",
"mean": 0.01166160480113208,
"stddev": 0.003704802671295294,
"median": 0.01181929682,
"user": 0.00675558515723271,
"system": 0.005929101509433962,
"min": 0.00752503782,
"max": 0.020983905820000003
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.5304572178599996,
"stddev": 0.09259746207532144,
"median": 2.49246439186,
"user": 1.8475951599999998,
"system": 1.68202726,
"min": 2.46935130436,
"max": 2.7312887193599997
},
{
"command": "pacquet@main",
"mean": 2.49340332566,
"stddev": 0.025817682884720534,
"median": 2.48239704386,
"user": 1.7360680599999998,
"system": 1.6027146600000002,
"min": 2.4750993863599997,
"max": 2.55642320536
},
{
"command": "pnpr@HEAD",
"mean": 1.55997344756,
"stddev": 0.0899580883707028,
"median": 1.57815457736,
"user": 1.12688916,
"system": 1.33985756,
"min": 1.4111705113600002,
"max": 1.7108946963600002
},
{
"command": "pnpr@main",
"mean": 1.5175311264600002,
"stddev": 0.09993013926517365,
"median": 1.54171184486,
"user": 1.1297801599999997,
"system": 1.2122362599999998,
"min": 1.3840093723600002,
"max": 1.66864797536
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.44374639477999994,
"stddev": 0.017191860133139072,
"median": 0.44602296828,
"user": 0.6051140399999999,
"system": 0.7669510399999999,
"min": 0.41373603728,
"max": 0.46957792228
},
{
"command": "pacquet@main",
"mean": 0.49167361247999997,
"stddev": 0.11231034016728741,
"median": 0.44062371678,
"user": 0.71522134,
"system": 0.8452609399999998,
"min": 0.41524829628000004,
"max": 0.71791763228
},
{
"command": "pnpr@HEAD",
"mean": 0.29031244757999997,
"stddev": 0.012651703972971742,
"median": 0.29427802078,
"user": 0.23842984,
"system": 0.5625314400000001,
"min": 0.27157418128,
"max": 0.30365585328
},
{
"command": "pnpr@main",
"mean": 0.29040995438000006,
"stddev": 0.006314423525393498,
"median": 0.29118665128,
"user": 0.24607683999999996,
"system": 0.58254934,
"min": 0.28067570228,
"max": 0.29970860128
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.6747806831000003,
"stddev": 0.10901627632861541,
"median": 1.6188684230000001,
"user": 1.00120316,
"system": 1.0010624799999999,
"min": 1.5898945560000002,
"max": 1.9079650550000002
},
{
"command": "pacquet@main",
"mean": 1.6018132652000001,
"stddev": 0.022428057864442668,
"median": 1.6024038910000002,
"user": 0.86550896,
"system": 0.88099328,
"min": 1.554265132,
"max": 1.634125217
},
{
"command": "pnpr@HEAD",
"mean": 0.31546585160000007,
"stddev": 0.06851955605198373,
"median": 0.2859050795,
"user": 0.28119995999999997,
"system": 0.5897648799999999,
"min": 0.272732177,
"max": 0.49061177000000006
},
{
"command": "pnpr@main",
"mean": 0.2734289149000001,
"stddev": 0.009516957778796532,
"median": 0.273925081,
"user": 0.23276276,
"system": 0.49352887999999995,
"min": 0.259239855,
"max": 0.28878712000000006
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.23330988612,
"stddev": 0.02802201090902933,
"median": 0.22774663912,
"user": 0.20672461333333333,
"system": 0.08824813999999999,
"min": 0.20676536762,
"max": 0.31441144362000006
},
{
"command": "pacquet@main",
"mean": 0.36780216792000003,
"stddev": 0.00787555361197573,
"median": 0.36571725312000003,
"user": 0.36858097999999995,
"system": 0.14283624,
"min": 0.35911377662000005,
"max": 0.38199648262
},
{
"command": "pnpr@HEAD",
"mean": 0.10886467631565219,
"stddev": 0.017174863409762757,
"median": 0.10882183562000002,
"user": 0.04554312782608696,
"system": 0.019665031304347828,
"min": 0.09176358262,
"max": 0.13689617362
},
{
"command": "pnpr@main",
"mean": 0.09082091397483873,
"stddev": 0.002112291515602262,
"median": 0.09100567962000002,
"user": 0.03469110258064516,
"system": 0.011781607741935485,
"min": 0.08618189662,
"max": 0.09490957762
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.21276186763333335,
"stddev": 0.011334206817052385,
"median": 0.2148336733,
"user": 0.21436924666666665,
"system": 0.05415977777777778,
"min": 0.1940680713,
"max": 0.2274792713
},
{
"command": "pacquet@main",
"mean": 0.21017469874444447,
"stddev": 0.007138368126283509,
"median": 0.2084822203,
"user": 0.2097339133333333,
"system": 0.055942222222222227,
"min": 0.2005201643,
"max": 0.22186439230000002
},
{
"command": "pnpm@HEAD",
"mean": 3.3291035711888894,
"stddev": 0.07221966068452929,
"median": 3.3363839743000003,
"user": 5.087060135555556,
"system": 0.36926411111111107,
"min": 3.1929453243,
"max": 3.4169527103000004
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.19769384093333334,
"stddev": 0.00385377375436569,
"median": 0.1965842978,
"user": 0.15345736,
"system": 0.08297451333333333,
"min": 0.1929674168,
"max": 0.2045514568
},
{
"command": "pacquet@main",
"mean": 0.19029703122857142,
"stddev": 0.005390976100308193,
"median": 0.1913570643,
"user": 0.15565288857142856,
"system": 0.06901475142857143,
"min": 0.1832598018,
"max": 0.2031251578
}
]
}Scenario: Isolated linker: injected workspace repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.08048419592594594,
"stddev": 0.003723798741305808,
"median": 0.08111132398000001,
"user": 0.02619696378378378,
"system": 0.06045322594594595,
"min": 0.07308528398000001,
"max": 0.09152485498000001
},
{
"command": "pacquet@main",
"mean": 0.082504753355,
"stddev": 0.00413792407817766,
"median": 0.08234125198,
"user": 0.030817054999999996,
"system": 0.05814937375000001,
"min": 0.07246847298000002,
"max": 0.09189245598000001
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.496725140160001,
"stddev": 0.1831408034779877,
"median": 4.407025618960001,
"user": 1.48149526,
"system": 1.6081551399999998,
"min": 4.33708822896,
"max": 4.809246793960001
},
{
"command": "pacquet@main",
"mean": 4.48197654306,
"stddev": 0.13099383546563712,
"median": 4.45681455196,
"user": 1.4106472600000002,
"system": 1.4372818400000003,
"min": 4.345286741960001,
"max": 4.6869955269600005
},
{
"command": "pnpr@HEAD",
"mean": 3.48012458656,
"stddev": 0.09690164747256197,
"median": 3.4471026699599996,
"user": 1.31568256,
"system": 1.36413364,
"min": 3.3924963299599997,
"max": 3.70332776496
},
{
"command": "pnpr@main",
"mean": 3.5641332819599993,
"stddev": 0.138585652653277,
"median": 3.51583280346,
"user": 1.31658186,
"system": 1.34647594,
"min": 3.39421188496,
"max": 3.81191432296
}
]
}Scenario: GVS linker: fresh restore, hot cache + hot storeSame install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.11254955879043478,
"stddev": 0.003924103110715356,
"median": 0.11183199866,
"user": 0.14625147304347824,
"system": 0.11558973652173911,
"min": 0.10578757266000001,
"max": 0.12224985766
},
{
"command": "pacquet@main",
"mean": 0.11320212305130435,
"stddev": 0.004377593894566178,
"median": 0.11203836566,
"user": 0.13996490782608692,
"system": 0.11769104086956522,
"min": 0.10725213666000001,
"max": 0.12067635866000001
},
{
"command": "pnpr@HEAD",
"mean": 0.12262184718380953,
"stddev": 0.0025800237210065694,
"median": 0.12252353066,
"user": 0.1467658933333333,
"system": 0.11727854190476193,
"min": 0.11890399666000001,
"max": 0.12999061266000003
},
{
"command": "pnpr@main",
"mean": 0.20577275739684212,
"stddev": 0.02870065102088621,
"median": 0.20681294866000002,
"user": 0.23536613894736844,
"system": 0.18583167473684206,
"min": 0.13441102266000002,
"max": 0.25263260366
}
]
}Scenario: Store only: unlocked direct deps, cold cache + hot storeStore-only install (
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.1302333214400004,
"stddev": 0.015597141875196115,
"median": 1.13063950424,
"user": 0.51931018,
"system": 0.20110109999999998,
"min": 1.10760137074,
"max": 1.14968078174
},
{
"command": "pacquet@main",
"mean": 1.1287782387400003,
"stddev": 0.012362670654500856,
"median": 1.12698784874,
"user": 0.50966438,
"system": 0.2051259,
"min": 1.1130613977400001,
"max": 1.1538222397400002
}
]
} |
|
@coderabbitai review |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
PR Summary by QodoUnify tiered peer-provider selection in pnpm v11 and v12
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Code Review by Qodo
1. v11 and v12 can bind different providers
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
- pnpm v12 borrows the run-resolved set for the required tier, without cloning it. - pnpm v11 checks tier membership before validating a version. - pnpm v11 calls acceptsCandidate only for a version that would become the new highest. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Replies to the Qodo review of e7c6fb0:
Written by an agent (Claude Code, claude-opus-5-5). |
|
Code review by qodo was updated up to the latest commit 096a5c3 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Summary
First step of pnpm/tasks#143 (related, not closing it). The maintainer chose to scope this to step 1 of the issue's design: one owner for the hoist-time peer provider pick.
hoist_peers.rsbecomespeer_provider.rs. The required and optional pickers both go throughhighest_provider_version, which takesProviderTiersand a range check. Each picker now differs only in those two inputs.hoistPeers.tsgets the samepickProviderVersion(selectors, { tiers, qualifies })shape.The picks do not change. No changeset, because nothing a user can see changes.
Steps 2 to 4 of pnpm/tasks#143 are still open: lockfile pins as a tie-break input, recorded peer bindings, and the freshness,
optionaland deploy consumers. One more thing for a maintainer: pnpm v11's optional picker has no lockfile tiers, but pnpm v12's has had them since #14895 and #16443. I did not check whether v11 needs them, and this PR leaves that difference as it is.Squash Commit Body
Checklist
already linked to it solves it.
are implemented in every affected version.
ProviderTiers. They pass unchanged: 467 deps-resolver tests and 73 package-manager peer tests in v12, 228 deps-resolver tests in v11.)Written by an agent (Claude Code, claude-opus-5-5).
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit