ReviewOS

zig-utils/zig-js

Intl: remove redundant ordinary state from native services

#593
Closed chris opened this 9 days ago ·
9 days ago

Summary

PluralRules, ListFormat, RelativeTimeFormat, DisplayNames, Segmenter, and DurationFormat already resolve all observable constructor state eagerly into immutable native sidecars, and every public operation brands through that native record. The shared generic constructor nevertheless publishes redundant NUL-prefixed \0intl and \0locale ordinary properties, retains an unreachable generic \0opts fallback, and the Temporal.Duration locale-string helper repeats the ordinary brand/locale protocol before installing native DurationFormat state.

Remove this dead parallel representation. Native sidecars become the only brand/configuration source for every resolved Intl service, and internal Duration formatting publishes native state directly.

Related: #475, #493, #460. Follows #590, #591, and #592. Does not touch stacks, queues, jobs, Promise, microtasks, or Worker lifecycle.

Frozen boundary

Current main at da10d1f7:

  • PluralRules: 53/53
  • ListFormat: 81/81
  • RelativeTimeFormat: 80/80
  • DisplayNames: 57/57
  • Segmenter: 79/79
  • DurationFormat: 110/110
  • complete Intl402: 3341/3341

Existing representative consumer rows cover PluralRules, ListFormat, RelativeTimeFormat, DisplayNames, Segmenter, and DurationFormat. Exact-parent structural attribution must retain their checksums; no benchmark recognition or reduced logical work is allowed.

Requirements

  • Public instances of all six services publish no NUL-prefixed ordinary own construction properties.
  • Native sidecars remain the sole brand and configuration source; forged \0intl, \0locale, or \0opts properties cannot affect branding, reflection, or steady consumers.
  • Delete the generic raw-options fallback only after proving every installed service has an eager typed publication branch.
  • Temporal.Duration locale formatting initializes DurationFormat native state directly.
  • Preserve constructor option observation order, subclass prototypes, OOM rollback, moving/concurrent GC, shared-realm immutability, and no-GIL race freedom.
  • Keep locale resolution and resolvedOptions key/value order unchanged.

Acceptance

  • The six frozen test262 subtrees and complete Intl402 have zero regressions against the exact parent.
  • Regression coverage checks reflection and hidden-property forgery across all six services plus Temporal.Duration internal formatting.
  • Existing OOM, bounded-heap, moving-nursery, shared-realm, and focused TSan gates pass.
  • Exact-parent representative attribution preserves checksums and reports lock/property/allocation/GC deltas without promoting noisy wall timing.
  • Full sharded units pass with zero failures/leaks.
9 days ago

Implementation is complete and all acceptance gates are green.

The shared Intl constructor now publishes only explicit typed native sidecars for every installed service. Redundant \0intl / \0locale publication, the unreachable generic \0opts fallback, the dead hidden-state numbering resolver, and Temporal.Duration internal pseudo-state are removed. A full-context regression covers public reflection, forged ordinary brands/options/locales, native resolved state, and Temporal.Duration locale formatting across all six services.

Validation:

  • PluralRules 53/53; ListFormat 81/81; RelativeTimeFormat 80/80; DisplayNames 57/57; Segmenter 79/79; DurationFormat 110/110
  • complete Intl402: 3341/3341
  • focused normal: 34/34, zero leaks
  • focused TSan: 34/34, zero leaks/race reports
  • full sharded units: 1707 passed, 1 skipped, 0 failed, 0 leaked

Exact-parent 100-job attribution on all nine existing representative rows preserves every checksum and collection count. Each row removes exactly 112 property-lock acquisitions, 56 Shape transitions, 168 backing allocations, and 56 GC cells. Backing-byte variation follows allocator/collection layout and is not being promoted into a memory or timing claim.

9 days ago

Landed on main in fix(intl): remove redundant service state (#593).

Final gates:

  • PluralRules 53/53; ListFormat 81/81; RelativeTimeFormat 80/80; DisplayNames 57/57; Segmenter 79/79; DurationFormat 110/110
  • complete Intl402: 3341/3341
  • focused normal + TSan: 34/34 each, zero leaks/races
  • full units: 1707 passed, 1 skipped, 0 failed, 0 leaked

All shared-constructor Intl services now publish typed native state only. Forgeable ordinary service/locale/options records and Temporal.Duration pseudo-state are removed.

Sign in to comment on this issue.