Problem
The unit test Context heap_limit_bytes never publishes a torn object under recovery pressure fails on current main after the shape transition representation changed. The 4 MiB cap is reached during the live-hoard fill at 10,018 retained objects, but that OOM is swallowed. The test then requires at least one of 500 smaller post-recovery rounds to OOM; all 500 can now complete after recovery, so the assertion reports failure even though the cap and recovery path were both exercised.
This was found while validating #533 and reproduces on pristine main without that patch. Related historical torn-object issue: #100. The representation change came from the #531 / #478 shape publication work.
Requirements
- Record the allocation-pressure OOM that actually drives reserveWithRecovery.
- Require at least one successfully returned post-recovery object and validate all of its fields.
- Prove that a full collection occurred during the evaluation.
- Do not require a second OOM whose occurrence depends on object or shape representation size.
- Keep the heap cap and workload bounded; do not relax engine OOM behavior.
Acceptance
- The exact focused test passes repeatedly on current main.
- The test still fails if the pressure fill never reaches the cap, if no post-recovery object completes, if no full collection runs, or if any returned object is torn.
- Full sharded units pass with the corrected witness.