You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Define and maintain the public heap-cap and per-thread OOM contract for zig-js contexts, including how allocation pressure is surfaced to hosts and to shared-realm Thread joiners.
Current status
The original PR-249 blocker semantics/oom-one-thread.js is now promoted. GC-backed capped contexts can collect and retry at safe GC cell allocation failures and ArrayBuffer byte allocation failures, and the reference recovery witness passes.
Implemented contract:
Context.Options.heap_limit_bytes applies a thread-safe outstanding-byte budget to Context-owned allocator traffic.
Context.heapBudgetStats() reports limit, used, peak, and remaining bytes for capped contexts.
Top-level host evaluation reports unrecovered cap pressure as Zig error.OutOfMemory.
A capped context prebuilds an immutable OutOfMemoryError object so shared-realm Thread completion can publish a deterministic JS error value even when ordinary heap allocation is exhausted.
join() rethrows that reserved object, and already-created asyncJoin() reactions reject with it when they can be delivered.
Allocation-site OOM can become catchable by active JS handlers in the covered interpreter/tree-walker paths, including catch-binding pressure that has pre-reserved environment storage.
Arena-backed caps remain fail-closed and non-reclaimable unless callers opt into GC-backed recovery.
GC-backed capped contexts can recover after unreachable pressure is collected at safe allocation-recovery points.
Child tracker from #11/#16/#1.
Goal
Define and maintain the public heap-cap and per-thread OOM contract for zig-js contexts, including how allocation pressure is surfaced to hosts and to shared-realm
Threadjoiners.Current status
The original PR-249 blocker
semantics/oom-one-thread.jsis now promoted. GC-backed capped contexts can collect and retry at safe GC cell allocation failures and ArrayBuffer byte allocation failures, and the reference recovery witness passes.Implemented contract:
Context.Options.heap_limit_bytesapplies a thread-safe outstanding-byte budget to Context-owned allocator traffic.Context.heapBudgetStats()reports limit, used, peak, and remaining bytes for capped contexts.error.OutOfMemory.OutOfMemoryErrorobject so shared-realmThreadcompletion can publish a deterministic JS error value even when ordinary heap allocation is exhausted.join()rethrows that reserved object, and already-createdasyncJoin()reactions reject with it when they can be delivered.Remaining linked work
Acceptance criteria
Threadcan hit OOM while siblings and cleanup/finalization remain well-defined.