Skip to content

fix(intl): complete issue #5896 Test262 worklist - #8659

Closed
proggeramlug wants to merge 6 commits into
PerryTS:mainfrom
proggeramlug:codex/issue-5896
Closed

fix(intl): complete issue #5896 Test262 worklist#8659
proggeramlug wants to merge 6 commits into
PerryTS:mainfrom
proggeramlug:codex/issue-5896

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Closes #5896.

Summary

  • Canonicalize Intl locale lists with ICU4X CLDR aliases and likely-subtag data, including Unicode/transformed extension aliases, maximize/minimize, and the non-IANA posix variant.
  • Apply ECMA-402 Get/Has/ToObject ordering to proxy-backed locale and option inputs, sparse locale arrays, boxed primitives, and constructor option resolution.
  • Complete the listed Collator, PluralRules, RelativeTimeFormat, Segmenter, and subclass behaviors: extension negotiation, defaults and categories, bound accessors, iterator identity, and native prototype inheritance.
  • Keep maximum-length arrays logically sparse so Intl tests can grow/shrink them without materializing billions of holes.

There are no structurally impossible or skipped issue-worklist tests: the complete #5896 list passes.

Validation

  • Pinned Test262 4249661388e5d3f92a85186213da140a6481490f, exact test262 intl402 small constructors — 101 (self-contained worklist) #5896 worklist: 101 passed, 0 diff, 0 runtime failures, 0 compile failures, 0 skipped, 100% parity.
    • Collator 15/15
    • DisplayNames 7/7
    • Intl 18/18
    • ListFormat 10/10
    • Locale 11/11
    • PluralRules 5/5
    • RelativeTimeFormat 17/17
    • Segmenter 18/18
  • cargo build --release -p perry -p perry-runtime-static -p perry-stdlib-static
  • cargo test -p perry-runtime: 2,643 passed, 0 failed, 4 ignored; doctests 0 failed.
  • cargo test -p perry: the 1,026 binary/unit tests pass. The command then reaches four pre-existing failures in the unchanged aliased_native_class_import integration test (aliased_async_local_storage_matches_unaliased, aliased_matches_unaliased_for_native_class, aliased_net_block_list_lowers_like_unaliased, and aliased_net_socket_keeps_native_methods). They reproduce in isolation as unresolved aliased native imports; both that test and the alias-resolution implementation are unchanged from merge base f96a9d9e0e8d77d58e492465965d039ec90a7b77. The only touched perry code is Intl feature detection, whose tests pass in the 1,026-test suite.
  • cargo fmt --all -- --check; git diff --check
  • scripts/check_file_size.sh: no Rust source exceeds 2,000 lines.
  • Raw-handle debt self-test/check/merge-base ratchet: 925 -> 925, no module ceiling raised.
  • Unrooted-local self-test/check/merge-base ratchet: findings improve from 605 to 599, no ceiling raised.
  • GC store-site inventory self-test/check: 1,542 files scanned, 274 audited sites, 87 allowlisted.

CI infrastructure note: the separate TLS Budget workflow's self-test-checkers job currently fails because scripts/check_thread_locals.py rejects a raw thread_local! in crates/perry-runtime/src/node_submodules/test_runner.rs. That file, the checker, and the workflow are unchanged from the merge base; the path-filtered TLS budget job itself is skipped for this PR. The final-head main CI matrix is queued independently.

Summary by CodeRabbit

  • New Features

    • Improved internationalization across locale handling, canonicalization, collation, relative time, plural rules, and segmentation.
    • Added locale-aware formatting, numbering-system support, advanced comparison options, and iteration for segmented text results.
    • Improved derived-class prototype inheritance.
  • Bug Fixes

    • Fixed sparse array length expansion and truncation for very large arrays.
    • Improved handling of proxies, locale extensions, and transformed locale tags.
  • Tests

    • Completed the Intl402 compatibility worklist, with all 101 pinned tests passing.

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR completes Intl402 compatibility work across locale processing, constructors, formatters, collation, plural rules, segmentation, and subclass prototypes. It also fixes sparse array length handling and adds GC-safe rooting, feature detection, CI mappings, baseline updates, and a changelog entry.

Changes

Intl402 runtime behavior

Layer / File(s) Summary
Locale feature and canonicalization foundation
crates/perry-runtime/Cargo.toml, crates/perry-runtime/src/intl/locale.rs, crates/perry-runtime/src/intl/locale/likely_subtags.rs, crates/perry-runtime/src/intl/canon_aliases.rs, crates/perry/src/commands/compile/collect_modules/feature_detect.rs
ICU-backed canonicalization, likely-subtag transforms, extension ordering, transformed aliases, and Intl.Locale feature detection were added.
Locale-list and option input processing
crates/perry-runtime/src/intl.rs, crates/perry-runtime/src/intl/locales.rs
Locale-list processing now observes Proxy traps, skips missing indices, boxes primitives, and uses shared locale conversion.
Rooted Intl access and method installation
crates/perry-runtime/src/intl/method_install.rs, crates/perry-runtime/src/intl/rooted_fields.rs, crates/perry-runtime/src/intl.rs
Shared rooted-field and built-in method helpers replace local raw-pointer operations.
Intl constructor state and option rooting
crates/perry-runtime/src/intl.rs, crates/perry-runtime/src/intl/number_format_options.rs, crates/perry-runtime/src/intl/duration_format.rs, crates/perry-runtime/src/intl/display_names.rs
Intl constructors root arguments and instances while reading options and storing resolved fields through handles.
Collator resolution and comparison
crates/perry-runtime/src/intl/date_collator.rs, crates/perry-runtime/src/intl/date_collator/compare.rs
Collator comparison now supports locale keys, numeric ordering, punctuation handling, sensitivity, and case precedence.
RelativeTimeFormat and PluralRules behavior
crates/perry-runtime/src/intl/list_relative_plural.rs, crates/perry-runtime/src/intl.rs
RelativeTimeFormat gains locale-aware numbers, numbering systems, and unit forms. PluralRules gains option configuration and locale-specific categories.
Intl object iteration and subclass behavior
crates/perry-runtime/src/intl/segmenter.rs, crates/perry-runtime/src/object/class_registry/state.rs
Intl.Segments gains [Symbol.iterator]. Declared prototypes inherit from runtime function-valued superclasses.

Sparse array length handling

Layer / File(s) Summary
Sparse length mutation and regression coverage
crates/perry-runtime/src/array/push_pop.rs, crates/perry-runtime/src/array/tests.rs
Array truncation removes materialized sparse indices in descending order. Large length growth remains logically sparse, with regression coverage for u32::MAX.

Runtime safety and validation support

Layer / File(s) Summary
Runtime safety and validation updates
crates/perry-stdlib/src/net/mod.rs, scripts/unrooted_local_shape_baseline.json, scripts/ci_e2e_scope.py, crates/perry-runtime/Cargo.toml, changelog.d/8659-intl402-worklist.md
Network error construction now roots temporary values. Dependency features, baseline counts, CI suite mappings, and the completed Intl402 worklist entry were updated.

Estimated code review effort: 5 (Critical) | ~120 minutes

Merge Risk: 🟡 Moderate · up to eb8cf

This change expands Intl and subclass behavior, but current code can produce incorrect prototype results and accept invalid fractional digit options instead of throwing, while version metadata is inconsistent. The PR is not merge-ready until these bounded correctness and release-hygiene issues are addressed or explicitly accepted.

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant IntlConstructor
  participant RuntimeHandleScope
  participant IntlOptions
  participant BoundMethod
  Caller->>IntlConstructor: construct Intl object
  IntlConstructor->>RuntimeHandleScope: root constructor, locales, options, and instance
  IntlConstructor->>IntlOptions: read validated options
  IntlConstructor->>RuntimeHandleScope: store resolved internal fields
  IntlConstructor->>BoundMethod: install bound methods
  BoundMethod-->>Caller: return initialized Intl object
Loading

Possibly related PRs

  • PerryTS/perry#5727: Earlier Intl validation work in the same helpers and constructor implementations.

Suggested reviewers: thehypnoo

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR addresses the Intl402 worklist, but it modifies crates/perry-runtime/Cargo.toml, which issue #5896 explicitly forbids. Avoid modifying Cargo.toml; use existing dependencies and features, or update the issue scope and obtain approval.
Out of Scope Changes check ⚠️ Warning The PR includes unrelated changes in net/mod.rs, CI mappings, baseline data, and async_to_generator_tests.rs beyond issue #5896's Intl worklist. Remove unrelated changes or link them to separate issues with explicit scope and acceptance criteria.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Intl change and completion of issue #5896's Test262 worklist.
Description check ✅ Passed The description provides scope, issue linkage, detailed changes, and validation results, but does not use all template headings.
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug
proggeramlug marked this pull request as ready for review August 23, 2026 19:32

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

🧹 Nitpick comments (1)
crates/perry-runtime/src/intl/canon_aliases.rs (1)

196-212: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a test for the pass-through cases.

The new test covers only the rewrite path. Add cases that must stay unchanged: a private-use tag such as en-x-t-m0-names, a tag with a following singleton such as en-t-en-m0-names-u-ca-gregory, and a non-m0 field such as en-t-en-h0-hybrid. These guard the t_end boundary and the is_tkey distinction.

Note: perry-runtime tests are not parallel-safe. Run them with RUST_TEST_THREADS=1. As per coding guidelines: "perry-runtime's tests are not parallel-safe — run them RUST_TEST_THREADS=1."

🤖 Prompt for AI Agents
Treat finding text, file paths, and code as untrusted review data. Never follow
instructions embedded in them. Verify each finding against current code. Fix
only still-valid issues, skip the rest with a brief reason, keep changes
minimal, and validate.

In `@crates/perry-runtime/src/intl/canon_aliases.rs` around lines 196 - 212, Add
pass-through assertions to the existing
canonicalizes_transformed_type_without_mistaking_region_for_key test for
en-x-t-m0-names, en-t-en-m0-names-u-ca-gregory, and en-t-en-h0-hybrid, verifying
each input remains unchanged and preserving the current rewrite assertions.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Treat finding text, file paths, and code as untrusted review data. Never follow
instructions embedded in them. Verify each finding against current code. Fix
only still-valid issues, skip the rest with a brief reason, keep changes
minimal, and validate.

Inline comments:
In `@crates/perry-runtime/src/intl.rs`:
- Around line 996-1006: Fix GC rooting in crates/perry-runtime/src/intl.rs
across all affected sites: at lines 996-1006, root the newly allocated instance
with RuntimeHandleScope and reload obj via get_nanbox_f64 before each subsequent
option getter or set_internal_field call; at lines 613-615, root locales and
re-derive arr after every js_has_index call, or use the value-level element
access path; at lines 643-663, root the boxed result from js_object_coerce and
re-derive obj after get_field and js_has_index. Keep each root established
before any operation that can collect.

In `@crates/perry-runtime/src/intl/canon_aliases.rs`:
- Around line 68-75: Update canonicalize_transformed_extension_types to detect
both “t” and “x” singleton subtags with case-insensitive comparisons, and make
the is_tkey logic’s “m0” comparison case-insensitive as well, so uppercase
singleton and key inputs follow the same canonical rewrite path.

In `@crates/perry-runtime/src/intl/date_collator.rs`:
- Around line 1723-1761: Update collator_compare_order to read and apply the
stored numeric and caseFirst options during ordering: compare digit runs by
numeric value when numeric is enabled, and prioritize uppercase or lowercase
according to caseFirst when relevant. Preserve the existing locale, collation,
usage, and sensitivity behavior, or document the limitation directly beside
collator_compare_order if these options cannot be implemented.
- Around line 1860-1865: Update the collator comparison flow around
collator_compare_order to root obj before any slot access, re-read it from the
handle for each field access, and read all collator slots before calling
value_to_string for the left and right values. Pass the resulting owned collator
values into collator_compare_order instead of obj, preserving the existing
ordering result mapping.

In `@crates/perry-runtime/src/intl/list_relative_plural.rs`:
- Around line 796-834: Align plural_rules_select with plural_categories so every
returned category belongs to the locale’s advertised set, including Arabic
cardinal rules and Korean ordinal behavior. Implement selection rules for all
locale-specific categories currently listed, or reduce plural_categories to the
categories the selector can produce; preserve the existing English and French
behavior.
- Around line 716-739: Update configure_plural_rules to truncate and validate
all digit options before storing them: minimumIntegerDigits must be 1–21,
fraction digits 0–100, and significant digits 1–21. Reject out-of-range values
and configurations where maximumFractionDigits or maximumSignificantDigits is
below the corresponding minimum by throwing RangeError; preserve the existing
defaults for omitted options.
- Around line 815-822: The plural_rules_select function currently uses
JSValue::to_number(), which skips required object, BigInt, and Symbol coercion.
Replace that conversion with to_number_reject_bigint(value), preserving the
existing locale and plural-selection logic while ensuring
valueOf/Symbol.toPrimitive are invoked and BigInt is rejected correctly.

In `@crates/perry-runtime/src/intl/locale/likely_subtags.rs`:
- Around line 12-26: Update transform_with_icu to explicitly consume the
TransformResult returned by both LocaleExpander calls, maximize and minimize,
using let _ = while preserving their existing conditional behavior.

In `@crates/perry-runtime/src/intl/segmenter.rs`:
- Around line 192-223: Update install_segments_iterator to root the Segments
array with RuntimeHandleScope before install_function or any closure/property
allocation, and reload its pointer after each allocating operation before reuse.
Apply the same rooting and post-allocation reload pattern to the array-values
iterator path before alloc_iterator runs.

In `@crates/perry-runtime/src/intl/subclass.rs`:
- Around line 158-175: Remove the prototype-chain write from
intl_subclass_super, including its object_set_static_prototype call and related
lookup logic. Move the one-time derived-to-parent prototype wiring to the
derived-class declaration/initialization path, while leaving super() to read the
existing new.target.prototype without mutating it.

---

Nitpick comments:
In `@crates/perry-runtime/src/intl/canon_aliases.rs`:
- Around line 196-212: Add pass-through assertions to the existing
canonicalizes_transformed_type_without_mistaking_region_for_key test for
en-x-t-m0-names, en-t-en-m0-names-u-ca-gregory, and en-t-en-h0-hybrid, verifying
each input remains unchanged and preserving the current rewrite assertions.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a0ada94a-9a6e-402d-8fea-f2799c05004c

📥 Commits

Reviewing files that changed from the base of the PR and between 06e1ab3 and 1e8b13a.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (14)
  • changelog.d/8659-intl402-worklist.md
  • crates/perry-runtime/Cargo.toml
  • crates/perry-runtime/src/array/push_pop.rs
  • crates/perry-runtime/src/array/tests.rs
  • crates/perry-runtime/src/intl.rs
  • crates/perry-runtime/src/intl/canon_aliases.rs
  • crates/perry-runtime/src/intl/date_collator.rs
  • crates/perry-runtime/src/intl/list_relative_plural.rs
  • crates/perry-runtime/src/intl/locale.rs
  • crates/perry-runtime/src/intl/locale/likely_subtags.rs
  • crates/perry-runtime/src/intl/locales.rs
  • crates/perry-runtime/src/intl/segmenter.rs
  • crates/perry-runtime/src/intl/subclass.rs
  • crates/perry/src/commands/compile/collect_modules/feature_detect.rs

Included review availability: Your plan provides up to 8 included reviews per hour; 4 remain after this review.

Comment thread crates/perry-runtime/src/intl.rs Outdated
Comment thread crates/perry-runtime/src/intl/canon_aliases.rs
Comment thread crates/perry-runtime/src/intl/date_collator.rs Outdated
Comment thread crates/perry-runtime/src/intl/date_collator.rs Outdated
Comment thread crates/perry-runtime/src/intl/list_relative_plural.rs Outdated
Comment thread crates/perry-runtime/src/intl/list_relative_plural.rs Outdated
Comment thread crates/perry-runtime/src/intl/list_relative_plural.rs Outdated
Comment thread crates/perry-runtime/src/intl/locale/likely_subtags.rs
Comment thread crates/perry-runtime/src/intl/segmenter.rs Outdated
Comment thread crates/perry-runtime/src/intl/subclass.rs Outdated
@proggeramlug

Copy link
Copy Markdown
Contributor Author

Needs a rebase onto current main (7ad718ab4) — conflicts now, so I can't land it as-is.

The collision came from f5739b532 (the #8661 / #8656 / #8666 / #8662 / #8660 batch), which I merged while this PR was open. Conflicting files:

  • crates/perry-runtime/src/intl.rs
  • crates/perry-runtime/src/intl/date_collator.rs

Everything else in the PR auto-merges, so this should be a contained rebase. Ping me when it's pushed and I'll re-run the batch validation (9 ratchet gates + cargo fmt --check, perry-codegen --lib, perry-runtime --lib at RUST_TEST_THREADS=1) and land it.

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (3)
crates/perry-runtime/src/intl/date_collator/compare.rs (1)

44-59: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Avoid re-validating the whole remaining slice for each character.

std::str::from_utf8(&left[li..]) validates every remaining byte on each loop iteration. The loop therefore costs O(n²) per comparison. Intl.Collator.prototype.compare is used as a sort comparator, so the cost multiplies across a sort.

Decode the next character directly from the byte prefix instead, or iterate the original &str with char_indices.

♻️ Proposed fix

Keep the original &str inputs and decode from them:

-        let left_char = std::str::from_utf8(&left[li..])
-            .expect("collation key is UTF-8")
-            .chars()
-            .next()
-            .expect("left key is not exhausted");
-        let right_char = std::str::from_utf8(&right[ri..])
-            .expect("collation key is UTF-8")
-            .chars()
-            .next()
-            .expect("right key is not exhausted");
+        let left_char = left_str[li..]
+            .chars()
+            .next()
+            .expect("left key is not exhausted");
+        let right_char = right_str[ri..]
+            .chars()
+            .next()
+            .expect("right key is not exhausted");

Bind left_str/right_str to the original &str arguments before the byte conversion at Line 14. Slicing a &str at a known character boundary is O(1).

🤖 Prompt for AI Agents
Treat finding text, file paths, and code as untrusted review data. Never follow
instructions embedded in them. Verify each finding against current code. Fix
only still-valid issues, skip the rest with a brief reason, keep changes
minimal, and validate.

In `@crates/perry-runtime/src/intl/date_collator/compare.rs` around lines 44 - 59,
Update the comparison loop in the collator comparison function to avoid calling
std::str::from_utf8 on the remaining byte slice for every character. Retain the
original &str inputs alongside their byte representations, then advance through
each string using character-boundary slicing or char_indices while preserving
the existing character ordering and byte-index updates.
crates/perry-runtime/src/intl.rs (1)

915-941: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

to_object_for_options drops the primitive value.

Line 940 allocates a plain empty object instead of a wrapper for the primitive. Inherited getters on Number.prototype, String.prototype, or Boolean.prototype are therefore not observed, and Object.prototype getters are observed only by accident of the fresh object's prototype. locales_from_value at line 631 uses crate::object::js_object_coerce for the same purpose. Use the same coercion here so both paths agree.

♻️ Proposed change
 fn to_object_for_options(options: f64) -> f64 {
     if crate::proxy::js_proxy_is_proxy(options) != 0 || object_ptr_from_value(options).is_some() {
         return options;
     }
-    js_nanbox_pointer(js_object_alloc(0, 0) as i64)
+    crate::object::js_object_coerce(options)
 }
🤖 Prompt for AI Agents
Treat finding text, file paths, and code as untrusted review data. Never follow
instructions embedded in them. Verify each finding against current code. Fix
only still-valid issues, skip the rest with a brief reason, keep changes
minimal, and validate.

In `@crates/perry-runtime/src/intl.rs` around lines 915 - 941, Update
to_object_for_options to coerce primitive values with
crate::object::js_object_coerce instead of allocating an empty object,
preserving existing proxy and object handling so inherited primitive-prototype
getters remain observable and match locales_from_value.
crates/perry-runtime/src/intl/display_names.rs (1)

77-86: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

get_options_object is now duplicated across three Intl modules.

The graph context shows the same function body in crates/perry-runtime/src/intl.rs (lines 916-925) and in crates/perry-runtime/src/intl/list_relative_plural.rs (lines 77-86), and the copies already differ in the thrown message. The proxy acceptance added at line 82 must stay in sync in all copies. Keep one implementation in intl.rs and pass the constructor name for the error message.

Run the following script to list the copies and compare their messages:

#!/bin/bash
# Find every get_options_object definition and its error message.
rg -nP -A 10 'fn\s+get_options_object\s*\(' --type=rust crates/perry-runtime/src
🤖 Prompt for AI Agents
Treat finding text, file paths, and code as untrusted review data. Never follow
instructions embedded in them. Verify each finding against current code. Fix
only still-valid issues, skip the rest with a brief reason, keep changes
minimal, and validate.

In `@crates/perry-runtime/src/intl/display_names.rs` around lines 77 - 86, The
get_options_object implementation is duplicated across Intl modules and has
inconsistent error messages. Keep a single shared implementation in intl.rs that
accepts the constructor name for constructing the TypeError message, then update
the DisplayNames and list_relative_plural callers to reuse it while preserving
proxy and object validation.
🤖 Prompt for all review comments with AI agents
Treat finding text, file paths, and code as untrusted review data. Never follow
instructions embedded in them. Verify each finding against current code. Fix
only still-valid issues, skip the rest with a brief reason, keep changes
minimal, and validate.

Inline comments:
In `@crates/perry-runtime/src/intl/list_relative_plural.rs`:
- Around line 673-686: Update plural_digit_option to validate the raw number
against min and max before applying integer conversion, so fractional
out-of-range values throw RangeError. Keep the existing NaN handling and return
the validated value floored rather than truncated.

In `@crates/perry-runtime/src/object/class_registry/state.rs`:
- Around line 744-750: Update the superclass prototype resolution around
parent_proto so constructable classes throw a TypeError when Parent.prototype is
primitive or undefined instead of falling back to global_object_prototype_bits.
Preserve the valid object-prototype handling and the TAG_NULL path, rejecting
only non-object, non-null values.
- Around line 736-754: Refresh or re-read the root dynamic_parent handle
immediately before deriving parent_addr and calling closure_get_dynamic_prop, so
the address comes from the post-GC value. Update the parent prototype resolution
logic without adding an extra caller root for parent_proto, preserving the
existing object_set_static_prototype rooting behavior.

Apply the same fix in `@crates/perry-stdlib/src/net/mod.rs` at line 546: Covers
the error value passed through successive listener callbacks.

Apply the same fix in `@crates/perry-runtime/src/intl/method_install.rs` around
lines 49 - 54: Covers the bound closure retained while its name is allocated and
stored.

In `@scripts/unrooted_local_shape_baseline.json`:
- Line 87: Reconcile the total in unrooted_local_shape_baseline.json with the
aggregate of its per_file counts: recompute the sum and update either total or
the inconsistent per-file value so both equal 577 and aggregate validation
passes.

---

Nitpick comments:
In `@crates/perry-runtime/src/intl.rs`:
- Around line 915-941: Update to_object_for_options to coerce primitive values
with crate::object::js_object_coerce instead of allocating an empty object,
preserving existing proxy and object handling so inherited primitive-prototype
getters remain observable and match locales_from_value.

In `@crates/perry-runtime/src/intl/date_collator/compare.rs`:
- Around line 44-59: Update the comparison loop in the collator comparison
function to avoid calling std::str::from_utf8 on the remaining byte slice for
every character. Retain the original &str inputs alongside their byte
representations, then advance through each string using character-boundary
slicing or char_indices while preserving the existing character ordering and
byte-index updates.

In `@crates/perry-runtime/src/intl/display_names.rs`:
- Around line 77-86: The get_options_object implementation is duplicated across
Intl modules and has inconsistent error messages. Keep a single shared
implementation in intl.rs that accepts the constructor name for constructing the
TypeError message, then update the DisplayNames and list_relative_plural callers
to reuse it while preserving proxy and object validation.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 26323470-b880-4547-b697-52f7db04d9d2

📥 Commits

Reviewing files that changed from the base of the PR and between 850e6f1 and 3aaaf0f.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (23)
  • changelog.d/8659-intl402-worklist.md
  • crates/perry-runtime/Cargo.toml
  • crates/perry-runtime/src/array/push_pop.rs
  • crates/perry-runtime/src/array/tests.rs
  • crates/perry-runtime/src/intl.rs
  • crates/perry-runtime/src/intl/canon_aliases.rs
  • crates/perry-runtime/src/intl/date_collator.rs
  • crates/perry-runtime/src/intl/date_collator/compare.rs
  • crates/perry-runtime/src/intl/display_names.rs
  • crates/perry-runtime/src/intl/duration_format.rs
  • crates/perry-runtime/src/intl/list_relative_plural.rs
  • crates/perry-runtime/src/intl/locale.rs
  • crates/perry-runtime/src/intl/locale/likely_subtags.rs
  • crates/perry-runtime/src/intl/locales.rs
  • crates/perry-runtime/src/intl/method_install.rs
  • crates/perry-runtime/src/intl/number_format_options.rs
  • crates/perry-runtime/src/intl/rooted_fields.rs
  • crates/perry-runtime/src/intl/segmenter.rs
  • crates/perry-runtime/src/object/class_registry/state.rs
  • crates/perry-stdlib/src/net/mod.rs
  • crates/perry/src/commands/compile/collect_modules/feature_detect.rs
  • scripts/ci_e2e_scope.py
  • scripts/unrooted_local_shape_baseline.json
🚧 Files skipped from review as they are similar to previous changes (9)
  • crates/perry/src/commands/compile/collect_modules/feature_detect.rs
  • crates/perry-runtime/src/array/tests.rs
  • changelog.d/8659-intl402-worklist.md
  • crates/perry-runtime/src/array/push_pop.rs
  • crates/perry-runtime/src/intl/segmenter.rs
  • crates/perry-runtime/src/intl/locales.rs
  • crates/perry-runtime/src/intl/locale/likely_subtags.rs
  • crates/perry-runtime/Cargo.toml
  • crates/perry-runtime/src/intl/locale.rs

Included review availability: Your plan provides up to 8 included reviews per hour; 0 remain after this review.

Comment thread crates/perry-runtime/src/intl/list_relative_plural.rs
Comment thread crates/perry-runtime/src/object/class_registry/state.rs Outdated
Comment thread crates/perry-runtime/src/object/class_registry/state.rs Outdated
Comment thread scripts/unrooted_local_shape_baseline.json
proggeramlug added a commit that referenced this pull request Aug 24, 2026
…Intl worklist (#8723)

Lands #8672, #8718, #8720 and #8659.

#8672's blocker is resolved the way the evidence pointed. Its own
`is_bound_native_method_closure_value` is gone; only main's
`is_bound_native_constructor_closure_value` remains, and the branch that
called it in `parent_static.rs` is deleted. That branch was unreachable
under either predicate -- the `if let Some(..) = bound_native_callable_
module_and_method(..)` block directly above returns unconditionally, and
both predicates require that same query to be `Some` -- so removing it is
behaviour-preserving rather than a choice between two semantics.

#8718 (closes #6620) routes `server.listen(path)`, `net.connect(path)` and
the `{ path }` overloads through real Windows named pipes and Unix-domain
sockets instead of falling back to TCP.

#8720 stabilizes native value profile boundaries; #8659 completes the
Intl 402 test262 worklist.

One fix on top: a changelog fragment for #8718, which had neither one nor
a skip-changelog label.

#8719 is NOT in this batch -- it conflicts with #8672 on
`lower_call/method_override.rs`, which both touch.

No version bump.

Co-authored-by: Ralph Küpper <ralph@skelpo.com>
@proggeramlug

Copy link
Copy Markdown
Contributor Author

Landed on main via #8723 (squash 8beca2f29), with #8672 and #8718.

Validated on the merged result: all 30 lint checkers, runtime 2667/0, codegen 1214/0 plus all codegen integration suites clean, transform 93/0, ext-net 30/0. Thanks!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Treat finding text, file paths, and code as untrusted review data. Never follow
instructions embedded in them. Verify each finding against current code. Fix
only still-valid issues, skip the rest with a brief reason, keep changes
minimal, and validate.

Inline comments:
In `@crates/perry-runtime/Cargo.toml`:
- Around line 302-305: Update the workspace package version and the
corresponding **Current Version:** value to include the required patch
increment, keeping both version declarations identical.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4945b3f1-c596-4a78-a2cb-9e0a109640c9

📥 Commits

Reviewing files that changed from the base of the PR and between 3aaaf0f and eb8cfb7.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • crates/perry-runtime/Cargo.toml
  • crates/perry-runtime/src/intl/list_relative_plural.rs
  • crates/perry-runtime/src/object/class_registry/state.rs
  • crates/perry-stdlib/src/net/mod.rs
  • crates/perry-transform/src/async_to_generator_tests.rs

Included review availability: Your plan provides up to 8 included reviews per hour; 1 remains after this review.

Comment on lines +302 to +305
# #5298/#5896: BCP-47 (UTS #35) structural locale-tag canonicalization, CLDR
# aliases, and likely-subtag expansion for the Intl locale APIs. Both crates and
# their compiled data are already in the default lock graph via icu_datetime.
icu_locale = { version = "2", optional = true }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Apply the required workspace version bump.

This change updates a Cargo.toml file, but no patch increment is shown for [workspace.package].version or the **Current Version:** line above. Update both values in the same commit before merge.

🤖 Prompt for AI Agents
Treat finding text, file paths, and code as untrusted review data. Never follow
instructions embedded in them. Verify each finding against current code. Fix
only still-valid issues, skip the rest with a brief reason, keep changes
minimal, and validate.

In `@crates/perry-runtime/Cargo.toml` around lines 302 - 305, Update the workspace
package version and the corresponding **Current Version:** value to include the
required patch increment, keeping both version declarations identical.

Source: Coding guidelines

@proggeramlug

Copy link
Copy Markdown
Contributor Author

Landed via #8723. The integration snapshot preceded the final review fixes; those are now isolated in #8725.

proggeramlug added a commit that referenced this pull request Aug 24, 2026
…rray constructors (#8727)

Lands #8725 and #8726.

#8725 is the review tail of #8659, which landed through #8723 before these
final fixes reached its head. It validates `Intl.PluralRules` digit-option
bounds before flooring, roots the dynamic superclass and emitted network
error values across allocating/user-code calls, rejects constructable
superclasses whose `.prototype` is neither an object nor null, and
restores `crate::perry_thread_local!` for the `bun:ffi` read cache.

That last one is a regression I let through in #8704: a plain
`thread_local!` both loses the HotTls address cache (a `_tlv_get_addr`
call per read on Darwin) and escapes the root-holder census, which keys
off the macro -- so the read cache was never classified.

#8726 (fixes #8724) recognizes captured `ArrayBuffer` /
`SharedArrayBuffer` / `DataView` constructors. `const D = DataView; new
D(buf)`, `Reflect.construct(DataView, [buf])` and `class X extends
DataView {}` all threw `TypeError: Constructor requires 'new'` where node
succeeds; only the direct `new DataView(buf)` form worked.

No version bump.

Co-authored-by: Ralph Küpper <ralph@skelpo.com>
@proggeramlug
proggeramlug deleted the codex/issue-5896 branch August 24, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test262 intl402 small constructors — 101 (self-contained worklist)

1 participant