Merge train 184s: #10217 - #10233
Merged
Merged
Merge train 184s: #10217#10233
Conversation
added 4 commits
September 14, 2026 00:26
… sweep (#10182) A synchronous full sweep walked every arena object; each dead one paid for old-page accounting, finalize_dead_arena_payload and a page-index removal before the block cleanup reset the block wholesale. After a parse/scan loop most blocks hold only dead objects, so a full's cost scaled with garbage. The exact census (ValidPointerSetBuilder) now seals its address-ordered runs at block boundaries and records, per block, the object count, bytes, and whether any header owes per-object work (pinned, forwarded, pre-marked, no ARENA flag, a finalize hook, an error/regexp/lazy-tape hook, raw-f64 array layout bits, or an object while the legacy overflow table or the wasm module-wrapper registry has entries). A successful census membership query marks the query's block as reached; every mark a census-built cycle sets is preceded by one, and the two mark paths that are not (allocate-black births, block-persistence force marks) are excluded by construction (a block whose bump offset moved since the census, and the recent general window, are never skipped). ArenaSweepObjectsState skips a block that is censused, unreached, free of obligations, unchanged since the census, and reclaimed by the cleanup when it has no live object (general blocks outside the recent window, survivor and old blocks). Freed/Eden-dead bytes come from the census sums; the block cleanup's unregister_old_block_pages supersedes the per-object page bookkeeping; element-shape, per-object layout and closure side tables are already dropped by the full trace's dead-owner fan-out. The require-marked old-to-young remembered-set rebuild skips the same unreached blocks. Test builds re-walk every skipped block and assert it holds no marked or pinned header. Budgeted fulls (classifier membership, mutator windows) and minors keep the per-object walk. ArenaSweepObjectsState moves to gc/oldgen/sweep_objects.rs for the 2000-line cap. PERRY_GC_DIAG prints block_skip_reclaimed_blocks / _objects / _bytes on each sweep's [gc] blocks: line. (cherry picked from commit 27ad15e)
(cherry picked from commit 0b81857)
(cherry picked from commit 0e782c6)
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (20)
📝 WalkthroughWalkthroughChangesBlock-granular garbage collection
Estimated code review effort: 4 (Complex) | ~60 minutes Change: Refactor Sequence Diagram(s)sequenceDiagram
participant FullGC
participant BlockCensus
participant RememberedSetRebuild
participant ArenaSweep
FullGC->>BlockCensus: collect reachability and sweep obligations
BlockCensus-->>RememberedSetRebuild: provide unreached block set
RememberedSetRebuild->>ArenaObjectCursor: skip selected blocks
FullGC->>ArenaSweep: pass census
ArenaSweep->>ArenaSweep: reclaim eligible blocks without object walking
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 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.
Merge train 184s: lands #10217 (reclaim dead blocks without visiting them in the synchronous full sweep; Part 1 of #10182) at
0e782c659a, plus the workspace version bump to 0.5.1562. (The "s" suffix keeps clear of the other merge lane's train numbers.)The three PR commits were cherry-picked onto
6000a00dfewithout conflicts.Validation (macOS arm64)
Validation ran on the same PR over
bb9aa5a641. Main has since gained only #10225 (regex files), which #10217 does not touch.scripts/run_lint_gates.sh: 80 of 83 pass. The 3 failures are the same steps as main: public benchmark evidence freshness, API docs drift, and-D warningsstopping on main'sglobal_this_webassembly.rsdead code.raw_handle_debt.py(both invocations),gc_runtime_root_holders.py,shape_descriptor_census.py,gc_store_site_inventory.py, fmt, file size: pass.check_thread_locals.py: only main'sregex/perex_owner.rs.cargo test --release -p perry-runtime: 3786 passed / 1 failed. This run includes the test-build safety net that re-walks every skipped block. The failure isgc::tests::heap_generation::a_free_or_move_outside_every_scope_is_caught_in_debug_builds, already on main from perf(regex): resume JS-level searches on non-ASCII strings from the previous call's position #10205.--lib block_skip: 11 / 0.2899_2779_2777_static_helpers,disposablestack_2875,iterator_prototype_next_patch,gc_http2_pending_event_callback_rooting) plus9592_child_timeout_threads, where the Node oracle fails on this host. Two further entries were timing flakes on a loaded host:9574_unlink_waits_for_parked_writepasses 3/3 on this build and also fails intermittently with a9b911855f8compiler, and9676_stdin_unref_ref_keeps_readerhit the 10 s harness timeout once, then passed 3/3 on this build and 2/2 with the old compiler.gc()) underPERRY_GC_DIAG=1reportsblock_skip_reclaimed_blocksup to 3 and a block of 23,834 objects reclaimed without visiting it. Its output matches Node except the finalWeakRef.deref()of an unreferenced object, which Perry clears aftergc()while Node still holds it. JS permits either, and it is identical across the plain, diagnostic and GC-stress runs. UnderPERRY_GC_SCHEDULE_SEED7 and 184 at rate 0.2, with forced evacuation, verification and from-space protection (917 and 935 copying minors), the output is identical to the plain run.Confirmation on this exact tree:
RUSTFLAGS=-Dwarnings cargo check -p perry --bins;cargo test --release -p perry-runtime3791 passed / 1 failed (the same #10205 test).CI attribution (#10217 run 34769800931 vs main's run at
b5a82cfeae)The same failing lint/check/warnings/cargo-test steps and errors, the same
native_stackfailure, the same four gated gap regressions with identical output, and the same gc-stress failure.Review notes
A block is skipped only when no census membership query landed in it (every census-built mark is preceded by one) and the census recorded no per-object obligation: pinned, forwarded or pre-marked headers, non-arena, finalize hooks, Error/RegExp/LazyArray dead-payload hooks, raw-f64/holes array layouts, or legacy overflow and wasm-wrapper entries while those tables are non-empty. Allocate-black births are excluded by the bump-offset comparison and block persistence by the recent-window exclusion. Budgeted fulls and minors keep the per-object walk. Page bookkeeping for skipped old blocks goes through the existing
unregister_old_block_pages.Summary by CodeRabbit
New Features
PERRY_GC_DIAG=1.Documentation
Chores