Repository navigation
Conversation
…erialization The loaded linker ran CreateVirtualStore twice: a hoisted fetch pass over the whole graph, then an isolated pass over the excluded and patched trees. The second pass derived its cache keys, read the store index and checked CAFS files again for snapshots the first pass had just verified. The fetch pass now hands its settled prefetch to the materialization pass. The handoff carries the selected snapshots' cache keys and their verified rows, narrowed to those keys, plus the packages the fetch pass downloaded, so the second pass links them as warm. Git-hosted downloads stay out because their reuse also depends on the recorded prepare state. Related to pnpm/tasks#77. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keeps pipeline.rs under the file-length limit, boxes the settled prefetch variant, and splits the download filter out of retain_fetch_pass_rows. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (3)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe virtual-store pipeline retains selected prefetch rows across fetch and materialization passes. It carries settled prefetch results with the store index and verified-files cache. The changes also add prefetch-result filtering, settlement and verification logic, and tests for row retention and loaded-store materialization. ChangesVirtual-store prefetch flow
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Refactor Sequence Diagram(s)sequenceDiagram
participant CAS
participant run_retaining
participant PrefetchResult
participant CasPrefetch
participant settle_prefetch
CAS->>run_retaining: Run fetch and materialization with retained snapshots
run_retaining-->>CAS: Return output and prefetch handoff
CAS->>PrefetchResult: Retain selected rows and eligible downloads
CAS->>CasPrefetch: Package retained rows in a settled task
CasPrefetch->>settle_prefetch: Provide running or settled prefetch task
settle_prefetch->>PrefetchResult: Verify rows selected for import
Suggested labels: Merge Risk: ⚪ Minimal · up to This change reuses selected fetch-pass prefetch rows during materialization. No merge-blocking risk is established by the reviewed behavior. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Existing integrity and package-preparation controls remain in the installation path, and no concrete security regression was established. Reusing previously checked package data nevertheless relies on its remaining valid between passes; concurrent store changes and uncommon custom-source combinations are not fully resolved. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
✨ 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❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16602 +/- ##
=======================================
Coverage 92.31% 92.32%
=======================================
Files 1576 1577 +1
Lines 208813 208904 +91
=======================================
+ Hits 192772 192863 +91
Misses 16041 16041 ☔ 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.45655270668,
"stddev": 0.09370394209545713,
"median": 2.46870261688,
"user": 1.58670388,
"system": 1.5603131399999999,
"min": 2.30629865138,
"max": 2.60738678038
},
{
"command": "pacquet@main",
"mean": 2.46371765988,
"stddev": 0.1364416674170482,
"median": 2.45169656738,
"user": 1.6196453800000001,
"system": 1.58510744,
"min": 2.30862330338,
"max": 2.6893349853800004
},
{
"command": "pnpr@HEAD",
"mean": 1.5223676752800002,
"stddev": 0.1447756907578812,
"median": 1.47711586038,
"user": 1.50877768,
"system": 1.50802804,
"min": 1.34457054738,
"max": 1.71901536038
},
{
"command": "pnpr@main",
"mean": 1.48026489738,
"stddev": 0.10234908969658357,
"median": 1.4899086433800002,
"user": 1.5075422799999998,
"system": 1.49468384,
"min": 1.34569809538,
"max": 1.62619776538
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.34201272682,
"stddev": 0.015394698087813623,
"median": 0.33747734082,
"user": 0.41834375999999995,
"system": 0.8260239800000001,
"min": 0.31732128232,
"max": 0.36326432432
},
{
"command": "pacquet@main",
"mean": 0.33430336392,
"stddev": 0.018500226720879604,
"median": 0.32916590382,
"user": 0.39690986,
"system": 0.8390010800000001,
"min": 0.31322338231999997,
"max": 0.37625207432
},
{
"command": "pnpr@HEAD",
"mean": 0.42853040862,
"stddev": 0.06344327445731247,
"median": 0.44665313182,
"user": 0.50418576,
"system": 0.9916475799999999,
"min": 0.34672330032,
"max": 0.51936096432
},
{
"command": "pnpr@main",
"mean": 0.36116243102,
"stddev": 0.02233395511926015,
"median": 0.35996409482,
"user": 0.39050606,
"system": 0.8719009799999998,
"min": 0.32735888032,
"max": 0.41203523532
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.009082634857177913,
"stddev": 0.0016248674521511255,
"median": 0.008666772940000001,
"user": 0.005247695828220861,
"system": 0.004676833128834353,
"min": 0.00693687094,
"max": 0.01733066594
},
{
"command": "pacquet@main",
"mean": 0.011260053061311467,
"stddev": 0.0026167200209001413,
"median": 0.01033710294,
"user": 0.006549148721311474,
"system": 0.00574290924590164,
"min": 0.00814388694,
"max": 0.02268472294
},
{
"command": "pnpr@HEAD",
"mean": 0.012482526164390231,
"stddev": 0.002266253726962487,
"median": 0.01177273594,
"user": 0.006642439999999998,
"system": 0.006923432585365853,
"min": 0.00917336794,
"max": 0.02089074694
},
{
"command": "pnpr@main",
"mean": 0.012066354450869564,
"stddev": 0.0018598347827414332,
"median": 0.01170180394,
"user": 0.007155774782608697,
"system": 0.005974750434782607,
"min": 0.00917372894,
"max": 0.017814553940000002
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.012594380574358967,
"stddev": 0.0033218820497622056,
"median": 0.0118487426,
"user": 0.007478566666666664,
"system": 0.00600202646153846,
"min": 0.0090341656,
"max": 0.0450012096
},
{
"command": "pacquet@main",
"mean": 0.014573555819858152,
"stddev": 0.00300248689204098,
"median": 0.0144621586,
"user": 0.008417752482269501,
"system": 0.007363403120567376,
"min": 0.0093376676,
"max": 0.0219064816
},
{
"command": "pnpr@HEAD",
"mean": 0.012611967405714292,
"stddev": 0.0021340464661563007,
"median": 0.012238947600000001,
"user": 0.007156225714285719,
"system": 0.006609999771428571,
"min": 0.0092001986,
"max": 0.020198051600000003
},
{
"command": "pnpr@main",
"mean": 0.012238838113513518,
"stddev": 0.0021108559501607145,
"median": 0.0130982276,
"user": 0.007401035135135137,
"system": 0.005822203675675674,
"min": 0.0087430466,
"max": 0.0171920256
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.59894805834,
"stddev": 0.08288632684567375,
"median": 2.58706315634,
"user": 2.24863876,
"system": 1.7361716999999999,
"min": 2.5211035558400003,
"max": 2.81064942784
},
{
"command": "pacquet@main",
"mean": 2.5881420964400004,
"stddev": 0.043439177646084716,
"median": 2.57883229684,
"user": 2.1867766599999996,
"system": 1.7068590999999997,
"min": 2.5226468038400003,
"max": 2.65912177684
},
{
"command": "pnpr@HEAD",
"mean": 1.5282903776399999,
"stddev": 0.09284478410258659,
"median": 1.51949358034,
"user": 1.34337046,
"system": 1.3025594999999999,
"min": 1.43183263484,
"max": 1.69058435384
},
{
"command": "pnpr@main",
"mean": 1.62089499824,
"stddev": 0.08867858150587099,
"median": 1.61154512884,
"user": 1.6382592599999999,
"system": 1.6607954,
"min": 1.4964952598399999,
"max": 1.7733006228400001
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.49412473828000003,
"stddev": 0.03233156174674903,
"median": 0.49319756778,
"user": 0.6707555199999999,
"system": 0.7927215400000001,
"min": 0.44840063478000003,
"max": 0.5601934957800001
},
{
"command": "pacquet@main",
"mean": 0.51391085508,
"stddev": 0.061132644852493506,
"median": 0.5071447247800001,
"user": 0.69770612,
"system": 0.8110413399999998,
"min": 0.44301829578,
"max": 0.64511764678
},
{
"command": "pnpr@HEAD",
"mean": 0.36124401838000003,
"stddev": 0.05392671472810087,
"median": 0.33706047278,
"user": 0.32932272,
"system": 0.69604554,
"min": 0.30931407078,
"max": 0.45030210578
},
{
"command": "pnpr@main",
"mean": 0.31483393248,
"stddev": 0.012135730550855305,
"median": 0.31628847128000004,
"user": 0.27002622,
"system": 0.5962968399999999,
"min": 0.29063820978,
"max": 0.33480626678000003
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.6781483630399996,
"stddev": 0.026432354332102094,
"median": 1.66389744384,
"user": 0.9937850200000001,
"system": 0.8936425399999999,
"min": 1.65239123634,
"max": 1.72662323734
},
{
"command": "pacquet@main",
"mean": 1.6995266474400001,
"stddev": 0.03405279991544531,
"median": 1.6875196803399999,
"user": 1.0740852200000002,
"system": 0.96813994,
"min": 1.66596006934,
"max": 1.78208478434
},
{
"command": "pnpr@HEAD",
"mean": 0.32780201594,
"stddev": 0.01424447716305888,
"median": 0.32900221184,
"user": 0.28765911999999993,
"system": 0.61767654,
"min": 0.30854245934,
"max": 0.34584705334000004
},
{
"command": "pnpr@main",
"mean": 0.35680533924,
"stddev": 0.029778959048632404,
"median": 0.35184799334000005,
"user": 0.3187421200000001,
"system": 0.65094224,
"min": 0.31677077334000003,
"max": 0.43384122734
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.24723175308666664,
"stddev": 0.01219036042338007,
"median": 0.24456538992000004,
"user": 0.22990828,
"system": 0.09658927,
"min": 0.22298794492000001,
"max": 0.26595100692
},
{
"command": "pacquet@main",
"mean": 0.22004429376615392,
"stddev": 0.01644104718836336,
"median": 0.22002051492000002,
"user": 0.1977450107692308,
"system": 0.07890432769230768,
"min": 0.20008471592000002,
"max": 0.25609904692
},
{
"command": "pnpr@HEAD",
"mean": 0.09414902705333333,
"stddev": 0.0026384730947008723,
"median": 0.09358991942,
"user": 0.03379574666666666,
"system": 0.014701086666666665,
"min": 0.09032756692,
"max": 0.10218996692
},
{
"command": "pnpr@main",
"mean": 0.09687337562000002,
"stddev": 0.0033898453710912596,
"median": 0.09619222692,
"user": 0.036908213333333335,
"system": 0.015462686666666666,
"min": 0.09177347092,
"max": 0.10631755192
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2267505920288889,
"stddev": 0.0191378711126141,
"median": 0.22362115214,
"user": 0.2335397577777778,
"system": 0.054192404444444446,
"min": 0.20139053814000002,
"max": 0.26439535514
},
{
"command": "pacquet@main",
"mean": 0.23553672091777778,
"stddev": 0.010409028763742703,
"median": 0.23294790314000002,
"user": 0.25183186888888887,
"system": 0.04387129333333333,
"min": 0.22422109914000002,
"max": 0.25329507514
},
{
"command": "pnpm@HEAD",
"mean": 4.036317112473334,
"stddev": 0.28345854542194676,
"median": 4.021943080140001,
"user": 6.280197313333333,
"system": 0.44822718222222224,
"min": 3.50765622214,
"max": 4.559036045140001
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.27305078264000004,
"stddev": 0.026582541475793503,
"median": 0.26293233874,
"user": 0.21913538000000005,
"system": 0.10441651999999998,
"min": 0.24168966874,
"max": 0.32308383074
},
{
"command": "pacquet@main",
"mean": 0.2530335761945455,
"stddev": 0.011584198709625638,
"median": 0.25016398274,
"user": 0.2030882527272727,
"system": 0.09627625636363635,
"min": 0.24007111274,
"max": 0.28061909974
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.55550546062,
"stddev": 0.13680084250387015,
"median": 4.564557656020001,
"user": 1.7752072,
"system": 1.6888980799999995,
"min": 4.40568359752,
"max": 4.83825225252
},
{
"command": "pacquet@main",
"mean": 4.62362817072,
"stddev": 0.1778908758924217,
"median": 4.563402395020001,
"user": 1.8254879,
"system": 1.69498048,
"min": 4.39616911552,
"max": 4.876139082520001
},
{
"command": "pnpr@HEAD",
"mean": 3.8925668170199996,
"stddev": 0.3295188567755492,
"median": 3.77818741202,
"user": 2.193152,
"system": 1.92250768,
"min": 3.60113607152,
"max": 4.50108326652
},
{
"command": "pnpr@main",
"mean": 3.7353836122199993,
"stddev": 0.12002197486261537,
"median": 3.66572987752,
"user": 2.056422,
"system": 1.8550627799999997,
"min": 3.61783655552,
"max": 3.91008466052
}
]
}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.19749124466181825,
"stddev": 0.058226773908568036,
"median": 0.22763906048000002,
"user": 0.2366267418181818,
"system": 0.18722635636363635,
"min": 0.12753424648000003,
"max": 0.26432160948000005
},
{
"command": "pacquet@main",
"mean": 0.14045961274315788,
"stddev": 0.005501797744609106,
"median": 0.13843287648000002,
"user": 0.17785392842105266,
"system": 0.1447914042105263,
"min": 0.13281491548000002,
"max": 0.15205711548000003
},
{
"command": "pnpr@HEAD",
"mean": 0.14875686918588232,
"stddev": 0.004857548604365039,
"median": 0.14967439648000003,
"user": 0.18251773647058822,
"system": 0.13828701411764707,
"min": 0.14081892048000003,
"max": 0.15678190548
},
{
"command": "pnpr@main",
"mean": 0.14981257685500005,
"stddev": 0.004463247994392605,
"median": 0.15020066748000002,
"user": 0.17202943499999998,
"system": 0.1570465325,
"min": 0.14296401448,
"max": 0.15635317448000002
}
]
} |
Wrapping run_inner around run_retaining grew the future every install awaits past clippy's large_futures limit on Windows. The hoisted patch e2e test aborted there with a stack buffer overrun. 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 QodoReuse fetch-pass CAS prefetch for loaded linker materialization
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
…ized Without excluded or patched packages the materialization pass has no snapshots, so narrowing the fetch-pass rows for it was wasted work. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Qodo finding "Loaded installs scan unused store rows": confirmed and fixed in 42aacd7. Written by an agent (Claude Code, claude-opus-5-5). |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Thanks for the update. finding 1 is now marked implemented, and the fix matches the intended behavior: an empty selection passes |
|
Code review by qodo was updated up to the latest commit 42aacd7 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Summary
The loaded linker runs
CreateVirtualStoretwice: a hoisted fetch pass over the whole graph, then an isolated pass over the excluded and patched trees. The second pass derived cache keys, read the store index, and re-checked CAFS files for snapshots the first pass had just verified.The fetch pass now hands a settled
CasPrefetchto the materialization pass:CasPrefetchcarries either a running prefetch task or a settled, verifiedPrefetchResult(PrefetchTask::Settled).run_retainingreturns the settled prefetch for the snapshots a later pass installs.run_cashands it to the second pass through the existingVirtualStoreFetchInputs::cas_prefetchslot, so the second pass never callsCasPrefetch::start. This works the same when the frozen-install caller already supplied a full-graph prefetch.requiresBuild, so the second pass links them as warm. Mutable or missing sources and git-hosted downloads are not added: git reuse also depends on the recorded prepare state. Those keep the existing cold path.verify_rowsalready skips rows it has checked, so the second pass's files check is a no-op for rows the fetch pass verified.Prefetch settling moved from
pipeline.rsintocreate_virtual_store/settle.rsto stay under the file-length limit.Related to pnpm/tasks#77. The loaded linker hasn't been released yet, so there's no changeset.
Regression test
loaded_materialization_reuses_the_fetch_pass_prefetchrecords everyCasPrefetch::startand asserts that a loaded install with an excluded tree prefetches once, over the full graph. To check the test, I temporarily dropped the handoff. The test then failed:childandexcludedwere prefetched a second time.fetch_pass_rows_keep_the_selection_and_its_downloadscovers the narrowing and which downloads get added.Benchmark
Synthetic workspace: 8 projects, 1079 lockfile snapshots,
nodeLinker: { type: loaded, excluded: [jest, webpack, eslint] },ignoreScripts. Warm store,install --frozen-lockfile --offline, release builds of this branch and its base, alternating, 10 runs each, Linux x64:The gain grows with the size of the excluded trees. Both binaries produce byte-identical
.pnpm-store.jsonand the same GVS tree.Tests:
pnpm-deps-restorerandpnpm-tarball(785 passed),pnpm-clicas_linker::andconfig_dependencies::(27 passed), pre-push checks (clippy, doc, dylint, fmt).Squash Commit Body
Checklist
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. Autofix is disabled.Summary by CodeRabbit