…stry, not the compiler's
Two registries numbered types independently. The compiler numbered a
generator's or async function's parked-frame type from a fresh
`TypeRegistry` counting from 0 and the host passed it straight through in
`FrameShape.ty`; the running `Context` gives its first number to strings.
So every first async body's frame header said "string", and when the frame
died `collect_cycle::release` freed the text-slab slot named by its field
0 — a resume label or a parameter, a small integer, i.e. the slot of an
early literal. The next string reused it, two cells shared one text, and
every program compiled afterwards (`new Function`, a page `<script>`) read
other strings from the literal table. WhatsApp Web's `fb-error` received
the launcher's regex TEXT as the flags of `/:/g`.
`entry/generator/numbering.rs`: every `FrameShape` gets a number from the
context's own registry, declared all-`I64` because a frame's references
are traced through `Context::generators`, never through its type; the
only reader of the number is the header `generator_new` writes, so no
agreement with the compiler is needed. Wired in `declare_frames` (JIT and
AOT) and in `eval.rs::adopt` (later compilations).
Found with a debug build and traces, not with the lost-roots checks —
every root was present; this is the "one source, generated views" class:
two numberings for one thing. Regression test without network:
`rts-host/tests/frame_type.rs`, 100 000 async calls then `new Function`,
red before, green after. `rts-core --lib` 352; `frame_type`,
`generator_frame`, `await_parks` 1+6+3; CSS corpus identical; suite
890/905 lost list empty; `target/wa/rx17.ts` with N=12 prints the array as
written in release.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ERaR4gN9psf59ofSFpqZaf
Two type registries numbered independently: an async/generator frame got the compiler's number 0, which is the context's STRING type, so a dying frame freed a literal's text slot and every later compilation read wrong strings (what kept WhatsApp Web on its splash). One numbering now (
generator/numbering.rs). Regression test without network (rts-host/tests/frame_type.rs); corpus identical; suite 890/905 lost list empty;rx17prints correctly in release.🤖 Generated with Claude Code
https://claude.ai/code/session_01ERaR4gN9psf59ofSFpqZaf