docs(gc): one GC correctness plan — three layers, and the enabler they depend on - #7292
Merged
Conversation
This was referenced Aug 3, 2026
|
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)
📝 WalkthroughWalkthroughThe PR documents a three-layer GC correctness plan covering codegen rooting, LLVM statepoints, and runtime Rust rooting. It also records statepoint effects, measured costs, known limitations, RSS sequencing, and the related changelog entry. ChangesGC correctness plan
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: ✨ 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 |
This was referenced Aug 3, 2026
Open
Open
This was referenced Aug 3, 2026
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.
We have five documents and issues that each describe part of the same defect, and no single place that says how they relate. This makes
rfc-rooting-by-construction.mdthat place, rather than adding a sixth.The motivating evidence
40 GC/rooting commits landed in three days, and the blocking bug (#7280) still measures red 0/30. Every one of those fixes was correct. None ended the class. That is what fixing instances instead of the shape looks like.
What the plan says
The shape, stated once: a GC-managed pointer exists somewhere the collector does not know about, across a point where the collector can run.
"Somewhere it does not know about" has had three homes, needing three different mechanisms — and conflating them is why this felt endless:
perry-codegen's lowering codeRaw/Rooted)perry-runtime's hand-written RustRuntimeHandleScope, non-optionalLayer 0 is the enabler. #7108 measured statepoints viable but concluded "the text-IR-plus-stock-clang architecture is what rules the cheapest design out" — Perry emits textual
.llto a user-suppliedclang, controlling neither the pass pipeline nor stackmap emission. #7241's Phase 0 removes exactly that, and independently verifiedgc "statepoint-example"constructs, verifies and emits. Dependency order is 0 → 2, with 1 and 3 independent.The finding worth reading even if you skip the rest
Adopting statepoints deletes three of this RFC's own "cannot catch" entries rather than mitigating them — shadow-frame correctness, side-table-rooted values, and the
SlotIdxcompanion change — because the shadow frame stops existing. Layers 1 and 2 are complements: layer 2 makes emitted code correct by construction, layer 1 makes the compiler's own code hard to write incorrectly.Costs, recorded so they are decided rather than discovered
RSS interaction
The −65% (320 MB → 111 MB) comes from the 16 MB nursery cap, not the copying — they merely share a flag. So the memory win has a route that avoids the risky path. Sequenced last deliberately: measuring it while "minors" fall back to a conservative full scan (#7255) would bake that cost in and make it look inherent.
Docs only. No behaviour change.
Summary by CodeRabbit