Bench: cover Bun isolated .bun store; fix rescan restore - #667
Conversation
Bun 1.3.2+ installs with the isolated linker by default, keeping every package only in node_modules/.bun/<name>@<version>/node_modules/<name>. #496 taught the npm crawler (scan, apply's resolver, VEX) to walk that store, but the suite only had a hoisted Bun layout, so the new walk was never timed and a regression back to "2700 lockfile-only packages" would have gone unnoticed. Add bun-isolated/{hosted,rescan}: the same text bun.lock as bun/*, with a pnpm-shaped .bun store, per-entry dependency links, Bun's .bun/node_modules hoist links and root links for direct deps only. A pre-#496 binary fails it (lockfileOnlyPackages: got 2700, want 0). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
bugbot run Generated by Claude Code |
|
Ready for review at
Generated by Claude Code |
|
Codex review of Reviewed all three changed files, fixture registration, dependency/version resolution, and scoped/unscoped symlink targets. Validation passed:
Full current-head CI is clear: 245 successful checks, six skipped; six successful workflows, two skipped. Exact-head Bugbot is clear, with no unresolved review threads. The unchanged source merges cleanly with current main The two debug scenario runs validate correctness; they do not independently establish the author's performance comparison. No source changes were needed. |
A rescan's preparatory scan returned early on a validation failure, skipping the tree restore. The project stayed rewritten, so in `compare` the other binary's next run started from a rescanned tree and was reported INVALID for the first binary's fault: on the 2026-10-04 weekly A/B a pre-#496 base failed bun-isolated/rescan's prep and the head (valid on its own) was flagged invalid too. Restore before returning the error, as the measured run already does. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Gubp3gsnxFDvRbguaeLqT
|
bugbot run Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 93b1c92. Configure here.
|
[burn-down agent] Still Ready for review, now at
Generated by Claude Code |
What main changed
#496 (
35de7548, "Fix npm crawler missing Bun, Deno and Yarn 4 stores") made the npm crawler walk Bun's isolated store,node_modules/.bun/<name>@<version>/node_modules/<name>, in scan, apply's resolver and VEX. Bun 1.3.2+ uses the isolated linker by default. The suite only had a hoisted Bun project (bun/*), so this path was never timed or validated.Suite changes
bun-isolated/hostedandbun-isolated/rescan(3000 packages, 60 patched). They use the same textbun.lockgenerator asbun/*, with a pnpm-shaped.bunstore: per-entry dependency symlinks, Bun's.bun/node_moduleshoist links, and root links for direct dependencies only, so 2700 of the 3000 packages exist only in the store. TheExpectmatchesbun/*: every package scanned, 60 redirected,bun.lockrewritten.93b1c929, harness): when a rescan's preparatory scan failed validation,run_oncereturned before restoring the tree. Incomparethe other binary then started from a rescanned project and was reported INVALID by mistake. The 2026-10-04 weekly A/B hit this: the pre-Fix npm crawler missing Bun, Deno and Yarn 4 stores (#366, #373, #405, #495) #496 base failedbun-isolated/rescan's prep, and the head, which validates on its own, was flaggedredirect.rewrittenFiles: got [], want ["bun.lock"]. The harness now restores before returning the error.Validation (4 vCPU Intel Xeon @ 2.80GHz cloud sandbox)
runon main045d7ec7, 3 runs:bun-isolated/hosted321.9 ms,bun-isolated/rescan332.6 ms, 127 requests, 34.8 MiB peak RSS. Both validate.1169ae68) fails it withlockfileOnlyPackages: got 2700, want 0.compare(default 15 pairs): hosted +0.8% [−2.1, +6.1], rescan −0.7% [−4.0, +6.4]. No regression.strace -f -e trace=execveon aserverun shows onlyenv→socket-patch, so no subprocesses.cargo fmt -p socket-patch-bench,cargo clippy -p socket-patch-bench --all-features --all-targets -D warningsandcargo test -p socket-patch-bench(29 passed) are all clean.2463257avs main onbun-isolated/rescan+yarn-berry/rescannow reports only the base invalid. A/A, 7 pairs:npm/rescan+1.2% [−10.2, +13.9],bun-isolated/rescan+1.2% [−7.9, +12.2],poetry/rescan−4.8% [−11.0, +12.3]. No regressions. fmt, clippy-D warningsand tests (29 passed) are clean.Time budget
The harness fix doesn't change timing (restore runs only on a failed prep). A default (15-pair)
compareof the two new scenarios took 89 s on this sandbox, fixture builds included. On this machine a 9-pair compare of the existing 39 scenarios took 8.4 min. GitHub's 4-core runners have run faster than this sandbox so far, so a full default compare should stay near the ~12 min target. If it goes over,bun/rescanis the first candidate to drop, since its code path is now covered twice.🤖 Generated with Claude Code
https://claude.ai/code/session_016Gubp3gsnxFDvRbguaeLqT
Note
Low Risk
Changes only the benchmark harness and fixtures; the rescan restore fix improves test isolation with no production runtime impact.
Overview
Adds
bun-isolatedhosted/rescan scenarios tosocket-patch-benchso timing and validation cover Bun 1.3’s default isolatednode_modules/.bunstore (samebun.lockas hoistedbun, but a pnpm-shaped symlink layout with most packages store-only). The README now separates hoistedbunfrombun-isolated.Fixes a harness bug in
run_once: when a rescan’s preparatory scan fails validation, the work tree is restored before returning the error so A/Bcomparedoes not leave the next binary starting from a partially rewritten fixture and failing validation incorrectly.Reviewed by Cursor Bugbot for commit 93b1c92. Configure here.
Generated by Claude Code