Problem
After #563 removes repeated resolved-option decoding, the frozen 360,000-call representative_intl invocation still records approximately 1,080,042 backing allocations and 293,771,203 cumulative backing bytes. Intl.NumberFormat.prototype.format calls the structural nfBuildParts path, which allocates a parts list and integer grouping fragments, then joins those parts into a second output buffer even though only formatToParts/range APIs need structural part boundaries.
Scope
- Add exact-checksum controls that compare plain
format,formatToParts, and range consumers across ungrouped/grouped/Indic, fraction/sign, currency/unit, compact/scientific, non-Latin numbering, NaN/Infinity, and BigInt inputs. - Refactor the formatter around one ordered emission algorithm with text and structural sinks;
formatmust emit into one ownership-correct result buffer without first materializing parts. - Keep
formatToParts,formatRange, andformatRangeToPartsexact, including part types, shared affixes/suffixes, and source annotations. - Bound temporary numeric/grouping storage and transfer the final string without a precise-GC arena-to-managed copy where ownership permits.
No-workaround rules
- No duplicate formatting algorithm, locale/workload recognition, skipped grouping/numbering translation, fixed maximum output truncation, borrowed stack bytes, or special case limited to the representative row.
- Preserve all coercion order, BigInt exactness, rounding, signs/accounting, locale symbols, and OOM behavior.
Acceptance
- Focused rows freeze exact string/part/range checksums before implementation.
- Attribution shows the retained allocation and cumulative-byte deltas for the frozen row plus focused controls.
- Seven-pair exact-parent evidence improves plain
formatwithout regressing structural consumers outside noise. - Exact-parent Intl402 and BigInt locale compatibility remain regression-free.
- OOM, bounded heap, moving GC, no-GIL, TSan, and full units pass with zero leaks.