Skip to content

fix: method-scoped prototype guards, IPC transports, value profiles, Intl worklist - #8723

Merged
proggeramlug merged 1 commit into
mainfrom
merge/b23
Aug 24, 2026
Merged

fix: method-scoped prototype guards, IPC transports, value profiles, Intl worklist#8723
proggeramlug merged 1 commit into
mainfrom
merge/b23

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

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

#8672 — method-scoped prototype guards

The predicate collision that held this 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 in the import, and the branch that called it in parent_static.rs is deleted.

That deletion is behaviour-preserving rather than a choice between two semantics: the branch was unreachable under either predicate. The block directly above it —

if let Some((module, method)) = bound_native_callable_module_and_method(parent_value) {return;                     // unconditional
}

— returns whenever that query is Some, and both candidate predicates are defined as refinements of exactly that query. So neither could ever fire there.

#8718 — named-pipe and Unix-socket IPC (closes #6620)

server.listen(path), net.connect(path) and the { path } overloads now route through a real Windows named pipe or Unix-domain socket instead of falling back to TCP, reusing the existing socket lifecycle.

#8720 — stabilize native value profile boundaries

#8659 — complete the Intl 402 test262 worklist

Fix on top

A changelog.d/ fragment for #8718, which had neither one nor a skip-changelog label.

Validation (on the merged result)

  • All 30 lint-job checkers pass
  • perry-runtime --lib (RUST_TEST_THREADS=1): 2667 passed, 0 failed (+6)
  • perry-codegen --lib: 1214 passed, 0 failed
  • perry-codegen --tests (all integration suites): 0 failures
  • perry-transform --lib: 93 passed, 0 failed (+1)
  • perry-ext-net --lib: 30 passed, 0 failedfix(net): support named-pipe and Unix-socket IPC #8718's own subject suite
  • Squashed tree verified identical to the validated tree

Not in this batch

#8719 conflicts with #8672 on lower_call/method_override.rs, which both touch. It'll need a rebase now that #8672 has landed.

#8714 is still held on the raw-handle ratchet — 4 bare reads in value/to_string.rs against a ceiling of 2. Details on that PR.

Summary by CodeRabbit

  • New Features

    • Added Unix socket and Windows named-pipe support for node:net local connections.
    • Expanded native-library ABI support for 8-/16-bit and pointer-sized integers.
    • Added source-based POD type contracts, nested POD copying, and safer wide-integer handling.
    • Improved Intl locale canonicalization, collation, plural rules, relative-time formatting, and proxy-aware inputs.
  • Bug Fixes

    • Improved sparse-array length handling and deletion behavior.
    • Prototype method optimizations now invalidate only affected method guards.
    • Intl and native-value behavior now more closely matches standards and preserves value semantics.

…Intl worklist

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.
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 585c5e01-8871-42d3-95c5-2c52a90cc2e4

📥 Commits

Reviewing files that changed from the base of the PR and between 3f65530 and c558750.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (73)
  • changelog.d/8659-intl402-worklist.md
  • changelog.d/8672-method-name-prototype-guards.md
  • changelog.d/8718-named-pipe-unix-socket-ipc.md
  • changelog.d/8720-native-value-profile.md
  • crates/perry-api-manifest/src/native_abi.rs
  • crates/perry-codegen/src/collectors/proven_this_routing_tests.rs
  • crates/perry-codegen/src/expr/literals_vars.rs
  • crates/perry-codegen/src/expr/mod.rs
  • crates/perry-codegen/src/expr/pod_record.rs
  • crates/perry-codegen/src/lower_call/extern_func.rs
  • crates/perry-codegen/src/lower_call/method_override.rs
  • crates/perry-codegen/src/lower_call/native_table/net_events.rs
  • crates/perry-codegen/src/lower_call/omitted_native_params.rs
  • crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs
  • crates/perry-codegen/src/native_value/materialize.rs
  • crates/perry-codegen/src/native_value/pod.rs
  • crates/perry-codegen/src/native_value/verify/abi.rs
  • crates/perry-codegen/src/runtime_decls/mod.rs
  • crates/perry-codegen/src/runtime_decls/objects.rs
  • crates/perry-codegen/src/stmt/let_stmt.rs
  • crates/perry-codegen/tests/native_proof_regressions/native_library.rs
  • crates/perry-codegen/tests/native_proof_regressions/pod_manifest.rs
  • crates/perry-ext-net/src/dispatch.rs
  • crates/perry-ext-net/src/ipc.rs
  • crates/perry-ext-net/src/lib.rs
  • crates/perry-ext-net/src/server_state.rs
  • crates/perry-ext-net/src/test_async_shims.rs
  • crates/perry-ext-net/src/transport.rs
  • crates/perry-hir/src/lib.rs
  • crates/perry-hir/src/native_profile.rs
  • 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/native_abi.rs
  • crates/perry-runtime/src/object/class_registry.rs
  • crates/perry-runtime/src/object/class_registry/construct.rs
  • crates/perry-runtime/src/object/class_registry/gc_roots.rs
  • crates/perry-runtime/src/object/class_registry/prototype_methods.rs
  • crates/perry-runtime/src/object/class_registry/state.rs
  • crates/perry-runtime/src/object/delete_rest.rs
  • crates/perry-runtime/src/object/descriptor_state.rs
  • crates/perry-runtime/src/object/native_call_method.rs
  • crates/perry-runtime/src/object/native_call_method/handle_methods.rs
  • crates/perry-runtime/src/typed_feedback/guards.rs
  • crates/perry-runtime/src/typed_feedback/tests.rs
  • crates/perry-stdlib/src/common/dispatch/fastify_net_zlib.rs
  • crates/perry-stdlib/src/net/mod.rs
  • crates/perry-transform/src/async_to_generator_tests.rs
  • crates/perry-transform/src/inline/analysis.rs
  • crates/perry-transform/src/inline/mod.rs
  • crates/perry/src/commands/compile/collect_modules/feature_detect.rs
  • crates/perry/src/commands/compile/resolve/native_library.rs
  • docs/api/manifest.schema.json
  • docs/src/language/native-values.md
  • docs/src/native-libraries/manifest-v1.md
  • scripts/ci_e2e_scope.py
  • scripts/unrooted_local_shape_baseline.json
  • test-files/test_method_guard_name_invalidation.ts
  • test-files/test_parity_native_value_profile.ts

📝 Walkthrough

Walkthrough

This PR expands native ABI and POD support, updates Intl402 locale and formatting behavior, adds Unix-domain socket and Windows named-pipe IPC, scopes prototype guard invalidation by method, and fixes sparse-array length handling. It also adds regression tests, documentation, schema updates, and integration mappings.

Changes

Native ABI and POD value profile

Layer / File(s) Summary
Native contracts and ABI descriptors
crates/perry-api-manifest/..., crates/perry-hir/..., crates/perry/src/commands/compile/resolve/native_library.rs, docs/api/manifest.schema.json, docs/src/language/native-values.md, docs/src/native-libraries/manifest-v1.md
Adds exact-width integer descriptors and source-backed, nested POD contracts with validation and drift checks.
Native lowering and materialization
crates/perry-runtime/src/native_abi.rs, crates/perry-codegen/src/runtime_decls/..., crates/perry-codegen/src/lower_call/..., crates/perry-codegen/src/native_value/materialize.rs, crates/perry-codegen/src/expr/mod.rs
Adds checked integer validators and safe wide-integer materialization across native calls and generated code.
Nested POD storage and copy semantics
crates/perry-codegen/src/expr/pod_record.rs, crates/perry-codegen/src/expr/literals_vars.rs, crates/perry-codegen/src/stmt/let_stmt.rs, crates/perry-codegen/tests/native_proof_regressions/*, test-files/test_parity_native_value_profile.ts, crates/perry-transform/src/inline/*
Flattens nested initializers, copies unboxed POD storage, clones managed values, and prevents inlining of POD parameters. Tests cover nested values and ABI proofs.

Intl402 runtime behavior

Layer / File(s) Summary
Locale canonicalization and locale lists
crates/perry-runtime/Cargo.toml, crates/perry-runtime/src/intl/locale*, crates/perry-runtime/src/intl/locales.rs, crates/perry-runtime/src/intl/canon_aliases.rs, crates/perry/src/commands/compile/collect_modules/feature_detect.rs
Adds ICU-backed canonicalization and likely-subtag handling, transformed-extension aliases, and proxy-aware locale-list processing.
Rooted Intl construction and method installation
crates/perry-runtime/src/intl.rs, crates/perry-runtime/src/intl/rooted_fields.rs, crates/perry-runtime/src/intl/method_install.rs, crates/perry-runtime/src/intl/*_format.rs, crates/perry-runtime/src/intl/display_names.rs, crates/perry-runtime/src/intl/segmenter.rs
Uses rooted handles for constructor inputs, option access, internal fields, partially initialized objects, and installed methods.
Collation, plural, and relative-time behavior
crates/perry-runtime/src/intl/date_collator*, crates/perry-runtime/src/intl/list_relative_plural.rs
Adds option-aware collation, locale-specific plural categories, and locale- and numbering-system-aware relative-time rendering.

Local IPC transports

Layer / File(s) Summary
IPC transport and platform implementations
crates/perry-ext-net/src/transport.rs, crates/perry-ext-net/src/ipc.rs
Adds shared IPC stream handling with Unix-domain socket and Windows named-pipe clients, listeners, lifecycle events, cleanup, and platform round-trip tests.
Network API and lifecycle integration
crates/perry-ext-net/src/lib.rs, crates/perry-ext-net/src/dispatch.rs, crates/perry-ext-net/src/server_state.rs, crates/perry-ext-net/src/test_async_shims.rs, crates/perry-codegen/src/lower_call/native_table/net_events.rs, crates/perry-stdlib/src/common/dispatch/fastify_net_zlib.rs, crates/perry-stdlib/src/net/mod.rs
Routes path and { path } overloads through IPC, preserves connection accounting and address reporting, returns socket handles from dispatch, and roots network error construction.

Method-scoped prototype guards

Layer / File(s) Summary
Runtime invalidation and method resolution
crates/perry-runtime/src/object/class_registry/*, crates/perry-runtime/src/object/delete_rest.rs, crates/perry-runtime/src/object/descriptor_state.rs, crates/perry-runtime/src/object/native_call_method*
Tracks invalidation by hashed method slot, preserves a global fail-closed path, handles deleted methods, and prioritizes direct prototype methods.
Guard ABI and compiler wiring
crates/perry-runtime/src/typed_feedback/*, crates/perry-codegen/src/lower_call/method_override.rs, crates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rs, crates/perry-codegen/src/runtime_decls/objects.rs, crates/perry-codegen/src/collectors/proven_this_routing_tests.rs, test-files/test_method_guard_name_invalidation.ts
Passes method guard slots through direct-shape guards and verifies unrelated mutations remain valid while matching mutations invalidate guards.

Runtime and integration maintenance

Layer / File(s) Summary
Sparse array length behavior
crates/perry-runtime/src/array/push_pop.rs, crates/perry-runtime/src/array/tests.rs
Preserves sparse deletion order and avoids dense allocation for very large logical lengths.
Integration mappings and baselines
scripts/ci_e2e_scope.py, scripts/unrooted_local_shape_baseline.json, crates/perry-transform/src/async_to_generator_tests.rs
Updates integration-suite selection and shape baselines, and removes a duplicate test import.

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

Suggested reviewers: thehypnoo

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant NetAPI
  participant IPC
  participant ServerState
  participant Transport
  Client->>NetAPI: connect(path)
  NetAPI->>ServerState: reserve local path connection
  NetAPI->>IPC: create IPC client
  IPC->>Transport: register Unix socket or named pipe
  Transport->>NetAPI: emit connect and data events
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch merge/b23

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 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>
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.

windows-runtime: net has no named-pipe IPC — server.listen(path) / net.connect({path}) unsupported

1 participant