Skip to content

perf(deps-restorer): stat each store file once, and gate the benchmark on syscall counts - #3

Draft
jclaveau wants to merge 22 commits into
mainfrom
fix/statx-regression-with-syscall-gate
Draft

jclaveau wants to merge 22 commits into
mainfrom
fix/statx-regression-with-syscall-gate

Conversation

@jclaveau

@jclaveau jclaveau commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Fixes the part of pnpm#17500 that pnpm#17502 left in place, and adds the benchmark check that would have caught the 12.8.0 regression before it shipped.

Two commits:

  1. ci(benchmark): gate the same-run comparison on file syscall counts: the long-term fix. The integrated benchmark already compares HEAD and main in one run, but on wall time only, with a 5% noise allowance. The 12.8.0 regression added about 67k warm-cache statx calls per install, roughly 1 µs each, so wall time never left that band. This commit counts file syscalls in the same run and fails the check when HEAD makes more than max(2%, 50 calls) beyond main's highest count. Reverting perf(deps-restorer): stat a store file once for the hardlink mode check pnpm/pnpm#17502 on top of it turns the check red (12 statx rows, +2.7% to +7.3%), while the timing table reads "Within tolerance".
  2. perf(deps-restorer): reuse the store verifier's mode reading for hardlinks: the fix. It brings statx back to the 12.7.0 count: 54,251 vs 53,885 calls (1.01x), while main reads 100,215 vs 53,885 calls (1.86x).

The gate commit comes first, so this PR's own benchmark run measures the fix with the new check.

The fix

Follow-up to pnpm#17502 for pnpm#17500: closes the remaining statx gap.

pnpm#17502 caches a linkable answer per store path, so a store file shared by several packages is no longer stat'ed once per link. It still stats every store file once before its first link, though the store verifier (check_pkg_files_integrity) read that same inode's mode a moment earlier in the same install. On the vitest fixture that leaves 100k statx calls, against 54k in 12.7.0 (run below).

This PR replaces the DashSet<PathBuf> of linkable paths in target_mode.rs with a process-wide map from store path to inode mode, kept in pnpm_fs::file_mode:

  • The verifier records the mode of every file it passes: the fast path, the re-stat path and the rehash path.
  • The verifier forgets the recorded mode of a file that fails (missing, wrong size, digest mismatch). The re-fetch may land a new inode with this process's mode, so the importer stats it again. The old DashSet kept a stale entry here too.
  • source_has_desired_mode reads the map first. On a miss it reads the mode once (fs::metadata on unix, copy_permissions on wasi) and records it.
  • store_inode_mode_is_linkable is unchanged, so the umask issue pnpm/pnpm#3807 semantics are unchanged.
  • deps-restorer no longer depends on dashmap.

The result:

Why process-global. The verifier and the importer run in different install-scoped contexts. The CAS write locks live in pnpm_fs for the same reason. Threading the mode down to import_indexed_dir instead would change the FilesMap shape at about a dozen call sites across deps-restorer, package-manager, cli, env-installer and python-installer.

Trade-offs:

v11 is not affected.

Tests

  • hardlink_uses_the_mode_the_verifier_recorded (deps-restorer, new): it records the desired mode, sets the file's real mode off it, then links. The link must share the inode, because the recorded mode was used without a stat.
  • careful_path_records_the_mode_of_a_verified_file (store-dir, new): a verified pass records the blob's mode.
  • careful_path_forgets_the_mode_of_a_file_that_went_missing and careful_path_forgets_the_mode_of_a_file_whose_content_hash_mismatches (store-dir, new): a pass records the mode, then a failed check leaves no mode recorded. Both fail with the verifier change reverted (the old mode is still returned), and all 247 store-dir tests pass with it.
  • hardlink_reuses_a_store_entry_mode_check (from perf(deps-restorer): stat a store file once for the hardlink mode check pnpm/pnpm#17502): kept as is, and still passes.
  • Red: target_mode.rs, check_pkg_files_integrity.rs, the deps-restorer Cargo.toml and Cargo.lock restored from main 896dc10 make both new tests fail, while the perf(deps-restorer): stat a store file once for the hardlink mode check pnpm/pnpm#17502 test passes.
  • Green: with the fix, all three pass.
  • cargo test:
    • -p pnpm-deps-restorer: 672 passed.
    • -p pnpm-store-dir: 245 + 2 passed.
    • -p pnpm-fs: 212 passed. 2 secure_temp_lock XDG tests fail the same way on the base commit, because of the local sandbox environment.
  • cargo clippy --all-targets -- -D warnings is clean on the three crates.

Measurement

Offline frozen pnpm install of the vitest fixture (da7ce171, 66,952 linked files) on a warm store. All arms run on the same Ubuntu image, interleaved, with medians over n=10 rounds per runner and cgroup CPU. patched is this change on its pre-pnpm/pnpm#17502 base (f4a1e8c). pr17502 is b96f423 and base is 4cb926c. The source arms are glibc cargo build --release -p pnpm-cli builds made the same way, and 12.7.0 is the registry binary. Each cell is arm vs 12.7.0.

Run 40981503781:

runner arm statx sys user user+sys
EPYC 7763 patched 54,276 vs 53,886 (1.01x) 2.07 vs 2.09 s (0.99x) 0.86 vs 0.81 s (1.06x) 2.93 vs 2.90 s (1.01x)
EPYC 7763 pr17502 100,057 vs 53,886 (1.86x) 2.34 vs 2.09 s (1.12x) 0.91 vs 0.81 s (1.12x) 3.25 vs 2.90 s (1.12x)
EPYC 7763 base 121,177 vs 53,886 (2.25x) 2.41 vs 2.09 s (1.15x) 0.81 vs 0.81 s (1.00x) 3.22 vs 2.90 s (1.11x)
Xeon 8573C patched 54,276 vs 53,888 (1.01x) 1.26 vs 1.21 s (1.04x) 0.79 vs 0.78 s (1.01x) 2.05 vs 1.99 s (1.03x)
Xeon 8573C pr17502 100,016 vs 53,888 (1.86x) 1.38 vs 1.21 s (1.14x) 0.81 vs 0.78 s (1.04x) 2.19 vs 1.99 s (1.10x)
Xeon 8573C base 121,181 vs 53,888 (2.25x) 1.43 vs 1.21 s (1.18x) 0.73 vs 0.78 s (0.94x) 2.16 vs 1.99 s (1.09x)
EPYC 7763 patched 54,276 vs 53,885 (1.01x) 2.05 vs 2.02 s (1.02x) 0.82 vs 0.78 s (1.05x) 2.87 vs 2.80 s (1.03x)
EPYC 7763 pr17502 100,057 vs 53,885 (1.86x) 2.26 vs 2.02 s (1.12x) 0.88 vs 0.78 s (1.13x) 3.14 vs 2.80 s (1.12x)
EPYC 7763 base 121,176 vs 53,885 (2.25x) 2.34 vs 2.02 s (1.16x) 0.77 vs 0.78 s (0.99x) 3.11 vs 2.80 s (1.11x)

pnpm#17502 recovers 21k of the 67k extra statx calls. Its user time rose about as much as its sys time fell, so its user+sys is no better than base. This change brings statx back to the 12.7.0 count and sys to 0.99-1.04x. Its user time is also up 0.01-0.05 s against base, from the map lookups.

The fix vs post-pnpm/pnpm#17502 main vs 12.7.0

Run 41075659469: followup = the fix commit (2221b90, same diff as 8d14549 here), main = 896dc10 (contains 63be32b), both built from source with the same flags. Offline warm-store install of vitest@da7ce17 (66,954 files), medians over 10 interleaved rounds, 3 runners.

CPU arm statx sys user user+sys
EPYC 9V45 followup vs 12.7.0 54,251 vs 53,885 calls (1.01x) 1.42 vs 1.42 s (1.00x) 0.55 vs 0.48 s (1.14x) 1.97 vs 1.90 s (1.04x)
EPYC 9V45 main vs 12.7.0 100,215 vs 53,885 calls (1.86x) 1.58 vs 1.42 s (1.12x) 0.54 vs 0.48 s (1.12x) 2.12 vs 1.90 s (1.12x)
EPYC 9V45 followup vs main 54,251 vs 100,215 calls (0.54x) 1.42 vs 1.58 s (0.90x) 0.55 vs 0.54 s (1.02x) 1.97 vs 2.12 s (0.93x)
EPYC 9V45 (2nd) followup vs 12.7.0 54,256 vs 53,885 calls (1.01x) 1.51 vs 1.50 s (1.01x) 0.62 vs 0.58 s (1.07x) 2.13 vs 2.08 s (1.02x)
EPYC 9V45 (2nd) main vs 12.7.0 100,153 vs 53,885 calls (1.86x) 1.68 vs 1.50 s (1.12x) 0.61 vs 0.58 s (1.05x) 2.29 vs 2.08 s (1.10x)
EPYC 9V45 (2nd) followup vs main 54,256 vs 100,153 calls (0.54x) 1.51 vs 1.68 s (0.90x) 0.62 vs 0.61 s (1.02x) 2.13 vs 2.29 s (0.93x)
Xeon 8573C followup vs 12.7.0 54,247 vs 53,893 calls (1.01x) 1.28 vs 1.23 s (1.04x) 0.87 vs 0.84 s (1.05x) 2.15 vs 2.07 s (1.04x)
Xeon 8573C main vs 12.7.0 100,015 vs 53,893 calls (1.86x) 1.39 vs 1.23 s (1.13x) 0.85 vs 0.84 s (1.02x) 2.24 vs 2.07 s (1.08x)
Xeon 8573C followup vs main 54,247 vs 100,015 calls (0.54x) 1.28 vs 1.39 s (0.92x) 0.87 vs 0.85 s (1.02x) 2.15 vs 2.24 s (0.96x)

On main, pnpm#17502 still issues about 46k extra statx per install, one per store file on its first link. This branch removes them, because the store verifier has already read those modes. User time is 0.01-0.02 s above main, from the map lookups. linkat is identical across the source-built arms (66,946).

The long-term fix: a syscall-count gate in the benchmark

Adds a syscall-count row to the integrated benchmark's same-run comparison, so a change that multiplies filesystem work fails the check even when wall time does not move.

Why wall time missed pnpm#17500

pnpm 12.8.0 (a90ec21, "materialize imported files at the current umask") added a metadata read of the store file before every hardlink. On a hot store that roughly doubled the statx calls of an install. pnpm#17502 removed part of it. Each extra call hits a warm page cache and costs about a microsecond, so tens of thousands of them move a 1 s install by less than the comparison's 5% noise allowance. The information run below shows this today: main still makes 58% more statx calls than a candidate fix on the hot-store fresh restore, and the timing table reads "Within tolerance" (−2.1% pacquet, −5.3% pnpr).

What changes

  • Harness: integrated-benchmark --count-syscalls runs every benchmarked install twice more after the timed runs. These runs are untimed, start from the same cleanup a timed run starts from, and execute under strace --follow-forks --summary-only. Each run writes <target>/SYSCALL_COUNTS.<round>.txt.
  • run-integrated-benchmark.mjs: when HEAD and main are both benchmarked, passes --count-syscalls to the first run and stores the parsed counts in BENCHMARK_REPORT.json as syscalls. A missing or malformed strace table fails the run and names the file. When the harness itself fails after the traced runs, as a failed diagnostics check does, the counts are still attached, so the report keeps its tables. The round files of every target are removed before the harness starts, so a harness that fails earlier never carries a previous run's counts. The parser requires every row to parse and the rows to add up to the total row.
  • compare-integrated-benchmarks.mjs: adds a "Same-run syscall check" table after the "Same-run regression check" table. It gates about 30 file syscalls (stat family, open, link, copy, ioctl, getdents, mkdir, rename, unlink, chmod, symlink, readlink, access):
    • Regression when HEAD's fewest calls exceed main's most by more than max(2% of main, 50 calls). This fails the check.
    • Unstable when a revision's two identical runs differ by more than that tolerance. The row stays visible and is not gated, because the counts cannot tell a change from noise, unless HEAD's fewest calls also exceed main's most by more than the tolerance plus that difference, which is a regression however noisy the runs.
    • Each scenario and engine lists its largest change relative to its tolerance plus every row that is not within tolerance.
    • A report without counts, from a PR still on the older harness, shows "Not recorded by this run's harness" instead of failing the whole comment. Counts that are present but partial or invalid still fail.
  • Workflow:
    • Installs strace.
    • Removes syscalls from the JSON embedded in the summary.
    • Gives each benchmark step 10 more minutes for the traced runs.
    • Adds head_ref/main_ref inputs to workflow_dispatch, so two arbitrary revisions can be compared with the current harness. The harness always comes from the dispatched ref. A dispatch with head_ref skips the Bencher upload, since it measured another revision than the branch it names. main_ref is refused when dispatching from main, which benchmarks HEAD alone. Both take a SHA or origin/<branch>, and a ref that does not resolve fails the dispatch.
    • Takes its runner from vars.INTEGRATED_BENCHMARK_RUNNER, falling back to blacksmith-8vcpu-ubuntu-2404, so a fork without Blacksmith runners can run it. Nothing changes upstream.

Thresholds

The negative run below compared 24 scenario/engine pairs and found no syscall within tolerance's reach of failing:

  • The largest spread between identical runs was statx in fresh-install cold/cold for pacquet (1,640 calls on about 160k, 1.0%). Every other spread is under 0.3% or under 50 calls.
  • 2% sits above that run-to-run noise. Most counts are fully deterministic: hot-store scenarios move by 0 to 65 calls.
  • The 50-call floor keeps rarely-called syscalls (single-digit access, a few hundred rename) from failing on scheduling-dependent retries.
  • Both regressions this PR targets are far above the line: +5.5k statx (+7%) for reverting perf(deps-restorer): stat a store file once for the hardlink mode check pnpm/pnpm#17502 alone, +28k (+58%) for main vs the candidate fix.

Proof runs (fork, ubuntu-latest)

Positive: the gate fails on a reintroduced per-link stat

Run: https://github.com/jclaveau/pnpm/actions/runs/41084341826. HEAD is this branch plus a revert of pnpm#17502 (throwaway branch ci/syscall-gate-proof-revert-17502). main is this branch. The check fails with 12 syscall regressions, all statx, while the timing table reports every scenario within tolerance:

Scenario Engine Syscall main calls (max) HEAD calls (min) Change Tolerance Identical-run spread Result
isolated-fresh-restore-cold-cache-cold-store pacquet statx 123480 128941 +4.4% 2470 84 Regression
isolated-fresh-restore-cold-cache-cold-store pnpr statx 123931 129396 +4.4% 2479 267 Regression
isolated-fresh-restore-hot-cache-hot-store pacquet statx 76625 82203 +7.3% 1533 5 Regression
isolated-fresh-restore-hot-cache-hot-store pnpr statx 76638 82211 +7.3% 1533 9 Regression
isolated-fresh-install-cold-cache-cold-store pacquet statx 160390 164717 +2.7% 3208 1640 Regression
isolated-fresh-install-cold-cache-cold-store pnpr statx 124129 129536 +4.4% 2483 4 Regression
isolated-fresh-install-hot-cache-hot-store pacquet statx 80484 85928 +6.8% 1610 44 Regression
isolated-fresh-install-hot-cache-hot-store pnpr statx 77531 82953 +7.0% 1551 3 Regression
isolated-fresh-install-cold-cache-hot-store pacquet statx 81498 86865 +6.6% 1630 38 Regression
isolated-fresh-install-cold-cache-hot-store pnpr statx 77529 82950 +7.0% 1551 1 Regression
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet statx 123393 128940 +4.5% 2468 18 Regression
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr statx 123485 129030 +4.5% 2470 13 Regression

Timing rows for the same scenarios in the same run:

Scenario Engine main median HEAD median Change Tolerance Result
isolated-fresh-restore-hot-cache-hot-store pacquet 982.13 ms 924.03 ms -5.9% 49.11 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 1075.54 ms 1032.48 ms -4.0% 53.78 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 1164.42 ms 1196.38 ms 2.7% 58.22 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 883.00 ms 887.34 ms 0.5% 44.15 ms Within tolerance

I first tried the literal pair, a90ec21 against its parent 7679530. It cannot run with today's harness: the September pnpr binary rejects --packument-ttl, and its revision mock never starts. That is why the proof reverts the remaining part of the regression instead.

Negative: the gate passes on a neutral change

Run: https://github.com/jclaveau/pnpm/actions/runs/41084352182 (success). HEAD is this branch, main is main. All 15 scenarios ran, and the syscall check reported no regression and no unstable row.

Information: current main vs a candidate fix

Run: https://github.com/jclaveau/pnpm/actions/runs/41084361972. HEAD is 896dc10 (main after pnpm#17502), main is 2221b90 (jclaveau/pnpm fix/hardlink-mode-check-per-source, a fix that reads the mode once per source file). It shows what pnpm#17502 left of pnpm#17500:

Scenario Engine Syscall main calls (max) HEAD calls (min) Change Tolerance Identical-run spread Result
isolated-fresh-restore-hot-cache-hot-store pacquet statx 48331 76615 +58.5% 967 8 Regression
isolated-fresh-restore-hot-cache-hot-store pnpr statx 48345 76630 +58.5% 967 11 Regression
isolated-fresh-install-cold-cache-cold-store pacquet mkdir 10809 10686 -1.1% 217 247 Unstable (identical runs differ by 247, not gated)
isolated-fresh-install-cold-cache-cold-store pacquet statx 140879 160621 +14.0% 2818 1536 Regression
isolated-fresh-install-hot-cache-hot-store pacquet statx 52209 80385 +54.0% 1045 65 Regression
isolated-fresh-install-hot-cache-hot-store pnpr statx 48979 77524 +58.3% 980 3 Regression
isolated-fresh-install-cold-cache-hot-store pacquet statx 53338 81517 +52.8% 1067 18 Regression
isolated-fresh-install-cold-cache-hot-store pnpr statx 48985 77529 +58.3% 980 3 Regression

In the same run the timing table shows -2.1% (pacquet) and -5.3% (pnpr) for the hot-store fresh restore, both "Within tolerance".

Tests

node --test .github/scripts/compare-integrated-benchmarks.test.mjs .github/scripts/run-integrated-benchmark.test.mjs passes 30 tests. They cover strace parsing, the 2% and 50-call boundaries, unstable runs, a run spread within the tolerance not widening the gate, stale round files, refusal of missing, partial or invalid counts, and the table rendering. Disabling each guard in turn fails at least one test.

Refs pnpm#17500, pnpm#17502. Supersedes #1 and #2, which carry each commit alone.

Assisted-by: Claude:claude-opus-5-5

pnpm 12.8.0 doubled the statx calls of a hot-store install
(pnpm#17500) while the timing check stayed within tolerance: on a
warm page cache a stat costs about a microsecond, so 67k extra calls
move a 1 s install by less than the 5% noise allowance.

When HEAD and main are compared, the harness now runs every install
twice more, untimed, under `strace --follow-forks --summary-only`, and
the run script stores the per-syscall counts in the report. The
comparison adds a "Same-run syscall check" table: a file syscall
regresses when HEAD's fewest calls exceed main's most by more than 2%
of main or 50 calls, whichever is larger. A syscall whose two
identical runs differ by more than that is reported unstable and not
gated.

The workflow also takes `head_ref`/`main_ref` dispatch inputs, so a
past regression can be benchmarked with the current harness, and an
`INTEGRATED_BENCHMARK_RUNNER` repository variable, so forks without
Blacksmith runners can run it.

Assisted-by: Claude:claude-opus-5-5
…links

pnpm#17502 stopped the hardlink mode check from stat'ing a store
file once per link, but it still stats each file once before its
first link. The store verifier has read the same inode's mode a moment
earlier in the same install, so an offline install of a large
workspace still makes about 100k `statx` calls, against 54k in 12.7.0
(pnpm#17500).

`pnpm_fs::file_mode` now keeps a process-wide map from store path to
the mode last read for it. The verifier records the mode of each file
it passes, and `source_has_desired_mode` reads the map before falling
back to one read of its own, which it then records too. This replaces
the set of linkable paths from pnpm#17502. A warm store with
verify-store-integrity on goes back to one stat per blob, the 12.7.0
count; with it off, each blob is still stat'ed only once however many
packages link it. The mode comparison itself is unchanged.

The map is process-global because the verifier and the importer run in
different install-scoped contexts, the same reason the CAS write locks
live in `pnpm_fs`. Threading the mode down to `import_indexed_dir`
instead would change the `FilesMap` shape at a dozen call sites across
five crates. Unlike the set it replaces, a mismatched mode is
remembered too: such an entry keeps being copied, now without a
re-stat. A blob rewritten by another process under a different umask
after this process first read it is noticed only by the next process.

Assisted-by: Claude:claude-opus-5-5
…a failed check

The syscall tolerance rounded 2% of main up, so a change one call above
2% of a base that is not a multiple of 50 passed (main 10001, HEAD 10202).
Round it down: an integer change exceeds 2% of main exactly when it
exceeds the floor of it.

The harness checks its diagnostics after the traced runs. When that check
failed, the runner returned before attaching the counts, so the report job
threw "Expected 2 syscall count runs" and hid every table. Attach them on
a failed exit too, and log why when they cannot be read.

Assisted-by: Claude:claude-opus-5-5
…in_ref on main

- A dispatch with head_ref measured another revision than the branch it
  names, so skip the Bencher upload for it.
- On main the benchmark runs HEAD alone, so a main_ref compared nothing
  without saying so. Fail the revisions step with a message instead.
- Refresh the apt index before installing strace.

Assisted-by: Claude:claude-opus-5-5
- The observed store mode survives a rewrite with equal bytes, but not a
  mode change by another process's atomic rewrite or a chmod through a
  hardlink. Say so where the map is defined.
- pnpr targets' syscall counts cover the client only: the server starts
  before the trace.
- Lead the changeset with what users see, and limit the 12.7.0 parity
  claim to the default verify-store-integrity.

Assisted-by: Claude:claude-opus-5-5
The comment workflow runs main's compare script on a PR's artifacts. Once
this lands, a PR still on the old harness uploads reports without
`syscalls`, and the script threw "Expected 2 syscall count runs", so the
PR got no comment at all. Show "Not recorded by this run's harness" rows
for those reports and keep the timing check. Counts that are present but
partial or invalid still fail.

Assisted-by: Claude:claude-opus-5-5
The unstable check ran before the regression check, so any run-to-run
disagreement above the tolerance hid a regression of any size: main
[1000, 1000] against HEAD [3000, 3100] passed as unstable. Gate first
when HEAD's fewest calls exceed main's most by more than the tolerance
plus the spread, a gap noise alone cannot open. A noisy syscall with a
smaller gap stays unstable, and a stable one is gated exactly as before.

Assisted-by: Claude:claude-opus-5-5
…table rows

The previous commit added the identical-run spread to every row's
threshold, so a spread within the tolerance loosened the stable gate:
main [1000, 1040] vs HEAD [1091, 1091] passed although its rise of 51
exceeds the tolerance of 50. The spread now widens the gate only when it
exceeds the tolerance, as the rendered description states. The
description also says the listed row is the largest change relative to
its tolerance, which is how it is chosen.

Assisted-by: Claude:claude-opus-5-5
…ess runs

Nothing removed `<target>/SYSCALL_COUNTS.<round>.txt` between runs, so a
harness that failed before its traced runs in a reused work env had the
previous run's counts attached to its report without a word. The runner
now removes the round files of every target before starting the harness.

The test of an initial failure ran in the default `bench-work-env`
relative to the working directory, so it could rewrite a developer's
real report there. It now uses a temporary directory, and the test of
malformed counts writes them from the harness stub like the harness does.

Assisted-by: Claude:claude-opus-5-5
…ommit

The revisions step wrote `$(git rev-parse ...)` through echo, so a ref
that did not resolve wrote an empty SHA and the step passed. The build
then checked out the dispatched ref as HEAD and cached its binary under
a key with an empty revision, which a later dispatch with another bad
ref would restore. The step now fails and names the ref. The input
descriptions say a SHA or origin/<branch>, since a fresh clone has no
local branch of that name to resolve.

Assisted-by: Claude:claude-opus-5-5
The comment claimed the traced runs' events never mix with the timed
runs' in BENCHMARK_OUTPUT.ndjson. They do: the traced runs execute the
same install script, which appends to that file. What the ordering keeps
apart is the diagnostics, written from the file before the traced runs.

Assisted-by: Claude:claude-opus-5-5
A blob that fails verification (missing, wrong size, digest mismatch) is
re-fetched, and the re-fetch may land a new inode carrying this process's
mode. The mode recorded when the blob last passed stayed in
OBSERVED_STORE_MODES, so a long-lived process (pnpr) could hardlink the
new inode where a copy with the wanted mode was needed. The verifier now
drops the entry on every failing branch; the importer stats the new inode
on its next import.

Assisted-by: Claude:claude-opus-5-5
jclaveau and others added 10 commits November 1, 2026 16:00
The release note pointed at pnpm#17500, which pnpm#17502
closed. The remaining statx gap this change closes is tracked in
pnpm#17543.

Assisted-by: Claude:claude-opus-5-5
Assisted-by: Claude:claude-opus-5-5
verify_modified_file grew to 41 lines with the recorded-mode calls, one
past perfectionist::overly_long_function's limit; the size check now
reads metadata.len() in place, with no behaviour change. The changeset
says `stat` calls, since cspell does not know statx.

Assisted-by: Claude:claude-opus-5-5
Pass the head_ref and main_ref dispatch inputs to git rev-parse after
--end-of-options, so no input can be read as a git option. The ^{commit}
suffix already kept every probed option-shaped value from parsing as one;
this makes it explicit.

State in the workflow that vars.INTEGRATED_BENCHMARK_RUNNER also runs fork
PRs, so it must name a hosted or ephemeral runner. Reword two comments to
describe the current contract rather than past runs.

Assisted-by: Claude:claude-opus-5-5
The verifier records a blob's mode without the CAS write lock. A thread
whose read predates another thread's failed verification of the same
blob could record the old mode after the failure dropped it, and the
importer would then trust it for the re-fetched inode.

A failure now leaves a marker instead of removing the entry. A verifier
read only fills a path the map does not know yet, so it can overwrite
neither the marker nor the fresh stat that later replaces it. Only the
importer's own stat clears the marker, so a re-fetched blob costs one
stat.

Assisted-by: Claude:claude-opus-5-5
Concurrent installs race to create the same directories, so the number of
mkdir calls failing with EEXIST varies between identical runs. On this
PR's own benchmark run, pacquet's fresh install with a cold cache and hot
store made 10,528 to 10,704 mkdir calls on main and 11,049 to 11,061 on
HEAD, a change that touches no directory creation, and the syscall gate
reported it as a regression.

The strace parser now records mkdir and mkdirat as "mkdir (succeeded)"
and "mkdirat (succeeded)", the calls minus their errors, and gates those.
A new directory created per package still fails the gate. A row whose
errors column exceeds its calls is refused.

Assisted-by: Claude:claude-opus-5-5
On a head_ref dispatch the checkout holds the tools revision, so the
peer-heavy scenario built the TypeScript pnpm@HEAD from it while
pacquet@HEAD came from head_ref. The build step now passes a detached
worktree at the measured HEAD as --pnpm-repository whenever the two
differ.

The report header showed github.sha even when head_ref chose another
revision, and never named main. It now shows the measured HEAD and the
main commit it was compared against.

Assisted-by: Claude:claude-opus-5-5
A run on main benchmarks HEAD alone, so its report has no main target
to name.

Assisted-by: Claude:claude-opus-5-5
A process that changes a store entry's mode during an install (a chmod
of the store, a backup restore, a concurrent install linking bins) is
not guarded against by the recorded mode, nor by a stat before the
link, which the change can land after. State it where the mode is
recorded and where it is read.

Assisted-by: Claude:claude-opus-5-5
Drop the "no longer reads" contrast and name the setting the way the
v12 docs spell it, verifyStoreIntegrity.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants