Parents: #493, #495 Related: #412, #867, #869
Problem
The process-wide private_global_lifecycles table maps opaque JSGlobalObject*
addresses to the exact private creator/VM ownership record. Its callers accept
arbitrary host-provided context pointers and correctly look them up before any
dereference, but the table still uses std.AutoHashMapUnmanaged with predictable
default bucket placement. Unlike the neighboring serialized-owner and script-
execution-context registries, it also retains its allocation and hash regime
after the final lifecycle is consumed.
Required design
- Use a lazy secure exact-identity hash context independent from every other process and VM registry.
- Publish the first context and lifecycle entry only after successful entropy and backing allocation; failure leaves an empty, unseeded, retryable table.
- Keep every lookup/removal under the existing process mutex and compare full pointer integers before returning a record or dereferencing its stored context.
- Centralize exact removal for isolation rollback, isolation replacement, and destruct-on-exit; when the last record is removed, free/reset the table so a later lifecycle starts with fresh entropy.
- Preserve the exact private VM/context ownership, thread-affinity, process-ID transfer, failure rollback, and single-consumer teardown contracts.
No-workaround rules
- No predictable or address-derived fallback seed, hash-only equality, linear scan, registry cap, leaked tombstone/backing allocation, forged-pointer dereference, weakened mutex/thread checks, alternate lifecycle path, or ABI signature/layout change.
Acceptance
- Default-seed collision families disperse under the lifecycle registry's independent context while lookup/removal remain exact.
- Entropy and first backing-allocation failures leave the table empty, unseeded, leak-free, and retryable.
- Exact final removal frees and resets the process table; later insertion installs a fresh context without accepting retired or forged addresses.
- Create, test-isolation transfer/rollback, destruct-on-exit, wrong-thread, null/foreign/stale, and concurrent lifecycle semantics remain unchanged.
- Focused tests pass in Debug, ReleaseSafe, and TSan; Home/Bun lifecycle fixtures, ABI audits, threadfuzz, full units, and docs gates pass.