Skip to content

Shape tree (#6759 Phase C): tracking + design review #6798

Description

@proggeramlug

Tracking issue for #6759 Phase C (shape tree), per the parent issue's "own tracking issue + design review" gate.

Design doc: docs/shape-tree-plan.md, landing in #6797 — review of that doc is the design review. Core thesis: a shared keys_array already IS a shape (mutation always forks), the transition cache already IS the edge set, and typed_feedback/read-plan/wide-index already key on keys_array identity — Phase C promotes this to first-class Shape records and re-points consumers rung by rung.

Ladder (each rung lands independently behind green suites):

  • C1 — shapes as first-class records; subsume per-object KEYS_INDEX + 4-entry WIDE_KEY_INDEX LRU → perf(runtime): #6759 Phase C1 — first-class Shape records keyed on keys_array identity (+ Phase C design doc) #6797
  • C2 — property attributes + accessor-presence facts move into the shape (shape-split on descriptor install; diverged objects hang state off the Phase B meta record)
  • C3 — shape pointer becomes object identity: unify class_id / literal shape ids / keys_array identity; codegen ICs + prop plans compare shape ids; keys_array demoted to a shape-owned enumeration artifact. Subsumes FIELD_CACHE, transition cache, read prop-plan. Own design review before landing (touches codegen + GC + every object path).
  • C4 — dictionary mode formalized for wide/high-churn objects (today: ad-hoc thresholds 32/257 + delete compaction), authoritative per-object map in the meta record, off the transition system
  • C5 — typed_feedback exactness: shape-adjacent guard families (object_get/set_by_name, class_field_get/set, method_direct_call) vet one exact shape id instead of re-deriving getter/setter/descriptor/prototype facts per call; representation-change invalidation gated on "shape actually changed"

Acceptance (from #6759): read/write/define/in/Object.keys within ~1.5× node across the micro suite; babel-class module init ≤2× node.

Known hard problems (doc §risks): class instances with keys_array == null (fourth shape representation, no array to key on); enumeration-order preservation through C4; per-thread shape tables on workers.

Prerequisites: #6795 (Phase A), #6796 (Phase B).

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