Problem
After #105 reduced GcCellBacking.allocFn from 10,150 sampled frames to about 14, minor collection and sweep are the next object-churn costs. A fresh 8-second 8-lane sample recorded:
- collectYoung -> sweepPhaseLocked ephemeron pass: 676 samples
- collectYoung -> sweepPhaseLocked afterWeak pass: 327 samples
- collectYoung young-prefix mark reset: 852 + 263 samples
- gc.allocObjectBatch: about 1,500 samples per busy worker
The object-churn benchmark creates no WeakMap, WeakSet, WeakRef, or FinalizationRegistry state, yet zig-gc walks the managed-cell list for both weak hooks on every minor collection.
Parent: #97 Depends on: zig-utils/zig-gc#19 Related: #105
Direction
Add a realm-local monotonic false-to-true flag that is published before any weak semantic state can become collector-visible. Expose it through the zig-gc optional weak-work predicate so collections can skip ephemeron, weak-slot, and afterWeak passes while it remains false. Once true, keep using the existing conservative processing for the remainder of the Context lifetime.
Acceptance
- Constructors/mutations that create WeakMap, WeakSet, WeakRef, or FinalizationRegistry state publish the flag before the state is visible.
- Focused tests prove a plain realm skips weak passes and each weak feature flips the predicate without changing collection behavior.
- Existing weak/ephemeron/finalization tests pass, including concurrent and parallel coverage under TSan where relevant.
- Exact direct and shared 1/2/4/8 object-churn A/B retains checksum equality.
- A material retained change refreshes README.md and the full benchmark publication.
- Run the full suite once after the retained implementation is assembled.