GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Fix yarn classic hosted scan lock rescans (#1423) by mikolalysenko · Pull Request #1426 · SocketDev/socket-patch Conversation
|
| scenario | base wall | head wall | Δ wall [95% CI] | requests |
|---|---|---|---|---|
yarn-classic/hosted |
472.5 ms | 204.1 ms | -56.2% [-59.5, -53.9] | 187 |
yarn-classic/rescan |
320.8 ms | 143.6 ms | -55.8% [-58.1, -53.7] | 127 |
yarn-berry/hosted |
225.1 ms | 224.6 ms | -0.9% ≈ | 127 |
yarn-berry/rescan |
187.6 ms | 184.1 ms | -1.0% ≈ | 127 |
Against the commit before #1328 (f864148):
| scenario | base wall | head wall | Δ wall [95% CI] | requests |
|---|---|---|---|---|
yarn-classic/hosted |
176.3 ms | 208.9 ms | +17.7% [+13.5, +22.5] | 127 → 187 |
yarn-classic/rescan |
137.1 ms | 145.4 ms | +3.5% [-5.4, +13.2] ≈ | 127 |
Most of the remaining hosted delta comes from the 60 served-tarball downloads
(plus gunzip and hashing) that #1328 added deliberately, for the #558 sha1 and
the #591 dependency check. #1423 itself calls those downloads intentional, so
this PR leaves them in place. Callgrind on the hosted scan: total instructions
dropped from 1.74G to about 1.1G. yarn_classic_artifact_targets went from
68% inclusive to under 4%, and unlocked_among went from 29% to 0%.
| issue | test | red → green |
|---|---|---|
| #1423 (target selection) | hosted::engine::tests::classic_artifact_targets_read_the_lock_blocks_at_most_once counts block reads: 0 on a fully pinned rescan, exactly 1 for 200 unpinned deps |
fails (left: 1, right: 0) if the cheap pinned filter moves behind the block read. An earlier timing version of this test took 58 s with per-dep scans and 1.7 s with the fix |
| #1423 (target selection) | quoted_fragment_urls_reads_each_resolved_url, classic_registry_copy_is_matched_by_block_name_and_source (updated to the set) |
new / existing |
| #1423 (#591 check) | classic_deps::tests::unlocked_descriptors_in_matches_the_block_scan (the set form agrees with the block scan) |
new |
Commands run locally:
cargo fmt --all -- --check: cleancargo clippy --workspace --all-features -- -D warnings: cleancargo test --workspace --all-features: 14229 passed, 13 failed. All 13main in this sandbox and none touch yarn code. Ten arecovgap_commands_vendor::*_state_write_failure_* andvendor::pypi_poetry::tests::wire_write_failure_*. The others needpatches-api.socket.dev, which the proxy blocks, for examplee2e_bun_lockb::binary_shared_bundled_record_hosted_pin_is_managed.scripts/yarn-classic-vex-matrix.sh 1.22.22 1.0.2 (real yarn,SOCKET_PATCH_YARN_E2E_REQUIRED=1): exit 0, every suite passed (110 PASScargo test -p socket-patch-cli --test scan --test hosted_memory_engine --test e2e_redirect_yarn_classic_build --test e2e_vendor_yarn_classic_build --test e2e_vendor_yarn_classic_dev_flow:/code-review high, findings not fixed)yarn-berry's berry_lock_locks scans per dep too. That is a different🤖 Generated with Claude Code
https://claude.ai/code/session_018G3cdPFQuuBbZahpQSKpoB
Generated by Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
A hosted scan of a yarn classic project re-read the whole yarn.lock once per patched package to decide which served tarballs it must fetch. On a 3000-package lock with 60 patches that made hosted scans about 2.6x slower than before #1328, even on a rescan that fetches nothing. The lock's registry copies are now collected in one pass, and the cheap "lock already pins this artifact" test runs first, so a rescan of a fully pinned lock never reads the blocks at all. The selected tarballs are unchanged. Fixes #1423 Assisted-by: Claude Code:claude-opus-5-5
Keep the old quick "is this name in the lock at all" check before the registry-copy lookup, so a grant for a package the lock never mentions costs a substring search, not a read of every block. The blocks now come from the shared memoized scan, which the rewriter also reads later in the same run. The regression test counts lock reads instead of timing them: none on a fully pinned rescan, exactly one for many unpinned deps. It fails if the cheap filters move back behind the block read. Refs #1423 Assisted-by: Claude Code:claude-opus-5-5
A hosted scan of a yarn classic project downloads each patched package's served tarball to check its sha1 and dependencies. Those downloads ran one at a time, so 60 patches cost 60 round trips in a row. They now run through the same ordered, bounded window the patch record fetch uses, and the results are folded in the same order as before, so pins, skips and --debug output are unchanged. A new test serves three tarballs (slow, fast, missing) and checks each pin carries its own tarball's sha1 and only the missing one is skipped. Refs #1423 Assisted-by: Claude Code:claude-opus-5-5
The yarn classic dependency check (#591) runs once per patched package and split every key of yarn.lock into its patterns each time, even when the served package has no dependencies at all. On a large lock this was the biggest remaining cost of a hosted scan. It now returns at once when there is nothing to look up, and only splits the keys whose text names one of the wanted packages. The result is the same set of unlocked descriptors as before. Refs #1423 Assisted-by: Claude Code:claude-opus-5-5
Picking the served tarballs to fetch still searched the whole yarn.lock twice per patched package: once for its pinned URL and once for its name. The lock is now read once for every URL it pins with a fragment, and each package is a set lookup. Refs #1423 Assisted-by: Claude Code:claude-opus-5-5
This reverts commit ee84a85.
The yarn classic dependency check (#591) runs once per patched package and split every key of yarn.lock into its patterns each time. On a large lock that was the biggest remaining cost of a hosted scan. The rewriter already splits each key once, so the check now uses a set built from those patterns, made the first time a package needs it. The result is the same set of unlocked descriptors. Target selection also goes back to a plain block scan (the shared memo it used is not read by the hosted rewriter, so it only held a copy of the lock), and builds its pinned-URL set only once a package with a sha1 asks for it. Refs #1423 Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ 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 9d0c1bc. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Labeled Ready for review at head
Slack announcement not sent this run (Slack send unavailable); the next run will retry. Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Final review briefWhat it does: Removes the 2.6x slowdown in yarn classic hosted scans that #1328 introduced (#1423). Two checks that re-read the whole Risk: low. It refactors the code into precomputed sets and keeps the same predicates ( Look here
Verified
Changes I made: none. Open questions (non-blocking):
Auto-merge is armed, so approving sends this straight to the merge queue. Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
* ci(release): publish npm from release.yml, not publish-npm.yml Every socket-patch npm package's trusted publisher is registered against release.yml, and npm allows only one publisher per package. The 5.0.0 release dispatched publish-npm.yml, whose OIDC token named that file, so npm rejected it with E401 before staging anything. Move the npm leg back inline as release.yml's npm-publish job (same steps as publish-npm.yml) and delete publish-npm.yml, so the existing registration keeps working. Add an `npm-retry-version` input that skips the version gate, build, tag, GitHub release and crates.io jobs and re-stages npm from an existing release's assets; this retries 5.0.0 now and replaces the manual Publish npm dispatch. crates.io stays dispatched through publish-cargo.yml, since crates.io allows several publishers per crate. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * chore(release): fold 22 more PRs into the 5.0.0 notes Cover the PRs merged to main after #1432's base (1779317..4cb3643): Cargo source replacement and registry = "crates-io" (#338/#455, #386), pnpm lockfile=false (#1074), berry removed descriptors (#1435), yarnrc ${VAR} reads (#1100), CRLF .npmrc append (#1196), Composer vendor-dir cascade and global home (#439/#686, #586), Go +incompatible vex (#484), gem moved BUNDLE_GEMFILE and commented Gemfile revert (#952, #988), Poetry source = "pypi" (#1282) and Hatch path characters (#547). No entries for #1411 (macOS fix to code #1393 added in this release; the #1393 entry already describes the intended behavior), #1426 (perf regression introduced and fixed within 5.0.0) or the CI/test/bench PRs. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * chore(release): cover #1419, #1434, #1440, #1442, #1444 in the 5.0.0 notes Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * chore(release): 5.0.1 Cut [Unreleased] into [5.0.1] — 2026-10-13 and stamp 5.0.1 with scripts/version-sync.sh. The 5.0.1 notes cover main through 501c6d9 (#1449), i.e. every PR after the v5.0.0 tag (6ad6add): the npm publish fix (5.0.0 never reached npm or crates.io, 5.0.1 is the first v5 there), #1465, #759, #1460, #1462, #1445, #869, #1447, #1450, #1467, and #1449 under Maintenance. CI/test-only PRs (#1448, #1452, #1454, #1457, #1459) have no entries. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * chore(release): 5.0.1 notes for PRs merged since the cut Covers #1469, #1470, #1474, #1475, #1478, #1479, #1480 and #1482; #1484 is CI-only. The notes now cover main through 285a5e8. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Perf regression: yarn-classic/hosted wall +165% (5096c41a, #1328)
There was an error while loading. Please reload this page.