fix(gc): right-size idle arena capacity - #9731
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 (11)
Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe GC now tracks arena utilization across collections and opens bounded right-sizing episodes for idle heaps with sustained slack. Idle reclaim can service arena debt without mutator activity. Tests, diagnostics, changelog text, and internal documentation cover the new behavior. ChangesArena right-sizing
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to Arena right-sizing is bounded by utilization, capacity, and idle-reclaim gates, with coverage for follow-up collection and re-arm behavior. No actionable current-head merge risk remains. Sequence Diagram(s)sequenceDiagram
participant GC
participant GC_policy
participant arena_right_size
participant idle_reclaim
participant idle_reducer
GC->>GC_policy: publish collection outcome
GC_policy->>arena_right_size: record live bytes and full flag
arena_right_size-->>idle_reclaim: report owed full collection
idle_reclaim->>idle_reducer: start ArenaRightSize full collection
idle_reducer->>arena_right_size: note_started()
idle_reducer->>GC_policy: publish next collection census
GC_policy->>arena_right_size: decrement debt or finish episode
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 44 functions across 9 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
8091888 to
6d0a048
Compare
|
Landed on |
Summary
Right-size GC arena capacity after a burst leaves a persistently small live set. The idle reducer can now pay the arena's bounded two-full release debt without waiting forever for new mutator activity.
Changes
Related issue
Fixes #9709
Test plan
cargo fmt --all -- --checkcargo check -p perry-runtimeRUST_TEST_THREADS=1 cargo test -p perry-runtime --lib(3,104 passed; 4 ignored)scripts/check_test_registration.pyscripts/check_gc_doc_claims.pyscripts/check_gc_env_knobs.pyscripts/check_docs.pyscripts/test_affected_crates.sh --base upstream/main(runtime and 1,073/1,074 CLI tests passed; the sole CLI failure reproduces unchanged on the base commit because upstreamPERRY_CONCAT_SITE_CACHEis absent from its build-cache inventory)scripts/run_lint_gates.sh(all 62 applicable static gates passed)scripts/run_gap_tests.shwith the pinned Node 26.5.1 oracle (full local snapshot comparison in progress; release compiler/runtime archives built successfully)PERRY_GC_CENSUSThe real-workload census observed arena capacity fall from 96.5 MB before the right-size episode to 36.7 MB, then 35.7 MB and 35.7 MB across the five-minute soak, with about 23 MB live. RSS fell from 401 MB at the first census to 132 MB at the last. Exactly one idle full was attributed to arena right-sizing.
Known upstream failures
The
self-test-checkersTLS job currently fails on five untouched files already present onmain(fs/deferred.rs,gc/census.rs,gc/idle_compact.rs,gc/idle_reclaim.rs, andgc/oldgen_defrag.rs). Recent scheduledmainruns fail the same gate; this PR's new TLS state usescrate::perry_thread_local!and is absent from the violation list.test_affected_crates.sh's sole CLI failure,codegen_env_vars_are_build_cache_inputs, reproduces unchanged on the base commit becausePERRY_CONCAT_SITE_CACHEis missing from upstream's build-cache inventory. The affected runtime suite passes in full.Relevant release compiler/runtime archives build cleanly
Added
#[test]coverage in the affected runtime crateUpdated
docs/src/Screenshots / output
Checklist
CONTRIBUTING.mdand agree to the Code of ConductSummary by CodeRabbit
Bug Fixes
Documentation