Parent: #412 GC parent: #144 Profiles: #163, #164 Roadmap: #134
The exact private global lifecycle now creates clean same-VM replacement realms and retires the old realm from process lookup, but public C context groups are arena-backed. Unreachable cells from an isolated realm therefore remain physically allocated until the VM group is destroyed. Implement one shared precise-GC realm architecture so test isolation can reclaim the old global, module graph, jobs, and embedder roots without replacing the VM.
Acceptance:
- Allow a precise-GC VM/group to own multiple independent realms with distinct globals, intrinsics, environments, shapes, module state, and microtask queues.
- Trace every live realm as a VM root while allowing a retired realm to leave the root set atomically.
- Keep same-VM value identity, Symbol registry behavior, pending-exception behavior, barriers, stable cell IDs, and relocation updates correct across sibling realms.
- Make Zig__GlobalObject__create and Zig__GlobalObject__createForTestIsolation use the precise-GC group path while preserving the #412 ownership and execution-context contract.
- Drop the old global, module registry, queued jobs, and embedding roots before a synchronous full collection; prove external-owner finalizers run once.
- Cover retained old handles, sibling-realm reachability, concurrent lookup retirement, collection during/after replacement, compaction eligibility, and terminal VM teardown.
- Add focused Debug, ReleaseSafe, TSan, and relocation evidence without weakening existing arena-backed public context-group behavior.
- Update the #412 contract/docs and reconcile exact main CI before closing this dependency.