Files
scriptc/packages/runtime
Malte UblandClaude Opus 5.5 062c77c05a Restore survivors from the recorded gray set instead of whitening
scan walked every referenced component from its candidates, whitening
each object it reached and restoring the subgraphs of the externally
referenced ones, so garbage inside a live component was walked a second
time and objects whitened before a later root restored them were walked a
third. markGray already records every gray object in a pass of up to 64k
objects, and the survivors are exactly what the externally referenced
ones reach. So scan now sweeps the recorded entries of the referenced
components once, restores from each one that is still gray and
referenced, and drops survivors from the list as it sees them; what stays
gray is the dead set, with no whitening walk. A pass too large to record
still walks scan, but restores from its referenced candidates first. On
test_cycle's growing chain this cuts the objects traced from 1.53M to
1.06M, and the work-bound check now passes at thresholds 2 and 7 with a
growth cap of 1, where it failed before.

Every walk also visits a dense cycle-capable array's elements itself, in
a per-phase loop kept out of line so the per-edge visitors stay small,
instead of calling scr_arr_trace_v's indirect visit per element. Arrays
with sparse entries, properties or metadata keep the trace callback. The
array descriptor's kind is what identifies them, so it is reserved.

The new corpus program mixes dead and live structures in one pass,
inner nodes held from outside, arrays with holes and sparse slots, and a
live tree too large for a pass to record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 06:24:00 -07:00
..
2026-07-22 18:08:04 -05:00
2026-10-17 13:47:41 -05:00