perf(codegen): reuse receiver validation in ordinary counted loops - #9712
perf(codegen): reuse receiver validation in ordinary counted loops#9712proggeramlug wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (9)
Included review availability: Your plan provides up to 8 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughOrdinary counted loops now use one-time receiver validation for eligible numeric-array accesses. Codegen caches and refreshes the receiver handle at loop polls, emits trusted raw-load paths, preserves guarded fallbacks, and adds IR, runtime, moving-GC, and rejection tests. ChangesCounted-loop receiver descriptor validation
Merge Risk: ⚪ Minimal · up to No concrete merge-blocking issue remains, and the optimization preserves guarded fallback and moving-GC behavior. Sequence Diagram(s)sequenceDiagram
participant CountedLoop
participant ReceiverDescriptorTable
participant IndexGet
participant GuardedArray
participant MovingGC
CountedLoop->>ReceiverDescriptorTable: Analyze and install numeric array descriptor
IndexGet->>ReceiverDescriptorTable: Query validated array access
ReceiverDescriptorTable-->>IndexGet: Return valid_i1 and base handle slot
IndexGet->>GuardedArray: Emit trusted raw load or checked fallback
MovingGC->>ReceiverDescriptorTable: Refresh rooted receiver and derived handle at poll
ReceiverDescriptorTable-->>IndexGet: Provide refreshed handle for later loads
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 60.53% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 38 functions across 8 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 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 |
412f7aa to
845139a
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
i < array.lengthnumeric-array loops without adding another specialized loop tier.This deliberately leaves Phase 4 (retiring the remaining fact tables one at a time) for follow-up work.
Refs #9254.
Validation
cargo build --releasecargo test -p perry-codegen --lib— 1,404 passed, 1 ignoredcargo test -p perry --test issue_9254_receiver_descriptor_counted_loop -- --test-threads=1— 2 passed, including a rate-1 scheduled moving-GC run with from-space protection./run_parity_tests.sh --filter issue_9254_receiver_descriptor_counted_loopunder the pinned Node 26.5.1 — 1 passed./scripts/pre-tag-check.sh --quickpython3 scripts/check_test_registration.pycargo clippy -p perry-codegen --libcargo clippy -p perry --test issue_9254_receiver_descriptor_counted_loop./scripts/test_affected_crates.sh --base origin/mainran 1,073 Perry bin tests successfully and found one unrelated failure: the existing build-cache inventory does not classifyPERRY_CONCAT_SITE_CACHE. The same exact test fails unchanged on a clean detached worktree at base commit75b886a381918e345f22b7f84dde7f4bb42e8a9a.Summary by CodeRabbit
Performance
Tests
Documentation