Parents: #473, #478\nRelated: #672, #693, #696\n\n## Problem\n\nvaluebox.encode passes Value.asStr() directly to InternTable.intern. asStr() is a physical storage view, while the intern table explicitly requires canonical WTF-8 content keys. With flat-Latin-1 storage active, a non-ASCII Latin-1 value therefore feeds invalid/noncanonical bytes into the content-keyed table, can trip the Debug WTF-8 invariant, and can break cross-representation convergence.\n\n## Scope\n\n- Add a representation-aware intern-table entry point for a StringCell physical image.\n- Preserve the existing canonical-WTF-8 fast path without scratch allocation.\n- Re-encode flat Latin-1 into bounded temporary canonical WTF-8 before keyed lookup/insertion, releasing scratch on success and failure.\n- Route the standalone Value↔NanBox compatibility bridge through that entry point.\n- Preserve exact cell ownership, shard locking, collision verification, literal encoding, and object/primitive payload behavior.\n\n## No-workaround rules\n\n- No raw flat bytes as content keys, lossy replacement, ASCII restriction, leaked scratch, global canonicalization, alternate hash table, pointer-identity assumption, or disabled validity assertion.\n- No stacks, queues, jobs, Promise, Worker, or Map/Set iterator changes.\n\n## Acceptance\n\n- Canonical and forced-flat Latin-1 values round-trip and converge through the bridge.\n- Canonical storage remains allocation-free before the intern table’s ordinary owned key/cell allocations.\n- OOM cleanup, intern-table concurrency/collision behavior, focused Debug/forced-flat/ReleaseSafe/TSan, full units, and exact Test262 accounting pass.
NaN-box: canonicalize flat strings before compatibility interning
#697Landed in f9ca94d6. Canonical cells retain the direct intern path; flat Latin-1 cells now use temporary canonical WTF-8 content keys whose lifetime is bounded across success and failure. Canonical/forced-flat/ReleaseSafe/TSan bridge tests passed 6/6, exhaustive allocation-failure injection passed, StringCell controls passed 14/14 with TSan concurrent convergence, and full units passed 1,794 with 1 intentional skip, 0 failures, and 0 leaks. Test262 has 0 applicable internal-bridge files, so flips 0.
Follow-up #702 aligned the standalone ValueNB proof with the production compatibility interning fixed here. 538233bd distinguishes physical asStr storage from semantic asWtf8 output, uses the real flat representation for numeric parsing, and proves flat conversion OOM/canonical borrowing across Debug/ReleaseSafe/TSan.
Sign in to comment on this issue.