Skip to content

test(runtime): cover for-in visited levels across GC - #9902

Closed
proggeramlug wants to merge 1 commit into
PerryTS:mainfrom
proggeramlug:test/9869-for-in-proxy-prototype-gc
Closed

test(runtime): cover for-in visited levels across GC#9902
proggeramlug wants to merge 1 commit into
PerryTS:mainfrom
proggeramlug:test/9869-for-in-proxy-prototype-gc

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

The runtime fix for #9869 is already on main, but the retained prototype levels had no parity regression that forces collection between recording a level and rebuilding the deferred shadow set. This fixture uses a keyed receiver, an empty middle prototype, and a keyed ancestor: middle-level key-array allocation evacuates the retained receiver, then the ancestor triggers the shadow rebuild and duplicate-key filter.

Validation:

  • Exact fixture: 1/1 pass against Node 26.5.1
  • Forced schedule completed 11 copying collections and moved 18,887 objects with from-space protection and evacuation verification enabled
  • Test registration check passes: 259 files checked, no missing registrations
  • scripts/run_lint_gates.sh: all 64 gates passed, 2 CI-only checks skipped locally
  • Test-only change; no changeset or version bump required

Fixes #9869

Summary by CodeRabbit

  • Tests
    • Added coverage for for-in iteration across a multi-level prototype chain.
    • Verifies that enumeration remains correct when garbage collection occurs during key collection.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 04a470a8-63b5-48fe-8e3d-d50739bbf91c

📥 Commits

Reviewing files that changed from the base of the PR and between 9869101 and 6f0f774.

📒 Files selected for processing (1)
  • test-files/test_issue_9869_for_in_visited_levels_gc.ts

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


📝 Walkthrough

Walkthrough

Adds a parity test for issue #9869. The test enables forced moving GC, builds a three-level prototype chain with an empty middle level, iterates with for-in, and prints the collected keys.

Changes

for-in GC regression

Layer / File(s) Summary
GC-sensitive for-in iteration test
test-files/test_issue_9869_for_in_visited_levels_gc.ts
The test configures deterministic GC, builds the prototype chain, collects for-in keys, and prints the joined result after forced evacuation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 6f0f7

This adds regression coverage for GC-sensitive prototype traversal during for-in iteration without changing runtime behavior. No current merge-readiness risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies a runtime regression test for for-in visited levels across garbage collection.
Description check ✅ Passed The description explains the regression scenario, test design, linked issue, validation results, and test-only scope. It does not reproduce the template headings, but it contains the required informat…
Linked Issues check ✅ Passed The test covers the deferred shadow-set scenario from [#9869] using a keyed receiver, an empty middle prototype, a keyed ancestor, forced moving collections, and duplicate-key filtering after prototyp…
Out of Scope Changes check ✅ Passed The changes are limited to the requested parity regression fixture. No unrelated production, version, documentation, or configuration changes are reported.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
✨ 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 force-pushed the test/9869-for-in-proxy-prototype-gc branch from f781e08 to 6f0f774 Compare September 6, 2026 16:36
@proggeramlug

Copy link
Copy Markdown
Contributor Author

Landed on main via merge train #9903. Validated as a tree: 64/64 lint gates, and perry-runtime/codegen/hir/stdlib all green (5,944 tests, 0 failures). Thanks!

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.

GC: for-in's deferred shadow set records prototype levels as unrooted raw pointers

1 participant