fix(lint): keep array/iter_methods within its raw-handle ceiling - #8492
Merged
Conversation
#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
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughArray join helpers now re-derive receivers through scoped ChangesArray join normalization
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
lintis currently RED onmain, which blocks every open PR —lintis part ofpr-gate.#8482 added four
arr_handle.get_raw_const_ptr::<ArrayHeader>()reads (the join helpers' post-collection receiver reload), takingarray/iter_methods.rsto 6 bare reads against a ceiling of 2, and the workspace to 982 against a baseline of 978:The ratchet deliberately refuses to be raised (
--updateonly accepts a lower number), so this needs the reads converted rather than the baseline moved.Why
with_const_ptris the right conversion here: the ratchet's message recommends it for "a scoped argument to a non-allocating operation", andnormalize_array_receiveronly strips a NaN-box tag and probes the GC header — it cannot allocate or move anything. So each site becomesarr_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.pyreports 978 (baseline 978) with all 109 modules within ceilings,cargo fmtclean,perry-runtimebuilds, and the array join unit tests pass.Diagnosed while investigating why #8488's
lintfailed: 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