Skip to content

fix(lint): keep array/iter_methods within its raw-handle ceiling - #8492

Merged
proggeramlug merged 1 commit into
mainfrom
fix/8493-raw-handle-iter-methods
Aug 20, 2026
Merged

fix(lint): keep array/iter_methods within its raw-handle ceiling#8492
proggeramlug merged 1 commit into
mainfrom
fix/8493-raw-handle-iter-methods

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

lint is currently RED on main, which blocks every open PRlint is part of pr-gate.

#8482 added four arr_handle.get_raw_const_ptr::<ArrayHeader>() reads (the join helpers' post-collection receiver reload), taking array/iter_methods.rs to 6 bare reads against a ceiling of 2, and the workspace to 982 against a baseline of 978:

crates/perry-runtime/src/array/iter_methods.rs: 6 bare reads exceeds its ceiling of 2

The ratchet deliberately refuses to be raised (--update only accepts a lower number), so this needs the reads converted rather than the baseline moved.

Why with_const_ptr is the right conversion here: the ratchet's message recommends it for "a scoped argument to a non-allocating operation", and normalize_array_receiver only strips a NaN-box tag and probes the GC header — it cannot allocate or move anything. So each site becomes arr_handle.with_const_ptr(normalize_array_receiver). The rooting #8482 introduced is untouched; only the final read inside each already-open scope becomes scoped.

Verified: scripts/raw_handle_debt.py reports 978 (baseline 978) with all 109 modules within ceilings, cargo fmt clean, perry-runtime builds, and the array join unit tests pass.

Diagnosed while investigating why #8488's lint failed: that branch measures exactly 978 on its own, and only fails as a merge with main — so the violation is main's, not the PR's.

Summary by CodeRabbit

  • Bug Fixes
    • Improved array joining reliability when callbacks or string conversions occur.
    • Preserved correct handling for missing elements, regular values, and BigInt values during array stringification.
    • Fixed internal raw-handle usage without changing the public API.

#8482 added four `arr_handle.get_raw_const_ptr::<ArrayHeader>()` reads —
the join helpers' post-collection receiver reload — taking this module to 6
bare reads against a ceiling of 2, and the workspace to 982 against a
baseline of 978. That turned `lint` RED on main, and since `lint` is part
of `pr-gate` it blocked every open PR (surfaced on #8488, whose own branch
measures exactly 978).

The ratchet's own guidance applies directly here: `normalize_array_receiver`
only strips a NaN-box tag and probes the GC header — it cannot allocate — so
the scoped `with_const_ptr` form is exactly right. The rooting #8482 added
is unchanged; only the final read inside each scope becomes scoped.

Verified: raw_handle_debt.py reports 978 (baseline 978), all 109 modules
within ceilings; perry-runtime builds; the array join unit tests pass.

Refs #8482
@proggeramlug
proggeramlug merged commit a00b165 into main Aug 20, 2026
18 of 19 checks passed
@proggeramlug
proggeramlug deleted the fix/8493-raw-handle-iter-methods branch August 20, 2026 17:43
@coderabbitai

coderabbitai Bot commented Aug 20, 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: a742ff4f-bf15-44f5-b51d-848c57addab2

📥 Commits

Reviewing files that changed from the base of the PR and between f5a8dcf and 904b07d.

📒 Files selected for processing (2)
  • changelog.d/8493-raw-handle-iter-methods.md
  • crates/perry-runtime/src/array/iter_methods.rs

📝 Walkthrough

Walkthrough

Array join helpers now re-derive receivers through scoped with_const_ptr access after callbacks and string conversions. A changelog entry documents the raw-handle lint fix.

Changes

Array join normalization

Layer / File(s) Summary
Scoped receiver access
crates/perry-runtime/src/array/iter_methods.rs, changelog.d/8493-raw-handle-iter-methods.md
Join helpers use the rooted handle’s current pointer through with_const_ptr for exotic elements and stringification paths. The changelog records the lint remediation.

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

Suggested reviewers: thehypnoo

✨ 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/8493-raw-handle-iter-methods

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