Skip to content

perf(python): share concurrent project resolutions - #14993

Merged
zkochan merged 6 commits into
mainfrom
fix-14945-13
Sep 16, 2026
Merged

zkochan merged 6 commits into
mainfrom
fix-14945-13

Conversation

@zkochan

@zkochan zkochan commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

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

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 https://github.com/pnpm/pnpm/issues/14945 (item 13).

Checklist

  • I checked the referenced issue and verified that none of the PRs already linked to it solves it.
  • New features are implemented only in the Rust pnpm v12 CLI. Bug fixes are implemented in every affected version.
  • Added a changeset if this PR changes any published package.
  • Added or updated tests.

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 packaging requirements, warm index/artifact caches, offline,
--lockfile-only, with lockfiles removed before each run:

Projects Serial preparation without sharing This change
1 0.560 s 0.740 s
5 1.248 s 0.727 s
20 5.860 s 0.792 s

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

    • Python workspaces with multiple projects now prepare concurrently, helping speed up dependency installation.
    • Compatible dependency resolutions and build environments can be shared across projects during installation.
    • Different dependency or Python-version requirements remain isolated with separate resolutions.
    • Frozen-lockfile installations now support shared resolution behavior.
  • Bug Fixes

    • Improved handling of nested build requirements to prevent cyclic build chains.
    • Re-running integrated benchmarks now replaces existing uploaded results instead of failing because of duplicate artifacts.

@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 6969cbf9-aac0-483e-8897-f7b3677483bc

📥 Commits

Reviewing files that changed from the base of the PR and between 7fb3e08 and b264aeb.

📒 Files selected for processing (12)
  • .changeset/quiet-python-projects.md
  • .github/workflows/pacquet-integrated-benchmark.yml
  • pnpm/crates/cli/tests/suite/python.rs
  • pnpm/crates/cli/tests/suite/python/resolution.rs
  • pnpm/crates/cli/tests/suite/python/sources.rs
  • pnpm/crates/package-manager/src/install/tests/repeat_install.rs
  • pnpm/crates/python-installer/src/build.rs
  • pnpm/crates/python-installer/src/environment.rs
  • pnpm/crates/python-installer/src/lib.rs
  • pnpm/crates/python-installer/src/lockfile.rs
  • pnpm/crates/python-installer/src/projects.rs
  • pnpm/crates/python-installer/src/resolutions.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/quiet-python-projects.md

Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

Changes

Python preparation and resolution

Layer / File(s) Summary
Concurrent project orchestration
pnpm/crates/python-installer/...
Project selection and preparation moved into projects.rs. Eligible projects prepare concurrently with bounded workspace concurrency. Requirement sets are computed once and passed into project preparation.
Shared build environment state
pnpm/crates/python-installer/src/environment.rs, pnpm/crates/python-installer/src/build.rs, pnpm/crates/cli/tests/suite/python/sources.rs
Shared caches hold build environments. Per-preparation state tracks active build keys, detects cycles, and supports nested requirement installation. Integration coverage verifies reuse across Git projects.
Shared registry resolutions
pnpm/crates/python-installer/src/resolutions.rs
Fresh registry lockfile results are cached by resolution inputs. Existing lockfiles, populated local directories, and URL requirements bypass the cache.
Resolution integration coverage
pnpm/crates/cli/tests/suite/python.rs, pnpm/crates/cli/tests/suite/python/resolution.rs
Tests cover shared resolutions, concurrent preparation, lockfile-only behavior, failure handling, and differing dependency or Python-version inputs.
Supporting release and test updates
.changeset/quiet-python-projects.md, .github/workflows/pacquet-integrated-benchmark.yml, pnpm/crates/package-manager/src/install/tests/repeat_install.rs
The changeset documents the installer changes. Benchmark uploads overwrite artifacts on reruns. Repeat-install tests use deterministic modification times.

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
Loading

Suggested labels: product: pacquet

Merge Risk: ⚪ Minimal · up to b264a

Concurrent project preparation and cache reuse have no verified merge-blocking defect; current merge risk is minimal.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-14945-13

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.02     14.4±0.55ms    26.0 MB/sec    1.00     14.1±1.06ms    26.5 MB/sec
packument/parse                                  1.00     48.1±1.83µs  1378.3 MB/sec    1.36    65.3±14.08µs  1016.5 MB/sec
tarball/download_dependency                      1.00      7.1±0.96ms   615.2 KB/sec    1.36      9.6±1.48ms   452.2 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00   258.2±11.38ms 62.0 KElem/sec    1.03   267.1±20.87ms 59.9 KElem/sec
workspace_resolution/hoist_heavy                 1.01   345.8±30.59ms        ? ?/sec    1.00   343.3±27.50ms        ? ?/sec
workspace_sort/chained_projects                  1.33     22.9±7.66ms        ? ?/sec    1.00     17.3±2.74ms        ? ?/sec

@codecov-commenter

codecov-commenter commented Sep 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.64865% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.07%. Comparing base (3bda5e8) to head (b264aeb).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pnpm/crates/python-installer/src/build.rs 96.29% 1 Missing ⚠️
pnpm/crates/python-installer/src/projects.rs 98.46% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: c242ce88ae21

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.527 ± 0.131 2.366 2.749 1.76 ± 0.13
pacquet@main 2.517 ± 0.167 2.364 2.798 1.75 ± 0.15
pnpr@HEAD 1.457 ± 0.073 1.384 1.592 1.01 ± 0.08
pnpr@main 1.439 ± 0.080 1.354 1.639 1.00
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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 296.6 ± 58.9 232.2 379.3 1.24 ± 0.25
pacquet@main 239.7 ± 11.8 222.2 259.9 1.00
pnpr@HEAD 250.2 ± 20.6 231.1 291.9 1.04 ± 0.10
pnpr@main 250.5 ± 12.6 231.4 273.8 1.05 ± 0.07
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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 8.4 ± 0.8 7.0 13.1 1.02 ± 0.22
pacquet@main 8.3 ± 1.6 6.5 16.5 1.00
pnpr@HEAD 8.5 ± 0.8 6.9 11.5 1.03 ± 0.22
pnpr@main 8.5 ± 0.7 7.1 11.0 1.03 ± 0.22
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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 8.3 ± 1.2 6.8 15.8 1.00
pacquet@main 8.5 ± 0.8 6.9 11.9 1.03 ± 0.18
pnpr@HEAD 8.9 ± 1.3 6.8 14.0 1.08 ± 0.22
pnpr@main 8.9 ± 1.4 6.5 15.2 1.07 ± 0.23
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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.664 ± 0.083 2.555 2.788 1.63 ± 0.15
pacquet@main 2.533 ± 0.043 2.467 2.594 1.55 ± 0.13
pnpr@HEAD 1.635 ± 0.139 1.474 1.901 1.00
pnpr@main 1.701 ± 0.127 1.561 2.008 1.04 ± 0.12
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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 368.8 ± 18.4 339.9 400.9 1.26 ± 0.18
pacquet@main 360.0 ± 46.4 320.4 469.0 1.23 ± 0.23
pnpr@HEAD 347.3 ± 58.7 257.5 420.8 1.19 ± 0.25
pnpr@main 291.8 ± 38.1 256.9 371.3 1.00
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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.734 ± 0.087 1.626 1.879 5.26 ± 0.48
pacquet@main 1.693 ± 0.046 1.630 1.751 5.13 ± 0.42
pnpr@HEAD 0.330 ± 0.025 0.295 0.383 1.00
pnpr@main 0.339 ± 0.023 0.318 0.382 1.03 ± 0.11
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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 270.1 ± 54.2 186.5 350.9 2.82 ± 0.57
pacquet@main 237.4 ± 17.8 218.8 273.5 2.48 ± 0.21
pnpr@HEAD 97.4 ± 4.9 90.1 110.0 1.02 ± 0.06
pnpr@main 95.9 ± 3.5 89.1 103.1 1.00
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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 643.5 ± 120.7 432.6 781.5 1.00
pacquet@main 665.2 ± 152.4 278.3 777.0 1.03 ± 0.31
pnpm@HEAD 3286.6 ± 390.4 2875.5 4049.8 5.11 ± 1.13
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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 219.5 ± 12.9 196.8 240.0 1.03 ± 0.07
pacquet@main 212.4 ± 9.0 195.8 224.0 1.00
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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.891 ± 0.516 4.313 5.956 1.36 ± 0.15
pacquet@main 4.463 ± 0.139 4.311 4.688 1.24 ± 0.06
pnpr@HEAD 3.588 ± 0.145 3.452 3.851 1.00
pnpr@main 3.786 ± 0.231 3.534 4.323 1.06 ± 0.08
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 store

Same 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.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 108.4 ± 6.2 100.3 119.3 1.00
pacquet@main 143.4 ± 27.2 103.9 193.0 1.32 ± 0.26
pnpr@HEAD 175.9 ± 14.3 144.1 193.8 1.62 ± 0.16
pnpr@main 151.7 ± 29.3 109.3 198.3 1.40 ± 0.28
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
    }
  ]
}

@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/14993
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
gvs-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
100.28 ms
(-13.31%)Baseline: 115.67 ms
138.80 ms
(72.25%)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
2,554.81 ms
(+2.39%)Baseline: 2,495.27 ms
2,994.32 ms
(85.32%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,626.49 ms
(+3.45%)Baseline: 1,572.32 ms
1,886.78 ms
(86.20%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
339.95 ms
(-11.43%)Baseline: 383.84 ms
460.60 ms
(73.81%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
186.48 ms
(-9.91%)Baseline: 207.00 ms
248.40 ms
(75.07%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,366.50 ms
(+2.97%)Baseline: 2,298.16 ms
2,757.79 ms
(85.81%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,313.29 ms
(-1.05%)Baseline: 4,359.27 ms
5,231.12 ms
(82.45%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
232.18 ms
(-7.67%)Baseline: 251.47 ms
301.77 ms
(76.94%)
isolated-linker.linked-workspace-resolve.hot-cache.offline📈 view plot
🚷 view threshold
196.83 ms
(+10.87%)Baseline: 177.52 ms
213.03 ms
(92.40%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
432.63 ms
(-29.59%)Baseline: 614.48 ms
737.37 ms
(58.67%)
isolated-linker.repeat-install.cold-cache.hot-store📈 view plot
🚷 view threshold
6.79 ms
(-1.39%)Baseline: 6.89 ms
8.27 ms
(82.17%)
isolated-linker.repeat-install.hot-cache.hot-store📈 view plot
🚷 view threshold
6.98 ms
(-3.48%)Baseline: 7.23 ms
8.68 ms
(80.44%)
🐰 View full continuous benchmarking report in Bencher

@zkochan

zkochan commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

Investigated the two Bencher alerts before changing anything. The original run's paired main minimum for hot installs was 664.58 ms, while this PR was 662.68 ms. Bencher's historical baseline was 383.03 ms. Fresh-resolution means were also nearly identical for main and this PR.

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 8e2b8763b2 enables artifact replacement for scenario and combined-report uploads. No benchmark threshold or gate changed. A fresh CI run is underway.


Written by an agent (Codex, GPT-5).

@zkochan

zkochan commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

Investigated the Linux failure in sync_fast_path_matches_optimistic_short_circuit and reproduced it locally by forcing the manifest and lockfile to whole-second mtimes before the original backdating helper ran. Both files received equal mtimes, so the conservative coarse-timestamp freshness check could not prove that the manifest preceded the lockfile.

Commit c242ce88ae seeds distinct whole-second manifest, lockfile, and validation timestamps. The manifest and lockfile each have a full-second gap before the next event. All 10 neighboring repeat-install tests passed, as did workspace check, clippy, and the push hooks. CI is rerunning on this commit.


Written by an agent (Codex, GPT-5).

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/14993
Testbedpnpr

⚠️ 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-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
gvs-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
144.12 ms
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,473.82 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
295.46 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
257.48 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
90.05 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,383.54 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,452.38 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
231.07 ms
isolated-linker.repeat-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
6.79 ms
isolated-linker.repeat-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
6.90 ms
🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan marked this pull request as ready for review September 16, 2026 23:14
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Share Python resolutions across concurrent workspace preparation

✨ Enhancement 🐞 Bug fix 🧪 Tests ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Prepares Python workspace projects concurrently while preserving ordered selection, errors, and
 publication.
• Shares eligible registry resolutions and safely coordinates backend environments across projects.
• Hardens benchmark artifacts and timestamp-sensitive fixtures, with concurrency regression
 coverage.
Diagram

graph TD
    A["Workspace install"] --> B["Ordered discovery"] --> C["Bounded preparation"] --> D{"Existing lock?"}
    D -->|Yes| G["Project validation"] --> H["Ordered publication"]
    D -->|No| E{"Shareable inputs?"}
    E -->|Yes| F["Shared caches"] --> G
    E -->|No| G
    C -->|Backend builds| F
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Workspace-wide batch resolution
  • ➕ Could resolve compatible projects in one explicit solver invocation.
  • ➕ Could avoid per-key mutex entries and serialized cache population.
  • ➖ Would require merging project requirements across interpreters and Python constraints.
  • ➖ Could weaken independent lockfile replay and frozen-install validation semantics.
  • ➖ Local sources and direct URLs make safe batching substantially more complex.

Recommendation: Keep the PR's keyed, per-install cache with bounded project concurrency. It preserves existing per-project lockfile semantics and isolates incompatible inputs while removing duplicate registry work; a workspace-wide solve would offer limited additional benefit at substantially greater semantic and implementation risk.

Files changed (11) +394 / -73

Enhancement (4) +196 / -45
environment.rsIntroduce shared preparation caches and per-project state +19/-3

Introduce shared preparation caches and per-project state

• Groups build-environment and resolution caches into shared install state. Makes project preparation clonable and tracks backend keys active within each recursive build chain.

pnpm/crates/python-installer/src/environment.rs

lib.rsIntegrate concurrent project and resolution modules +8/-42

Integrate concurrent project and resolution modules

• Delegates workspace preparation to the new project coordinator and routes fresh lockfile generation through the shared-resolution path. Precomputed project requirements are passed into individual preparation tasks.

pnpm/crates/python-installer/src/lib.rs

projects.rsPrepare Python projects with bounded concurrency +103/-0

Prepare Python projects with bounded concurrency

• Separates ordered interpreter, source, and requirement selection from concurrent project preparation. Buffers tasks by workspaceConcurrency, settles every result, and restores discovery order before returning.

pnpm/crates/python-installer/src/projects.rs

resolutions.rsCache eligible fresh registry resolutions per install +66/-0

Cache eligible fresh registry resolutions per install

• Adds a normalized, per-key mutex cache for fresh registry lockfiles. Existing locks, local projects, and direct URLs bypass sharing, while non-lockfile-only consumers re-enter the standard acceptance path.

pnpm/crates/python-installer/src/resolutions.rs

Bug fix (1) +32 / -23
build.rsCoordinate concurrent backend environment creation +32/-23

Coordinate concurrent backend environment creation

• Uses per-key mutex entries so sibling projects wait for one shared backend environment. Nested backend chains track their own active keys to preserve cycle detection without deadlocking against sibling builds.

pnpm/crates/python-installer/src/build.rs

Refactor (1) +1 / -1
lockfile.rsExpose lockfile acceptance to shared resolutions +1/-1

Expose lockfile acceptance to shared resolutions

• Makes the existing lockfile acceptance path available to the resolution cache so reused lockfiles still fetch artifacts and validate each project's requirements.

pnpm/crates/python-installer/src/lockfile.rs

Tests (3) +158 / -4
python.rsRegister Python resolution regression tests +1/-0

Register Python resolution regression tests

• Adds the new resolution test module to the Python CLI integration suite.

pnpm/crates/cli/tests/suite/python.rs

resolution.rsTest concurrent and shared Python resolutions +149/-0

Test concurrent and shared Python resolutions

• Covers shared fresh resolutions for identical projects, independent frozen-lockfile validation, bounded slot replenishment, failure settlement, and isolation of differing resolution inputs.

pnpm/crates/cli/tests/suite/python/resolution.rs

repeat_install.rsMake fast-path timestamp ordering deterministic +8/-4

Make fast-path timestamp ordering deterministic

• Assigns manifest, lockfile, and validation timestamps with full-second gaps. This prevents equal coarse-grained mtimes from unexpectedly triggering content validation in CI.

pnpm/crates/package-manager/src/install/tests/repeat_install.rs

Documentation (1) +5 / -0
quiet-python-projects.mdDocument faster Python workspace installation +5/-0

Document faster Python workspace installation

• Adds a patch changeset for pacquet describing concurrent project preparation and shared dependency resolutions.

.changeset/quiet-python-projects.md

Other (1) +2 / -0
pacquet-integrated-benchmark.ymlReplace benchmark artifacts on workflow reruns +2/-0

Replace benchmark artifacts on workflow reruns

• Enables artifact overwrites for per-scenario results and the combined Ubuntu report so reruns publish current benchmark data instead of retaining stale samples.

.github/workflows/pacquet-integrated-benchmark.yml

@greptile-apps

greptile-apps Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge with no outstanding actionable findings.

Reviews (4) · Last reviewed commit: "test(python): keep project dependency ru..."

Comment thread .changeset/quiet-python-projects.md Resolved
@qodo-code-review

qodo-code-review Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (1) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Concurrent builds reinstall toolchains 🐞 Bug ➹ Performance ⭐ New
Description
install_requirements immediately runs install_nested_requirements whenever try_lock() finds a
shared environment entry locked, without determining whether the in-flight owner can safely be
awaited or recording the fallback result. When unrelated sibling backend chains concurrently request
the same nested requirements, each chain performs resolution, wheel fetching, and Python environment
installation instead of reusing the owner's result, while only a genuine dependency cycle requires
isolated work.
Code

pnpm/crates/python-installer/src/build.rs[R281-283]

+            match entry.try_lock() {
+                Ok(environment) => environment,
+                Err(_) => return self.install_nested_requirements::<Reporter>(requires, key).await,
Relevance

●●● Strong

Accepted performance/correctness concerns in Python build sharing; concurrent cache contention
should await reusable environments.

PR-#14953
PR-#14973

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed project scheduler runs preparations concurrently, and nested calls use try_lock() when
accessing shared environment entries. If another task holds an entry, the fallback immediately
builds an environment independently through install_nested_requirements and
install_build_requirements, performing resolver work and a Python installation while the entry
owner follows the same path before populating the cache, which demonstrates that contending sibling
chains duplicate the full installation work rather than sharing the in-flight result.

pnpm/crates/python-installer/src/projects.rs[22-30]
pnpm/crates/python-installer/src/build.rs[269-301]
pnpm/crates/python-installer/src/build.rs[324-341]
pnpm/crates/python-installer/src/environment.rs[37-40]
pnpm/crates/python-installer/src/build.rs[276-290]
pnpm/crates/python-installer/src/build.rs[294-301]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Nested backend chains bypass a locked shared environment entry and independently resolve, fetch, and install the same requirements. Although a non-waiting fallback is needed when awaiting the owner would create a dependency cycle, unrelated sibling chains should await and reuse the in-flight result rather than duplicating expensive work.

## Fix Focus Areas
- pnpm/crates/python-installer/src/build.rs[269-301]
- pnpm/crates/python-installer/src/environment.rs[37-60]

## Recommended Fix
Track the owning backend chain or active dependency chain for each in-flight environment entry. Await and reuse the entry when adding that dependency cannot create a cycle, keep the isolated non-waiting fallback only when the tracked relationship proves an actual cycle risk, and publish a successful fallback result to an empty shared entry so later chains can reuse it.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Release note bundles internal details ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
quiet-python-projects.md uses one sentence to describe concurrent preparation and shared
dependency resolutions, which are two separate implementation mechanisms rather than one observable
change. Readers must disentangle those mechanisms from the preceding user-facing speed improvement
when reusing or editing the release note.
Code

.changeset/quiet-python-projects.md[5]

+Sped up `pnpm install` in Python workspaces with many projects. Projects now prepare concurrently, and projects with identical registry requirements share fresh dependency resolutions [pnpm/pnpm#14945](https://github.com/pnpm/pnpm/issues/14945).
Relevance

●●● Strong

Recent changeset reviews accept splitting compound implementation details into separate user-facing
statements.

PR-#14959
PR-#14926

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 3058304 requires each changeset sentence to describe one logical change, while rule 3058322
restricts entries to observable behavior. Line 5 joins concurrent project preparation and shared
resolution caching in one sentence even though both describe internal mechanisms.

Rule 3058304: Avoid compound sentences in individual changeset entries
Rule 3058322: Changeset entries must describe observable behavior changes only
.changeset/quiet-python-projects.md[5-5]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The changeset combines two internal implementation changes in one compound sentence instead of limiting the entry to the observable install performance change.

## Fix Focus Areas
- .changeset/quiet-python-projects.md[5-5]

## Recommended Fix
Keep the user-visible statement that Python workspace installs are faster and the issue link. Remove the implementation-detail sentence, or replace it with separate sentences describing distinct observable effects if those effects need release-note coverage.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Nested builds repeat environment setup ✓ Resolved 🐞 Bug ➹ Performance
Description
install_requirements bypasses build_environments whenever state.building is nonempty, so a
completed environment produced while building a Git source is never retained in the shared cache.
When multiple workspace projects resolve build requirements that fetch the same Git-backed
dependency, each nested backend chain recreates its temporary environment and repeats resolution and
package installation instead of reusing the completed one.
Code

pnpm/crates/python-installer/src/build.rs[R273-276]

+        // Nested builds must not wait on a sibling's backend chain, which may
+        // in turn need the environment this chain is currently preparing.
+        if !self.state.building.is_empty() {
+            return self.install_nested_requirements::<Reporter>(requires, key).await;
Relevance

●●● Strong

Recent Python installer reviews accepted findings exposing incorrect shared build-environment
caching and repeated backend work.

PR-#14973
PR-#14953

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
A nested build is reached when a resolver fetches a Git source: fetch_git invokes
PythonPrepare::build through the current preparation state. That build creates its backend
environment via install_requirements; the changed nonempty-building branch returns directly from
install_nested_requirements, while only the top-level branch stores a successful result in
build_environments. Each uncached installation creates a new temporary directory, resolves
requirements, and invokes the installer.

pnpm/crates/python-installer/src/sources/git.rs[12-46]
pnpm/crates/python-installer/src/build.rs[235-301]
pnpm/crates/python-installer/src/build.rs[324-341]
pnpm/crates/python-installer/src/projects.rs[22-30]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Nested build-environment creation bypasses the shared cache to avoid waiting on an in-flight sibling backend chain. This also means successfully completed nested environments are discarded, so later projects repeat their resolver work, temporary-directory creation, and backend-package installation.

## Fix Focus Areas
- pnpm/crates/python-installer/src/build.rs[269-301]
- pnpm/crates/python-installer/src/environment.rs[35-40]

## Recommended Fix
Preserve the no-wait behavior for nested requests, but publish a successfully completed nested environment into the per-key cache when doing so does not wait for or overwrite an existing in-flight/ready entry. Subsequent independent chains should then be able to reuse that completed environment, while recursive chains must retain the current cycle detection and must not block on sibling cache entries.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View medium (1)
4. Unrelated fixes widen the change 📘 Rule violation ⚙ Maintainability
Description
The artifact overwrite additions and deterministic timestamp setup do not participate in Python
project preparation or resolution sharing. They are bundled with the Python performance change, so
review and rollback span three independent concerns.
Code

.github/workflows/pacquet-integrated-benchmark.yml[660]

+          overwrite: true
Relevance

●● Moderate

The PR explicitly scopes benchmark rerun fixes, but no close precedent confirms rejecting this
bundling concern.

PR-#12630

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Compliance rule 2255067 excludes unrelated behavioral or maintenance changes from a focused fix. The
workflow changes artifact replacement, the package-manager test changes timestamp setup, and the
Python installer separately introduces concurrent preparation, demonstrating three independent
concerns.

Rule 2255067: Bug fix changes must not include unrelated refactors or reformatting
.github/workflows/pacquet-integrated-benchmark.yml[660-660]
pnpm/crates/package-manager/src/install/tests/repeat_install.rs[261-267]
pnpm/crates/python-installer/src/projects.rs[23-30]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR combines the Python workspace performance change with independent benchmark artifact and test-fixture fixes.

## Fix Focus Areas
- .github/workflows/pacquet-integrated-benchmark.yml[660-660]
- pnpm/crates/package-manager/src/install/tests/repeat_install.rs[261-267]

## Recommended Fix
Move the benchmark artifact overwrite changes and deterministic timestamp fixture changes into separate pull requests or changes, leaving this PR focused on concurrent Python project preparation and shared resolutions.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 37 rules
✅ Cross-repo context — repo relationships
Review mode: 🧠 Deep: This push adds substantial concurrent preparation, shared-resolution caching, authenticated multi-index handling, dependency-rule semantics, and lockfile behavior across multiple independent Rust/Python paths, creating a high density of subtle performance, security, and correctness risks.

Grey Divider

Tip of the day
💡 Did you know, you can group findings by type and pick your Finding display, from Minimal to Full

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit b264aeb

Results up to commit c242ce8 🧠 Deep


🐞 Bugs (0) 📘 Rule violations (1) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. Release note bundles internal details ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
quiet-python-projects.md uses one sentence to describe concurrent preparation and shared
dependency resolutions, which are two separate implementation mechanisms rather than one observable
change. Readers must disentangle those mechanisms from the preceding user-facing speed improvement
when reusing or editing the release note.
Code

.changeset/quiet-python-projects.md[5]

+Sped up `pnpm install` in Python workspaces with many projects. Projects now prepare concurrently, and projects with identical registry requirements share fresh dependency resolutions [pnpm/pnpm#14945](https://github.com/pnpm/pnpm/issues/14945).
Relevance

●●● Strong

Recent changeset reviews accept splitting compound implementation details into separate user-facing
statements.

PR-#14959
PR-#14926

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 3058304 requires each changeset sentence to describe one logical change, while rule 3058322
restricts entries to observable behavior. Line 5 joins concurrent project preparation and shared
resolution caching in one sentence even though both describe internal mechanisms.

Rule 3058304: Avoid compound sentences in individual changeset entries
Rule 3058322: Changeset entries must describe observable behavior changes only
.changeset/quiet-python-projects.md[5-5]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The changeset combines two internal implementation changes in one compound sentence instead of limiting the entry to the observable install performance change.

## Fix Focus Areas
- .changeset/quiet-python-projects.md[5-5]

## Recommended Fix
Keep the user-visible statement that Python workspace installs are faster and the issue link. Remove the implementation-detail sentence, or replace it with separate sentences describing distinct observable effects if those effects need release-note coverage.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Nested builds repeat environment setup ✓ Resolved 🐞 Bug ➹ Performance
Description
install_requirements bypasses build_environments whenever state.building is nonempty, so a
completed environment produced while building a Git source is never retained in the shared cache.
When multiple workspace projects resolve build requirements that fetch the same Git-backed
dependency, each nested backend chain recreates its temporary environment and repeats resolution and
package installation instead of reusing the completed one.
Code

pnpm/crates/python-installer/src/build.rs[R273-276]

+        // Nested builds must not wait on a sibling's backend chain, which may
+        // in turn need the environment this chain is currently preparing.
+        if !self.state.building.is_empty() {
+            return self.install_nested_requirements::<Reporter>(requires, key).await;
Relevance

●●● Strong

Recent Python installer reviews accepted findings exposing incorrect shared build-environment
caching and repeated backend work.

PR-#14973
PR-#14953

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
A nested build is reached when a resolver fetches a Git source: fetch_git invokes
PythonPrepare::build through the current preparation state. That build creates its backend
environment via install_requirements; the changed nonempty-building branch returns directly from
install_nested_requirements, while only the top-level branch stores a successful result in
build_environments. Each uncached installation creates a new temporary directory, resolves
requirements, and invokes the installer.

pnpm/crates/python-installer/src/sources/git.rs[12-46]
pnpm/crates/python-installer/src/build.rs[235-301]
pnpm/crates/python-installer/src/build.rs[324-341]
pnpm/crates/python-installer/src/projects.rs[22-30]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Nested build-environment creation bypasses the shared cache to avoid waiting on an in-flight sibling backend chain. This also means successfully completed nested environments are discarded, so later projects repeat their resolver work, temporary-directory creation, and backend-package installation.

## Fix Focus Areas
- pnpm/crates/python-installer/src/build.rs[269-301]
- pnpm/crates/python-installer/src/environment.rs[35-40]

## Recommended Fix
Preserve the no-wait behavior for nested requests, but publish a successfully completed nested environment into the per-key cache when doing so does not wait for or overwrite an existing in-flight/ready entry. Subsequent independent chains should then be able to reuse that completed environment, while recursive chains must retain the current cycle detection and must not block on sibling cache entries.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Unrelated fixes widen the change 📘 Rule violation ⚙ Maintainability
Description
The artifact overwrite additions and deterministic timestamp setup do not participate in Python
project preparation or resolution sharing. They are bundled with the Python performance change, so
review and rollback span three independent concerns.
Code

.github/workflows/pacquet-integrated-benchmark.yml[660]

+          overwrite: true
Relevance

●● Moderate

The PR explicitly scopes benchmark rerun fixes, but no close precedent confirms rejecting this
bundling concern.

PR-#12630

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Compliance rule 2255067 excludes unrelated behavioral or maintenance changes from a focused fix. The
workflow changes artifact replacement, the package-manager test changes timestamp setup, and the
Python installer separately introduces concurrent preparation, demonstrating three independent
concerns.

Rule 2255067: Bug fix changes must not include unrelated refactors or reformatting
.github/workflows/pacquet-integrated-benchmark.yml[660-660]
pnpm/crates/package-manager/src/install/tests/repeat_install.rs[261-267]
pnpm/crates/python-installer/src/projects.rs[23-30]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR combines the Python workspace performance change with independent benchmark artifact and test-fixture fixes.

## Fix Focus Areas
- .github/workflows/pacquet-integrated-benchmark.yml[660-660]
- pnpm/crates/package-manager/src/install/tests/repeat_install.rs[261-267]

## Recommended Fix
Move the benchmark artifact overwrite changes and deterministic timestamp fixture changes into separate pull requests or changes, leaving this PR focused on concurrent Python project preparation and shared resolutions.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Sep 16, 2026
@zkochan

zkochan commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

Addressed the verified findings from this round:

  • 6a567eb8b1 splits the release-note sentence. Concurrency and fewer repeated resolutions are useful performance behavior for workspace users.
  • 7fb3e08f06 lets nested builds reuse and populate available backend-cache entries using a nonblocking lock. Busy entries are still bypassed, preserving cycle diagnostics and avoiding cross-chain deadlocks. The new Git-build test fails on the prior implementation (three backend index requests) and passes with the fix (two). All 147 Python tests passed.

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).

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 7fb3e08

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Sep 16, 2026
@zkochan

zkochan commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

@greptileai please review the latest head 7fb3e08f068b644b0700e13e8549d4f104049941. The release-note correction and nested backend-cache regression fix are now pushed.


Written by an agent (Codex, GPT-5).

@greptile-apps
greptile-apps Bot dismissed their stale review September 16, 2026 23:45

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

@zkochan

zkochan commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

Rebased onto main at 6b84edfb3a7cc7c374ebc3cb4d48b106149bc52b and force-pushed head b264aebbdf57eac974b8ff0e3d01085b13e1f33d. Resolved the project-preparation conflict by capturing each project's inherited resolution manifest during ordered selection and passing it to the configured registry. Normalized cache inputs include the new overrides, constraints, and extra indexes.

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).

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit b264aeb

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@zkochan
zkochan merged commit e53ce9a into main Sep 16, 2026
38 checks passed
@zkochan
zkochan deleted the fix-14945-13 branch September 16, 2026 23:56
u9g pushed a commit to u9g/pnpm that referenced this pull request Sep 25, 2026
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants