ReviewOS

zig-utils/zig-js

Builtins: optimize collections, Date, Intl, and Temporal

#475
Open chris opened this 9 days ago ·
9 days ago

Parent: #459 Depends on: #460, #465, #469, #473

Goal

Make collections and data-heavy built-ins—including Map/Set/Weak collections, Date, Intl, and Temporal—competitive on representative workloads while staying fully owned and table-driven.

Scope

  • Profile and optimize Map/Set hashing, lookup/update/delete/iteration, weak-key processing, growth/shrink, tombstones, and no-GIL synchronization.
  • Add fast builtin calls/iteration only behind exact intrinsic/version guards; preserve subclassing, species, monkey-patching, iterators, and callbacks.
  • Optimize Date parsing/arithmetic/formatting and Temporal calendar/time-zone arithmetic without changing edge semantics.
  • Improve Intl locale resolution, option parsing, formatter construction/reuse, number/date/plural/display/list/relative formatting, segmentation, and collation using generated owned tables.
  • Share immutable generated tables safely across realms/process lifetime while keeping mutable formatter/cache state bounded and correctly owned.
  • Measure construction latency, steady calls, bulk processing, allocations, retained memory, and concurrent use.

No-workaround rules

  • No ICU/system-JSC dependency, locale omission presented as performance, English-only shortcut, unbounded global cache, or skipped user-observable builtin hook.
  • Generated data must come from checked-in/pinned inputs through owned generators; generated Zig tables are never hand-edited.

Acceptance

  • #460 contains representative small/bulk/cold/warm/Unicode/time-zone/DST/adversarial and 1/8-lane rows.
  • Full test262 plus focused Intl/Temporal/weak/finalization, OOM, GC movement, no-GIL, TSan, and fuzz gates pass.
  • Profiles attribute hashing/table lookup/allocation/formatting/lock costs before each retained change.
  • Cache/table memory is bounded, lifecycle-tested, and included in RSS evidence.
  • Every accepted directly comparable JSC row meets the #459 gate.

Foundation

Generated CLDR/Unicode/Intl tables and semantic implementations already exist in src/*_data.zig, generator scripts, and src/interpreter.zig; edit generators, never generated tables.

9 days ago

The strong-collection hashing/index slice landed in c797973a via #513. Map/Set now index object and Symbol identity across moving GC, use securely seeded hashes and exact collision chains, and retain OOM/no-GIL/TSan correctness. This advances the Map/Set portion of #475; Date, Intl, Temporal, weak processing, full representative evidence, and the broader acceptance matrix remain open.

9 days ago

#514 is complete on main. The collections path now has O(1) synchronized size, fresh Map entry arrays, collision-safe/index-compatible stable logical iteration, bounded tombstone compaction and capacity release, plus OOM/moving-GC/no-GIL/TSan coverage. Exact-parent evidence is in 363a643; the final lock-elision step measured 0.9835x instructions and 0.973x wall time versus its exact parent (diagnostic-only because cache-miss counters were unavailable).

9 days ago

#513 is complete on main. Exact-parent object/Symbol Map+Set rows measured 0.6190x instructions in the base workload and 0.6187x in the anti-specialization variant, with identical checksums and no Map/Set test262 regressions. The security boundary remains intact: unpredictable per-collection seeds, exact-equality collision chains, moving-GC-stable identity, OOM-safe fallback, no-GIL, and TSan. Evidence: 4adcc0d.

9 days ago

Opened #523 for the next weak-collection slice: preserve authoritative object/Symbol identity lookup across moving GC, make insertion failure-atomic, and release dead-key high-water backing. It includes 1K/2K/4K post-movement witnesses plus OOM, ephemeron, no-GIL, TSan, and exact-parent evidence requirements.

9 days ago

Closed child #523 via 6989099b and 39eeb362.

WeakMap/WeakSet lookup now keeps an authoritative relocation-stable identity index through moving GC. Seven-pair exact-parent retired-instruction ratios improve from 0.726× at 1K to 0.395× at 4K, while the identical ordinary no-movement control is 1.009×. The full 1,563-test unit gate, focused TSan, no-GIL, moving nursery, OOM, pruning, and WeakMap/WeakSet test262 subtrees pass.

9 days ago

Closed #524 via ddaae8a5 and evidence 0e2ed155. Date component setters now use bounded native argument storage and observe only their ECMA-262 arity. Date is 594/594; full units and no-GIL TSan pass. Exact attribution removes 9,273,552 retained backing bytes across ten 4K warmups, while 1K/2K/4K instructions and the setTime control remain neutral.

9 days ago

Opened #526 for the next Date slice. It removes intermediate date/time/year formatting buffers and the precise-GC arena-to-managed copy, while preserving exact invalid/extended-year/alias semantics. Acceptance includes deterministic 1K/2K/4K all-conversion rows, an unrelated getter control, exact allocation/RSS evidence, OOM, moving-GC, no-GIL, TSan, and Date test262.

9 days ago

Closed #526 via 0b01b789, OOM witness 3a5fc50d, and evidence c7705224. All non-locale Date string results now format through bounded native storage into one directly transferred realm-owned buffer. The 4K invocation removes 158,851,286 bytes (97.5%) of new retained Context backing and 215/215 growth events with identical GC-cell issuance; Date remains 594/594 and full units/no-GIL TSan/moving/OOM gates pass.

9 days ago

Opened #528 for the next Intl slice. CanonicalizeLocaleList is shared by all service constructors and supportedLocalesOf; it currently performs quadratic canonical-tag deduplication and retains a freshly allocated decimal property key for every input index. The child requires a securely seeded invocation-local exact-content index, bounded native index-key storage, exact Proxy/getter order, OOM/moving-GC/bounded-heap/no-GIL/TSan coverage, nonzero test/intl402, and exact-parent 1K/2K/4K evidence.

9 days ago

Completed the CanonicalizeLocaleList slice in #528. Wide Intl locale lists now promote after eight unique results to a securely seeded invocation-local exact-content index; per-index keys and canonicalization scratch are bounded/reclaimed. Final exact-parent chain: 8-item control ~0.969x wall, 1K 0.252x, 2K 0.156x, 4K ~0.069x, duplicate-heavy 4K 0.862x. Full Intl402 remains 3,341/3,341. Implementation/evidence: 9cc8d496, c4662097, b9e44874.

9 days ago

Opened #563 for the next Intl slice. The frozen steady-state family shows roughly 725 ms median for 360,000 NumberFormat calls because each call generically traverses and reconverts the same engine-owned normalized option record. The child adds construction/steady controls, then moves all consumers to one immutable formatter-owned resolved state with explicit GC ownership and shared-realm read-only publication.

9 days ago

Completed #563 via benchmark boundary 57eb69d5 and immutable resolved state 7cf6b000. Frozen Intl base/variant exact-parent medians improve 26.51%/26.79%; four default-to-uncommon steady controls improve 19.68%-23.15%, while construction stays flat. Intl402 remains 3,341/3,341; full units, OOM, bounded heap, moving GC, no-GIL, and TSan gates pass.

9 days ago

Opened #564 for the next NumberFormat slice after #563. Current attribution for the frozen 360,000-call invocation records about 1.08M backing allocations and 293.8 MB cumulative backing bytes: plain format still materializes structural parts and then joins them. The child requires one shared ordered emitter with separate text/parts sinks, exact structural controls, ownership evidence, and no duplicated locale algorithm.

9 days ago

#564 is complete in 1b24c77f and closed with exact-parent evidence. NumberFormat now emits plain text without materializing parts and reuses structural endpoint output for ranges. Seven-pair medians improve plain text 2.31%, range 12.93%, and range-parts 3.08%; the representative row improves 1.12%. Scored backing bytes fall 48.73% on representative Intl and 53.78% on the focused text row, with parts flat. Intl402 remains 3,341/3,341 and full units are clean (1,646 pass, 1 skip, 0 failures/leaks).

9 days ago

Opened #565 for the next NumberFormat slice. After #564, exact attribution still shows about 1.92M backing allocations across 384K steady calls (roughly five per call), with 257.8-259.0 MB of scored backing bytes on common paths and 341.5 MB on the significant/compact path. The child replaces repeated allocPrint, prefix rebuilding, and fraction-list copies with an ownership-safe bounded numeric scratch shared by text and structural sinks, with exact rounding-family controls and full OOM/GC/no-GIL/TSan requirements.

9 days ago

While freezing #565 controls, direct JSC comparison exposed two semantic gaps and they are now tracked separately: #566 for explicit compact-notation precision (zig-js currently returns 1.2 million where explicit maxSignificantDigits:4 requires 1.235 million) and #567 for BigInt structural formatting (visible text is exact, but formatToParts currently collapses integer/group boundaries into one literal). Keeping these as explicit correctness children prevents the #565 performance row from hiding or conflating semantic changes.

9 days ago

#565 is complete in 339e3d1b with exact-parent evidence. NumberFormat rounding now uses finite-f64/ECMA-402-bounded native scratch, with explicit ownership transfer for parts and RelativeTimeFormat. Seven-pair medians improve the rounding text matrix 2.40%, steady default/fraction 1.05%/1.18%, and representative Intl 2.27%; frozen text cumulative/current backing bytes fall 53.23%/80.91%. Intl402 remains 3,341/3,341 and full units/TSan/no-GIL/OOM/GC gates are clean.

9 days ago

#566 is complete in 0d591e3a with exact-parent evidence. Compact NumberFormat now honors explicit significant/fraction precision and rounding priority, recomputes exponents across threshold carry, trims significant zeros from the rounded magnitude, and validates roundingIncrement against the resolved rounding type. The 16-case text/parts checksums now exactly match JSC; Intl402 remains 3,341/3,341 and full units/TSan/no-GIL/OOM/GC gates are clean. The distinct generated CLDR compact-pattern work remains in #568.

9 days ago

#567 is complete via boundary aa3cf4d0 and implementation 5d255fec. BigInt NumberFormat is now exact and structural across text, parts, ranges, notation, rounding, localized digits, and affixes; the range path no longer narrows endpoints through binary64. Intl402 remains 3,341/3,341 and full units / focused TSan / OOM / bounded heap / moving GC / no-GIL gates are clean. The distinct generated locale currency-name gap found by the oracle is tracked in #569 alongside compact-pattern data work #568.

9 days ago

Compact notation follow-up #568 is complete on main:

Owned, revision-pinned CLDR data now drives short/long magnitudes, locale exponents, affix part boundaries, plural forms, and exact BigInt selection. NumberFormat remains 249/249, full Intl402 is 3,341/3,341, focused normal and TSan are 10/10 each, and full units are 1,649 pass / 1 skip / 0 fail / 0 leak. Compact text and parts benchmark checksums now exactly match JavaScriptCore.

Range separator and affix-collapse behavior exposed by the controls is intentionally separated into #570. Currency display-name data remains tracked by #569.

9 days ago

Currency display-name follow-up #569 is complete on main:

Generated immutable data now drives locale currency names, exact Number/BigInt plural selection, unit-pattern part boundaries, and plural-range sharing. NumberFormat remains 249/249, full Intl402 is 3,341/3,341, focused normal and TSan are 11/11 each, and full units are 1,650 pass / 1 skip / 0 fail / 0 leak. Text, parts, and range-text benchmark checksums now exactly match JavaScriptCore.

The remaining range-parts difference is the interval separator/collapse work in #570. Locale default numbering systems exposed during attribution are tracked separately by #571.

9 days ago

#571 is complete in 42cb6a23: generated immutable CLDR defaults/symbol pairs now make NumberFormat text, parts, and resolved-state controls exact against JSC across Arabic, Persian, Thai, Indic, Latin, extensions, and option overrides. NumberFormat is 249/249, Intl402 is 3341/3341, and the full suite is 1651 pass / 1 skip. #570 now owns the only remaining range-control delta (locale interval patterns).

9 days ago

#570 is complete in cb3e8182. Generated CLDR interval/approximation data now makes compact, currency-name, and numbering-system range controls exact against JSC, including part values/types and source attribution. Verification: 249/249 NumberFormat, 3341/3341 Intl402, 1652 pass / 1 skip full units, focused normal+TSan/no-GIL/moving-GC/OOM clean. Together with #568, #569, and #571, the generated NumberFormat locale-data sequence is complete.

9 days ago

#572 is complete on main in 939d9394. DateTimeFormat construction now publishes one compact, formatter-owned immutable resolved record; steady text/parts/range/resolved-options consumers perform no internal generic option traversal, and style expansion is compiled once without changing reflected options.

Exact-parent medians improve the four consumers to 0.923x-0.987x and all four constructors to 0.933x-0.965x. Constructor backing allocations fall 4.5%-9.9%, with explicit bounded-heap, OOM, moving-GC, no-GIL, and TSan coverage. DateTimeFormat stays 244/244, Temporal stays 4,603/4,603, full Intl402 stays 3,341/3,341, and full units are 1,656 pass / 1 skip.

9 days ago

Completed the DateTimeFormat steady text-emission leaf in #573 via 502ccfee.

One shared emitter now targets direct text or structural parts. The representative text consumer retains exact parent/JSC output while backing allocation bytes fall 90,434,989 → 80,579,965 (−10.9%), with unchanged GC-cell allocation and collection counts. DateTimeFormat remains 244/244, Intl402 Temporal 2029/2029, built-ins Temporal 4603/4603, and the full unit/TSan/no-GIL evidence is clean. No throughput ratio is claimed because timing windows were noisy.

9 days ago

Completed the next DateTimeFormat allocation leaf in #574, landed as perf(intl): reuse identical DateTimeFormat ranges (#574).

After both range inputs are coerced in specification order and kind/calendar validation succeeds, identical canonical numbers or the same immutable Temporal object now build one endpoint. Distinct values remain on the full interval/collapse path.

Against exact parent 502ccfee, equal-range text retained JSC-identical checksums while two opposite-order 11-sample windows measured 0.927x and 0.933x parent median. At 100 jobs, cumulative backing bytes fell 90,431,085 -> 80,576,073 (-10.9%) with GC cells and collections unchanged. Affected test262 subtrees remain 244/244, 2,029/2,029, and 4,603/4,603; focused TSan and the full 1,658-test sharded suite are clean.

9 days ago

Completed the DateTimeFormat structural-metadata leaf in #575 via perf(intl): intern DateTimeFormat part metadata (#575).

Closed native enums now represent part types and range sources, exposing process-lifetime immutable string cells while keeping formatted values independently owned and result objects ordinary/mutable. Against exact parent 9f6a8e5e, the 100-job parts row removes 83,202 backing allocations and 83,200 GC cells; range-parts removes 166,398 backing allocations and 166,400 GC cells. Collections fall 47 -> 45 and 73 -> 70; checksums and property-lock counts are exact.

Two opposite-order 11-sample windows favor the candidate in all four comparisons (0.976x-0.994x parent median). Affected test262 stays 244/244, 2,029/2,029, and 4,603/4,603; focused TSan and the full 1,658-test sharded suite are clean.

9 days ago

Completed the NumberFormat structural-metadata leaf in #576 via perf(intl): intern NumberFormat part metadata (#576).

Closed native enums now represent NumberFormat part types and shared Intl range sources, while dynamic values retain their existing owned lifetime. Against exact parent 9baffa8c, the 100-job parts row removes 55,998 backing allocations and 56,000 GC cells; range-parts removes 231,079 backing allocations and 231,080 GC cells. Range-parts cumulative backing bytes fall 15.30% and collections fall 15 -> 11, with exact checksums and unchanged property-lock counts.

Opposite-order 11-sample range-parts windows measure 0.873x and 0.937x parent median. Dedicated compact/currency structural checksums remain exact against JSC. NumberFormat stays 249/249, Intl402 stays 3,341/3,341, and focused TSan plus the full 1,658-test sharded suite are clean.

9 days ago

Completed the remaining structural-service metadata leaf in #577 via perf(intl): intern structural service metadata (#577). ListFormat, RelativeTimeFormat, and DurationFormat eliminate 73,602, 36,802, and 115,202 backing allocations respectively at 100 jobs, with exact checksums, unchanged property-lock counts, fewer collections, full Intl402 3,341/3,341, focused TSan/no-GIL/moving/bounded coverage, and clean full units. Timing was mixed, so the result is intentionally allocation/GC-only.

9 days ago

Opened #578 for the next Intl leaf. Segmenter currently recreates the complete immutable input string cell for every containing() and iterator record, giving attacker-controlled long, densely segmented inputs multiplicative allocation pressure. The child freezes symmetric iteration/containing rows, then shares one precisely rooted input value across %Segments%, iterators, and result records with bounded-heap, moving-GC, no-GIL, TSan, and full Segmenter conformance gates.

9 days ago

Completed the Segmenter ownership leaf in #578:

  • benchmark boundary: bench(intl): isolate Segmenter input ownership (#578)
  • engine change: perf(intl): share Segmenter input values (#578)
  • full iteration removes 72,801 backing allocations/GC cells, 4,420,452 cumulative bytes, and 2 collections at 100 jobs with the exact checksum preserved
  • indexed containing() removes 32,001 allocations/GC cells and 1,919,252 bytes with the exact checksum and collection count preserved
  • Segmenter test262 remains 79/79; focused normal/TSan and full sharded units are clean

#578 is closed. #475 remains open for the next independently measured Intl leaf.

9 days ago

Opened #579 for the next independently measured Intl leaf. PluralRules.select() currently allocates a fresh GC string cell for every result even though the category vocabulary is closed to six values; resolvedOptions().pluralCategories repeats the same structural allocation. The child freezes steady select/resolved-category rows first, then uses immutable native category values with OOM, bounded heap, moving GC, no-GIL, TSan, full PluralRules/Intl402, and full-unit gates.

9 days ago

Completed #579 via perf(intl): intern PluralRules categories (#579), following the committed benchmark boundary 65dbcf2c.

Closed native category values remove 198,402 backing allocations/GC cells and 3 collections from steady select(), plus 396,802 allocations/cells and 7 collections from repeated resolvedOptions().pluralCategories at 100 jobs. Checksums and property-lock counts are exact; timings are neutral, so no latency claim is made. PluralRules remains 53/53, full Intl402 3,341/3,341, and focused normal/TSan/no-GIL/moving/bounded/OOM plus full units are clean.

9 days ago

Opened #580 for the next independently measured Intl leaf. Bound compare currently allocates/canonicalizes its already-normalized locale and reprocesses the internal options object on every call, multiplying configuration work during sort. The child freezes direct-compare and sort rows first, then reuses immutable instance state with coercion/OOM/bounded-heap/moving/no-GIL/TSan, full Collator/Intl402, and full-unit gates.

9 days ago

Collator differential follow-up: #581 tracks German phonebook ordering and Thai ignorePunctuation preserving case/accent weights; discovered while freezing the #580 exact-parent workloads.

9 days ago

#580 completed on main: immutable GC-finalized Collator state, invocation-local freeable Unicode/numeric key storage, and dedicated direct/sort benchmark rows landed in 56bf8586, 9f1fbf48, and 92f9bc4a. Exact-parent medians improved 28.3% for both direct compare and bound sort; retained backing fell 91.1% and 85.8%, respectively. Collator 65 → 65, Intl402 3,341 → 3,341, full units 1,675 pass / 1 skip, focused TSan clean. Separate pre-existing locale-weight divergences are tracked in #581.

9 days ago

#581 completed on main in f54dea87: German phonebook/search case weights and Thai default/explicit ignorePunctuation now preserve accent/case distinctions. Expanded 121-case and original 128-case public matrices match system JSC sign-for-sign; Collator 65/65, Intl402 3,341/3,341, full units 1,676 pass / 1 skip, focused TSan clean. No repro-string special cases or unbounded caches were added.

9 days ago

Opened #582 for the generated locale-aware DisplayNames correctness/data gap and #583 for the independent immutable steady-state optimization. The #583 public boundary is committed in 6f1e25f8: zig-js and system JSC agree on checksum 139703394, while exact-parent attribution records about 32.0M property-lock acquisitions and 17.2M backing allocations across the warmed 100-job invocation. The two children stay separate so performance work cannot hide locale-data differences.

9 days ago

#583 is complete in benchmark 6f1e25f8 and runtime 925075c8. Immutable DisplayNames state and bounded canonicalization scratch cut property locks 20.49%, current backing 33.00%, and retained RSS 8.00% at the frozen 100-job checksum; the diagnostic median improves 4.80%. DisplayNames remains 57/57, Intl402 3,341/3,341, focused TSan is clean, and full units are 1,680 pass / 1 skip. Locale-data correctness remains separately visible in #582.

9 days ago

DisplayNames correctness/data child #582 is complete in 2b4449f6: 51 pinned locale bundles, all six types and styles, canonicalization/aliases/composition/fallback, service-specific availability, and a public JSC differential gate. DisplayNames remains 57/57 and Intl402 3341/3341; full units are 1,683 pass / 1 skip / 0 fail / 0 leak. The exact-parent steady checksum and allocation/GC/lock counters are unchanged; the bounded owned-data cost is +4,856,320 bytes in the ReleaseFast comparison executable.

9 days ago

#584 is complete in a3400953: RelativeTimeFormat now uses immutable GC-finalized resolved state and a native receiver brand. At the frozen checksum, property-lock acquisitions fall 4.93%; GC cells fall by 3 and current/peak backing by 144 bytes, while 7-sample timing is flat (no throughput claim). RelativeTimeFormat remains 80/80, Intl402 3,341/3,341, focused TSan is clean, and full units are 1,686 pass / 1 skip / 0 fail / 0 leak.

9 days ago

#585 is complete in 6f8e770c: ListFormat now uses immutable GC-finalized locale/type/style state and a native receiver brand. At the frozen checksum, property locks fall 1.63%, backing allocations by 1, GC cells by 3, and current/peak backing by 1,266 bytes; paired timing was high-variance, so no throughput claim. ListFormat remains 81/81, Intl402 3,341/3,341, focused TSan is clean, and full units are 1,689 pass / 1 skip / 0 fail / 0 leak.

9 days ago

#586 is complete in d77dbd2b: Segmenter formatter locale/granularity is now immutable, GC-finalized native state while input and iterator records stay separate. At the frozen checksum, the exact-parent median improves 1.92%, property locks fall by 12,803, and GC cells by 1; bounded cost is one 40-byte backing allocation. Segmenter remains 79/79, Intl402 3,341/3,341, focused TSan is 8/8, and full units are 1,692 pass / 1 skip / 0 fail / 0 leak.

9 days ago

Completed the PluralRules immutable-state leaf in 33d6e55b, closing #587. Native state removes hidden option-bag reads from select/resolvedOptions while preserving all 53 PluralRules test262 cases and all 3,341 Intl402 cases. Exact-parent medians improve 6.63% for select and 3.93% for resolved categories.

9 days ago

Opened #588 and landed its benchmark boundary in 406361e3. DurationFormat currently re-resolves a hidden option object on every format/parts/reflection call; the child will replace it with one immutable GC-finalized native record while preserving all 23 option observations and the ten-unit cascade.

9 days ago

Completed the Intl.DurationFormat immutable-state leaf in #588 via 1cf4df26. The native branded record removes repeated normalized-option object traversal, cuts the frozen resolvedOptions row by 371,423 property locks, 268,814 backing allocations, 268,832 GC cells, and four collections, with a 1.59% exact-parent median improvement. DurationFormat remains 110/110 and Intl402 remains 3,341/3,341; the full unit gate is clean.

9 days ago

Completed the remaining Collator reflection-state follow-up in #589 via db8ef45b, after corrected boundary 3f3bb952. Collator now has one complete native brand/state and no NUL-led own properties. The frozen reflection row removes 153,759 property locks, 25,696 backing allocations, and 25,632 GC cells with exact JSC checksum; Collator remains 65/65, Intl402 3,341/3,341, and full units/TSan are clean. Timing was unstable, so no latency claim is made.

9 days ago

Locale native-state leaf completed in #590 via 28165f51: unforgeable immutable brand/state, one traced+relocated canonical string, precomputed reflection ranges, and all Locale consumers migrated. Locale 152/152, Intl402 3341/3341, full units 1704 pass/1 skip/0 fail/0 leak; exact-parent property locks -499,232 (-9.85%) with unchanged GC cells/collections.

9 days ago

#591 landed in eb661dce: NumberFormat construction now publishes only native resolved state, removing forgeable/lazy hidden configuration and reducing exact-parent 100-job property locks by 13.4% (default) / 8.3% (uncommon). Intl402 remains 3341/3341.

9 days ago

#592 landed in da10d1f7: DateTimeFormat now uses its immutable native sidecar as the sole brand/configuration state, including Date/Temporal helpers and ChainDateTimeFormat. DateTimeFormat remains 244/244 and Intl402 3341/3341.

9 days ago

#593 landed in 724c3d73: PluralRules, ListFormat, RelativeTimeFormat, DisplayNames, Segmenter, and DurationFormat now publish only typed native state. Their frozen subtrees and complete Intl402 remain exact.

9 days ago

Opened #594 from the frozen Temporal profile. Both PlainDate.add and Instant.add concentrate their hottest samples in durationFromArg's ten independent ordinary property reads; the child is bounded to a synchronization-correct data-only snapshot with mandatory fallback before any observable getter, Proxy trap, host hook, custom prototype, or object conversion.

9 days ago

#594 landed in b795eeb2: exact ordinary numeric duration bags now batch descriptor/prototype probing without bypassing observable Gets or conversions. Exact-parent medians improve the frozen Temporal base row 23.00% and reversed variant 21.66%; core Temporal remains 4,603/4,603 and Intl402 Temporal 2,029/2,029.

9 days ago

Opened #595 from the post-#594 profile. Fixed-field duration snapshots are now the dominant native leaf (mem.eqlBytes 240, Shape.lookupState 202 top-of-stack samples); the child replaces repeated per-name walks with one bounded shallow-shape scan, without caching user bags or weakening accessor/concurrency fallback.

9 days ago

#595 landed in 6be183d3: fixed-field snapshots now scan shallow Shapes once with exact byte classification and bounded fallback. This adds 16.80% exact-parent improvement on the already-optimized Temporal base and 17.75% on its variant, with unchanged checksums/counters and exact Temporal corpora.

9 days ago

Opened #596 from the post-#595 allocation profile. Each Temporal result allocates a cold rare-state sidecar solely to carry its already-typed state pointer; the child reuses the existing engine-private word, with an exact C-API spill to cold state before host data attaches. No TemporalData/finalizer/GC-accounting shortcut is in scope.

9 days ago

Follow-up #596 landed in c544df8e: Temporal native state now uses the engine hot private word with failure-atomic C API spill. Exact-parent 1,000-job medians improved 3.65% and 3.66%; 100 jobs removed 19,800 backing allocations and 3,801,600 allocated bytes, with conformance and the full unit plan unchanged.

9 days ago

Opened #603 for a bounded DateTimeFormat resolved-options allocation issue found on current main. The native state already stores components/styles as a closed enum, but each non-empty enum is converted back into a newly managed string on every resolvedOptions() call. The existing component-construction row executes 3,200 projections per 100 jobs and provides unchanged attribution/timing coverage. Scope is static projection of validated enum values only; dynamic locale/calendar/numbering/time-zone strings remain owned.

9 days ago

Child #603 is complete on main via 10ac2f3d. DateTimeFormat resolved component/style enums now return exact immutable static cells. The 3,200-operation component row removes 22,400 managed cells and 1,433,600 GC-cell bytes with identical work/checksum; 21 paired samples improve median time by 3.114% with 21/21 candidate wins. Exact DateTimeFormat test262 remains 244/244 and the full unit gate is clean.

9 days ago

Opened #604 for NumberFormat resolved-options strings that are already constructor-validated finite choices but still allocate fresh managed cells at reflection time. The four existing 3,200-operation constructor rows provide exact allocation, work, checksum, and paired-timing coverage. Dynamic locale/numbering/currency/unit values remain out of scope.

9 days ago

Child #604 is complete on main via b5dd6761. NumberFormat now projects validated finite resolved options through immutable static cells while dynamic locale/numbering/currency/unit strings remain managed. Ordinary 3,200-operation rows remove 19,200 cells; the uncommon currency+compact row removes 28,800. All four 21-pair medians improve 3.523%-12.192%, exact NumberFormat test262 remains 249/249, and the full unit gate is clean.

9 days ago

Opened benchmark-first child #605 for DisplayNames resolved enum projections. Its native record already stores style/type/fallback/languageDisplay as closed enums, but reflection allocates fresh cells. A dedicated fresh-result checksum row will land before any runtime change; locale remains dynamically managed.

9 days ago

Benchmark-first child #605 is complete via 103413d0 + 3b61ee05. DisplayNames resolved enum projection removes exactly 20,800 managed cells and backing allocations across 6,400 operations, with identical execution/Shape/checksum. Timing is neutral (-0.105%, 14/21 wins), so only the allocation reduction is claimed. Exact test262 remains 57/57 and the full unit gate is clean.

9 days ago

Opened benchmark-first child #606 for the remaining ListFormat type/style and RelativeTimeFormat style/numeric enum projections. One combined fresh-result row will freeze every field and checksum before the runtime change; locale and numberingSystem remain managed.

9 days ago

Benchmark-first child #606 is complete via 338b472b + 7f46c2dd. ListFormat and RelativeTimeFormat resolved enum projection removes exactly 25,600 cells/backing allocations across the paired 6,400-operation row, with identical work/Shape/checksum. Timing is neutral (+0.044%), exact test262 remains 161/161 combined, and the clean full unit rerun is green.

9 days ago

Generic iterator correctness follow-up #698 landed in f843f8d8: zipKeyed keeps exact non-ASCII Latin-1 keys across longest-mode padding and fresh result objects. The Iterator/zipKeyed subtree remains 44/44; shared Map/Set cursor work is unchanged.

9 days ago

Iterator-protocol correctness hardening landed via #750 in 28482211: Math.sumPrecise now captures [[NextMethod]] once, preventing repeated observable lookup and mid-iteration replacement. Exact subtree evidence: 10 pass -> 10 pass; 0 flips.

9 days ago

The Math.sumPrecise size-bound follow-up #751 landed in 25b8d23e: exact 2^53 - 1 enforcement, spec-ordered Number validation, and completion-preserving IteratorClose. Test262: 10 pass -> 10 pass; 0 flips.

9 days ago

Opened benchmark-first child #772 for the remaining DateTimeFormat hourCycle projection allocation. The audit found that all other closed component/style fields already use native enums, while hourCycle is still copied into formatter-owned bytes and materialized through Value.strAlloc on every resolvedOptions() call. #772 first requires a dedicated exact-checksum/allocation row because the existing constructor row does not consume that property; no runtime change or timing claim has been made yet.

9 days ago

#772 now has a landed benchmark-first boundary: https://github.com/zig-utils/zig-js/commit/dcee391\n\nIt measures 12,800 fresh Intl.DateTimeFormat resolvedOptions results per 100 jobs with exact allocation/tier attribution and distinct cross-engine checksums. Three-sample zig-js baseline is stable at 0.8793% RSD. Runtime work remains pending; #773 separately tracks the pattern-added dayPeriod semantic divergence exposed by the row.

9 days ago

#772 is complete on main.\n\nImplementation: https://github.com/zig-utils/zig-js/commit/66c150f\nEvidence: https://github.com/zig-utils/zig-js/commit/836ac5b\nShape witness: https://github.com/zig-utils/zig-js/commit/a553994\n\nPer 12,800 fresh results, exact native replay removes 11,200 managed cells, 11,200 backing allocations, and 33,600 bytes with identical checksum/execution/Shape counts. Full units, focused no-GIL TSan, OOM/GC/required-bytecode witnesses, and 244/244 DateTimeFormat Test262 cases pass.\n\n#773 remains the separate dayPeriod semantic follow-up. #775 tracks adding mixed-tier allocation replay directly to generated exact-parent artifacts.

9 days ago

DateTimeFormat selected-pattern state is now complete in 08a37fe9 (#773). The immutable native record now retains pattern-added dayPeriod and locale-specific clock widths from revision-pinned CLDR data; all formatting/reflection consumers share it.

Measured result: the frozen #772 checksum changes 705814248 -> 242469243 and exactly matches system JSC; DateTimeFormat Test262 remains 244/244, full units are 1,940 pass / 1 skip / 0 fail / 0 leak, and the TSan witness is green. #772 remains the separate closed allocation optimization.

9 days ago

#1062 is complete: local Date constructors/setters now convert wall time to UTC before TimeClip, while Date.UTC and direct numerical construction preserve their clipping semantics. Both range boundaries, fixed offset signs, millisecond edges, extreme inputs, and DST disambiguation are pinned.

The full pinned Date corpus moves from 592 pass / 2 fail to 594 pass / 0 fail, with exact gains in the two recorded toISOString boundary cases and zero regressions. The 594-case tree/VM witness has zero divergences; normal and unsuppressed TSan tests pass 4/4. No throughput or global conformance-score claim is made.

Sign in to comment on this issue.