Problem
On Linux x86-64 with Zig 0.17.0-dev.1818+7051f8e73, both the ordinary and TSan unit shards fail Context heap_limit_bytes never publishes a torn object under recovery pressure before the JavaScript pressure loop executes. The escaping OutOfMemory comes from annexbPushLexical growing its temporary NameStack through the realm arena while scanning the top-level const declaration.
Evidence: CI run 32338430544, unit shard 0 and TSan shard 0. The same full suite passes locally on macOS (1,738 pass / 1 skip), so the test currently depends on host allocation size rather than only the declared 4 MiB realm contract.
Required implementation
- Make Annex B B.3.3 analysis use reclaimable invocation scratch with explicit lifetime, including the lexical name stack and candidate indexes.
- Preserve the heap-limit security boundary: do not raise the test limit, bypass accounting for input-sized storage, skip Annex B analysis, or swallow OOM.
- Publish no partial legacy-binding state when scratch allocation fails.
- Preserve interpreter/VM semantics for sloppy block functions and strict-mode exclusions.
Acceptance
- The focused recovery-pressure witness passes under exact dev.1818 on Linux and under TSan.
- Existing Annex B semantic tests pass.
- Full unit suite and dependency audit pass with no leaks.
- Add a focused ownership/lifetime witness if the corrected scratch path is not already directly observable.