Parents: #475, #460 Related: #577
Problem
Intl.PluralRules.prototype.select evaluates generated CLDR rules correctly, but then allocates a new GC-owned string cell for every result through Value.strAlloc. The result vocabulary is closed by ECMA-402/CLDR to zero, one, two, few, many, and other. resolvedOptions().pluralCategories repeats dynamic category-cell allocation when constructing each result array.
High-frequency numeric classification therefore turns immutable structural metadata into avoidable allocation and collection pressure. The representative matrix has no dedicated PluralRules consumer/control rows, so the boundary must be committed before the runtime change.
Scope
- Add dependency-free steady
select()andresolvedOptions().pluralCategoriesrows covering cardinal/ordinal rules, multiple locale category sets, fractional operands, notation/exponent behavior, and stable full-result checksums. - Keep formatter construction and fixed inputs outside the timed steady boundary; each scored call must execute the public operation and consume its observable result.
- Record exact zig-js/JSC checksums plus exact-parent allocations, bytes, GC cells/collections, property locks, timing, and process memory.
- Represent the six closed plural categories natively and expose process-lifetime immutable string values from both
select()andpluralCategories. - Preserve dynamic CLDR rule evaluation,
ToNumber/abrupt completion order, rounding/fraction/exponent operands, fresh ordinary resolved-options objects/arrays, category ordering, moving roots, and no-GIL behavior.
Security and no-workaround rules
Numeric inputs, call count, locales, and options are attacker-controlled. The implementation must remove category-cell churn without caching numeric results, bypassing rule evaluation, precomputing benchmark output, recognizing workload source/names, weakening OOM/GC/watchdog accounting, or adding unbounded/global mutable state.
Acceptance
- Committed steady select and resolved-category rows meet the timing protocol and have stable non-zero checksums identical to system JSC.
- Exact-parent attribution proves category string cells no longer scale with select/result-category count, without increased property locks or collections.
- Cardinal/ordinal, locale category ordering, fractional/exponent, coercion/throw, result freshness/mutation, and exact checksums remain correct.
- Focused OOM, bounded-heap, moving nursery, shared-realm no-GIL, and suppression-free TSan coverage pass.
- The complete
test/intl402/PluralRulessubtree, full Intl402, and full sharded units have no regressions.
Exclusions
No Promise, microtask, Worker, queue, job-lifecycle, stack, or user-owned documentation changes.