Repository navigation
fix(jsc): track ArrayBuffer ownership and inspect worker memory - #5
Merged
Merged
Conversation
Keep allocation-origin attribution with backing stores across transfers and VM teardown, while holder external and GC heap totals remain independent. Instrument Fast/Oversize allocation in C++, DFG and FTL, and service numeric worker inspections on the owning thread during loops and atomic waits. Include the matching Bun qualification adapter and execution-tier tests. Retain only the accounting-related visited-total atomics and the helper activity assertion lock exercised by the accounting collector path. Builds on oven-sh#303 and oven-sh/bun#34406; thanks @robobun.
Preserve both independently reviewed changes and their regression checks. Apply stack-position adapter 009 before accounting adapter 010, retain both changelog entries, and synchronize the two reviewed Bun header whitespace fixes. Accounting runtime and JSC test patch sections are unchanged. Combined-base direct AWS qualification and exact-head CI gate landing.
This was referenced Oct 5, 2026
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.
ArrayBuffer payloads now retain their allocation-origin charge across worker transfers while external memory follows the current holder. Previously, unmaterialized typed-array vectors were missing, GC-holder estimates moved the wrong charge between VMs, and worker statistics waited for the worker event loop to become idle.
The engine keeps separate origin, holder, native-object, and GC-epoch accounting. Fast/Oversize vectors are registered in C++, DFG and FTL, reconciled before sweep, and retired once during materialization. A packed weak link preserves view size, and Eden collections scan only the young prefix. Resizable, shared, native-adopted and WebAssembly storage have explicit ownership rules. JavaScript heap reporting and worker limits share the same backing-store classification.
Worker inspections run on the owning VM thread through traps, an idle drain and atomic-wait wakeup. Teardown disposes pending callbacks. The matching Bun adapter is included in the existing qualification pipeline; engine and Bun must be rebuilt together. This extends the read-only engine check. Artifact publication remains a coordinator action.
Builds on oven-sh/WebKit#303 and oven-sh/bun#34406; thanks @robobun.
Integrated onto source-position main
e9d324af5. Exact-head CI run 37242889997 is green ate95a3ef91cf0fda2d4e65ddc250513c0c669565c. The accounting adapter is 010, after the common stack-position adapter 009.Validation on one direct AWS c7a.24xlarge Linux host, using the unchanged lane recipe:
One initial API run exposed startup allocation timing in the new busy/wait fixture, also reproducible on the prior candidate. Settling startup before allocating the fresh payload preserves all assertions, the 64 KiB bound, and the consumer. Node and Bun then passed 20 busy plus 20 wait repetitions each before the complete rerun.
ABBA, eight samples per arm, against paired current-main engine plus the same common Bun adapters:
Tiny-array tracking costs approximately 2.2 ns per allocation in this workload. These costs are explicit; no consumer assertion or benchmark threshold was relaxed.