Skip to content

repsel: promotion census — make "zero values promoted" a visible, gated state instead of an invisible one #7106

Description

@proggeramlug

--opt-report (#6952) can tell you, for one build, which values got an unboxed
representation and which did not. What it cannot do is tell you that the answer
changed — or that it has been zero all along.

#7034 established the state of things by hand-instrumenting the compiler:

  • Ptr<Shape> promotes nothing at all on benchmarks/app-patterns/kernels/batch.ts,
    the object/property-heavy program that representation exists for.
    PERRY_PTR_SHAPE_LOCALS=0 versus the default produced a byte-identical
    binary (4,294,904 bytes, __text 3,804,424).
  • Across benchmarks/suite, only 3 files promote a shape local, and each
    promotes exactly one.

Nobody knew any of that until somebody went looking. That is the failure to
make impossible to repeat.

Ask

A per-workload, per-representation census recorded as a ratcheted baseline,
so a drop turns a build red.

Per representation, not aggregated: the interesting signal is Ptr<Shape> = 0
while canonical Str ≠ 0. One total hides exactly that.

The hard part

CLAUDE.md, "★ Four ways a gate can be unable to fail", case 4 — the gate runs
but its subject never did
. A census that faithfully reports Ptr<Shape>: 0
and exits green is worth nothing: that is the state the project is in
today.
So the census needs, beyond floors:

  • floors that can actually be violated (the honest floor for Ptr<Shape> on
    real code is zero, and a zero floor can never fail);
  • a liveness assertion on the instrument itself — a fixture that definitely
    promotes, which fails the census if its count reads zero, so that "zero
    because nothing promoted" is distinguishable from "zero because nobody
    increments the counter";
  • verification by sabotage in both directions.

Related

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