Repository navigation
Conversation
…ent lockfile records A project's current lockfile only vouches for slots that project alone writes. A global virtual store slot is shared, so another project's interrupted install may have re-created it without its child links or package files after the record was written. The warm-slot probe now checks the completion marker and every child link of a GVS slot even when the current lockfile records it unchanged. Fixes #16642 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughWhen the global virtual store is enabled, unchanged lockfile entries no longer bypass checks for a slot’s package marker or child links. Unit and CLI tests verify that installs restore missing slot contents, including when the project already records the package. ChangesGlobal virtual store slot repair
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix Suggested labels: Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue is identified. The scoped GVS repair is mergeable after normal checks. ✨ 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 |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16649 +/- ##
==========================================
- Coverage 92.34% 92.34% -0.01%
==========================================
Files 1590 1590
Lines 210019 210021 +2
==========================================
Hits 193947 193947
- Misses 16072 16074 +2 ☔ 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-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.59788000268,
"stddev": 0.163279810177893,
"median": 2.60637187228,
"user": 1.8660202399999999,
"system": 1.8759512600000001,
"min": 2.3102306177800003,
"max": 2.8704627937800002
},
{
"command": "pacquet@main",
"mean": 2.4650917034799997,
"stddev": 0.12342101849023708,
"median": 2.42347814378,
"user": 1.5366094399999999,
"system": 1.5961384599999997,
"min": 2.3126680517800002,
"max": 2.65470483178
},
{
"command": "pnpr@HEAD",
"mean": 1.4585547385800004,
"stddev": 0.09025088916340898,
"median": 1.4524092302800002,
"user": 1.5359069399999998,
"system": 1.48676856,
"min": 1.3527418957800001,
"max": 1.66518572278
},
{
"command": "pnpr@main",
"mean": 1.5466434818800001,
"stddev": 0.11837206647772762,
"median": 1.5147803732800003,
"user": 1.6375280399999999,
"system": 1.64116896,
"min": 1.35900368178,
"max": 1.7011029127800001
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.23027125799999998,
"stddev": 0.011982695288325225,
"median": 0.23273476070000002,
"user": 0.27224648,
"system": 0.53428444,
"min": 0.21295229170000002,
"max": 0.2483070867
},
{
"command": "pacquet@main",
"mean": 0.23324815120000003,
"stddev": 0.012737790046448956,
"median": 0.23058094170000001,
"user": 0.26010417999999996,
"system": 0.58390274,
"min": 0.2197423947,
"max": 0.2558793177
},
{
"command": "pnpr@HEAD",
"mean": 0.23348708069999996,
"stddev": 0.012316574341314326,
"median": 0.23137099020000002,
"user": 0.25802478000000006,
"system": 0.52404184,
"min": 0.2168381457,
"max": 0.2506573637
},
{
"command": "pnpr@main",
"mean": 0.24878340710000005,
"stddev": 0.021502458875693263,
"median": 0.2471198007,
"user": 0.26514667999999997,
"system": 0.5635322399999999,
"min": 0.2218589407,
"max": 0.2984196267
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.01268846593294965,
"stddev": 0.003097145802511796,
"median": 0.012653143120000002,
"user": 0.007262492086330936,
"system": 0.006469076546762596,
"min": 0.00793269712,
"max": 0.023995010120000004
},
{
"command": "pacquet@main",
"mean": 0.014196232313069315,
"stddev": 0.002331783741205539,
"median": 0.01424911262,
"user": 0.007990305940594059,
"system": 0.007382890495049503,
"min": 0.00856649512,
"max": 0.02111346512
},
{
"command": "pnpr@HEAD",
"mean": 0.009154541480000002,
"stddev": 0.002176845013517713,
"median": 0.00846571512,
"user": 0.005549457142857142,
"system": 0.004415105828571429,
"min": 0.007042295120000001,
"max": 0.016157060120000004
},
{
"command": "pnpr@main",
"mean": 0.008821546362424246,
"stddev": 0.0011082107850798504,
"median": 0.00861405412,
"user": 0.005100059932659932,
"system": 0.004441285656565655,
"min": 0.007275463120000001,
"max": 0.01505971212
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.013379955395000007,
"stddev": 0.002699298378912203,
"median": 0.01272434734,
"user": 0.006742157400000001,
"system": 0.008066817399999999,
"min": 0.00866924384,
"max": 0.022695346840000002
},
{
"command": "pacquet@main",
"mean": 0.012848299555151512,
"stddev": 0.0021633655309204166,
"median": 0.01223315384,
"user": 0.007011919999999999,
"system": 0.0071651473939393934,
"min": 0.00955177284,
"max": 0.019709945840000003
},
{
"command": "pnpr@HEAD",
"mean": 0.012205753981791042,
"stddev": 0.001981013000731466,
"median": 0.01169818284,
"user": 0.007054258805970149,
"system": 0.006418129552238806,
"min": 0.00918912484,
"max": 0.018935371840000003
},
{
"command": "pnpr@main",
"mean": 0.012909118363255813,
"stddev": 0.002309505118544634,
"median": 0.01246135234,
"user": 0.007201525813953489,
"system": 0.007079796976744187,
"min": 0.00920291884,
"max": 0.02431009484
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.6404725691799995,
"stddev": 0.08632245232910858,
"median": 2.6013715821799996,
"user": 2.30795456,
"system": 1.8398006999999996,
"min": 2.58561430418,
"max": 2.81602577818
},
{
"command": "pacquet@main",
"mean": 2.62858300718,
"stddev": 0.07539641517804978,
"median": 2.60640227268,
"user": 2.26111766,
"system": 1.7937662999999993,
"min": 2.5609774231799998,
"max": 2.7708848381799998
},
{
"command": "pnpr@HEAD",
"mean": 1.6499183159800002,
"stddev": 0.11653844769121989,
"median": 1.63909419818,
"user": 1.5302624599999999,
"system": 1.583643,
"min": 1.5088753931799999,
"max": 1.82339273818
},
{
"command": "pnpr@main",
"mean": 1.5846415940799996,
"stddev": 0.14235732963416944,
"median": 1.50870872018,
"user": 1.4668788599999996,
"system": 1.5397807999999997,
"min": 1.4662814581799999,
"max": 1.84992382918
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6006013698000001,
"stddev": 0.02227714798781686,
"median": 0.5950032805000001,
"user": 0.83773242,
"system": 1.05319956,
"min": 0.5771884285000001,
"max": 0.6439759235000001
},
{
"command": "pacquet@main",
"mean": 0.7411327533,
"stddev": 0.17572457765661842,
"median": 0.6578046770000001,
"user": 1.06409282,
"system": 1.3144228599999999,
"min": 0.5845931665,
"max": 1.0316609454999999
},
{
"command": "pnpr@HEAD",
"mean": 0.38393557970000014,
"stddev": 0.015151563524989826,
"median": 0.38419725550000006,
"user": 0.36690051999999995,
"system": 0.8150196599999999,
"min": 0.36225344950000005,
"max": 0.40766242850000006
},
{
"command": "pnpr@main",
"mean": 0.3790803756,
"stddev": 0.011766647571692126,
"median": 0.37920139650000007,
"user": 0.3643509199999999,
"system": 0.8009745599999999,
"min": 0.35552213450000003,
"max": 0.3942381945
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.6288884022799999,
"stddev": 0.019441490472297696,
"median": 1.6292190740799999,
"user": 0.8846509200000001,
"system": 0.8169790000000001,
"min": 1.59776799658,
"max": 1.66093526458
},
{
"command": "pacquet@main",
"mean": 1.6328520364799999,
"stddev": 0.020588047823911538,
"median": 1.6328457800799998,
"user": 0.8987715199999998,
"system": 0.8047399000000001,
"min": 1.60178509558,
"max": 1.66304069958
},
{
"command": "pnpr@HEAD",
"mean": 0.29540052008,
"stddev": 0.011834507255476533,
"median": 0.29509192258,
"user": 0.26093612,
"system": 0.5702061,
"min": 0.26685834458,
"max": 0.30979782058
},
{
"command": "pnpr@main",
"mean": 0.28931005957999995,
"stddev": 0.010945628519826837,
"median": 0.29258666608,
"user": 0.25248701999999995,
"system": 0.5665281,
"min": 0.27293126258,
"max": 0.30354192758
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.23960622583636368,
"stddev": 0.017946596448831495,
"median": 0.24650678820000002,
"user": 0.2130986872727273,
"system": 0.09848658000000002,
"min": 0.21104937320000003,
"max": 0.2614285102
},
{
"command": "pacquet@main",
"mean": 0.22234002658461538,
"stddev": 0.01618592262785015,
"median": 0.21753780820000002,
"user": 0.1919073446153846,
"system": 0.07885458,
"min": 0.20150586520000002,
"max": 0.2609990432
},
{
"command": "pnpr@HEAD",
"mean": 0.0925969281032258,
"stddev": 0.002176153774176331,
"median": 0.09220386020000002,
"user": 0.03329363741935484,
"system": 0.01467291612903226,
"min": 0.0873228612,
"max": 0.0999394462
},
{
"command": "pnpr@main",
"mean": 0.09213725952258066,
"stddev": 0.0012991403623108984,
"median": 0.09244479420000001,
"user": 0.031939476129032245,
"system": 0.012853496774193549,
"min": 0.08773718920000001,
"max": 0.09360338520000001
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2084132980377778,
"stddev": 0.012190719869080298,
"median": 0.21272365626000003,
"user": 0.2103006222222222,
"system": 0.04793661555555555,
"min": 0.19022524826000003,
"max": 0.22834205526000004
},
{
"command": "pacquet@main",
"mean": 0.20607688481555558,
"stddev": 0.01607709770750159,
"median": 0.20635916426000003,
"user": 0.20371051111111113,
"system": 0.04270939333333333,
"min": 0.18167062526000002,
"max": 0.23106354026000003
},
{
"command": "pnpm@HEAD",
"mean": 3.819108823926667,
"stddev": 0.5269955082787402,
"median": 3.61777118926,
"user": 5.849329733333333,
"system": 0.4151745044444445,
"min": 3.45903256526,
"max": 5.15983575826
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.25548428916000004,
"stddev": 0.017566664829701463,
"median": 0.25258706386,
"user": 0.21148907999999994,
"system": 0.10310617999999998,
"min": 0.23600675336000002,
"max": 0.29935490236000006
},
{
"command": "pacquet@main",
"mean": 0.24890902763272732,
"stddev": 0.01059968428263961,
"median": 0.24640457636000002,
"user": 0.19871793454545453,
"system": 0.10725901636363638,
"min": 0.23613508436000002,
"max": 0.26752766936000005
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.5806902880400004,
"stddev": 0.16062528024741934,
"median": 4.51327112204,
"user": 1.9032268400000003,
"system": 2.0945332,
"min": 4.44628829254,
"max": 4.88345734254
},
{
"command": "pacquet@main",
"mean": 4.54192536634,
"stddev": 0.11465511599369868,
"median": 4.493171433540001,
"user": 1.8079161400000001,
"system": 1.9960027999999999,
"min": 4.47193965754,
"max": 4.84047272054
},
{
"command": "pnpr@HEAD",
"mean": 3.5501873651399998,
"stddev": 0.04875063562292437,
"median": 3.55483558154,
"user": 1.69363214,
"system": 1.8479433999999997,
"min": 3.48138915254,
"max": 3.63913050554
},
{
"command": "pnpr@main",
"mean": 3.71274826744,
"stddev": 0.11223195763561145,
"median": 3.69360513204,
"user": 1.8502807399999999,
"system": 1.9813366,
"min": 3.49993123754,
"max": 3.91294885054
}
]
}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.18930249917142858,
"stddev": 0.020078571049644285,
"median": 0.18530892860000003,
"user": 0.22748211999999995,
"system": 0.16771282857142852,
"min": 0.16144461460000004,
"max": 0.22129703060000003
},
{
"command": "pacquet@main",
"mean": 0.17306621321538465,
"stddev": 0.011355786966558094,
"median": 0.16917340560000002,
"user": 0.2141028123076923,
"system": 0.15991432307692308,
"min": 0.15569695960000002,
"max": 0.19317112260000002
},
{
"command": "pnpr@HEAD",
"mean": 0.15214918265555558,
"stddev": 0.012260398001428205,
"median": 0.14849167510000003,
"user": 0.18119862000000003,
"system": 0.14075073333333335,
"min": 0.1393852506,
"max": 0.18100973060000003
},
{
"command": "pnpr@main",
"mean": 0.16092153260000003,
"stddev": 0.014510854439309629,
"median": 0.15654149160000003,
"user": 0.20013950461538463,
"system": 0.13965039999999998,
"min": 0.14512399260000003,
"max": 0.2011314466
}
]
} |
optimisticRepeatInstall: false only disables the CLI fast path. The frozen up-to-date check still short-circuited on Windows, so removing the project's direct link makes the install materialize on every platform. 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.
PR Summary by QodoRepair incomplete global virtual store slots despite current lockfile records
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
|
@coderabbitai review |
Code Review by Qodo
1. Windows installs lack slot-repair coverage
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
…nt lockfile records (#16663) A project's current lockfile vouches only for slots that project alone writes. A global virtual store slot is shared, so another project's interrupted install may have re-created it without its child links. Such a slot now stays in the dependency graph as reusable instead of up to date, so the linker restores its children. skipGvsInternalLinking (#11073) still skips linking when the install fetches nothing, because reusable nodes do not count as added. This matches pnpm v12 after #16649. Related to #16642 Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
With
enableGlobalVirtualStore, the warm-slot probe skipped the completion-marker and child-link checks for any slot the project's current lockfile (node_modules/.pnpm/lock.yaml) records unchanged. That record is written only by a completed install, but it vouches for a slot only this project writes. A global virtual store slot is shared, so another project's interrupted install may re-create it after the record was written and leave it without child links or package files. Every later install then kept the damaged slot.Under GVS the record no longer vouches for the slot. The probe always checks
package.jsonand every child link the symlink layout would create, as it already did for a GVS slot with no record. A project-local virtual store keeps trusting the record.Related to #16642. This is a partial fix, see below.
What this covers and what it does not
The repair happens in any install that materializes the virtual store. Examples: a manifest or lockfile change, a missing or broken direct-dependency link, or
--force. Before this PR those installs left the incomplete slots in place, as in the issue's Reproduction 2, step 5.An install in a project where nothing changed still short-circuits before the slot probe and does not repair a slot:
optimistic_repeat_install.rs) compares only manifest and lockfile mtimes.frozen_tree_up_to_datechecks only importer links under GVS (frozen_tree_intactskipsall_virtual_store_slots_presentbecause GVS slot paths depend on graph hashes).So the issue's Reproduction 1 (plain
pnpm installor--frozen-lockfilewith nothing changed) still prints "Already up to date". Closing that gap means walking every reachable GVS slot on each no-op install, a cost that needs a separate decision.pnpm v11
v11 has the same gap and is not changed here.
checkPkgDirReusein@pnpm/deps.graph-builderreturnsup-to-datefor a recorded GVS slot. Even when the slot is kept in the graph,linkIsolatedLayoutskips internal linking on warm GVS reinstalls on purpose (skipGvsInternalLinking, #11073), with or without a current lockfile. A v11 fix would have to undo that optimization, so it is left for a maintainer to decide.Squash Commit Body
Checklist
already linked to it solves it.
are implemented in every affected version. (v11 is affected and is not changed here, see above.)
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-5).
🤖 Generated with Claude Code
Summary by CodeRabbit