Mark initialized mature references - #36
Merged
Merged
Conversation
Objects published with an already initialized mature-to-nursery edge must enter the remembered set before a minor collection. The previous post-merge helper neither compiled nor participated in allocation.\n\nDetect the typed reference edges during fallible construction, mark the card after publication without an auxiliary allocation, and cover preservation and relocation through a real minor collection.
13 tasks
Contributor
There was a problem hiding this comment.
No issues found across 3 files
Tip: cubic could auto-approve low-risk PRs like this, if it thinks it's safe to merge. Learn more
Re-trigger cubic
Reanalyze every open Module in an affected Bubble before publishing a document change. This prevents stale dependent diagnostics while keeping standalone documents and unrelated Packages isolated.\n\nFilter document symbols to their owning Module, include method bodies in compiler-proven parameter hints, and return a request error for code actions against closed documents without terminating the LSP session.
Keep same-Bubble LSP snapshots consistent
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.
Summary
Repair the mature-object initialization regression currently present in
master.Objects constructed with an already initialized mature-to-nursery reference
now enter the remembered set during publication. The check uses the precise
object map, does not scan scalar slots, and does not allocate an auxiliary
buffer. A real minor-collection test proves that the young child survives and
that the mature slot is rewritten to its relocated reference.
Architecture traceability
architecture/15-garbage-collector-architecture.mdprecise generational write-barrier contract for initialized allocations.
change was required because the accepted contract was already explicit.
Verification
cargo fmt --all -- --checkcargo check --workspace --all-targetscargo test --workspace --all-targetscargo clippy --workspace --all-targets -- -D warningsIf a check was not run, explain why:
The repository's architecture tests prohibit executing harness-free benchmark
targets. The complete supported test selection was run with:
cargo test --workspace --lib --bins --tests --examples --quiet -- --test-threads=1cargo check --workspace --all-targetscompiled every target, includingbenchmarks. Cross-backend coverage is not applicable because this change is
confined to the shared runtime collector below all compiler backends.
Review notes
The broken helper merged in PR #35 did not compile, was not called, and would
have attempted to load scalar slots as references. This PR moves the check to
the allocation publication path, where the typed object map and validated
initializer values are both available.
Summary by cubic
Fixes a GC regression by marking initialized mature objects that point to the nursery during allocation, and keeps same‑Bubble LSP snapshots consistent with accurate, scoped diagnostics and hints.
mark_initialized_mature_objecthelper.Written for commit 03aa3d1. Summary will update on new commits.