ReviewOS

zig-utils/zig-js

GC: recover bounded heaps for interpreter side-storage allocation

#399
Closed chris opened this 9 days ago ·
9 days ago

Parent: #134

The bounded-heap object side-store regression test could exhaust its 4 MiB budget with zero collection attempts. Interpreter environments, promise reactions, and ArrayBuffer-owned buffers allocated through GcCellBacking; delegated non-cell allocations held that allocator's internal lock, where recursive allocation recovery is intentionally blocked. Cell slabs now remain on GcCellBacking, while interpreter-owned reclaimable side storage uses the Context budget allocator directly so an allocation miss can collect at a safe outer boundary.

Acceptance

  • Route GC-mode interpreter side storage through the Context allocator, separately from GC cell slabs.
  • Preserve exact finalization/accounting for environments, promise reactions, and ArrayBuffers.
  • Prove the bounded-heap side-store workload performs at least one collection and completes.
  • Keep the allocator-internal recovery suppression invariant intact.
  • Record the affected Debug/ReleaseSafe fixing CI and close.
9 days ago

Implemented in a423b52f. The formerly failing 4 MiB workload now completes and asserts that at least one collection occurred. Unit shard 1 passes 308/308, and the focused regression passes in Debug and ReleaseSafe with zero leaks. Awaiting fixing main CI.

9 days ago

Completed on main at a423b52f. The exact bounded-heap recovery regression is green in unit shard 1; optimized/concurrent coverage is independently green in releasesafe-threadfuzz and focused-engine-tests. The workload now performs collections instead of reaching OOM with zero recovery attempts.

Sign in to comment on this issue.