Skip to content

fix: honor same-second edits on whole-second-mtime filesystems - #12975

Merged
zkochan merged 1 commit into
mainfrom
fix-repeat-install-coarse-mtime
Jul 13, 2026
Merged

zkochan merged 1 commit into
mainfrom
fix-repeat-install-coarse-mtime

Conversation

@zkochan

@zkochan zkochan commented Jul 13, 2026 •

Copy link
Copy Markdown
Member

Summary

The optimistic repeat-install fast path (and verify-deps-before-run) decides whether a package.json, .pnpmfile.cjs, or patch file changed since the last install by comparing its mtime against the last-validated timestamp with a strict >. On a filesystem that records mtimes at whole-second resolution (ext4 with 128-byte inodes, HFS+, some CI runner disks), a file edited in the same second as the previous install gets an mtime that rounds down below the timestamp — so the edit looks unchanged, the fast path short-circuits, and re-resolution is skipped. The second install becomes a no-op and keeps the stale result.

This is a real, if narrow, correctness bug: a human editing a manifest and reinstalling is always >1s later, so it only bites automated same-second reinstalls on a coarse-mtime filesystem. It surfaced as deterministic pacquet integration-test failures (stale_pin_dedupe, custom_resolvers) once the Rust CI test job moved to a runner whose disk has second-granularity mtimes.

The fix

Detect a whole-second mtime (no sub-second component) and treat its whole second as possibly-after the reference — mtime + 1000 > reference instead of mtime > reference — so the comparison falls through to the authoritative content check instead of trusting the rounded-down mtime. Erring toward "modified" only ever runs the (cheap) content check; it never skips a needed install.

Key property: a complete no-op on sub-second filesystems. On ext4/APFS/NTFS/xfs the mtime carries a fractional part, so the branch stays strict and behavior/perf are unchanged — the existing checkDepsStatus and optimistic_repeat_install unit suites pass without modification. (An earlier fixed-tolerance attempt was rejected precisely because it regressed the common path; this variant keys off each file's own sub-second component, so it doesn't.)

Landed in both stacks:

  • pacquet — pnpm/crates/package-manager/src/optimistic_repeat_install.rs (new FileMtime carrying a whole_second flag + modified_at_or_after).
  • pnpm — pnpm11/deps/status/src/checkDepsStatus.ts (modifiedAtOrAfter, using mtimeMs to detect the whole second).

Each side gets a regression test that forces a whole-second mtime so the coarse-filesystem path is exercised on any filesystem (both verified to fail without the fix). I also removed the temporary per-test mtime bumps added in #12969 so stale_pin_dedupe genuinely validates this fix.

Squash Commit Body

The optimistic repeat-install fast path and verify-deps-before-run decide
whether a package.json, .pnpmfile.cjs, or patch file changed since the
last install by comparing its mtime against the last-validated timestamp
with a strict `>`. On a filesystem that records mtimes at whole-second
resolution (ext4 with 128-byte inodes, HFS+, some CI runner disks) a file
edited in the same second as the install gets an mtime that rounds down
below the timestamp, so the edit looks unchanged, the fast path
short-circuits, and re-resolution is skipped.

Detect a whole-second mtime (no sub-second component) and treat its whole
second as possibly-after the reference, falling through to the content
check instead of trusting the rounded-down mtime. On sub-second
filesystems the mtime carries a fractional part, so the comparison stays
exact and the common case is unaffected.

Landed in both stacks: pacquet's optimistic_repeat_install and pnpm's
checkDepsStatus, each with a regression test that forces a whole-second
mtime.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust pnpm/ port, or the description notes what still needs porting.
  • Added a changeset (pnpm changeset) if this PR changes any published package. (@pnpm/deps.status, pnpm, pacquet — patch.)
  • Added or updated tests. (Regression test on each stack; removed the ci: run TS and Rust test jobs on Blacksmith runners #12969 per-test workaround.)
  • Updated the documentation if needed. (N/A — internal behavior fix.)

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


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes
    • Improved dependency freshness checks on filesystems with whole-second timestamp resolution.
    • Changes to manifests, lockfiles, patches, or configuration files made within the same second as an installation are now detected reliably.
    • Prevented repeat installs and pre-run checks from incorrectly treating dependencies as up to date.
    • Added coverage for detecting recently edited configuration files and stale dependency state.

The optimistic repeat-install fast path and verify-deps-before-run decide
whether a package.json, .pnpmfile.cjs, or patch file changed since the
last install by comparing its mtime against the last-validated timestamp
with a strict `>`. On a filesystem that records mtimes at whole-second
resolution (ext4 with 128-byte inodes, HFS+, some CI runner disks) a file
edited in the same second as the install gets an mtime that rounds down
below the timestamp, so the edit looks unchanged, the fast path
short-circuits, and re-resolution is skipped — the second install is a
no-op and keeps the stale result.

Detect a whole-second mtime (no sub-second component) and treat its whole
second as possibly-after the reference, falling through to the
authoritative content check instead of trusting the rounded-down mtime.
Erring toward "modified" only ever runs the content check; it never skips
a needed install. On sub-second filesystems the mtime carries a
fractional part, so the comparison stays exact and the common case is
completely unaffected — the existing deps-status unit tests pass
unchanged.

Landed in both stacks: pacquet's optimistic_repeat_install and pnpm's
checkDepsStatus, with a regression test on each side that forces a
whole-second mtime so the coarse-filesystem path is exercised on any
filesystem.
Copilot AI review requested due to automatic review settings July 13, 2026 16:08

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

zkochan has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

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.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Dependency status and repeat-install freshness checks now account for whole-second filesystem mtimes. Manifest, lockfile, patch, and pnpmfile checks fall back to content validation when timestamps may indicate same-second edits.

Changes

Coarse-mtime freshness handling

Layer / File(s) Summary
Rust repeat-install freshness logic
pnpm/crates/package-manager/src/optimistic_repeat_install.rs
Introduces FileMtime and applies whole-second-aware freshness checks across repeat-install, verify-deps, lockfile, patch, and pnpmfile paths.
TypeScript dependency status checks
pnpm11/deps/status/src/checkDepsStatus.ts
Adds modifiedAtOrAfter and uses it for manifest, lockfile, patch, and hook modification detection.
Regression coverage and release metadata
pnpm/crates/package-manager/src/optimistic_repeat_install/tests.rs, pnpm11/deps/status/test/checkDepsStatus.test.ts, pnpm/crates/cli/tests/stale_pin_dedupe.rs, .changeset/*, cspell.json
Adds coarse-mtime tests, removes forced mtime adjustments from stale-pin tests, and records patch releases and spelling configuration.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related issues

Possibly related PRs

  • pnpm/pnpm#11605: Modifies checkDepsStatus mtime-gated validation decisions.
  • pnpm/pnpm#11943: Centers on optimistic repeat-install mtime checks.
  • pnpm/pnpm#12106: Updates optimistic fast-path handling for wanted lockfile changes.

Suggested labels: product: pnpm@11, product: pacquet

Suggested reviewers: copilot

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

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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix repeat-install mtime gating on whole-second filesystems

🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Prevent same-second manifest/lockfile edits from being missed on whole-second mtime filesystems.
• Treat whole-second mtimes as "possibly-after" to force authoritative content validation.
• Add regression coverage in Rust and TS, and remove the prior mtime-bump test workaround.
Diagram

graph TD
  A["Workspace state (lastValidatedTimestamp)"] --> B["Stat manifests/lockfiles/patches/pnpmfile"] --> C{\"mtime possibly-after?\"}
  C -->|"no"| D["Fast path: UpToDate"]
  C -->|"yes"| E["Content validation (lockfile equality / drift checks)"] --> F["Skip fast path / re-resolve"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Always treat mtimes within 1s as modified
  • ➕ Simpler rule; no need to detect whole-second mtimes
  • ➕ Avoids relying on per-file precision quirks
  • ➖ Introduces extra content-check work on common sub-second filesystems
  • ➖ Harder to bound perf impact across large workspaces
2. Persist content digests for key inputs in workspace state
  • ➕ Eliminates filesystem timestamp precision issues entirely
  • ➕ Can be more reliable than mtimes across sync/restore scenarios
  • ➖ Higher implementation complexity and state format changes
  • ➖ Additional hashing cost and migration considerations
3. Store higher-precision timestamps (sec+nsec) where available
  • ➕ Keeps comparisons precise on high-resolution filesystems
  • ➕ Avoids heuristic widening when precision exists
  • ➖ Does not solve coarse filesystems (precision simply not available)
  • ➖ Requires schema changes and careful cross-platform serialization

Recommendation: The PR’s approach (detect per-file whole-second mtimes and widen only those comparisons) is the best trade-off: it fixes correctness on coarse-mtime filesystems while remaining a no-op on sub-second filesystems, preserving the common-case fast path performance.

Files changed (7) +178 / -70

Bug fix (2) +91 / -43
optimistic_repeat_install.rsTreat whole-second mtimes as possibly-after in repeat-install fast path +60/-33

Treat whole-second mtimes as possibly-after in repeat-install fast path

• Replaces strict mtime '>' checks with 'modified_at_or_after', which widens comparisons only when a file’s mtime has no sub-second component. Introduces 'FileMtime' and 'file_mtime()' and applies the new logic to manifests, lockfiles, patches, and pnpmfiles so same-second edits cannot be skipped.

pnpm/crates/package-manager/src/optimistic_repeat_install.rs

checkDepsStatus.tsFix deps-status mtime gating on whole-second timestamp filesystems +31/-10

Fix deps-status mtime gating on whole-second timestamp filesystems

• Routes manifest/lockfile/patch/pnpmfile freshness checks through 'modifiedAtOrAfter' instead of strict 'mtime > lastValidatedTimestamp'. Detects whole-second mtimes using 'mtimeMs % 1000 === 0' (to avoid misclassifying sub-ms timestamps) and widens only in that case.

pnpm11/deps/status/src/checkDepsStatus.ts

Tests (3) +79 / -27
stale_pin_dedupe.rsRemove mtime-bump workaround from stale pin integration tests +1/-25

Remove mtime-bump workaround from stale pin integration tests

• Deletes the helper that artificially advanced manifest mtimes between installs. The test now relies on the fixed mtime comparison behavior and can reproduce same-second edit scenarios on coarse-mtime systems.

pnpm/crates/cli/tests/stale_pin_dedupe.rs

tests.rsAdd unit coverage for whole-second mtime comparison semantics +24/-2

Add unit coverage for whole-second mtime comparison semantics

• Adds a regression test validating that whole-second mtimes are treated as a 1-second window while sub-second mtimes remain exact. Ensures the helper does not change behavior on high-precision filesystems.

pnpm/crates/package-manager/src/optimistic_repeat_install/tests.rs

checkDepsStatus.test.tsAdd regression test for same-second pnpmfile edits on coarse mtimes +54/-0

Add regression test for same-second pnpmfile edits on coarse mtimes

• Adds a test that forces a whole-second mtime and a reference timestamp within that same second to ensure the change is detected. Validates that deps-status reports not up-to-date and surfaces the expected pnpmfile modification issue.

pnpm11/deps/status/test/checkDepsStatus.test.ts

Documentation (1) +7 / -0
repeat-install-coarse-mtime.mdAdd changeset for coarse-mtime repeat-install correctness fix +7/-0

Add changeset for coarse-mtime repeat-install correctness fix

• Introduces a changeset noting that same-second edits could be missed on whole-second mtime filesystems. Documents that whole-second mtimes now fall through to content checks while sub-second behavior is unchanged.

.changeset/repeat-install-coarse-mtime.md

Other (1) +1 / -0
cspell.jsonAllow "inodes" spelling for documentation/comments +1/-0

Allow "inodes" spelling for documentation/comments

• Adds "inodes" to the cspell dictionary to avoid false positives in new commentary about ext4 inode sizes and mtime granularity.

cspell.json

@qodo-code-review

qodo-code-review Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 18 rules

Grey Divider


Action required

1. Missing trailing comma filteredInstall ✗ Dismissed 📘 Rule violation ⚙ Maintainability
Description
In the new Jest test, the multi-line object literal for mockWorkspaceState omits a trailing comma
after the last property (filteredInstall: false). This violates the TypeScript trailing-comma
requirement and can cause inconsistent formatting/noisier diffs.
Code

pnpm11/deps/status/test/checkDepsStatus.test.ts[404]

+      filteredInstall: false,
Evidence
PR Compliance ID 713434 requires trailing commas in TypeScript multi-line collections/constructs.
The added mockWorkspaceState object ends with filteredInstall: false and no trailing comma
before the closing brace.

Rule 713434: Require trailing commas in TypeScript collections and multi-line constructs
pnpm11/deps/status/test/checkDepsStatus.test.ts[395-405]

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

## Issue description
A multi-line object literal is missing a trailing comma after the last property (`filteredInstall: false`).

## Issue Context
This repo requires trailing commas in TypeScript multi-line constructs to keep formatting consistent and reduce diff churn.

## Fix Focus Areas
- pnpm11/deps/status/test/checkDepsStatus.test.ts[395-405]

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



Remediation recommended

2. Overflow in mtime tolerance 🐞 Bug ☼ Reliability
Description
In Rust, modified_at_or_after() adds 1000ms for whole-second mtimes, but file_mtime() can set
FileMtime.ms to i64::MAX on conversion overflow; adding 1000 can overflow (panic in debug) or wrap
(release), potentially misclassifying a file as unmodified. This is very low-likelihood in real
timestamps, but the code explicitly creates the sentinel and should remain overflow-safe.
Code

pnpm/crates/package-manager/src/optimistic_repeat_install.rs[R865-888]

+    Some(FileMtime {
+        ms: i64::try_from(elapsed.as_millis()).unwrap_or(i64::MAX),
+        whole_second: elapsed.subsec_nanos() == 0,
+    })
+}
+
+/// Millisecond mtime of `path`, `None` when it can't be stat'd.
+fn mtime_ms(path: &Path) -> Option<i64> {
+    file_mtime(path).map(|mtime| mtime.ms)
+}
+
+/// Whether a file with mtime `subject` may have been modified at or after
+/// `reference_ms`. On a filesystem that keeps sub-second mtimes the
+/// comparison is exact (`ms > reference`); on one that rounds mtimes down
+/// to whole seconds the file could have been touched anywhere within its
+/// second, so the whole second counts as possibly-after
+/// (`ms + 1000 > reference`). A manifest, lockfile, patch, or pnpmfile
+/// edited in the same second as the previous install would otherwise
+/// look unchanged there and wrongly keep the fast path. Erring toward
+/// "modified" only runs the authoritative content check — it never skips
+/// a needed install — and it is a no-op on sub-second filesystems, so the
+/// common case is unaffected.
+fn modified_at_or_after(subject: FileMtime, reference_ms: i64) -> bool {
+    if subject.whole_second { subject.ms + 1_000 > reference_ms } else { subject.ms > reference_ms }
Evidence
The PR introduces a sentinel i64::MAX for ms conversion overflow in file_mtime(), and then
unconditionally adds 1000ms in modified_at_or_after() for whole-second mtimes. If ms is
i64::MAX and whole_second is true, the addition overflows (panic/wrap), breaking the intended
conservative “treat as modified” behavior.

pnpm/crates/package-manager/src/optimistic_repeat_install.rs[861-868]
pnpm/crates/package-manager/src/optimistic_repeat_install.rs[876-889]

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

### Issue description
`modified_at_or_after()` performs `subject.ms + 1_000` when `whole_second` is true. However, `file_mtime()` sets `ms` to `i64::MAX` when `elapsed.as_millis()` can’t be converted to `i64`. This makes the addition overflow-able.

### Issue Context
Although real filesystem mtimes are extremely unlikely to approach `i64::MAX` milliseconds since epoch, the code explicitly introduces the sentinel value on conversion failure. Overflow here can panic in debug/test builds or wrap in release builds, which could incorrectly keep the optimistic fast path.

### Fix
- Change `subject.ms + 1_000` to `subject.ms.saturating_add(1_000)` (or `checked_add` with overflow treated conservatively as “modified”).
- Consider adding a small regression unit test for `FileMtime { ms: i64::MAX, whole_second: true }` to lock in the intended conservative behavior.

### Fix Focus Areas
- pnpm/crates/package-manager/src/optimistic_repeat_install.rs[862-889]

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


Grey Divider

Qodo Logo

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pnpm/crates/package-manager/src/optimistic_repeat_install.rs`:
- Around line 560-568: After successful single-project validation in the Rust
flow around assert_wanted_lockfile_equals_current, refresh or persist the
existing trusted validation marker so subsequent unchanged checks use the warm
fast path without adding extra filesystem or content checks. Apply the same
marker update mechanism in
pnpm/crates/package-manager/src/optimistic_repeat_install.rs lines 560-568 and
mirror it in pnpm11/deps/status/src/checkDepsStatus.ts lines 563-574.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6f210610-0a9f-4122-9ab9-0252ca38751b

📥 Commits

Reviewing files that changed from the base of the PR and between 0dfce95 and 4ba0a8e.

📒 Files selected for processing (7)
  • .changeset/repeat-install-coarse-mtime.md
  • cspell.json
  • pnpm/crates/cli/tests/stale_pin_dedupe.rs
  • pnpm/crates/package-manager/src/optimistic_repeat_install.rs
  • pnpm/crates/package-manager/src/optimistic_repeat_install/tests.rs
  • pnpm11/deps/status/src/checkDepsStatus.ts
  • pnpm11/deps/status/test/checkDepsStatus.test.ts

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

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

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
High-level
Prevent integer overflow when adding tolerance to mtime

Use saturating_add(1_000) in modified_at_or_after to prevent integer overflow
when subject.ms is i64::MAX.

Examples:

pnpm/crates/package-manager/src/optimistic_repeat_install.rs [887-889]
fn modified_at_or_after(subject: FileMtime, reference_ms: i64) -> bool {
    if subject.whole_second { subject.ms + 1_000 > reference_ms } else { subject.ms > reference_ms }
}

Solution Walkthrough:

Before:

fn modified_at_or_after(subject: FileMtime, reference_ms: i64) -> bool {
    if subject.whole_second {
        subject.ms + 1_000 > reference_ms
    } else {
        subject.ms > reference_ms
    }
}

After:

fn modified_at_or_after(subject: FileMtime, reference_ms: i64) -> bool {
    if subject.whole_second {
        subject.ms.saturating_add(1_000) > reference_ms
    } else {
        subject.ms > reference_ms
    }
}
Suggestion importance[1-10]: 8

__

Why: Using saturating_add prevents a potential panic or overflow wrap-around when handling fallback i64::MAX file timestamps.

Medium
General
Use stats.mtimeMs directly

Use stats.mtimeMs directly to maintain full precision.

pnpm11/deps/status/src/checkDepsStatus.ts [977-981]

 function modifiedAtOrAfter (stats: fs.Stats, referenceMs: number): boolean {
   const wholeSecond = stats.mtimeMs % 1000 === 0
-  const mtimeMs = stats.mtime.valueOf()
+  const mtimeMs = stats.mtimeMs
   return wholeSecond ? mtimeMs + 1000 > referenceMs : mtimeMs > referenceMs
 }
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: Using stats.mtimeMs instead of stats.mtime.valueOf() preserves sub-millisecond precision, preventing edge cases where truncation to whole milliseconds could lead to incorrect false evaluations.

Low
  • More

@blacksmith-sh

blacksmith-sh Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Found 3 test failures on Blacksmith runners:

Failures

Test View Logs
change command and intent-consuming version -r/
bare version -r applies the release plan and cleans up the intent
View Logs
test/errorHandler.test.ts/errorHandler.test View Logs
test/errorHandler.test.ts (5.926 s)/errorHandler.test.ts (5.926 s) View Logs

Fix with Codesmith
Need help on this PR? Tag /codesmith with what you need.

@zkochan

zkochan commented Jul 13, 2026

Copy link
Copy Markdown
Member Author

A couple of clarifications on the automated feedback:

On the "use stats.mtimeMs directly" suggestion — keeping stats.mtime.valueOf() for the comparison is intentional. The precise stats.mtimeMs is already used for the whole-second detection (% 1000 === 0); the comparison then runs at whole-millisecond granularity to match (a) the reference values, which are all whole-ms (Date.now(), mtime.valueOf()), and (b) the Rust port, which detects the whole second via subsec_nanos() == 0 but compares via as_millis(). Switching only the TS comparison to sub-millisecond would introduce a TS/Rust divergence to change behavior solely within a sub-1ms window the fast path never exercises (real edits land on later runs, seconds apart). So this is deliberate, not an oversight.

On the Blacksmith CI failures (change version-r, errorHandler.test.ts) — these are not caused by this PR:

  • The change tests run no pnpm install (no mocked registry, no install command), so they never reach the optimistic-repeat-install / checkDepsStatus code this PR touches. change.rs / apply.rs / changelog.rs are byte-identical to main on this branch, and the changelog writer has no mtime logic at all.
  • errorHandler.test.ts fails on pnpm publish's git-clean guard (ERR_PNPM_GIT_UNCLEAN instead of the expected ERR_PNPM_PACKAGE_VERSION_NOT_FOUND) — a publish/test-environment interaction unrelated to deps-status; it reproduces on main as well.

Both are pre-existing failures that the Blacksmith migration (#12969) exposed; they were previously masked by nextest's fail-fast stopping at the mtime failures this PR fixes. This PR's own added tests pass on both stacks.


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

@zkochan
zkochan merged commit 29efb4a into main Jul 13, 2026
29 of 36 checks passed
@zkochan
zkochan deleted the fix-repeat-install-coarse-mtime branch July 13, 2026 16:32
zkochan added a commit that referenced this pull request Jul 13, 2026
Temporary diagnostic. The optimistic repeat-install integration tests
flake on the Blacksmith Linux runner: an edit made in the same second as
the previous install is intermittently not detected, so the fast path
skips re-resolution. The whole-second-mtime handling in #12975
fixed the deterministic cases but not this residual flakiness, which
points at either a coarser-than-expected (or non-whole-second) mtime
granularity or skew between the wall clock (used for
lastValidatedTimestamp) and the filesystem mtime clock in the microVM.

Add a probe step that measures, on the actual runner, the fresh-file
mtime granularity, the wall-clock-vs-mtime delta, and whether two writes a
few ms apart get distinguishable mtimes. Runs on every Rust test OS so the
Blacksmith Linux/Windows behavior can be compared against GitHub-hosted
macOS. To be removed once the root cause is confirmed.
@github-actions

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
lockfile/parse_pnpm_lock       1.00     23.5±0.27ms    15.9 MB/sec    1.01     23.8±0.38ms    15.8 MB/sec
packument/parse                1.00     78.5±0.63µs   845.5 MB/sec    1.03     80.4±7.03µs   824.6 MB/sec
tarball/download_dependency    1.00      6.8±0.25ms   640.1 KB/sec    1.01      6.9±0.21ms   630.8 KB/sec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet product: pnpm@11 reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants