You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Preserve WTF-8 keys for computed class members - #12471
Preserve exact WTF-8 bytes for computed class member names containing lone surrogates through declaration metadata, registration, lookup, reflection, descriptors, deletion and recreation, function names, method calls, and instance accessor writes, without changing the runtime ABI or symbol-key behavior. Fixes#12202.
At exact head 2272f7b5 (tree 20d752b0), 59 unique focused runtime tests passed across 67 executions. A fresh matching dev trio build passed, and the compiled fixture matched pinned Node v26.5.1 exactly. Genuine auto-opt validation passed after rebuilding runtime and stdlib with the async-bridge feature; fresh-archive Perry output matched Node exactly. Product and host warning comparisons are non-green but match the base exactly: 42 product and 35 host diagnostics.
The complete full-lint driver finished before its 30-minute cap with exit 1: 105 passed, 32 failed of 137 evaluated, and 2 CI-only gates were skipped. Thirty failures reproduce on the comparison parent; two are environment/path failures (the Windows CRT fetch was blocked by proxy HTTP 403, and the API docs wrapper used a hard-coded binary path). The fatal host Clippy error also reproduces on the parent, while the separate nonfatal warning comparison found three added and one removed warning fingerprints (net +2; 1102 vs 1100). Warn-level Clippy is informational under the repository workflow; the full delta is disclosed in the evidence. Direct API Markdown generation produced 91,751 bytes while tracked reference.md is empty on both baseline and candidate; the generated d.ts matched. The docs drift check after the wrapper failure does not prove regeneration.
Validation is Linux-only. Generic computed-method default-parameter .length behavior remains a separate known limitation for ASCII and WTF-8 keys. Tests lack a dedicated forced-evacuation stress witness for the byte-aware setter and prototype-materialization paths. Exact logs, hashes, and attribution are in the final validation record, the failure attribution, and the Clippy/API-doc reconciliation.
Summary by CodeRabbit
Bug Fixes
Computed class member names containing lone surrogates now retain their exact identity across registration, lookup, reflection, method calls, and accessor writes. They no longer collide with replacement-character names.
Native method calls and class static-property access preserve these names, including through inherited methods and accessors.
Tests
Added coverage for unusual computed keys, descriptors, function names, key ordering, deletion and re-addition, and method behavior.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
📝 Walkthrough
The runtime now carries computed class member names as byte keys through registration, storage, lookup, reflection, and invocation. The changes add byte-oriented APIs across class and property operations, and add regression coverage for lone-surrogate keys.
Changes: WTF-8 Class Member Keys
Layer / File(s)
Summary
Byte-key contracts and property operations crates/perry-runtime/src/closure/*, crates/perry-runtime/src/object/class_image.rs, crates/perry-runtime/src/object/class_registry/declarations.rs, crates/perry-runtime/src/object/accessor_pair.rs, crates/perry-runtime/src/object/descriptor_state.rs
Closure property operations and descriptor helpers now accept byte keys. Class member names, ordering entries, and bind-length keys use byte vectors. Declaration lookup compares names by bytes rather than converting them to UTF-8 strings.
Class registration and materialization crates/perry-runtime/src/object/class_registry*, crates/perry-runtime/src/object/class_value.rs, crates/perry-runtime/src/object/class_value/tests.rs, crates/perry-runtime/src/object/field_get_set/class_object_*, crates/perry-runtime/src/object/native_module/class_method_*, changelog.d/12471-wtf8-class-keys.md, scripts/*
Class declaration, prototype, accessor, and static-member registration paths use byte keys. Method materialization and class-value operations also use byte-oriented lookups. Tests cover class-value caching, collection, static properties, and computed-member declaration lookup.
sequenceDiagram
participant ClassEvaluation
participant ClassRegistry
participant PropertyStorage
participant PropertyLookup
ClassEvaluation->>ClassRegistry: Register computed member name bytes
ClassRegistry->>PropertyStorage: Install property using key bytes
PropertyLookup->>ClassRegistry: Resolve member using key bytes
PropertyLookup->>PropertyStorage: Read property using exact key bytes
Loading
Possibly related PRs
PerryTS/perry#11416: It introduces declaration-prototype and accessor-chain paths that this change updates to use byte-slice keys.
Suggested reviewers:proggeramlug
Merge Risk:⚪ Minimal · up to 26e4d
No actionable issue remains identified for this change. It is mergeable after normal checks.
Pre-merge checks · 4 · 1
Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 55.73% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 253 functions across 32 files. (3 skipped…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks (4 passed)
Check name
Status
Explanation
Linked Issues check
Issue #12202 requires computed class method names with lone surrogates to retain WTF-8 bytes through registration and invocation. The PR adds byte-based declaration, registration, lookup, prototype, f…
Out of Scope Changes check
The changes stay connected to #12202. Runtime changes extend byte-key handling across the class declaration and property paths needed for the stated behavior. The added tests exercise the issue and it…
Title check
The title clearly and concisely describes the main change: preserving WTF-8 keys for computed class members.
Description check
The description explains the implementation scope, linked issue, test results, known limitations, validation environment, and failure attribution. It does not use the template headings or checklist fo…
Full details: Docstring Coverage
Explanation
Docstring coverage is 55.73% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 253 functions across 32 files. (3 skipped: 3 unsupported.)
Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
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
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.
Preserve exact WTF-8 bytes for computed class member names containing lone surrogates through declaration metadata, registration, lookup, reflection, descriptors, deletion and recreation, function names, method calls, and instance accessor writes, without changing the runtime ABI or symbol-key behavior. Fixes #12202.
At exact head
2272f7b5(tree20d752b0), 59 unique focused runtime tests passed across 67 executions. A fresh matching dev trio build passed, and the compiled fixture matched pinned Node v26.5.1 exactly. Genuine auto-opt validation passed after rebuilding runtime and stdlib with theasync-bridgefeature; fresh-archive Perry output matched Node exactly. Product and host warning comparisons are non-green but match the base exactly: 42 product and 35 host diagnostics.The complete full-lint driver finished before its 30-minute cap with exit 1: 105 passed, 32 failed of 137 evaluated, and 2 CI-only gates were skipped. Thirty failures reproduce on the comparison parent; two are environment/path failures (the Windows CRT fetch was blocked by proxy HTTP 403, and the API docs wrapper used a hard-coded binary path). The fatal host Clippy error also reproduces on the parent, while the separate nonfatal warning comparison found three added and one removed warning fingerprints (net +2; 1102 vs 1100). Warn-level Clippy is informational under the repository workflow; the full delta is disclosed in the evidence. Direct API Markdown generation produced 91,751 bytes while tracked
reference.mdis empty on both baseline and candidate; the generated d.ts matched. The docs drift check after the wrapper failure does not prove regeneration.Validation is Linux-only. Generic computed-method default-parameter
.lengthbehavior remains a separate known limitation for ASCII and WTF-8 keys. Tests lack a dedicated forced-evacuation stress witness for the byte-aware setter and prototype-materialization paths. Exact logs, hashes, and attribution are in the final validation record, the failure attribution, and the Clippy/API-doc reconciliation.Summary by CodeRabbit