Repository navigation
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pnpm/pnpm/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe frozen lockfile build phase now checks top-level binary-link eligibility for each importer before linking. Tests cover root and non-root conditions, and an integration test checks binary links under ChangesBin relink optimization
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Refactor Suggested labels: Merge Risk: ⚪ Minimal · up to The bin-linking optimization appears ready to merge after normal checks; no actionable issue remains identified. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 Qodoperf(pacquet): skip redundant bin relinking
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Confidence Score: 4/5The PR appears safe to merge, with the non-blocking concern that its newly skipped filesystem paths are covered only by predicate-level tests. The earlier link phase reads and links the same unchanged direct-bin manifests when builds are deferred, and public workspace bins remain routed through the retained rewalk; stronger fixture coverage would protect those assumptions. Files Needing Attention: pnpm/crates/deps-restorer/src/install_frozen_lockfile/build_phase/tests.rs, pnpm/crates/deps-restorer/src/linking/tests.rs Reviews (1): Last reviewed commit: "perf(pacquet): skip redundant bin relink..." | Re-trigger Greptile |
| #[test] | ||
| fn top_level_bin_link_only_runs_when_post_materialization_work_can_change_bins() { | ||
| let public_hoisted = ["public-cli".to_string()]; | ||
|
|
||
| assert!(!needs_top_level_bin_link(Lockfile::ROOT_IMPORTER_KEY, false, &[])); | ||
| assert!(needs_top_level_bin_link(Lockfile::ROOT_IMPORTER_KEY, false, &public_hoisted)); | ||
| assert!(!needs_top_level_bin_link("packages/app", false, &public_hoisted)); | ||
| assert!(needs_top_level_bin_link("packages/app", true, &[])); |
There was a problem hiding this comment.
Predicate tests miss bin behavior
These assertions mirror the new routing predicate without exercising the filesystem behavior that permits relinking to be skipped. Add a fixture-level --ignore-scripts install test that verifies direct, public-hoist, and conflicting bins remain correct; otherwise an incorrect assumption about the earlier link phase can regress commands while these tests continue passing.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Added a fixture-level integration test (bin_linking_under_ignore_scripts_preserves_direct_hoisted_and_conflicting_bins in pnpm/crates/cli/tests/suite/hoist/patterns.rs) that runs against the mock registry with --ignore-scripts. It verifies that direct bins (@pnpm.e2e/touch-file-one-bin), publicly hoisted transitive bins (@pnpm.e2e/peer-with-bin), and conflicting bins (@pnpm.e2e/hello-world-js-bin-parent vs hoisted @pnpm.e2e/hello-world-js-bin) are correctly linked and that the direct dependency wins the collision in .bin.
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can copy the agent prompt from any finding and feed it to your IDE agent |
Micro-Benchmark ResultsLinux |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main pnpm/pnpm#14038 +/- ##
=======================================
Coverage 91.85% 91.86%
=======================================
Files 1453 1453
Lines 196080 196089 +9
=======================================
+ Hits 180112 180128 +16
+ Misses 15968 15961 -7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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-workspace scenario compares 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.4512003987999997,
"stddev": 0.14271648511299656,
"median": 2.4471425699,
"user": 1.3615402,
"system": 1.2997623999999997,
"min": 2.2906758654,
"max": 2.6234271594
},
{
"command": "pacquet@main",
"mean": 2.3688968388,
"stddev": 0.08733709663026736,
"median": 2.3366761689,
"user": 1.4317956000000003,
"system": 1.3616137,
"min": 2.2694732304,
"max": 2.5302347884
},
{
"command": "pnpr@HEAD",
"mean": 1.5257680208,
"stddev": 0.1257633890015409,
"median": 1.5972511089,
"user": 1.3459251,
"system": 1.4049243,
"min": 1.3320910304,
"max": 1.6348612764000001
},
{
"command": "pnpr@main",
"mean": 1.4888123697000002,
"stddev": 0.12050834987020424,
"median": 1.4493984104,
"user": 1.3526647,
"system": 1.3677299,
"min": 1.3305355864,
"max": 1.6835181364
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.22267934254,
"stddev": 0.007218543748142875,
"median": 0.22091074464,
"user": 0.24048866000000002,
"system": 0.53194468,
"min": 0.21402934164,
"max": 0.23627699964
},
{
"command": "pacquet@main",
"mean": 0.23839668934000002,
"stddev": 0.012657610739064374,
"median": 0.23767020914,
"user": 0.24999276000000004,
"system": 0.6033651800000001,
"min": 0.21501092364000002,
"max": 0.26345500964
},
{
"command": "pnpr@HEAD",
"mean": 0.24919138074,
"stddev": 0.017620025753788467,
"median": 0.24836860464000002,
"user": 0.25631196,
"system": 0.56545198,
"min": 0.22731933364,
"max": 0.28647326164000003
},
{
"command": "pnpr@main",
"mean": 0.25036592044000006,
"stddev": 0.011000337577461106,
"median": 0.24976471964000002,
"user": 0.26444576,
"system": 0.5709231800000001,
"min": 0.23585662064000001,
"max": 0.26862817564
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.013296525462972969,
"stddev": 0.004085896778990192,
"median": 0.014214812740000003,
"user": 0.00739945013513514,
"system": 0.006539481351351353,
"min": 0.007219891240000001,
"max": 0.02383757824
},
{
"command": "pacquet@main",
"mean": 0.008426987531793313,
"stddev": 0.001044249550706736,
"median": 0.00807192724,
"user": 0.004350909604863226,
"system": 0.00450119890577508,
"min": 0.006851060240000001,
"max": 0.01219624524
},
{
"command": "pnpr@HEAD",
"mean": 0.00802682772036253,
"stddev": 0.0006317501152539727,
"median": 0.00791887124,
"user": 0.004749402235649545,
"system": 0.003720695105740183,
"min": 0.006907628240000001,
"max": 0.01266342724
},
{
"command": "pnpr@main",
"mean": 0.008154391782016806,
"stddev": 0.0007264589866273306,
"median": 0.00803402024,
"user": 0.004444406386554619,
"system": 0.004193838151260505,
"min": 0.007062446240000001,
"max": 0.011563514240000001
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.010970429101094527,
"stddev": 0.0022321428191746993,
"median": 0.01042789832,
"user": 0.005539836915422883,
"system": 0.006027452537313428,
"min": 0.007323658320000001,
"max": 0.020320553320000004
},
{
"command": "pacquet@main",
"mean": 0.010382134704313732,
"stddev": 0.0011129456092274725,
"median": 0.01015009632,
"user": 0.006051247450980392,
"system": 0.004879231372549019,
"min": 0.00813230432,
"max": 0.01783811932
},
{
"command": "pnpr@HEAD",
"mean": 0.012108760512771086,
"stddev": 0.0021069749244048926,
"median": 0.01182979632,
"user": 0.006940842489959838,
"system": 0.005852263293172695,
"min": 0.00859976932,
"max": 0.023197246320000003
},
{
"command": "pnpr@main",
"mean": 0.012793121047777781,
"stddev": 0.0016376902312566406,
"median": 0.012584934320000001,
"user": 0.007411431111111111,
"system": 0.006039093111111113,
"min": 0.00959674932,
"max": 0.018048752320000003
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.69369911398,
"stddev": 0.04825521252933615,
"median": 2.6831836250800003,
"user": 2.4262711,
"system": 2.1667297999999997,
"min": 2.62214204708,
"max": 2.78342103308
},
{
"command": "pacquet@main",
"mean": 2.64218899018,
"stddev": 0.026916727579696088,
"median": 2.6452375315800003,
"user": 2.2738621,
"system": 2.0034154,
"min": 2.59813788208,
"max": 2.6753403600800003
},
{
"command": "pnpr@HEAD",
"mean": 1.60753966898,
"stddev": 0.1256962956714165,
"median": 1.58740968858,
"user": 1.3535205,
"system": 1.6237824999999997,
"min": 1.4501650420799999,
"max": 1.81515328408
},
{
"command": "pnpr@main",
"mean": 1.6338516026799996,
"stddev": 0.13249220090093933,
"median": 1.6796526885799998,
"user": 1.3533611000000003,
"system": 1.5859937999999996,
"min": 1.45413679008,
"max": 1.7935846550799999
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.4512676420600001,
"stddev": 0.03549555474783466,
"median": 0.4557059909600001,
"user": 0.6513647199999999,
"system": 0.7398496399999999,
"min": 0.40146953246000006,
"max": 0.5213953654600001
},
{
"command": "pacquet@main",
"mean": 0.42763650406,
"stddev": 0.022446744803021914,
"median": 0.43678298246,
"user": 0.60099672,
"system": 0.73458134,
"min": 0.38860594246,
"max": 0.45615674346000007
},
{
"command": "pnpr@HEAD",
"mean": 0.27914588766000004,
"stddev": 0.010625490349400772,
"median": 0.27999682096,
"user": 0.22165052,
"system": 0.50238204,
"min": 0.26019032546000004,
"max": 0.29433925946000006
},
{
"command": "pnpr@main",
"mean": 0.27711721666000005,
"stddev": 0.022665077296735708,
"median": 0.26911322646,
"user": 0.23890141999999998,
"system": 0.49173283999999995,
"min": 0.25484778546000003,
"max": 0.33596164346
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.6757944385799999,
"stddev": 0.03678898266519345,
"median": 1.67130895418,
"user": 0.9820605599999996,
"system": 0.8576046999999999,
"min": 1.63656308268,
"max": 1.75372328268
},
{
"command": "pacquet@main",
"mean": 1.6855340852799998,
"stddev": 0.06213768470911912,
"median": 1.6596760986799999,
"user": 1.01774126,
"system": 0.8636039999999999,
"min": 1.6401695936799998,
"max": 1.84446963968
},
{
"command": "pnpr@HEAD",
"mean": 0.29575672818000004,
"stddev": 0.018095745099223334,
"median": 0.29168842568000003,
"user": 0.23451255999999998,
"system": 0.5650174000000001,
"min": 0.27739423168000005,
"max": 0.33312248868000005
},
{
"command": "pnpr@main",
"mean": 0.32466833438,
"stddev": 0.023980603258985968,
"median": 0.33145385718000003,
"user": 0.27583406,
"system": 0.6154578000000002,
"min": 0.28116276568000004,
"max": 0.36207371368
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.44767220442,
"stddev": 0.12827354520335713,
"median": 0.42186750142000007,
"user": 0.43505586,
"system": 0.18315205999999998,
"min": 0.33243775642000006,
"max": 0.7986142074200001
},
{
"command": "pacquet@main",
"mean": 0.41929357262,
"stddev": 0.04094661459070203,
"median": 0.43054552692000003,
"user": 0.42052176,
"system": 0.15814136,
"min": 0.30396274042000004,
"max": 0.44564918242000007
},
{
"command": "pnpr@HEAD",
"mean": 0.13671091102,
"stddev": 0.0031300612216278423,
"median": 0.13648727492,
"user": 0.06139440999999999,
"system": 0.03592086,
"min": 0.13321008242,
"max": 0.14497483142
},
{
"command": "pnpr@main",
"mean": 0.13648872487000002,
"stddev": 0.003243225186653871,
"median": 0.13597867942,
"user": 0.06273395999999999,
"system": 0.03505630999999999,
"min": 0.13269887042,
"max": 0.14511410342
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6135614196711111,
"stddev": 0.1003187622430676,
"median": 0.62683003756,
"user": 0.6371094155555554,
"system": 0.1360177288888889,
"min": 0.39686751456,
"max": 0.75786276956
},
{
"command": "pacquet@main",
"mean": 0.6315586748933333,
"stddev": 0.07469655562779715,
"median": 0.6680964995600001,
"user": 0.651440748888889,
"system": 0.12718284000000002,
"min": 0.49810086556,
"max": 0.71976630356
},
{
"command": "pnpm@HEAD",
"mean": 3.2024771731155557,
"stddev": 0.22875374399062012,
"median": 3.1367821685600004,
"user": 5.035443082222222,
"system": 0.22976995111111112,
"min": 2.8507592495600003,
"max": 3.6029286595600003
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.22650425857846154,
"stddev": 0.0062819859257414856,
"median": 0.22587362104,
"user": 0.18001233230769226,
"system": 0.09476583692307693,
"min": 0.21409016204,
"max": 0.23654267604
},
{
"command": "pacquet@main",
"mean": 0.28836926364000004,
"stddev": 0.02177225849164752,
"median": 0.28258316704,
"user": 0.24210984,
"system": 0.11454006000000001,
"min": 0.26722532304,
"max": 0.34662045304000005
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.46432688468,
"stddev": 0.18571672949559406,
"median": 4.38004884998,
"user": 1.5260736600000002,
"system": 1.4747566600000002,
"min": 4.30723379498,
"max": 4.78227876198
},
{
"command": "pacquet@main",
"mean": 4.39039978958,
"stddev": 0.13124725701933615,
"median": 4.327008294980001,
"user": 1.53902666,
"system": 1.4387689599999998,
"min": 4.3061631589800005,
"max": 4.7195881789800005
},
{
"command": "pnpr@HEAD",
"mean": 3.47272332258,
"stddev": 0.12748770507978802,
"median": 3.40382344698,
"user": 1.38891366,
"system": 1.32439976,
"min": 3.37075046798,
"max": 3.72702833098
},
{
"command": "pnpr@main",
"mean": 3.47083849598,
"stddev": 0.12565000575524699,
"median": 3.4328582364800004,
"user": 1.41357156,
"system": 1.2740257599999998,
"min": 3.35531983798,
"max": 3.75610205598
}
]
}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.1374989529,
"stddev": 0.018257882894747987,
"median": 0.1291308944,
"user": 0.15979221428571427,
"system": 0.1524397657142857,
"min": 0.1216136939,
"max": 0.1774686249
},
{
"command": "pacquet@main",
"mean": 0.13325394279473685,
"stddev": 0.015055857238825479,
"median": 0.13238595790000002,
"user": 0.16883768421052633,
"system": 0.13553924315789473,
"min": 0.1101791969,
"max": 0.1791222979
},
{
"command": "pnpr@HEAD",
"mean": 0.19595332945555557,
"stddev": 0.032469795059458635,
"median": 0.2006646869,
"user": 0.23646899999999993,
"system": 0.1689723133333333,
"min": 0.1277662589,
"max": 0.2669132779
},
{
"command": "pnpr@main",
"mean": 0.1612559072846154,
"stddev": 0.02329614131577311,
"median": 0.1498721309,
"user": 0.19039969230769227,
"system": 0.15498421076923077,
"min": 0.1341334969,
"max": 0.1971936689
}
]
} |
1401b98 to
046093e
Compare
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Superseded by #14300, which already skips the post-build top-level bin relink unless the install is hoisted, a slot was mutated, or the root has publicly hoisted candidates. Closing. |
Summary
--ignore-scriptsbypasses dependency builds, skip the post-build direct-bin relink unless the root has public-hoist bin candidates. Preserve the full relink after real builds so lifecycle-created bins are still discovered.This is a pacquet-internal pipeline optimization related to pnpm/tasks#1 and #14022. The TypeScript implementation already performs its corresponding bin link once after dependency builds, so it does not need a matching change.
Paired local A/B benchmark of the tracked update scenario (8 pairs, 4 cores, 50 ms registry RTT, 200 Mbit/s):
Head was faster in 6 of 8 pairs.
Validation:
just ready— 8,452 tests passed, plus workspace checks and Clippy.cargo test -p pnpm-cli publicly_hoisted_workspace_package— both public-workspace-hoist bin tests passed.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 (Codex, GPT-5).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
Performance
--ignore-scriptsby skipping unnecessary binary relinking when dependency builds and public hoisting do not require it.Bug Fixes