Skip to content

fix(ci): confirm benchmark regressions with reversed target order - #15231

Merged
zkochan merged 1 commit into
mainfrom
intb
Sep 21, 2026
Merged

zkochan merged 1 commit into
mainfrom
intb

Conversation

@zkochan

@zkochan zkochan commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #15228. Its final benchmark run reported a 29% pnpr slowdown despite identical benchmarked Rust sources in HEAD and main. Same-run comparison removes cross-machine differences, but sequential measurements can still drift enough to produce a false regression.

Automatically repeat a suspected regression once with target order reversed. Fail the comparison only if the slowdown appears in both runs. Keep the agreed 5% tolerance with a 2 ms floor, preserve both reports, and continue uploading the initial timing to Bencher. Initial command failures are not retried, and confirmation failures propagate.

Validation: 18 Node tests pass, including transient and sustained slowdowns, reversed target order, no retry for stable/main-only runs, missing confirmations, and command failures. Workflow YAML and shell syntax checks pass. CI passed the full Rust and TypeScript matrices and all 12 benchmark scenarios. The new comparator passes the artifact with 20 rows within tolerance and two inconclusive rows. No scenario required a confirmation in this run; the confirmation branches are covered by the Node tests. The trusted comparison in the comment workflow takes effect after merge; this PR's comment workflow still runs the default-branch comparator.

Squash Commit Body

Confirm suspected integrated benchmark regressions once with target order
reversed. Same-run measurements can still be biased by sustained runner drift:
a control run on identical Rust sources produced a 29% apparent pnpr slowdown.

Keep the 5% tolerance with a 2 ms floor and the retained-sample noise guard.
Require the regression to reproduce in the confirmation, preserve both sets
of measurements in the artifact and report, and keep the initial timings for
historical Bencher uploads. Missing required confirmations fail the check.

The wrapper preserves the existing harness arguments and assertions. It does
not retry command failures, and confirmation failures propagate. Main-only
runs and scenarios without suspected regressions execute once.

Related to pnpm/pnpm#15228.

Checklist

  • Added or updated tests.
  • Updated the documentation if needed.

No published packages change, so no changeset is needed.


Written by an agent (Codex, gpt-6).

Summary by CodeRabbit

  • Bug Fixes

    • Benchmark performance regressions are now rerun in reversed order before being reported as failures.
    • Slowdowns that do not reproduce are classified as inconclusive instead of confirmed regressions.
    • Benchmark and confirmation failures now surface without being silently ignored.
  • Documentation

    • Updated contribution guidance to explain confirmation runs, retained measurements, and benchmark replay procedures.
  • Chores

    • Integrated benchmark workflows now use the updated runner and execute relevant validation tests.

@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

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: 1f44ae50-7efc-488e-9612-8f83fd9d52b0

📥 Commits

Reviewing files that changed from the base of the PR and between e25dc5d and b32d760.

📒 Files selected for processing (6)
  • .github/scripts/compare-integrated-benchmarks.mjs
  • .github/scripts/compare-integrated-benchmarks.test.mjs
  • .github/scripts/run-integrated-benchmark.mjs
  • .github/scripts/run-integrated-benchmark.test.mjs
  • .github/workflows/pacquet-integrated-benchmark.yml
  • pnpm/CONTRIBUTING.md

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


📝 Walkthrough

Walkthrough

The change adds confirmation runs for suspected integrated benchmark regressions. It introduces a Node benchmark runner, updates comparison handling, changes workflow invocations, expands tests, and documents reversed-order confirmation behavior.

Changes

Benchmark confirmation

Layer / File(s) Summary
Comparison confirmation contract
.github/scripts/compare-integrated-benchmarks.mjs, .github/scripts/compare-integrated-benchmarks.test.mjs
compareConfirmed rechecks regressions with confirmation data. Non-reproduced regressions become Inconclusive (not reproduced). Tests cover missing, invalid, reproduced, and non-reproduced confirmation results.
Runner confirmation execution
.github/scripts/run-integrated-benchmark.mjs, .github/scripts/run-integrated-benchmark.test.mjs
The new runner executes benchmarks, reruns suspected regressions with reversed target order, preserves failed initial reports, and combines successful confirmation results.
Workflow and replay integration
.github/workflows/pacquet-integrated-benchmark.yml, pnpm/CONTRIBUTING.md
Benchmark scenarios use the Node runner. Workflow validation runs both test suites. Documentation describes confirmation behavior and replay commands.

Priority: ⬇️ Low

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

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant Workflow
  participant runBenchmark
  participant integratedBenchmark
  participant compare
  Workflow->>runBenchmark: invoke benchmark scenario
  runBenchmark->>integratedBenchmark: execute target arguments
  integratedBenchmark-->>runBenchmark: write benchmark reports
  runBenchmark->>compare: evaluate regression status
  runBenchmark->>integratedBenchmark: rerun with reversed target order when needed
  integratedBenchmark-->>runBenchmark: write confirmation report
  runBenchmark-->>Workflow: return status and reports
Loading

Suggested labels: product: pacquet

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

.github/scripts/compare-integrated-benchmarks.mjs

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

.github/scripts/compare-integrated-benchmarks.test.mjs

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

.github/scripts/run-integrated-benchmark.mjs

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

  • 1 others

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. 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 2428.55 ms 2433.03 ms 0.2% 121.43 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1467.07 ms 1477.09 ms 0.7% 73.35 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 248.19 ms 264.18 ms 6.4% 12.41 ms Inconclusive (overlapping samples)
isolated-fresh-restore-hot-cache-hot-store pnpr 288.11 ms 293.39 ms 1.8% 14.41 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet 7.17 ms 6.87 ms -4.2% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 7.48 ms 7.12 ms -4.8% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 9.93 ms 10.44 ms 5.0% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 9.41 ms 9.26 ms -1.5% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2782.23 ms 2739.09 ms -1.6% 139.11 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1708.84 ms 1734.22 ms 1.5% 85.44 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 630.11 ms 519.47 ms -17.6% 31.51 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 374.23 ms 354.46 ms -5.3% 18.71 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1630.47 ms 1606.78 ms -1.5% 81.52 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 300.31 ms 304.95 ms 1.5% 15.02 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 245.43 ms 253.35 ms 3.2% 12.27 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 100.31 ms 102.26 ms 1.9% 5.02 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 1119.55 ms 1236.34 ms 10.4% 55.98 ms Inconclusive (overlapping samples)
isolated-linked-workspace-resolve-hot-cache-offline pacquet 170.45 ms 172.17 ms 1.0% 8.52 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4717.41 ms 4475.58 ms -5.1% 235.87 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3552.61 ms 3647.20 ms 2.7% 177.63 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 122.26 ms 125.54 ms 2.7% 6.11 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 120.83 ms 125.74 ms 4.1% 6.04 ms Within tolerance

Integrated-Benchmark Report (Linux)

Commit: b32d760aac91

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked-workspace scenario compares current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs.

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.468 ± 0.145 2.305 2.716 1.69 ± 0.14
pacquet@main 2.479 ± 0.138 2.353 2.769 1.70 ± 0.14
pnpr@HEAD 1.497 ± 0.123 1.315 1.718 1.03 ± 0.10
pnpr@main 1.458 ± 0.087 1.329 1.559 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.4684210583599997,
      "stddev": 0.14541786767686832,
      "median": 2.4330276724599997,
      "user": 1.6203549599999998,
      "system": 1.68338024,
      "min": 2.3050643749599997,
      "max": 2.71637813196
    },
    {
      "command": "pacquet@main",
      "mean": 2.47936871096,
      "stddev": 0.13758863189458184,
      "median": 2.42855221446,
      "user": 1.67372546,
      "system": 1.7683199400000003,
      "min": 2.3528464909599998,
      "max": 2.7685177079599996
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.49681110886,
      "stddev": 0.12283549200275239,
      "median": 1.4770882864600001,
      "user": 1.4811952599999998,
      "system": 1.53606664,
      "min": 1.3153443789600001,
      "max": 1.71817864196
    },
    {
      "command": "pnpr@main",
      "mean": 1.45844431736,
      "stddev": 0.08682063992600603,
      "median": 1.46706502846,
      "user": 1.4772065599999997,
      "system": 1.6216670400000002,
      "min": 1.32887170596,
      "max": 1.5587527439600002
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 268.0 ± 11.2 256.3 292.6 1.05 ± 0.07
pacquet@main 254.2 ± 12.3 242.9 277.1 1.00
pnpr@HEAD 299.5 ± 31.3 260.3 355.3 1.18 ± 0.14
pnpr@main 291.1 ± 12.7 278.8 321.8 1.15 ± 0.07
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.26800296042,
      "stddev": 0.011165445989097684,
      "median": 0.26418276412,
      "user": 0.29764673999999997,
      "system": 0.6608880399999999,
      "min": 0.25630106262,
      "max": 0.29257341862
    },
    {
      "command": "pacquet@main",
      "mean": 0.25419876242000006,
      "stddev": 0.012299158388920036,
      "median": 0.24818907462,
      "user": 0.28087504,
      "system": 0.6277747399999999,
      "min": 0.24289413162,
      "max": 0.27705594262
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29947132912,
      "stddev": 0.03132067863321331,
      "median": 0.29338841362,
      "user": 0.31881013999999996,
      "system": 0.6593435399999998,
      "min": 0.26026612362,
      "max": 0.35531978762
    },
    {
      "command": "pnpr@main",
      "mean": 0.29113634762,
      "stddev": 0.012705916279966851,
      "median": 0.28810892062000004,
      "user": 0.32894253999999995,
      "system": 0.63291464,
      "min": 0.27879512462,
      "max": 0.32183477762
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 7.0 ± 0.6 6.1 9.4 1.00
pacquet@main 7.5 ± 1.0 6.0 14.2 1.06 ± 0.17
pnpr@HEAD 7.3 ± 0.9 6.1 14.0 1.04 ± 0.15
pnpr@main 7.7 ± 1.4 5.8 13.9 1.11 ± 0.22
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.007009401843126682,
      "stddev": 0.0005997368719853851,
      "median": 0.0068672298,
      "user": 0.004270112075471694,
      "system": 0.0031568840970350428,
      "min": 0.0060926568,
      "max": 0.009394671799999999
    },
    {
      "command": "pacquet@main",
      "mean": 0.0074639313109890115,
      "stddev": 0.001037208628279773,
      "median": 0.0071658288,
      "user": 0.00454499648351648,
      "system": 0.0033854601648351645,
      "min": 0.006009328800000001,
      "max": 0.0141629588
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.007309313927999992,
      "stddev": 0.0008632270031618606,
      "median": 0.0071239718,
      "user": 0.004630161333333335,
      "system": 0.0030809525333333316,
      "min": 0.006084309800000001,
      "max": 0.0139810778
    },
    {
      "command": "pnpr@main",
      "mean": 0.007749114509779187,
      "stddev": 0.0013642034059321792,
      "median": 0.007482644800000001,
      "user": 0.0047987592429022076,
      "system": 0.0034037053627760253,
      "min": 0.005814803800000001,
      "max": 0.0138763318
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 10.4 ± 1.5 7.4 15.2 1.12 ± 0.19
pacquet@main 10.0 ± 1.1 7.1 13.5 1.07 ± 0.15
pnpr@HEAD 9.3 ± 0.8 7.4 12.0 1.00
pnpr@main 9.6 ± 0.9 7.8 12.4 1.03 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.01044337226076923,
      "stddev": 0.001470540022822435,
      "median": 0.010435438180000001,
      "user": 0.005959316923076919,
      "system": 0.005216042076923075,
      "min": 0.00736132618,
      "max": 0.015161151180000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.009975634689433964,
      "stddev": 0.0011156467356497521,
      "median": 0.00993397168,
      "user": 0.005703698490566035,
      "system": 0.004998001320754716,
      "min": 0.007131507180000001,
      "max": 0.013497220180000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.00928937421686636,
      "stddev": 0.0007913666067203097,
      "median": 0.00926232318,
      "user": 0.005421471336405528,
      "system": 0.004561499447004607,
      "min": 0.00744604918,
      "max": 0.011973007180000002
    },
    {
      "command": "pnpr@main",
      "mean": 0.0096015260290566,
      "stddev": 0.0009213430727058066,
      "median": 0.00940726318,
      "user": 0.005227898415094342,
      "system": 0.005072160754716979,
      "min": 0.00781451818,
      "max": 0.012377445180000002
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.736 ± 0.060 2.620 2.822 1.62 ± 0.12
pacquet@main 2.846 ± 0.174 2.620 3.133 1.68 ± 0.16
pnpr@HEAD 1.757 ± 0.160 1.561 2.025 1.04 ± 0.12
pnpr@main 1.692 ± 0.119 1.522 1.900 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.7360324548400006,
      "stddev": 0.060080567959761376,
      "median": 2.7390852899400002,
      "user": 2.8980190199999996,
      "system": 2.3276355000000004,
      "min": 2.61966015944,
      "max": 2.8219009954400005
    },
    {
      "command": "pacquet@main",
      "mean": 2.84569669574,
      "stddev": 0.17375747635231129,
      "median": 2.7822348864400004,
      "user": 3.07618782,
      "system": 2.4891174,
      "min": 2.62041650544,
      "max": 3.13323568844
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.75740036804,
      "stddev": 0.15965736360235241,
      "median": 1.73421682444,
      "user": 2.12467282,
      "system": 2.1222385,
      "min": 1.56148107144,
      "max": 2.0253343694400003
    },
    {
      "command": "pnpr@main",
      "mean": 1.6923473178400001,
      "stddev": 0.11877158062633882,
      "median": 1.7088429494400001,
      "user": 1.98757132,
      "system": 1.9018799000000002,
      "min": 1.52169483844,
      "max": 1.90004228244
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 520.1 ± 83.5 412.6 713.3 1.48 ± 0.27
pacquet@main 621.3 ± 106.0 489.3 824.6 1.77 ± 0.34
pnpr@HEAD 350.3 ± 29.7 300.5 394.6 1.00
pnpr@main 376.3 ± 31.4 315.4 425.6 1.07 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.52011855864,
      "stddev": 0.08351352934542618,
      "median": 0.51946641904,
      "user": 0.8373946199999999,
      "system": 1.0803667200000002,
      "min": 0.41261993454,
      "max": 0.71334478554
    },
    {
      "command": "pacquet@main",
      "mean": 0.62129652164,
      "stddev": 0.10600427250052198,
      "median": 0.63011275554,
      "user": 0.9996061199999999,
      "system": 1.17128952,
      "min": 0.48934687654000003,
      "max": 0.82460464254
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.3503312605400001,
      "stddev": 0.029738265105355856,
      "median": 0.35446159304,
      "user": 0.29128111999999995,
      "system": 0.6485547199999999,
      "min": 0.30054409654,
      "max": 0.39455183354
    },
    {
      "command": "pnpr@main",
      "mean": 0.37627366544,
      "stddev": 0.03141348352690973,
      "median": 0.37423430254,
      "user": 0.34162412,
      "system": 0.6329086199999999,
      "min": 0.31543352554,
      "max": 0.42560285654
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.612 ± 0.032 1.579 1.657 5.27 ± 0.34
pacquet@main 1.651 ± 0.084 1.573 1.878 5.40 ± 0.43
pnpr@HEAD 0.310 ± 0.019 0.280 0.345 1.01 ± 0.09
pnpr@main 0.306 ± 0.018 0.285 0.349 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.61175679154,
      "stddev": 0.03234808349130026,
      "median": 1.60677873324,
      "user": 0.9513906999999999,
      "system": 1.0031570000000003,
      "min": 1.57852085924,
      "max": 1.65740306624
    },
    {
      "command": "pacquet@main",
      "mean": 1.65119705274,
      "stddev": 0.08410726474890566,
      "median": 1.6304736962400002,
      "user": 1.0158112,
      "system": 1.0845529,
      "min": 1.57284139624,
      "max": 1.87821885624
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.30965944244,
      "stddev": 0.01899630505164965,
      "median": 0.30495266574,
      "user": 0.2562774,
      "system": 0.5852797,
      "min": 0.28027672024,
      "max": 0.34465563724
    },
    {
      "command": "pnpr@main",
      "mean": 0.30603009074,
      "stddev": 0.018476284783803303,
      "median": 0.30030847074,
      "user": 0.2701935999999999,
      "system": 0.5561310999999999,
      "min": 0.28472208824,
      "max": 0.34907755024
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 257.4 ± 28.9 219.3 335.7 2.53 ± 0.36
pacquet@main 245.8 ± 15.9 215.3 270.5 2.41 ± 0.26
pnpr@HEAD 102.5 ± 4.4 93.7 115.4 1.01 ± 0.10
pnpr@main 101.8 ± 9.0 93.7 145.4 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2573652675709091,
      "stddev": 0.028899168588994842,
      "median": 0.25335024648,
      "user": 0.28097969636363634,
      "system": 0.08828227454545452,
      "min": 0.21929680948000002,
      "max": 0.33565319248000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.24581033848000003,
      "stddev": 0.01592435510032277,
      "median": 0.24543326748,
      "user": 0.2614137266666667,
      "system": 0.08693890333333332,
      "min": 0.21526730448,
      "max": 0.27048010848000004
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.10250067810500002,
      "stddev": 0.0043955091819693,
      "median": 0.10225835148,
      "user": 0.043006684999999996,
      "system": 0.017114653333333334,
      "min": 0.09367046248,
      "max": 0.11535075848
    },
    {
      "command": "pnpr@main",
      "mean": 0.1017866906585714,
      "stddev": 0.008953900797518045,
      "median": 0.10031365998,
      "user": 0.04327077428571429,
      "system": 0.01585617714285714,
      "min": 0.09366785648,
      "max": 0.14540336348
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.229 ± 0.330 0.554 1.671 1.08 ± 0.40
pacquet@main 1.143 ± 0.301 0.654 1.715 1.00
pnpm@HEAD 4.140 ± 0.450 3.667 5.159 3.62 ± 1.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.2286172719355557,
      "stddev": 0.3300595319675424,
      "median": 1.23634336538,
      "user": 1.2437899866666668,
      "system": 0.2870500333333334,
      "min": 0.5541908803800001,
      "max": 1.67052812138
    },
    {
      "command": "pacquet@main",
      "mean": 1.1425618868244445,
      "stddev": 0.3012251831310384,
      "median": 1.1195455003800001,
      "user": 1.1729999866666665,
      "system": 0.25535336666666664,
      "min": 0.65434392438,
      "max": 1.7154208213800002
    },
    {
      "command": "pnpm@HEAD",
      "mean": 4.140096077491111,
      "stddev": 0.45027660617141363,
      "median": 4.00071913138,
      "user": 6.5173570977777775,
      "system": 0.2868019222222223,
      "min": 3.6673046803799996,
      "max": 5.15889194238
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 173.6 ± 4.7 167.4 186.6 1.00
pacquet@main 173.8 ± 13.4 164.8 222.0 1.00 ± 0.08
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.17361211283882355,
      "stddev": 0.004652352542781336,
      "median": 0.17217216478,
      "user": 0.12678388,
      "system": 0.08320622352941176,
      "min": 0.16739986878000002,
      "max": 0.18663991878000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.17383930354470586,
      "stddev": 0.013354207639560266,
      "median": 0.17044986678000001,
      "user": 0.12465623294117648,
      "system": 0.08323263529411765,
      "min": 0.16477623978,
      "max": 0.22195421178000002
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.525 ± 0.161 4.307 4.827 1.27 ± 0.07
pacquet@main 4.730 ± 0.343 4.341 5.473 1.33 ± 0.11
pnpr@HEAD 3.630 ± 0.153 3.419 3.901 1.02 ± 0.06
pnpr@main 3.568 ± 0.136 3.394 3.863 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.52547976704,
      "stddev": 0.16052673766239428,
      "median": 4.475575683840001,
      "user": 1.7248686399999997,
      "system": 1.8149896799999996,
      "min": 4.30701549884,
      "max": 4.82737597384
    },
    {
      "command": "pacquet@main",
      "mean": 4.7304766017399995,
      "stddev": 0.3429687356731427,
      "median": 4.71740622584,
      "user": 2.0420832399999993,
      "system": 2.04424978,
      "min": 4.34064837684,
      "max": 5.4734034758400005
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.6300258939399996,
      "stddev": 0.15270367910252386,
      "median": 3.64720253734,
      "user": 1.9252913399999998,
      "system": 1.9228395799999998,
      "min": 3.41890650984,
      "max": 3.90069399584
    },
    {
      "command": "pnpr@main",
      "mean": 3.56844907594,
      "stddev": 0.13602675155970034,
      "median": 3.55261135184,
      "user": 1.7675128399999995,
      "system": 1.86083128,
      "min": 3.39413232384,
      "max": 3.86334997484
    }
  ]
}

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 125.4 ± 6.7 113.5 136.1 1.01 ± 0.08
pacquet@main 125.3 ± 10.3 113.4 158.0 1.00 ± 0.10
pnpr@HEAD 130.6 ± 8.5 121.4 151.0 1.05 ± 0.10
pnpr@main 124.8 ± 8.0 116.0 142.0 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.12540446530000002,
      "stddev": 0.006729852278377258,
      "median": 0.1255383113,
      "user": 0.15184060210526312,
      "system": 0.13955636315789474,
      "min": 0.1134699233,
      "max": 0.1360527263
    },
    {
      "command": "pacquet@main",
      "mean": 0.12531208772857147,
      "stddev": 0.01028007821862727,
      "median": 0.12225539930000001,
      "user": 0.15259628380952378,
      "system": 0.1399876238095238,
      "min": 0.11343306430000001,
      "max": 0.1580296983
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.1305602885941177,
      "stddev": 0.008473294570933874,
      "median": 0.1257377953,
      "user": 0.14968611294117648,
      "system": 0.13596345294117648,
      "min": 0.1214055193,
      "max": 0.1510422653
    },
    {
      "command": "pnpr@main",
      "mean": 0.12476865970000002,
      "stddev": 0.008034839272394055,
      "median": 0.12083162580000001,
      "user": 0.14086495999999998,
      "system": 0.1359488,
      "min": 0.1160262963,
      "max": 0.1420161703
    }
  ]
}

@zkochan
zkochan marked this pull request as ready for review September 21, 2026 19:31
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Confirm benchmark regressions with reversed-order reruns

🐞 Bug fix 🧪 Tests 📝 Documentation ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Reruns suspected benchmark regressions with HEAD/main target order reversed.
• Fails CI only when the confirmation reproduces the slowdown.
• Preserves both reports while propagating benchmark command failures.
Diagram

sequenceDiagram
  participant W as CI Workflow
  participant R as Run Wrapper
  participant B as Benchmark Binary
  participant A as Report Artifact
  participant C as Comparator
  participant G as CI Gate
  W->>R: Start scenario
  R->>B: Initial targets
  B-->>A: Initial report
  R->>C: Check suspicion
  alt Regression suspected
    R->>B: Reverse targets
    B-->>A: Add confirmation
  end
  W->>C: Compare reports
  C-->>G: Reproduced status
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Always run both target orders
  • ➕ Removes conditional execution paths from the benchmark workflow.
  • ➕ Provides paired order data for every scenario.
  • ➖ Approximately doubles benchmark runtime and runner cost.
  • ➖ Generates confirmation data when initial measurements show no regression.
2. Interleave target measurements
  • ➕ Reduces sensitivity to monotonic runner drift within a benchmark run.
  • ➕ Can provide stronger evidence than two sequential batches.
  • ➖ Requires substantial changes to the existing benchmark harness.
  • ➖ May disturb cache, server, and scenario isolation assumptions.

Recommendation: Keep the conditional reversed-order confirmation implemented by this PR. It directly addresses order-dependent runner drift while preserving normal-case runtime, existing tolerance rules, report compatibility, and initial Bencher timings. Always running both orders is unnecessarily expensive, while interleaving would require a riskier harness redesign.

Files changed (6) +184 / -30

Bug fix (2) +59 / -2
compare-integrated-benchmarks.mjsRequire suspected regressions to reproduce in confirmation +13/-2

Require suspected regressions to reproduce in confirmation

• Adds confirmation-aware comparison that retains the initial timing values but downgrades unconfirmed slowdowns to inconclusive. Missing or invalid required confirmation data fails closed, and rendered reports explain the reproduction requirement.

.github/scripts/compare-integrated-benchmarks.mjs

run-integrated-benchmark.mjsAdd conditional reversed-order benchmark runner +46/-0

Add conditional reversed-order benchmark runner

• Introduces a wrapper around the integrated benchmark binary that reruns suspected regressions once with target arguments reversed. It preserves initial reports, appends successful confirmations, avoids retrying initial failures, and propagates confirmation failures.

.github/scripts/run-integrated-benchmark.mjs

Tests (2) +89 / -1
compare-integrated-benchmarks.test.mjsTest confirmation-aware benchmark comparison +14/-1

Test confirmation-aware benchmark comparison

• Extends comparison tests for missing, non-reproduced, reproduced, and invalid confirmation reports. Existing scenario fixtures now include confirmations where their initial results intentionally regress.

.github/scripts/compare-integrated-benchmarks.test.mjs

run-integrated-benchmark.test.mjsCover benchmark rerun and failure behavior +75/-0

Cover benchmark rerun and failure behavior

• Tests stable, transient, and sustained slowdown paths alongside target reversal and report preservation. It also verifies that main-only runs skip comparison and command failures are neither swallowed nor incorrectly retried.

.github/scripts/run-integrated-benchmark.test.mjs

Documentation (1) +9 / -2
CONTRIBUTING.mdDocument benchmark regression confirmation behavior +9/-2

Document benchmark regression confirmation behavior

• Explains reversed-order confirmation, failure propagation, artifact retention, and the requirement that a slowdown reproduce before failing CI. Updates the local validation command to run both benchmark script test suites.

pnpm/CONTRIBUTING.md

Other (1) +27 / -25
pacquet-integrated-benchmark.ymlRoute integrated benchmark scenarios through confirmation runner +27/-25

Route integrated benchmark scenarios through confirmation runner

• Invokes the new wrapper for all benchmark scenarios and runs both Node test suites. Workflow triggers include the wrapper files, while artifact previews redact sample details from nested confirmation reports.

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

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Sep 21, 2026
@greptile-apps

greptile-apps Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The PR appears safe to merge, with a non-blocking risk that slower confirmation runs can exhaust the unchanged workflow timeout budgets.

Reviews (1) · Last reviewed commit: "fix(ci): confirm benchmark regressions w..."

@zkochan
zkochan merged commit 3450bb8 into main Sep 21, 2026
54 checks passed
@zkochan
zkochan deleted the intb branch September 21, 2026 19:35
@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 add REVIEW.md to your repo root and Qodo follows it on every PR

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.

u9g pushed a commit to u9g/pnpm that referenced this pull request Sep 25, 2026
…pm#15231)

Confirm suspected integrated benchmark regressions once with target order
reversed. Same-run measurements can still be biased by sustained runner drift:
a control run on identical Rust sources produced a 29% apparent pnpr slowdown.

Keep the 5% tolerance with a 2 ms floor and the retained-sample noise guard.
Require the regression to reproduce in the confirmation, preserve both sets
of measurements in the artifact and report, and keep the initial timings for
historical Bencher uploads. Missing required confirmations fail the check.

The wrapper preserves the existing harness arguments and assertions. It does
not retry command failures, and confirmation failures propagate. Main-only
runs and scenarios without suspected regressions execute once.

Related to pnpm#15228.
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.

1 participant