Repository navigation
test(vm): measure retained memory after cache warmup - #131
Merged
Merged
Conversation
Adapt the live-cell and batched-collection approach from oven-sh#42474 while preserving 10000 scripts in every profile and the original 200/700 MiB RSS bounds. Compare the second half against an identical warmup workload so allocator and code-cache startup do not masquerade as retained growth.
steipete
marked this pull request as ready for review
October 5, 2026 19:41
steipete
marked this pull request as draft
October 5, 2026 22:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The existing
vm.Scriptleak test exceeds its 200 MiB cold RSS limit even when its wrappers and source providers are reclaimed. This change warms the allocator and code cache with 5,000 scripts, then measures the full 10,000-script workload. It collects between bounded batches and checks liveScriptcells. The 200 MiB release / 700 MiB ASAN limits and existing deadlines are unchanged. The measured 32 KiB sources total 312.5 MiB, so native source retention remains detectable.Measuring all 10,000 scripts preserves the original per-script RSS budget. The final integration review identified that an earlier half-window proposal did not; the corrected full-workload guard has a scoped-clean P2 review.
Matched builds of Bun
0e6a7b354732a887a937f396db1283b8a1bd644eagainst three immutable WebKit releases produce overlapping distributions. On the fork'smacos-15shape, with its runner GC and integrity-audit settings:42ab38d705(before coordinate cache)641c15f928(coordinate cache)f1e1ca1156Across five separately reported local/CI configurations, all 180 unchanged test executions fail. Native provider instrumentation records zero coordinate lookups on the original workload’s vm.Script providers, approximately 98,000 providers destroyed per 100,000 scripts, and at most 2,000 retained providers. A separate stack-heavy workload exercises the coordinate cache and still tears down providers within that bound. This result does not call for a WebKit change.
The corrected guard passes 9/9 local runs across the three engines; observed growth is 154.47–155.38 MiB. It detects all 9/9 cases for each deliberate-retention control: wrappers reach 15,002 live
Scriptcells; retained returned functions leave the Script count at two and grow RSS by 603.48–604.73 MiB; retaining a 25 KiB native buffer per script also leaves the Script count at two and grows RSS by 431.59–433.25 MiB. Control totals include the warmup. Native instrumentation independently confirms 15,000 providers created and zero destroyed for the function-retention control.Three-engine CI qualification 37383373462 verifies all 15 guard/control gates. The real guard and observed normal case pass at their default timeout; deliberate-retention mutants use a diagnostic ceiling so they must reach the intended assertion. CI normal growth is 153.16–154.42 MiB; all three wrapper, function, and native-buffer controls are detected. These artifacts separately bind runtime source
0e6a7b354, embedded build revision5c441bf48, each engine, each binary hash, and the corrected guard hash.Exact product head
3e067ca205a7e7c130919133e700120e51bca6f4, based on main after #113, #132, and #130, passes the focused default-timeout guard, all seven VM files, both setup checks, and all three retention controls locally. Its tree stays clean and the runtime/engine identities are verified. P2 review is scoped-clean. Final native CI 37383859719 passes on its first attempt: Linux 16/16 and Darwin 12/12, including the VM guard at 2.54 seconds on Darwin. Its tested merge tree equals the reviewed product tree. Format and JavaScript lint pass.Adapts the live-cell and batched-collection approach from the still-open oven-sh/bun#42474, while preserving this fork's RSS limits and full measured workload. The runtime and engine pin are unchanged.
The earlier
43b87ed44head had the named Darwin watcher failure: run 37358157982, attempt 1, Darwin job 111925745591. Attest/js/node/watch/fs.watch.rewrite.test.ts:94,expect(seen.some(p => p.startsWith("a/"))).toBe(false)expected false and received true after a recursive rename; runner cleanup subsequently raisedENOTEMPTY. The VM row and every other row passed. The cancelled old-head retry is not qualification evidence. No watcher assertion, skip, or deadline changed. Separate comparison reproduces the same delayed seed-event class on official upstream canary13a98b0dbd(3/80 trials) and the fork (4/80), with matching watcher/test blobs; this is upstream-parity evidence, not a product fix or a trace of the original CI process.