Parent: #24, #11.
The PR-249 semantics/oom-one-thread.js witness now exercises zig-js's real Context.Options.heap_limit_bytes cap instead of relying on the vendored JSC RAM-cap directive. That makes the remaining failure shape much sharper: the cap fires, but the allocation pressure escapes as a whole-Thread completion OutOfMemoryError instead of being caught by the allocating JS frame's local try/catch.
Current probe evidence:
FAIL semantics/oom-one-thread.js: OutOfMemoryError: Context heap limit exceeded
This is different from the already-landed reserved thread OOM completion object: that path is correct for thread startup/completion pressure where JS execution cannot publish a fresh exception object. Here, the allocation happens inside running JS, so the ideal contract is a catchable JS exception at the allocation site.
Acceptance:
- Allocations that exceed
Context.Options.heap_limit_bytes inside an active JS frame throw OutOfMemoryError into that frame.
- A local JS
try/catch around the allocating expression can observe the OutOfMemoryError before it becomes the whole Thread completion result.
- Host entry pressure before a JS frame exists may still surface as Zig
error.OutOfMemory / top-level evaluation failure where appropriate.
semantics/oom-one-thread.js passes or progresses past the allocation-site catchability blocker.
- Existing thread OOM survivor/recovery tests stay green, including sibling join behavior after one thread hits the heap cap.
Parent: #24, #11.
The PR-249
semantics/oom-one-thread.jswitness now exercises zig-js's realContext.Options.heap_limit_bytescap instead of relying on the vendored JSC RAM-cap directive. That makes the remaining failure shape much sharper: the cap fires, but the allocation pressure escapes as a whole-ThreadcompletionOutOfMemoryErrorinstead of being caught by the allocating JS frame's localtry/catch.Current probe evidence:
This is different from the already-landed reserved thread OOM completion object: that path is correct for thread startup/completion pressure where JS execution cannot publish a fresh exception object. Here, the allocation happens inside running JS, so the ideal contract is a catchable JS exception at the allocation site.
Acceptance:
Context.Options.heap_limit_bytesinside an active JS frame throwOutOfMemoryErrorinto that frame.try/catcharound the allocating expression can observe theOutOfMemoryErrorbefore it becomes the wholeThreadcompletion result.error.OutOfMemory/ top-level evaluation failure where appropriate.semantics/oom-one-thread.jspasses or progresses past the allocation-site catchability blocker.