← board

Adaptive heap growth policy (research / north-star — not scheduled)

Track O (heap allocator) — lands under A's gate. Research item, deliberately low prio: pick up only for fun or if a profile forces it. Recorded so the end-state and its cheap slices are on the board; NOT a queue item to grind.

The vision

A growth policy that adapts to size + access pattern + target: predict from current allocated size, whether the site is in a loop, how fast it has grown, and the target's memory ceiling — instead of one fixed factor. Genuinely a research project (per user); its ROI is low against correctness work, and its cheaper slices ([[feature-opt-alloc-intent-hint]], and the note below) capture most of the win. This supersedes the hint feature and the quantum band-aid — do NOT pursue all three in parallel; take the smallest slice a profile pulls.

Design constraints already reasoned out (this session)

Folded band-aid (was a candidate ticket, kept here as a NOTE, not filed)

Cheapest possible shortcut, drop-in, no analysis: round any modified managed string's capacity up to a small quantum (8-16 B). Turns realloc-per-byte into realloc-per-8th (~8x fewer reallocs) invisibly. HONEST caveat: constant-factor only — still O(n^2) for a real hot loop (n^2/8), so it papers over one-shot cases, NOT accumulation. Ship it ONLY if the per-byte pattern resurfaces in a profile; today it does not (the one site that mattered, pyfile_slurp, is fixed properly). This note is the entire "quantum band-aid" — it does not need its own ticket.

Why parked

Everything above is constant-factor / peak-shaping polish. The asymptotic wins are already banked (preallocate-where-known + amortise-where-not + trim-at-end). A profiler should PULL any of this; do not PUSH it.