Parents: #476, #480 Related: #655
Problem
A single-mutator concurrent mark can finish at an evaluation-exit defer through finishConcurrentGCIfActive(). That path completes the full sweep and updates heap collection counters, but it does not run the post-sweep Context maintenance performed by synchronous collection: WebAssembly garbage reclamation, empty GC-cell suffix trimming, or automatic compaction scheduling.
At the next quiescent boundary, collectQuiescentGarbage() notices only whether finishing a marker during that call changed full_collections. If the previous evaluation-exit defer already finished the cycle and current old/young thresholds are clear, the function returns before maintenance. Empty slabs from the completed sweep can therefore remain retained until an unrelated later collection.
Scope
- Make concurrent-cycle completion report exact
finished,aborted, orinactiveidentity rather than inferring solely from counters. - Run post-full-sweep maintenance exactly once at the first safe quiescent boundary, including Wasm reclamation and ordinary or hard-cap-aware cell-tail trimming.
- Preserve the active-interpreter/moving-compaction safety boundary; schedule compaction for a later valid moving stop rather than relocating through raw live values.
- Cover evaluation-exit completion, explicit/quiescent collection joining, parallel abort, allocation-failure recovery, and teardown without duplicate maintenance.
- Add a deterministic retained-slab witness that proves a completed concurrent sweep gives back eligible empty suffixes without reclaiming the live prefix.
No-workaround rules
- No disabling concurrent GC, forcing a redundant second full collection, lowering thresholds to manufacture maintenance, deleting live slabs, or moving through unregistered raw roots.
- No timer/retry heuristic or counter-only guess that can double-run finalizers.
Acceptance
- Concurrent finish publishes exact completion state and post-sweep work runs once.
- Eligible empty cell backing and Wasm garbage are reclaimed at the next safe boundary without another full sweep.
- Live graphs, finalizers, compaction requests, OOM recovery, and teardown remain exact.
- Focused normal/TSan, full units, concurrent/thread fuzz, and relevant nonzero conformance accounting pass with zero regressions.