Skip to content

fix(class): keep specialization IDs unique across modules - #12069

Merged
proggeramlug merged 1 commit into
mainfrom
fix-specialization-id-collision
Oct 5, 2026
Merged

proggeramlug merged 1 commit into
mainfrom
fix-specialization-id-collision

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Fixes a wrong-output regression that #12024 introduced.

Generic class specialization IDs were allocated per module, so they could collide with object-literal shape IDs from other modules. The prototype fast path then returned Object.prototype for an instance of a specialized class. Specializations now draw from a single program-wide ID sequence. Bisect: the first bad commit is 993bcb2 (#12024).

Tests:

  • test_gap_recur_class_id_unique.ts (plus a literal helper): fails on main and on the first bad commit, and matches node with the fix.
  • monomorph unit tests are added.
  • HIR: 925 passed. Runtime: 5,113 passed, 0 failed.
  • 60 related gap tests pass.
  • The Effect workload runs ok=20000.

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cba2ebf9-2de6-4bd0-9c0c-0998bfaeaea5
📥 Commits

Reviewing files that changed from the base of the PR and between 001997e and af7a215.

📒 Files selected for processing (9)
  • changelog.d/PENDING-recur2-class-ids.md
  • crates/perry-hir/src/lib.rs
  • crates/perry-hir/src/monomorph/context.rs
  • crates/perry-hir/src/monomorph/driver.rs
  • crates/perry-hir/src/monomorph/mod.rs
  • crates/perry-hir/src/monomorph/tests.rs
  • crates/perry/src/commands/compile/bootstrap.rs
  • test-files/_helpers/recur_class_id_literals.ts
  • test-files/test_gap_recur_class_id_unique.ts
 ____________________
< Expecto bugtronum! >
 --------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug
proggeramlug marked this pull request as ready for review October 5, 2026 23:01
@proggeramlug
proggeramlug merged commit 9d9c3f2 into main Oct 5, 2026
69 of 118 checks passed
@proggeramlug
proggeramlug deleted the fix-specialization-id-collision branch October 5, 2026 23:02
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