Skip to content

node:v8: snapshot and profiler output parity cut #3296

Description

@andrewtdiz

Summary

Create the medium PR boundary for package-visible V8 diagnostic output surfaces that can return Perry-shaped data while preserving Node's observable stream/file/report contracts.

Child Issues

Intended PR Boundary

Implement the diagnostic-output layer after the basic node:v8 namespace exists:

  • v8.getHeapSnapshot([options]) returns a readable stream that emits heap-snapshot-shaped JSON.
  • v8.writeHeapSnapshot([filename[, options]]) writes a non-empty heap snapshot file and returns the written path.
  • new v8.GCProfiler() exposes start, stop, and disposal behavior with a Node-shaped report object.
  • Add or extend a V8 parity fixture to cover stream/file/report shapes without requiring exact V8 heap internals.

This cut is coherent because all children are diagnostic outputs where Perry-specific internal data is acceptable if the Node-observable shape, stream/file lifecycle, and error behavior match.

Node Behavior

Node v25.9.0 returns a readable HeapSnapshotStream from getHeapSnapshot(), writes .heapsnapshot files through writeHeapSnapshot(), and exposes GCProfiler instances whose start() returns undefined and stop() returns a report with keys such as version, startTime, statistics, and endTime.

Perry Behavior

docs/runtime-parity.md and docs/runtime-parity-gaps.md list the V8 snapshot/profiler APIs. Source search found no public node:v8 heap snapshot or GCProfiler implementation, and this checkout has no dedicated V8 parity fixture.

Duplicate searches run before filing:

  • node:v8 heap snapshot GCProfiler profiler output diagnostics parity cut
  • node:v8 diagnostics serialization heap statistics snapshot promiseHooks startupSnapshot GCProfiler parity cut

Non-goals

Acceptance

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