Skip to content

ABI: implement heap snapshots and profile serialization #403

Description

@chrisbbreuer

Parents: #140, #143, #246
Roadmap: #134

Implement the three remaining pinned heap-profiler boundaries as real graph snapshots, including both Bun string formats and the JSC object-returning API. This is also the heap-snapshot prerequisite for promoting the remaining PR-249 collection tests.

Scope

  • Pin Bun 4982b91e and WebKit cd821fec snapshot schemas, source identities, and Home signature divergence.
  • Snapshot all strong roots across sibling realms at a quiescent VM boundary without changing user-visible state.
  • Preserve stable node IDs, cell kinds/class names, shallow sizes, named/indexed edges, roots, and weak-edge semantics.
  • Implement JSC__JSGlobalObject__generateHeapSnapshot as parsed GCDebugging snapshot data.
  • Implement Bun__generateHeapSnapshotV8 with valid V8 nodes/edges/string tables.
  • Implement Bun__generateHeapProfile from the same graph with exact aggregate/retained-size reporting.
  • Handle the Bun bun.String vs Home *String return ABI and ownership correctly.
  • Cover arena and precise-GC contexts, cycles, sibling realms, weak references, ArrayBuffer/external bytes, OOM/failure atomicity, and repeated snapshots.
  • Promote the applicable PR-249 heap-snapshot/preventCollection reference case with an explicit disposition for JSC-only hooks.
  • Add bounded Debug, ReleaseSafe, and sanitizer evidence; refresh inventories, README counts, and roadmap evidence.
  • Close only after fixing CI is green.

No placeholder JSON or count-only output: consumers must be able to parse/traverse the graph and use the V8 snapshot with standard tooling.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions