Skip to content

Mark initialized mature references - #36

Merged
kleeedolinux merged 3 commits into
masterfrom
fix/initialized-mature-cards
Jul 18, 2026
Merged

Mark initialized mature references#36
kleeedolinux merged 3 commits into
masterfrom
fix/initialized-mature-cards

Conversation

@serene1491

@serene1491 serene1491 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

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

  • Authorizing architecture section or ADR: ADR 0008 and
    architecture/15-garbage-collector-architecture.md
  • New or changed public contract: No new public API. This restores the accepted
    precise generational write-barrier contract for initialized allocations.
  • Architecture documents, examples, or terminology updated: No documentation
    change was required because the accepted contract was already explicit.

Verification

  • Tests were added or updated before implementation where behavior changed.
  • Positive behavior is covered.
  • Negative/rejection boundaries are covered.
  • Convention, consistency, and regression coverage is present where relevant.
  • Cross-backend or differential coverage is present where relevant.
  • cargo fmt --all -- --check
  • cargo check --workspace --all-targets
  • cargo test --workspace --all-targets
  • cargo clippy --workspace --all-targets -- -D warnings

If 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=1

cargo check --workspace --all-targets compiled every target, including
benchmarks. Cross-backend coverage is not applicable because this change is
confined to the shared runtime collector below all compiler backends.

Review notes

  • No dynamic typing, runtime string lookup, broad reflection, or universal-table behavior was introduced.
  • HIR/MIR remain backend-neutral.
  • No generated artifacts, dependency caches, credentials, or editor files are included.
  • This is ready for technical review.

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.

  • Bug Fixes
    • GC: detect typed nursery edges during allocation publication and mark the card; restores precise generational write‑barrier without extra scans or allocations.
    • Removes the unused mark_initialized_mature_object helper.
    • Adds a minor‑collection test that verifies survival and relocation.
    • LSP: reanalyzes all open Modules in the same Bubble on open/change/close and republishes their diagnostics; unrelated Packages and standalone documents are not republished.
    • LSP: document symbols are limited to the owning file; inlay hints include method call parameters; returns a request error for code actions on closed documents.

Written for commit 03aa3d1. Summary will update on new commits.

Review in cubic

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@kleeedolinux
kleeedolinux merged commit 9981c48 into master Jul 18, 2026
2 checks passed
@serene1491
serene1491 deleted the fix/initialized-mature-cards branch July 18, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants