Skip to content

Heap: retain young survivors across multiple minor collections #37

Description

@chrisbbreuer

Context

The current nursery is one-cycle: every live young cell is immediately tenured. zig-js #145 needs measurable multi-age survival before it can tune promotion policy or admit parallel mid-script minor collection.

Scope

  • Add a configurable, bounded tenuring age while preserving the young-prefix invariant.
  • Age live young cells across minor collections and promote only at the configured threshold.
  • Keep old-to-young owner cards and conservative target cards sound across repeated minors.
  • Adapt nursery sizing from all live young survivors, not only newly promoted bytes.
  • Publish exact young, survivor, promotion, and policy telemetry.
  • Keep full collection and nursery disable as explicit tenure boundaries.

Acceptance

  • Deterministic tests prove survival through multiple minors, threshold promotion, dead-young reclamation, persistent strong/weak cards, full-collection reset, and accounting.
  • Existing one-cycle behavior remains the default until an embedder selects a higher age.
  • Normal library tests and zig-js focused generational tests pass.

Downstream: zig-utils/zig-js#145

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