Repository navigation
perf(python): share concurrent project resolutions - #14993
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (12)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughChangesPython preparation and resolution
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant WorkspaceInstall
participant projects_prepare
participant PythonPrepare
participant Resolutions
participant Registry
WorkspaceInstall->>projects_prepare: select workspace projects
projects_prepare->>PythonPrepare: prepare projects concurrently
PythonPrepare->>Resolutions: request shared resolution
Resolutions->>Registry: resolve uncached requirements
Registry-->>Resolutions: return lockfile resolution
Resolutions-->>PythonPrepare: return parsed lockfile
PythonPrepare-->>projects_prepare: return prepared project
projects_prepare-->>WorkspaceInstall: return ordered results
Suggested labels: Merge Risk: ⚪ Minimal · up to Concurrent project preparation and cache reuse have no verified merge-blocking defect; current merge risk is minimal. ✨ 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 |
Micro-Benchmark ResultsLinux |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14993 +/- ##
==========================================
+ Coverage 91.04% 91.07% +0.02%
==========================================
Files 1303 1307 +4
Lines 174869 175164 +295
==========================================
+ Hits 159208 159522 +314
+ Misses 15661 15642 -19 ☔ 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; the linked-workspace scenario compares current Rust against main Rust. 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.5266774290000003,
"stddev": 0.13050440324851595,
"median": 2.4916811167999997,
"user": 1.8127526799999998,
"system": 1.8923944199999998,
"min": 2.3664964798,
"max": 2.7485167967999997
},
{
"command": "pacquet@main",
"mean": 2.5167819071,
"stddev": 0.16681841748979226,
"median": 2.4328577068,
"user": 1.9036913800000002,
"system": 1.9504810199999998,
"min": 2.3643166888,
"max": 2.7979744288
},
{
"command": "pnpr@HEAD",
"mean": 1.4572501655,
"stddev": 0.07272318305085224,
"median": 1.4362154843,
"user": 1.7257461799999998,
"system": 1.7515478199999996,
"min": 1.3835352788,
"max": 1.5915002468000001
},
{
"command": "pnpr@main",
"mean": 1.4385246067000002,
"stddev": 0.08003436637932275,
"median": 1.4330100473,
"user": 1.6701909799999999,
"system": 1.8059585199999997,
"min": 1.3542727358,
"max": 1.6394776238000002
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.29663428486000004,
"stddev": 0.0588741078881918,
"median": 0.27332232126,
"user": 0.33559320000000004,
"system": 0.68102892,
"min": 0.23218322476000003,
"max": 0.37934557776
},
{
"command": "pacquet@main",
"mean": 0.23972560286000003,
"stddev": 0.011816695457323497,
"median": 0.23594566876,
"user": 0.27612109999999995,
"system": 0.5517323199999999,
"min": 0.22222741976000002,
"max": 0.25988231676
},
{
"command": "pnpr@HEAD",
"mean": 0.25020793645999995,
"stddev": 0.020597565648203538,
"median": 0.24083891776000002,
"user": 0.2539835,
"system": 0.5396047199999999,
"min": 0.23107148076000003,
"max": 0.29188050176
},
{
"command": "pnpr@main",
"mean": 0.25053191566,
"stddev": 0.012562063339825574,
"median": 0.24764666726,
"user": 0.2695333,
"system": 0.55139092,
"min": 0.23137313476000002,
"max": 0.27376155875999997
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.008381846926013061,
"stddev": 0.0008492073314626412,
"median": 0.00818369306,
"user": 0.004574000000000005,
"system": 0.004338055294117647,
"min": 0.00698346606,
"max": 0.013146365060000002
},
{
"command": "pacquet@main",
"mean": 0.008250778317309946,
"stddev": 0.0016030541541467672,
"median": 0.007682553060000001,
"user": 0.004985248538011699,
"system": 0.003774812514619881,
"min": 0.006477388060000001,
"max": 0.01646505006
},
{
"command": "pnpr@HEAD",
"mean": 0.008502090965325443,
"stddev": 0.0007913043562288585,
"median": 0.008459549560000001,
"user": 0.00515945118343195,
"system": 0.0038752636686390516,
"min": 0.0068961720600000005,
"max": 0.011462738060000002
},
{
"command": "pnpr@main",
"mean": 0.008524465271320756,
"stddev": 0.0006883331662752482,
"median": 0.00844521806,
"user": 0.0049043905660377364,
"system": 0.004161636075471698,
"min": 0.0071171470600000005,
"max": 0.011030807060000002
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.008269052651748255,
"stddev": 0.0011581341852486523,
"median": 0.007987680399999999,
"user": 0.004921818741258741,
"system": 0.0038370972027972055,
"min": 0.0067918594,
"max": 0.015766514400000004
},
{
"command": "pacquet@main",
"mean": 0.00851678095474452,
"stddev": 0.0008494307521684788,
"median": 0.0084000714,
"user": 0.004863457810218975,
"system": 0.004154313722627739,
"min": 0.0068579344000000006,
"max": 0.0119108054
},
{
"command": "pnpr@HEAD",
"mean": 0.008899663123905728,
"stddev": 0.0012795252151236944,
"median": 0.0087151604,
"user": 0.005372251717171719,
"system": 0.004059718249158248,
"min": 0.0067899964000000005,
"max": 0.0140374494
},
{
"command": "pnpr@main",
"mean": 0.00887822221395349,
"stddev": 0.001432012685055196,
"median": 0.0085892274,
"user": 0.005478040620155039,
"system": 0.003926162480620153,
"min": 0.0064790804,
"max": 0.0151510754
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.66370564418,
"stddev": 0.08273966143915447,
"median": 2.65477117098,
"user": 2.376448259999999,
"system": 1.97857254,
"min": 2.5548121584800003,
"max": 2.78791584948
},
{
"command": "pacquet@main",
"mean": 2.53285408798,
"stddev": 0.043042336231354256,
"median": 2.5450041179800005,
"user": 2.0482361599999996,
"system": 1.6405221399999999,
"min": 2.46689261848,
"max": 2.5935569984800004
},
{
"command": "pnpr@HEAD",
"mean": 1.6354291669799998,
"stddev": 0.13857103605792132,
"median": 1.62686937848,
"user": 1.6141439599999998,
"system": 1.84678264,
"min": 1.47381870948,
"max": 1.90116949348
},
{
"command": "pnpr@main",
"mean": 1.70088377268,
"stddev": 0.12708370097506735,
"median": 1.68915498398,
"user": 1.74844966,
"system": 1.9611987400000004,
"min": 1.56065348348,
"max": 2.0076441334800004
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.3688176988800001,
"stddev": 0.01841948608509483,
"median": 0.3639679788800001,
"user": 0.57293776,
"system": 0.8298620799999998,
"min": 0.33994898038000004,
"max": 0.40090790638000007
},
{
"command": "pacquet@main",
"mean": 0.35997568868,
"stddev": 0.04641700972990321,
"median": 0.3441502268800001,
"user": 0.5828727600000001,
"system": 0.77396068,
"min": 0.32039271838000005,
"max": 0.46904972138000006
},
{
"command": "pnpr@HEAD",
"mean": 0.34726424788,
"stddev": 0.058689277265549726,
"median": 0.34875470788000007,
"user": 0.29573376,
"system": 0.64867048,
"min": 0.25747813538000003,
"max": 0.42083242438000007
},
{
"command": "pnpr@main",
"mean": 0.29178436798000007,
"stddev": 0.03806862573884768,
"median": 0.27526985038000007,
"user": 0.23372285999999995,
"system": 0.55275588,
"min": 0.25686315238,
"max": 0.3712690523800001
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.73414100084,
"stddev": 0.08707946562301214,
"median": 1.71845908494,
"user": 1.19725598,
"system": 1.2166790200000002,
"min": 1.62648910994,
"max": 1.87856849494
},
{
"command": "pacquet@main",
"mean": 1.69349088774,
"stddev": 0.04557210257965666,
"median": 1.68651740544,
"user": 1.1578306799999998,
"system": 1.18988162,
"min": 1.63008886494,
"max": 1.75073004894
},
{
"command": "pnpr@HEAD",
"mean": 0.32985891464,
"stddev": 0.02530932341667872,
"median": 0.33152030344000005,
"user": 0.27601068,
"system": 0.6180994199999998,
"min": 0.29545638194000007,
"max": 0.38331106194000003
},
{
"command": "pnpr@main",
"mean": 0.3390199671400001,
"stddev": 0.02296223630977066,
"median": 0.3297389794400001,
"user": 0.29385328,
"system": 0.6146717199999999,
"min": 0.31770076894000004,
"max": 0.38220500594000006
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2700905878307692,
"stddev": 0.05419345843075753,
"median": 0.2689352816,
"user": 0.2850842923076923,
"system": 0.09516098615384615,
"min": 0.1864788726,
"max": 0.3509213786
},
{
"command": "pacquet@main",
"mean": 0.2373548997538462,
"stddev": 0.017761776310295907,
"median": 0.23409224860000002,
"user": 0.24286921538461537,
"system": 0.09441075538461538,
"min": 0.2187864676,
"max": 0.2735063486
},
{
"command": "pnpr@HEAD",
"mean": 0.09735779940000001,
"stddev": 0.004887641537704186,
"median": 0.09664754660000002,
"user": 0.0387239,
"system": 0.015193239999999998,
"min": 0.09005440160000001,
"max": 0.1099857426
},
{
"command": "pnpr@main",
"mean": 0.09588548585000004,
"stddev": 0.003457587571112206,
"median": 0.0966399896,
"user": 0.03899227857142856,
"system": 0.014126456428571426,
"min": 0.08914062360000001,
"max": 0.10305838860000001
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6435304447111112,
"stddev": 0.12069853047258913,
"median": 0.6946438886,
"user": 0.6670562155555556,
"system": 0.14197849999999998,
"min": 0.4326317246,
"max": 0.7814516046000001
},
{
"command": "pacquet@main",
"mean": 0.6652059677111112,
"stddev": 0.15239416851039625,
"median": 0.7209005286000001,
"user": 0.6804788822222222,
"system": 0.16565327777777775,
"min": 0.2782893256,
"max": 0.7770137166000001
},
{
"command": "pnpm@HEAD",
"mean": 3.286642223488889,
"stddev": 0.3904096074695872,
"median": 3.1478579386,
"user": 5.0424594377777785,
"system": 0.23210816666666664,
"min": 2.8754904896,
"max": 4.0498326716
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.21954751216,
"stddev": 0.012883863707480833,
"median": 0.22158061816,
"user": 0.17691481,
"system": 0.10795982333333332,
"min": 0.19682769866,
"max": 0.24002275066
},
{
"command": "pacquet@main",
"mean": 0.2124115488028572,
"stddev": 0.009009794992922988,
"median": 0.21366017416,
"user": 0.15826906000000002,
"system": 0.11780631142857141,
"min": 0.19584273366,
"max": 0.22400198966
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.89071443674,
"stddev": 0.5159632585869175,
"median": 4.86013377364,
"user": 2.267472,
"system": 2.3415001799999997,
"min": 4.31329225464,
"max": 5.95561098764
},
{
"command": "pacquet@main",
"mean": 4.46253025464,
"stddev": 0.13891447920699496,
"median": 4.41672629014,
"user": 1.6693936999999999,
"system": 1.75342318,
"min": 4.31065582164,
"max": 4.68785490264
},
{
"command": "pnpr@HEAD",
"mean": 3.5878622818400006,
"stddev": 0.14519182268796202,
"median": 3.5236777111400004,
"user": 1.794155,
"system": 1.8278750799999997,
"min": 3.4523790516400004,
"max": 3.85121741764
},
{
"command": "pnpr@main",
"mean": 3.7864429530400003,
"stddev": 0.2312757521213078,
"median": 3.6977457411400003,
"user": 2.2706603999999997,
"system": 2.31533468,
"min": 3.5343738616400002,
"max": 4.32260595164
}
]
}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.10835749264181821,
"stddev": 0.006212507690243913,
"median": 0.10781128896,
"user": 0.13171352727272723,
"system": 0.12511476727272727,
"min": 0.10027793696000001,
"max": 0.11933288396000001
},
{
"command": "pacquet@main",
"mean": 0.14336686846,
"stddev": 0.027187790202713173,
"median": 0.15077387246,
"user": 0.1724225272727273,
"system": 0.1632482218181818,
"min": 0.10394529796,
"max": 0.19296210896000002
},
{
"command": "pnpr@HEAD",
"mean": 0.17587451388307695,
"stddev": 0.01428771115578456,
"median": 0.17788022696,
"user": 0.20211818461538458,
"system": 0.18183746307692308,
"min": 0.14411749196,
"max": 0.19384917196
},
{
"command": "pnpr@main",
"mean": 0.15165437909333335,
"stddev": 0.029343786075774498,
"median": 0.16419642096,
"user": 0.1675408,
"system": 0.17284594000000003,
"min": 0.10932457296,
"max": 0.19826002096
}
]
} |
|
Investigated the two Bencher alerts before changing anything. The original run's paired Rerunning the same head produced a 410.60 ms hot-install minimum and a 204.83 ms fresh-resolution minimum, both below their alert thresholds. The combined report nevertheless retained the old samples: reruns uploaded duplicate artifact names, and merging them allowed old results to overwrite the new ones. Commit Written by an agent (Codex, GPT-5). |
|
Investigated the Linux failure in Commit Written by an agent (Codex, GPT-5). |
|
| Project | pnpm's project |
| Branch | pr/14993 |
| 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) |
|---|---|---|
| gvs-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 144.12 ms |
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,473.82 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 295.46 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 257.48 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 90.05 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,383.54 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,452.38 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 231.07 ms |
| isolated-linker.repeat-install.cold-cache.hot-store | 📈 view plot | 6.79 ms |
| isolated-linker.repeat-install.hot-cache.hot-store | 📈 view plot | 6.90 ms |
PR Summary by QodoShare Python resolutions across concurrent workspace preparation
AI Description
Diagram
High-Level Assessment
Files changed (11)
|
|
Code Review by Qodo
1. Concurrent builds reinstall toolchains
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Addressed the verified findings from this round:
I am retaining the artifact and timestamp fixes. Both address failures encountered in this PR's validation, with reproductions documented above. The repository instructions require investigating and fixing such failures, including ones outside the changed feature. They remain separate commits for review. Written by an agent (Codex, GPT-5). |
|
Code review by qodo was updated up to the latest commit 7fb3e08 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
@greptileai please review the latest head Written by an agent (Codex, GPT-5). |
7fb3e08 to
b264aeb
Compare
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Rebased onto All 163 Python CLI and installer tests passed. The isolation test now also covers different per-project overrides and constraints. Push hooks passed and GitHub reports the PR as mergeable. @greptileai please review the rebased head. Written by an agent (Codex, GPT-5). |
|
Code review by qodo was updated up to the latest commit b264aeb |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Prepare Python projects with bounded concurrency after selecting their interpreters and workspace sources. Collect all results before reporting an error, preserving discovery order for publication and error selection. Share fresh registry resolutions within one install using normalized lockfile inputs (including overrides, constraints, and extra indexes), requires-python, and the interpreter report as the key. A per-key mutex allows one resolution to populate the cache while identical projects wait. Existing lockfiles retain their replay and frozen validation paths. Local sources and direct URLs do not share fresh resolutions. Environment installs seed and validate the shared lockfile through the existing acceptance path. Make backend environment sharing safe for concurrent projects. Siblings wait for one environment to finish; recursive builds track their own active keys and reuse completed nested environments without waiting on other backend chains. This preserves cycle diagnostics and avoids dependency cycles between in-flight cache entries. Add regression coverage for identical projects, frozen lockfile validation, project dependency-rule isolation, concurrent slot replenishment, and settling failed preparation without publishing lockfiles. Python installation exists only in pnpm v12. Replace benchmark artifacts on reruns so the combined report and privileged comment workflow consume current samples. Seed distinct whole-second manifest, lockfile, and validation times in the synchronous fast-path test; equal whole-second mtimes conservatively trigger a content check, so the prior fixture could fail when its initial mtime landed on a second boundary. Related to pnpm#14945 (item 13).
Summary
Speeds up Python workspace installs by preparing projects concurrently, bounded by
workspaceConcurrency, and sharing fresh resolutions for identical registry requirements. Interpreter selection and workspace source discovery stay ordered. Each project still validates its own lockfile, including frozen installs.Benchmark reruns now replace their scenario and report artifacts. Duplicate names previously let an old sample overwrite the rerun in the combined report. An npm fast-path test fixture now uses deterministic full-second gaps after CI exposed an equal-timestamp failure.
Addresses item 13 of #14945. Related to #14945; the other items remain outside this PR.
Squash Commit Body
Checklist
Validation: all 163 Python CLI and installer tests passed after rebasing onto main. The 10 repeat-install tests also passed. The npm fixture failure was reproduced with forced whole-second mtimes before correcting its timestamp order. All three
performance regression tests fail when the corresponding optimization is
disabled. Workspace check, clippy, custom Rust lints, formatting, and spelling
checks passed.
Local debug-build benchmark, median of three runs, identical
six,idna,and
packagingrequirements, warm index/artifact caches, offline,--lockfile-only, with lockfiles removed before each run:The baseline uses the same code with sharing disabled and preparation
concurrency set to one. These are local measurements, not release-build
performance guarantees.
Written by an agent (Codex, GPT-5).
Summary by CodeRabbit
New Features
Bug Fixes