Parent: #475 Benchmark matrix: #460
Problem
Intl.DurationFormat eagerly observes and normalizes its options, but publishes the result as a hidden \0opts JavaScript object. Every format, formatToParts, and resolvedOptions call then performs synchronized property lookups and reruns the ten-unit style/display cascade.
The existing 100-job representative_intl_duration_format_parts attribution row has checksum 58800326 and records 10,553,267 property-lock acquisitions, 6,080,927 backing allocations, 3,320,067 GC-cell allocations, and 120 collections across configuration, warmup, and invocation. A dedicated resolved-state row is still needed so state publication/reflection is distinguishable from number and list formatting.
Scope
- Freeze steady
formatToPartsand repeatedresolvedOptionsconsumers with checksums shared by zig-js and system JSC. - Preserve the complete observable InitializeDurationFormat option order: localeMatcher, numberingSystem, style, each unit style/display pair, then fractionalDigits.
- Publish one object-owned, GC-finalized immutable record containing the owned resolved locale/numbering system, base style, all ten resolved unit styles/displays, and optional fractionalDigits.
- Remove the hidden normalized-options object. Require the native record as the receiver brand for
format,formatToParts, andresolvedOptions. - Read the record directly in hot formatting and reflection paths; closed enum reflection must not allocate per-instance category strings.
- Keep temporary NumberFormat and output storage invocation-local and bounded.
Acceptance
- Invalid receivers cannot forge the DurationFormat brand with NUL-led properties.
- Throwing/proxy option getters prove exact observation order and no repeated reads.
- Constructor OOM rolls back every partially allocated record/string; teardown and moving GC finalize exactly once.
- Bounded repeated reflection/formatting, moving nursery, parallel shared-realm/no-GIL, and TSan probes pass.
- DurationFormat test262 and full Intl402 do not regress; focused unit and full sharded unit suites are clean.
- Exact-parent attribution reports checksum, property-lock, backing-allocation/bytes, GC-cell, collection, and retained-memory deltas for both frozen rows.
- Retain only changes with causal improvement and no unbounded cache or locale/option workaround.