Parents: #493, #496 Related: #618, #628, #770, #788, #855
Problem
#770 keyed compiler identifier-content maps, but three source-populable AST identity plans still use default AutoHashMapUnmanaged hashing:
FnScope.annex_b_variablesmaps sloppy block-function declaration identity to its variable slot;Compiler.environment_annex_bmaps top-level Annex B declaration identity to its environment plan row;RepeatedBodyCaptures.captured_catch_patternscaches repeated-body catch-pattern capture classification.
User source controls the number and insertion order of these arena nodes. Predictable arena placement/ASLR is not an explicit collision defense, and replacing identity keys with source content or repeated scans would change semantics or recover superlinear work.
Implementation
- Add an exact AST-identity map context keyed from the existing lazy compilation-owned secure seed.
- Convert all three plans while preserving exact pointer identity, slot/row numbering, capture decisions, and Chunk bytes.
- Share the same seed across program, plain-function, nested-function, generator, async, and admission/prepass structures.
- Publish a newly derived seed only after the first identity insertion succeeds; empty lookup paths remain allocation- and entropy-free.
- Preserve compiler-arena ownership and add no AST metadata, extra pass, or runtime state.
Acceptance
- All three AST identity plan indexes use the keyed context; no default pointer hash remains in
compiler.zig. - A deterministic witness proves a legacy fixed-bucket identity family disperses under a keyed context while exact lookup remains correct.
- Failed first insertion leaves both the identity index and compile-root seed unpublished; retry succeeds.
- Annex B program/function planning and repeated-body catch capture preserve exact semantics and structural Chunk layout across distinct seeds.
- Existing complete allocation replay covers the changed insertion paths.
- Compiler/frontend Debug and TSan, full units, exact-parent Test262, threadfuzz, and public/private ABI gates pass.
No-workaround rules
No source blacklist, grammar limit, linear identity scan, address-secrecy assumption, forced interpreter fallback, predictable seed, per-map entropy call, extra AST pass, or third-party hash table.