Skip to content

fix: keep main green after the #9300/#9315/#9316 batch - #9320

Merged
proggeramlug merged 4 commits into
mainfrom
fix/train16-followup
Aug 31, 2026
Merged

fix: keep main green after the #9300/#9315/#9316 batch#9320
proggeramlug merged 4 commits into
mainfrom
fix/train16-followup

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #9300 / #9315 / #9316, all validated together as one build before that batch merged.

class_decl.rs back under the file cap. It sat at 1989 lines on main and #9315's additions took it to 2013. The non-computed member registration and Symbol.iterator wrapper helpers move to a sibling module under the existing class_decl/ directory convention, unchanged apart from pub(super) visibility.

Two order side-tables classified in the root-holder inventory. gc_runtime_root_holders.py fails on main right now with two unclassified holders. Both are genuinely not GC roots, and the reasoning is worth recording because the first one looks like it should be:

  • CLASS_SYMBOL_MEMBER_ORDERS: HashMap<(u32, u64, bool), u32> — its declaration comment says symbol registries are keyed by heap addresses, which would make it a table needing a re-key on evacuation. It isn't: record_class_symbol_member_order reads SymbolHeader::id once at registration and keys on that, and the id is stable across a move. The member values live in CLASS_SYMBOL_METHODS/CLASS_SYMBOL_ACCESSORS, which scan_class_symbol_member_keys_mut visits and rewrite_class_symbol_method_key_if_forwarded re-keys.
  • CLASS_DYNAMIC_PROP_ORDER: HashMap<u32, Vec<String>> — owned Rust strings recording first-insertion order for [[OwnPropertyKeys]]; the f64 values live in CLASS_DYNAMIC_PROPS, already a scanned root.

One unused_parens in the numeric-range header read from #9316, which -D warnings makes a build failure.

Validation: perry-runtime + perry-codegen + perry-hir (80 suites) green under RUST_TEST_THREADS=1; strided_tagged_fill passing; and test_gap_9226_class_prototype_own_keys.ts byte-identical against the pinned Node 26.5.1 oracle. Release build clean with no warnings; file-size, raw-handle, thread-local, root-holder, GC-knob, store-site and fmt gates all pass.

Summary by CodeRabbit

  • Refactor

    • Reorganized class-member processing into a dedicated internal module without changing public behavior.
    • Preserved support for class methods, getters, setters, and symbol-based iterator methods.
  • Chores

    • Updated internal garbage-collection tracking metadata for class registry and property-order data.
    • Simplified internal numeric-range code syntax without changing functionality.
    • Added internal changelog documentation.

Ralph Küpper added 4 commits August 31, 2026 21:22
…ntory

CLASS_SYMBOL_MEMBER_ORDERS is keyed by SymbolHeader::id (stable, not an
address) with a u32 order value; CLASS_DYNAMIC_PROP_ORDER holds owned Rust
strings. Neither stores a JSValue, so neither is a GC root.
…ecl.rs

class_decl.rs was at 1989 lines; #9315's additions take it over the 2000-line
gate. The non-computed member registration and Symbol.iterator wrapper helpers
move to a sibling module unchanged.
`-D warnings` in CI treats unused_parens as an error.
@proggeramlug
proggeramlug merged commit b96f2fb into main Aug 31, 2026
16 of 17 checks passed
@proggeramlug
proggeramlug deleted the fix/train16-followup branch August 31, 2026 19:23
@coderabbitai

coderabbitai Bot commented Aug 31, 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: 5769e505-88ba-4ae8-8958-b3daad902f2d

📥 Commits

Reviewing files that changed from the base of the PR and between 19460b7 and b653469.

📒 Files selected for processing (5)
  • changelog.d/9320-train16-followup.md
  • crates/perry-hir/src/lower_decl/class_decl.rs
  • crates/perry-hir/src/lower_decl/class_decl/member_registration.rs
  • crates/perry-runtime/src/array/numeric_range.rs
  • scripts/gc_runtime_root_holders.json

📝 Walkthrough

Walkthrough

The PR extracts class-member registration helpers into a dedicated module, adds symbol iterator wrapper synthesis there, records GC root-holder classifications, removes redundant parentheses, and documents these changes in the internal changelog.

Changes

Class lowering and runtime follow-up

Layer / File(s) Summary
Class-member registration extraction
crates/perry-hir/src/lower_decl/class_decl.rs, crates/perry-hir/src/lower_decl/class_decl/member_registration.rs
Class-member registration and symbol iterator wrapper synthesis move into member_registration.rs. class_decl.rs imports the extracted functions.
GC root-holder classification
scripts/gc_runtime_root_holders.json
The inventory adds classifications for static prototypes, nulled prototype data, symbol member orders, and dynamic property order storage.
Runtime syntax cleanup and changelog
crates/perry-runtime/src/array/numeric_range.rs, changelog.d/9320-train16-followup.md
The numeric-range code removes redundant parentheses. The changelog records the extraction, root-holder classifications, and syntax cleanup.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant LoweringContext
  participant synthesize_symbol_iterator_wrapper
  participant pending_functions
  participant iterator_func_for_class
  participant IteratorWrapper
  participant LiftedIterator
  LoweringContext->>synthesize_symbol_iterator_wrapper: provide class name and generator function
  synthesize_symbol_iterator_wrapper->>IteratorWrapper: prepend this parameter
  synthesize_symbol_iterator_wrapper->>LiftedIterator: replace this references and lift generator body
  synthesize_symbol_iterator_wrapper->>pending_functions: register lifted generator
  synthesize_symbol_iterator_wrapper->>iterator_func_for_class: register class mapping
  synthesize_symbol_iterator_wrapper-->>LoweringContext: return synthetic @@iterator wrapper
  IteratorWrapper->>LiftedIterator: call with this
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 fix/train16-followup

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.

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.

1 participant