Parent: #493
Related: #482, #38, #39, #556, #858
Problem
The structured-clone serializer preserves graph identity with a default AutoHashMapUnmanaged(*Object, u32). JavaScript controls graph size, allocation order, and repeated references, so deterministic raw-pointer placement exposes collision-driven worst-case behavior. Raw addresses also are not the engine relocation identity contract: own-property getters run during serialization and can request collection, while managed object addresses may be rewritten by moving GC.
Scope
- Replace the raw-pointer memo key with an exact tagged identity: zig-gc stable cell identity for managed objects and lifetime-stable address identity for arena/static objects.
- Use a per-serialization secure keyed hash context without global state.
- Keep first insertion failure-atomic: allocation or entropy failure must publish neither a context, a memo entry, nor an object id.
- Preserve wire pre-order ids, cycles, aliases, DataCloneError behavior, frame limits, SAB token cleanup, and ordinary shallow behavior.
- Reuse one runtime object-identity definition rather than creating divergent JSON and structured-clone contracts.
No-workaround rules
- No disabling getters, callbacks, or moving GC.
- No linear-only visited scan, address secrecy assumption, global visited mark, duplicated object serialization, reduced graph limit, or input blacklist.
- No change to public structured-clone wire or JavaScript semantics.
Acceptance
Parent: #493
Related: #482, #38, #39, #556, #858
Problem
The structured-clone serializer preserves graph identity with a default
AutoHashMapUnmanaged(*Object, u32). JavaScript controls graph size, allocation order, and repeated references, so deterministic raw-pointer placement exposes collision-driven worst-case behavior. Raw addresses also are not the engine relocation identity contract: own-property getters run during serialization and can request collection, while managed object addresses may be rewritten by moving GC.Scope
No-workaround rules
Acceptance
next_idunpublished; retry succeeds exactly.