batch: land #8848, #8849, #8850, #8852, #8853 - #8857
Merged
Conversation
added 17 commits
August 26, 2026 08:47
…ined (#8770) A same-module direct call with fewer arguments than the callee's declared parameter count lowered only the provided args, leaving the remaining FP argument registers holding caller-saved garbage — which the callee then read as JS values. The cross-module twin (extern_func.rs, the issue #608 arm) has always padded missing trailing args with TAG_UNDEFINED; the same-module plain arm sat "one else away" (#7154's own words) unpadded. On the Claude Code bundle — one giant module, so EVERY direct call resolves through the same-module arm — `aP([q])` for `function aP(q, K = !1, _)` handed K/_ whatever d1/d2 held after js_array_from_values: impossible-NaN bit patterns (0xffffffffffffffff) that flowed into truthiness tests and method receivers (`_.get(A)`) and faulted in shape_is_url_search_params / js_is_truthy (~60% of `cc -p` runs SEGV), or silently corrupted the async iteration ("Detected unsettled top-level await", most of the rest). With the padding, `cc -p` runs 30/30 clean: 0 SEGV, 0 hangs, 0 unsettled awaits, node-identical output on every run. The GC-knob correlations the long #8770 investigation chased (scavenge pacing, conservative-scan "fixes") were register-content side effects of the missing padding, not collector bugs. Regression test: an under-applied direct call to a 3-param callee must emit all three double args, the omitted two as the TAG_UNDEFINED literal. Claude-Session: https://claude.ai/code/session_01Ay8VyLkKbm8Hkc1xmvTEsP
This was referenced Aug 26, 2026
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (43)
📝 WalkthroughWalkthroughThis PR adds strict assignment propagation, array and typed-array runtime optimizations, same-module call argument padding, an opt-in Node-API host core, and portable async_hooks fixtures with a 195/195 baseline. ChangesRuntime semantics and performance
Call lowering
Node-API host core
Async hooks parity
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
participant NativeAddon
participant NodeApiHost
participant PerryRuntime
participant RuntimeGC
NativeAddon->>NodeApiHost: create handles and invoke callbacks
NodeApiHost->>PerryRuntime: create values and call JavaScript functions
PerryRuntime-->>NodeApiHost: return values or pending exceptions
RuntimeGC->>NodeApiHost: scan and rewrite rooted handles
NodeApiHost-->>NativeAddon: return N-API status and values
Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
This was referenced Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Batch landing of five reviewed PRs, validated once as a single merged tree.
Fixes applied while landing
raw_handle_debt(runtime: add Node-API host core #8850) — two argument-position raw reads innode_api_host/values.rsfeeding allocating callees. Traced both rather than adding a module ceiling:kindresolves tojs_typeerror_new/js_rangeerror_new, which route throughalloc_error; that opens its ownRuntimeHandleScopeand rootsmessagebefore its first allocation, then re-reads through the handle.alloc_symbol's own body (see GC: a Symbol's description pointer is never traced — GC_TYPE_STRING is a pointer-free Leaf #7246 in it) copies the description text off the GC heap before it allocates, precisely so no live-but-untraced window exists.Both sound, so both were converted to the idiomatic
with_const_ptrscoped form. Ratchet back to baseline; no ceiling added.check_file_size— two files over the cap, one per PR:array/header.rs2001 → 1833 (perf: optimize proven Array length truncation #8849). Extracted the element-slot GC bookkeeping group (gc_element_slot_range,note_array_slot,store_array_slot,rebuild_array_layout*,replay_array_growth_write_barriers,mark_array_layout_unknown) toarray/header_gc_slots.rs, re-exported throughheaderso existing paths resolve unchanged.object/field_get_set/ic_miss.rs2010 → 1924 (perf: remove residual Wolf ECS admission overhead #8848). Extracted thearray_length_fast_path_testsmodule it added toic_miss_array_length_tests.rs.cargo fmt --all(codegen(calls): pad under-applied same-module direct calls with undefined (#8770) #8852) — formatting only.Validation (merged tree)
perry-runtime2701,perry-codegen1270,perry-stdlib120,perry-hir337 — all 0 failedPERRY_GC_FORCE_EVACUATE=1 PERRY_GC_VERIFY_EVACUATION=1): 16 failed on the batch and 16 on cleanmain— same-commit A/B, so none introduced heredfchecked before and after every run; no result produced under ENOSPCCoverage note on #8850
At +3002 lines and 81 C-ABI entry points,
cargo checkplus the unit suites are shallow coverage for a surface that size. It is opt-in behind thenode-api-hostfeature, so it cannot affect default builds, but no actual addon integration test was run here — real exercise of those entry points is still outstanding.Summary by CodeRabbit
New Features
undefined.Bug Fixes & Performance
lengthhandling for array subclasses.Compatibility
async_hooksparity across 195 fixtures, including Windows and Unix scenarios.Documentation