Skip to content

refactor(resolving-npm-resolver): share the metadata response decode across both fetchers - #17028

Merged
zkochan merged 1 commit into
mainfrom
fix-146-pipelines
Oct 17, 2026
Merged

zkochan merged 1 commit into
mainfrom
fix-146-pipelines

Conversation

@zkochan

@zkochan zkochan commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Second step of pnpm/tasks#146 (Related to pnpm/tasks#146), following #17024. It addresses the task's "v12 has two request pipelines" item. There is no behavior change.

v12 has two metadata fetchers: the cached one (FetchAttempt) and the plain one (fetch_full_metadata), which the minimumReleaseAge upgrade uses. Each had its own copy of the 2xx path:

  • status check
  • body read with downscale on timeout
  • permit release before the parse
  • spawn_blocking parse
  • drop_incomplete_publish_times
  • abbreviated normalization
  • slow-request timer

#16647 had to fix that path in both places.

Now decode_metadata_response does it once, and each fetcher supplies only what differs:

finish step on the blocking pool
plain fetcher Ok
cached fetcher MirrorStore::store (filter + persist, the rest of the old DecodeMeta)

The 304 handling stays per fetcher. The cached fetcher serves its mirror, and the plain fetcher returns NotModified to its caller.

Tests. The plain fetcher had no normalization test, so I added one. Inverting the normalization flag in the shared function now fails tests in both fetchers. Before, only the cached fetcher's tests caught it. All 614 tests of pnpm-resolving-npm-resolver pass.

Still open on the task. These are left for later PRs:

No changeset, since nothing changes for users.

Squash Commit Body

The cached fetcher and the plain fetcher that the release-age upgrade uses
each had their own copy of the 2xx metadata path: status check, body read,
permit release, off-reactor parse, normalization, and the slow-request
timer. A fix there had to be made twice (pnpm/pnpm#16647).

decode_metadata_response now does it once. A `finish` step runs on the
blocking pool. The plain fetcher passes `Ok`, and the cached fetcher passes
MirrorStore::store, which filters and persists the mirror. The 304 handling
stays per fetcher.

Adds a normalization test for the plain fetcher. No behavior changes.
Part of pnpm/tasks#146.

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 or updated tests.

Written by an agent (Claude Code, claude-opus-5-5).

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Bug Fixes
    • Abbreviated metadata requests now omit the install-irrelevant readme when a full package document is returned, while preserving dependencies. Full-metadata requests continue to include the readme.

…across both fetchers

The cached fetcher (FetchAttempt::run with DecodeMeta) and the plain
fetcher that the release-age upgrade uses (document_from_response with
decode_full_metadata) each had their own copy of the 2xx path:

- the status check
- the body read, with the client downscale on timeout
- the permit release
- the off-reactor parse
- dropping incomplete publish times
- abbreviated normalization
- the slow-request timer and warning

A fix to that path had to be made twice. #16647 was one such fix.

decode_metadata_response now does it once. It takes the response with its
network permit, the normalization choice from MirrorWrite, and a `finish`
step that runs on the blocking pool. The plain fetcher passes `Ok`. The
cached fetcher passes MirrorStore::store, which keeps DecodeMeta's
filter-and-persist half.

The 304 handling stays separate, because the two fetchers mean different
things by it. The cached fetcher serves its mirror, and the plain fetcher
returns NotModified to its caller.

The plain fetcher had no test for normalization. A new test covers it, and
inverting the flag in the shared function now fails tests in both
fetchers. No behavior changes.

Part of pnpm/tasks#146.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: pnpm/pnpm/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 00021397-1124-47fb-b3e0-8d493369dc2f
📥 Commits

Reviewing files that changed from the base of the PR and between d71dd6c and 41b6a55.

📒 Files selected for processing: 3
  • pnpm/crates/resolving-npm-resolver/src/fetch_full_metadata.rs
  • pnpm/crates/resolving-npm-resolver/src/fetch_full_metadata/tests.rs
  • pnpm/crates/resolving-npm-resolver/src/fetch_full_metadata_cached.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

📝 Walkthrough

The standard and cached metadata fetch paths now use a shared response decoder. The decoder handles response reading, parsing, and optional abbreviated-metadata normalization. A new test checks normalization when an abbreviated request receives a full document.

Changes: Metadata response decoding

Layer / File(s) Summary
Shared response decoding
pnpm/crates/resolving-npm-resolver/src/fetch_full_metadata.rs, pnpm/crates/resolving-npm-resolver/src/fetch_full_metadata/tests.rs
The standard fetch path delegates response handling to a shared decoder. The decoder handles status and body errors, blocking parsing, optional normalization, and completion. A test checks normalization for full-document responses.
Cached fetch integration
pnpm/crates/resolving-npm-resolver/src/fetch_full_metadata_cached.rs
The cached fetch path passes responses to the shared decoder. MirrorStore receives decoded packages and returns the saved mirror package or the decoded package.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Suggested labels: product: pacquet

Suggested reviewers: jatmn

Merge Risk: ⚪ Minimal · up to 41b6a

The shared metadata decoder preserves the checked fetch behaviors, and no issue remains that should block merging after normal checks.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Copy link
Copy Markdown
Contributor

Same-run regression check

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

Scenario Engine main median HEAD median Change Tolerance Result
isolated-fresh-restore-cold-cache-cold-store pacquet 2316.02 ms 2352.84 ms 1.6% 115.80 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1402.38 ms 1450.86 ms 3.5% 70.12 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 234.97 ms 224.60 ms -4.4% 11.75 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 249.95 ms 272.09 ms 8.9% 12.50 ms Inconclusive (overlapping samples)
isolated-repeat-install-hot-cache-hot-store pacquet 7.95 ms 7.94 ms -0.2% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 7.84 ms 8.13 ms 3.8% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 8.05 ms 8.55 ms 6.2% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 8.34 ms 7.93 ms -4.9% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2565.33 ms 2586.92 ms 0.8% 128.27 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1474.28 ms 1521.34 ms 3.2% 73.71 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 604.54 ms 603.97 ms -0.1% 30.23 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 372.17 ms 366.48 ms -1.5% 18.61 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1652.78 ms 1655.66 ms 0.2% 82.64 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 324.25 ms 322.91 ms -0.4% 16.21 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 221.77 ms 223.29 ms 0.7% 11.09 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 91.21 ms 91.70 ms 0.5% 4.56 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 215.77 ms 222.37 ms 3.1% 10.79 ms Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet 242.08 ms 207.97 ms -14.1% 12.10 ms Within tolerance
isolated-injected-workspace-repeat-install-hot-cache-hot-store pacquet 114.06 ms 78.11 ms -31.5% 5.70 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4374.13 ms 4374.87 ms 0.0% 218.71 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3475.04 ms 3423.33 ms -1.5% 173.75 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 210.60 ms 197.05 ms -6.4% 10.53 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 132.33 ms 134.83 ms 1.9% 6.62 ms Within tolerance
store-only-unlocked-direct-deps-cold-cache-hot-store pacquet 1115.15 ms 1112.23 ms -0.3% 55.76 ms Within tolerance

Integrated-Benchmark Report (Linux)

Commit: 41b6a553d5ff

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked and injected workspace scenarios compare 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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.402 ± 0.114 2.300 2.609 1.68 ± 0.14
pacquet@main 2.398 ± 0.131 2.299 2.649 1.68 ± 0.15
pnpr@HEAD 1.458 ± 0.107 1.316 1.616 1.02 ± 0.10
pnpr@main 1.430 ± 0.097 1.337 1.670 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.4023063281600003,
      "stddev": 0.11376901443706196,
      "median": 2.35283819066,
      "user": 1.4068002599999998,
      "system": 1.5680120800000001,
      "min": 2.29963024066,
      "max": 2.60877939866
    },
    {
      "command": "pacquet@main",
      "mean": 2.3976696410600002,
      "stddev": 0.1311035139016915,
      "median": 2.3160158921600003,
      "user": 1.4383528599999997,
      "system": 1.48623218,
      "min": 2.29853242166,
      "max": 2.64897080866
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.4580570822600003,
      "stddev": 0.10666911102751798,
      "median": 1.4508595691600001,
      "user": 1.29062206,
      "system": 1.44132678,
      "min": 1.31599790366,
      "max": 1.6155449726600002
    },
    {
      "command": "pnpr@main",
      "mean": 1.43021538756,
      "stddev": 0.09736326384797325,
      "median": 1.4023771961600002,
      "user": 1.34637066,
      "system": 1.4816761800000002,
      "min": 1.33711426466,
      "max": 1.66970990666
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 231.9 ± 14.4 216.1 256.4 1.00
pacquet@main 239.1 ± 14.9 223.2 272.2 1.03 ± 0.09
pnpr@HEAD 320.8 ± 86.7 240.2 440.4 1.38 ± 0.38
pnpr@main 250.2 ± 3.7 243.6 255.8 1.08 ± 0.07
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.23188839205999998,
      "stddev": 0.014377597233277601,
      "median": 0.22460444536000002,
      "user": 0.26020083999999993,
      "system": 0.57250488,
      "min": 0.21607011536,
      "max": 0.25635163736
    },
    {
      "command": "pacquet@main",
      "mean": 0.23906015516000007,
      "stddev": 0.014878064650829156,
      "median": 0.23497453986,
      "user": 0.27103823999999993,
      "system": 0.59038338,
      "min": 0.22321059836,
      "max": 0.27215826436
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.32078270986000007,
      "stddev": 0.08670648555859391,
      "median": 0.27209045136,
      "user": 0.35268833999999993,
      "system": 0.7366019799999999,
      "min": 0.24017619236,
      "max": 0.44037343836000004
    },
    {
      "command": "pnpr@main",
      "mean": 0.25023971746,
      "stddev": 0.003722908510460677,
      "median": 0.24995447336,
      "user": 0.27831463999999995,
      "system": 0.59173728,
      "min": 0.24361887436000002,
      "max": 0.25576532836
    }
  ]
}

Scenario: Isolated linker: repeat install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 8.0 ± 0.4 7.3 10.1 1.01 ± 0.08
pacquet@main 8.0 ± 0.3 7.3 9.5 1.01 ± 0.07
pnpr@HEAD 8.2 ± 0.4 7.3 10.3 1.04 ± 0.08
pnpr@main 7.9 ± 0.5 7.0 10.7 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.007971194486710095,
      "stddev": 0.00037377607653401327,
      "median": 0.00793517706,
      "user": 0.00468790918566775,
      "system": 0.003931059804560259,
      "min": 0.00732054006,
      "max": 0.01010368606
    },
    {
      "command": "pacquet@main",
      "mean": 0.007969787161851856,
      "stddev": 0.0003178232695181301,
      "median": 0.00794788006,
      "user": 0.005024906913580248,
      "system": 0.0036127672839506185,
      "min": 0.00729512206,
      "max": 0.009467630060000001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.008177290551071428,
      "stddev": 0.0003514122909792563,
      "median": 0.008133524060000001,
      "user": 0.004770255238095238,
      "system": 0.004216563333333333,
      "min": 0.007343713060000001,
      "max": 0.01029039806
    },
    {
      "command": "pnpr@main",
      "mean": 0.00789496616094637,
      "stddev": 0.0004673098630375564,
      "median": 0.00783530806,
      "user": 0.004702854006309148,
      "system": 0.003936276593059936,
      "min": 0.006975190060000001,
      "max": 0.010668519060000001
    }
  ]
}

Scenario: Isolated linker: repeat install, cold cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 8.7 ± 0.9 7.1 10.7 1.08 ± 0.14
pacquet@main 8.3 ± 0.8 7.1 11.9 1.03 ± 0.14
pnpr@HEAD 8.1 ± 0.7 7.1 11.8 1.00
pnpr@main 8.5 ± 0.6 7.2 10.3 1.05 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.00871126484757202,
      "stddev": 0.000851341204951639,
      "median": 0.00855362772,
      "user": 0.005264391028806585,
      "system": 0.004230619423868312,
      "min": 0.007065018720000001,
      "max": 0.01071641372
    },
    {
      "command": "pacquet@main",
      "mean": 0.008297679221718209,
      "stddev": 0.0008112180112143046,
      "median": 0.00805322672,
      "user": 0.005002397731958763,
      "system": 0.0040467083161512,
      "min": 0.007138095720000001,
      "max": 0.01192358372
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.008089452518534797,
      "stddev": 0.0007148178932174632,
      "median": 0.00793302072,
      "user": 0.00519504476190476,
      "system": 0.003602753699633698,
      "min": 0.0071265437200000005,
      "max": 0.011759023720000001
    },
    {
      "command": "pnpr@main",
      "mean": 0.008487201248735633,
      "stddev": 0.00064093098641839,
      "median": 0.00834235972,
      "user": 0.005068875632183909,
      "system": 0.004225422222222223,
      "min": 0.007232132720000001,
      "max": 0.01030015072
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.638 ± 0.126 2.558 2.973 1.73 ± 0.13
pacquet@main 2.580 ± 0.040 2.544 2.679 1.70 ± 0.10
pnpr@HEAD 1.552 ± 0.108 1.453 1.803 1.02 ± 0.09
pnpr@main 1.521 ± 0.086 1.461 1.717 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.63752252414,
      "stddev": 0.12555704841152374,
      "median": 2.58692065094,
      "user": 2.28133024,
      "system": 2.1991513400000002,
      "min": 2.55766986394,
      "max": 2.97314180094
    },
    {
      "command": "pacquet@main",
      "mean": 2.5797421420399997,
      "stddev": 0.0396752100101316,
      "median": 2.56532753894,
      "user": 2.1139232400000005,
      "system": 2.0346382399999996,
      "min": 2.54363319894,
      "max": 2.6788097579400003
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5522216203399999,
      "stddev": 0.10845457409163156,
      "median": 1.52134374544,
      "user": 1.34504284,
      "system": 1.6674602399999998,
      "min": 1.45308768994,
      "max": 1.8032295279400001
    },
    {
      "command": "pnpr@main",
      "mean": 1.5214152866400001,
      "stddev": 0.08623786030697336,
      "median": 1.47428452694,
      "user": 1.40300844,
      "system": 1.66128074,
      "min": 1.46128683994,
      "max": 1.7168171279400002
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 707.4 ± 158.1 565.5 938.4 1.92 ± 0.43
pacquet@main 595.1 ± 20.7 558.9 616.2 1.62 ± 0.08
pnpr@HEAD 367.7 ± 12.1 348.2 388.5 1.00
pnpr@main 405.1 ± 78.6 351.4 554.5 1.10 ± 0.22
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.7074127557400001,
      "stddev": 0.1580661182157861,
      "median": 0.60396552694,
      "user": 1.07102674,
      "system": 1.33231036,
      "min": 0.56547256794,
      "max": 0.9383527409400001
    },
    {
      "command": "pacquet@main",
      "mean": 0.59511308754,
      "stddev": 0.020680539829271184,
      "median": 0.60454397294,
      "user": 0.8902738399999999,
      "system": 1.11294506,
      "min": 0.55885529194,
      "max": 0.6162403709400001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.36769748804,
      "stddev": 0.012055751142733363,
      "median": 0.36648292694000006,
      "user": 0.31812574,
      "system": 0.8050536599999999,
      "min": 0.34819187294000004,
      "max": 0.38850663394
    },
    {
      "command": "pnpr@main",
      "mean": 0.4050584621400001,
      "stddev": 0.07861742808231008,
      "median": 0.37216674144000006,
      "user": 0.36510934,
      "system": 0.8942609600000001,
      "min": 0.35138874094000005,
      "max": 0.55446111494
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.652 ± 0.015 1.625 1.676 5.14 ± 0.15
pacquet@main 1.655 ± 0.016 1.635 1.680 5.15 ± 0.15
pnpr@HEAD 0.321 ± 0.009 0.308 0.332 1.00
pnpr@main 0.323 ± 0.009 0.311 0.335 1.00 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.6518375397599996,
      "stddev": 0.015494236807545882,
      "median": 1.65566360176,
      "user": 0.94121228,
      "system": 1.0241679600000002,
      "min": 1.62548361276,
      "max": 1.67593242976
    },
    {
      "command": "pacquet@main",
      "mean": 1.6554751231599998,
      "stddev": 0.015957977308009866,
      "median": 1.65278364326,
      "user": 0.9635421799999999,
      "system": 1.04957956,
      "min": 1.63526334776,
      "max": 1.6795396787599999
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.32128612966000003,
      "stddev": 0.00874370869840712,
      "median": 0.32290942526,
      "user": 0.27202257999999996,
      "system": 0.68316766,
      "min": 0.30781161076,
      "max": 0.33226855376000003
    },
    {
      "command": "pnpr@main",
      "mean": 0.32279753416,
      "stddev": 0.008988840278564466,
      "median": 0.32424500176000004,
      "user": 0.29323158000000005,
      "system": 0.6753446599999999,
      "min": 0.31130413476,
      "max": 0.33455656576000004
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 225.1 ± 11.9 207.7 248.9 2.48 ± 0.15
pacquet@main 219.3 ± 13.1 198.5 237.7 2.42 ± 0.16
pnpr@HEAD 92.0 ± 3.3 87.4 99.0 1.02 ± 0.05
pnpr@main 90.7 ± 2.5 86.8 97.2 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.22513347508,
      "stddev": 0.011890714928503906,
      "median": 0.22328896458000003,
      "user": 0.19029869999999996,
      "system": 0.08992676666666666,
      "min": 0.20772536708,
      "max": 0.24888819008000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.21928158958,
      "stddev": 0.013076481723621,
      "median": 0.22176621808000002,
      "user": 0.18612111666666667,
      "system": 0.08944076666666666,
      "min": 0.19854994008000001,
      "max": 0.23774666508
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09204113636125003,
      "stddev": 0.003322635428927837,
      "median": 0.09170142858000001,
      "user": 0.03203541874999999,
      "system": 0.015510503124999997,
      "min": 0.08742148308,
      "max": 0.09897074308
    },
    {
      "command": "pnpr@main",
      "mean": 0.0906728759832258,
      "stddev": 0.002472167441961141,
      "median": 0.09121160808,
      "user": 0.030137329032258058,
      "system": 0.015540454838709677,
      "min": 0.08680385908,
      "max": 0.09723658708
    }
  ]
}

Scenario: Isolated linker: peer-heavy resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 225.1 ± 13.0 208.9 247.9 1.03 ± 0.08
pacquet@main 219.1 ± 10.8 208.2 241.4 1.00
pnpm@HEAD 3428.7 ± 61.1 3317.1 3518.4 15.65 ± 0.82
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2251123041155555,
      "stddev": 0.01298009624478285,
      "median": 0.22236640156,
      "user": 0.22663328222222223,
      "system": 0.052821966666666664,
      "min": 0.20893957756,
      "max": 0.24786457256000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.21914323833777777,
      "stddev": 0.010765731585060972,
      "median": 0.21577094756,
      "user": 0.22474239333333332,
      "system": 0.04698596666666667,
      "min": 0.20821820156,
      "max": 0.24137670256000002
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.428703626004445,
      "stddev": 0.061081036664432105,
      "median": 3.41508534356,
      "user": 5.222742948888889,
      "system": 0.3697951888888888,
      "min": 3.3170693465600003,
      "max": 3.51837211556
    }
  ]
}

Scenario: Isolated linker: linked-workspace resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 216.3 ± 23.2 189.3 250.7 1.00
pacquet@main 242.0 ± 13.9 221.7 259.8 1.12 ± 0.14
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.21632776571333334,
      "stddev": 0.02322938778951441,
      "median": 0.20797319158,
      "user": 0.1725859,
      "system": 0.07979355333333332,
      "min": 0.18927515358,
      "max": 0.25066533858
    },
    {
      "command": "pacquet@main",
      "mean": 0.24203229212545455,
      "stddev": 0.01393668233322171,
      "median": 0.24207954158,
      "user": 0.19521422727272728,
      "system": 0.08779596545454546,
      "min": 0.22172706658,
      "max": 0.25983366258
    }
  ]
}

Scenario: Isolated linker: injected workspace repeat install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 83.9 ± 16.1 71.1 141.8 1.00
pacquet@main 119.7 ± 14.1 98.8 143.8 1.43 ± 0.32
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.08390036640631579,
      "stddev": 0.016133405424546148,
      "median": 0.07810940288000001,
      "user": 0.032494293684210536,
      "system": 0.058578850526315784,
      "min": 0.07111393388000001,
      "max": 0.14177593088
    },
    {
      "command": "pacquet@main",
      "mean": 0.1196523182713043,
      "stddev": 0.014063896328203231,
      "median": 0.11405625188,
      "user": 0.04833097217391304,
      "system": 0.08217279217391303,
      "min": 0.09880780788,
      "max": 0.14381773188000002
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.403 ± 0.095 4.320 4.625 1.27 ± 0.04
pacquet@main 4.446 ± 0.145 4.315 4.786 1.29 ± 0.05
pnpr@HEAD 3.455 ± 0.070 3.393 3.585 1.00
pnpr@main 3.536 ± 0.127 3.410 3.763 1.02 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.403309173619999,
      "stddev": 0.09530293811696845,
      "median": 4.37487094882,
      "user": 1.38588502,
      "system": 1.4366561199999999,
      "min": 4.31954476682,
      "max": 4.62495238382
    },
    {
      "command": "pacquet@main",
      "mean": 4.44610246142,
      "stddev": 0.14468690310610924,
      "median": 4.37412607882,
      "user": 1.45500992,
      "system": 1.4014490199999998,
      "min": 4.31549969882,
      "max": 4.7857939408200005
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.4550617731199997,
      "stddev": 0.0704900943475606,
      "median": 3.4233276648200004,
      "user": 1.33236822,
      "system": 1.36333972,
      "min": 3.3933219238200003,
      "max": 3.58472945482
    },
    {
      "command": "pnpr@main",
      "mean": 3.53566188012,
      "stddev": 0.12718902865697687,
      "median": 3.47504203732,
      "user": 1.3925789199999998,
      "system": 1.3286928199999999,
      "min": 3.4101815328200002,
      "max": 3.76318899982
    }
  ]
}

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 195.9 ± 11.7 164.0 209.3 1.48 ± 0.11
pacquet@main 209.2 ± 23.6 172.8 243.2 1.58 ± 0.19
pnpr@HEAD 156.3 ± 41.2 123.4 257.8 1.18 ± 0.32
pnpr@main 132.2 ± 6.0 118.6 143.1 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.19588421849,
      "stddev": 0.011694307939869216,
      "median": 0.19705244574000003,
      "user": 0.22744587333333333,
      "system": 0.19677719000000002,
      "min": 0.16397437424000003,
      "max": 0.20929086624
    },
    {
      "command": "pacquet@main",
      "mean": 0.2091994274542857,
      "stddev": 0.023595469960076644,
      "median": 0.21059745574000002,
      "user": 0.23705825428571425,
      "system": 0.19859343999999998,
      "min": 0.17275915424000002,
      "max": 0.24324214824000004
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.15633617866857144,
      "stddev": 0.04122566485885682,
      "median": 0.13483412324000002,
      "user": 0.17268589714285718,
      "system": 0.14508465428571427,
      "min": 0.12338607924,
      "max": 0.25777509924
    },
    {
      "command": "pnpr@main",
      "mean": 0.13220592681142856,
      "stddev": 0.005976328286074361,
      "median": 0.13232708224000003,
      "user": 0.15058746857142852,
      "system": 0.13258713047619047,
      "min": 0.11864745324,
      "max": 0.14307143324000002
    }
  ]
}

Scenario: Store only: unlocked direct deps, cold cache + hot store

Store-only install (enableModulesDir: false, per-file store index, trusted lockfile) against a lockfile missing the direct dependencies that have peers, with the metadata cache wiped per iteration: the install resolves those from the registry, reuses their subtrees from the lockfile and checks the store, linking nothing. Direct installs only.

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.116 ± 0.015 1.095 1.142 1.00
pacquet@main 1.136 ± 0.066 1.067 1.306 1.02 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.1164842776600001,
      "stddev": 0.015368765780836369,
      "median": 1.1122286369599999,
      "user": 0.50275572,
      "system": 0.19202711999999994,
      "min": 1.09466596396,
      "max": 1.14173539796
    },
    {
      "command": "pacquet@main",
      "mean": 1.13642892386,
      "stddev": 0.06601166603034532,
      "median": 1.11514661996,
      "user": 0.5362646200000001,
      "system": 0.20513711999999998,
      "min": 1.0666075959599999,
      "max": 1.3057284549600001
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.01     13.4±0.17ms    28.0 MB/sec    1.00     13.2±0.07ms    28.3 MB/sec
packument/parse                                  1.02     44.1±0.54µs  1505.2 MB/sec    1.00     43.0±0.22µs  1541.7 MB/sec
tarball/download_dependency                      1.00      3.9±0.09ms  1121.1 KB/sec    1.01      3.9±0.10ms  1112.7 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00    227.4±2.92ms 70.4 KElem/sec    1.04    236.5±2.92ms 67.7 KElem/sec
version_pick/repeated_ranges_file                1.03      4.8±0.07ms  6.5 KElem/sec    1.00      4.7±0.04ms  6.7 KElem/sec
version_pick/repeated_ranges_raw                 1.02      4.8±0.09ms  6.6 KElem/sec    1.00      4.7±0.04ms  6.7 KElem/sec
workspace_resolution/hoist_heavy                 1.03    236.4±3.63ms        ? ?/sec    1.00    230.3±0.63ms        ? ?/sec
workspace_sort/chained_projects                  1.00     18.5±3.15ms        ? ?/sec    1.01     18.6±0.65ms        ? ?/sec

@zkochan

zkochan commented Oct 17, 2026

Copy link
Copy Markdown
Member Author

The Code Coverage failure on this head is single_project_run_check_converges_after_lockfile_content_matches in pnpm-package-manager. This PR doesn't touch that crate.

That test fails whenever its lockfile mtime lands on an exact second, about once in a thousand runs. I reproduced it locally by forcing that case, and the fix is in #17031. I've re-run the failed job here.


Written by an agent (Claude Code, claude-opus-5-5).

@zkochan
zkochan marked this pull request as ready for review October 17, 2026 10:43
@zkochan

zkochan commented Oct 17, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

Copilot AI balanced review requested due to automatic review settings October 17, 2026 10:43

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.54%. Comparing base (b27ec88) to head (41b6a55).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17028      +/-   ##
==========================================
- Coverage   92.54%   92.54%   -0.01%     
==========================================
  Files        1776     1776              
  Lines      228560   228496      -64     
==========================================
- Hits       211519   211455      -64     
  Misses      17041    17041              

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

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Share metadata response decoding between cached and plain fetchers

✨ Enhancement 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Consolidates both fetchers’ response decoding so fixes to the common path need only one change.
• Keeps each fetcher’s distinct 304 handling and cached mirror persistence.
• Adds plain-fetcher coverage for conditional abbreviated normalization; no user-facing behavior
 changes.
Diagram

graph TD
    P["Plain fetcher"] --> S{"304 response?"} -->|2xx| D["Shared decode"] --> B["Blocking parse"] -->|Ok| R["Plain outcome"]
    C["Cached fetcher"] --> S
    S -->|plain 304| R
    S -->|cached 304| M["Cached mirror"]
    B -->|store| M
Loading
High-Level Assessment

A shared decoder with a fetcher-specific finish step removes the duplicated response path without merging the fetchers’ different 304 and mirror semantics. A single unified fetcher would broaden this behavior-preserving refactor unnecessarily.

Files changed (3) +140 / -112

Refactor (2) +79 / -112
fetch_full_metadata.rsCentralize metadata response decoding +56/-48

Centralize metadata response decoding

• Adds a shared decoder that checks status, buffers the body, releases the network permit, and parses and normalizes metadata on the blocking pool. The plain fetcher uses it with an identity finish step and retains its NotModified outcome.

pnpm/crates/resolving-npm-resolver/src/fetch_full_metadata.rs

fetch_full_metadata_cached.rsUse the shared decoder and retain mirror-specific storage +23/-64

Use the shared decoder and retain mirror-specific storage

• Replaces the cached fetcher’s duplicate read-and-parse path with the shared decoder. Renames its blocking-pool continuation to MirrorStore, retaining metadata filtering, persistence, and cached 304 recovery.

pnpm/crates/resolving-npm-resolver/src/fetch_full_metadata_cached.rs

Tests (1) +61 / -0
tests.rsTest plain-fetcher normalization choices +61/-0

Test plain-fetcher normalization choices

• Adds a registry-response test showing that a full document is normalized for an abbreviated request but retains its readme for a full-metadata request. It also checks that an install-relevant dependency remains present.

pnpm/crates/resolving-npm-resolver/src/fetch_full_metadata/tests.rs

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can see how risky a PR is at a glance with blast radius labels

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

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 Oct 17, 2026
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@zkochan
zkochan merged commit 474df98 into main Oct 17, 2026
60 of 61 checks passed
@zkochan
zkochan deleted the fix-146-pipelines branch October 17, 2026 10:56
zkochan added a commit that referenced this pull request Oct 17, 2026
…second mtimes (#17031)

Two tests date the lockfile MTIME_STEP_MS past the recorded timestamp,
the time setup wrote the files. About once in a thousand runs that mtime
lands on an exact second. The freshness check reads it as whole-second
precision, so the first check cannot record a timestamp past it, and the
second check compares the poisoned lockfile and reports it outdated.

date_lockfile_after moves an exact-second mtime one millisecond earlier.
Seen in Code Coverage on #17028.
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.

3 participants