Skip to content

test(gc): assert the sparse cache is old-gen before the containment branch (#7546 follow-up) - #7549

Merged
proggeramlug merged 2 commits into
mainfrom
fix/7549-cache-oldgen-assertion
Aug 6, 2026
Merged

test(gc): assert the sparse cache is old-gen before the containment branch (#7546 follow-up)#7549
proggeramlug merged 2 commits into
mainfrom
fix/7549-cache-oldgen-assertion

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

#7546's external-edge test asserts the lazy array's sparse cache and its header land on different pages, but never that the cache block is old-gen.

slot_is_external_to short-circuits to true on generation before reaching the containment test. So if an allocator change ever moved a 32 KiB sparse cache into the nursery, the containment branch the test exists to cover would quietly stop running — and the test would still pass.

That is CLAUDE.md's "a gate must assert its subject was live" hazard applied to a test written to close a coverage hole of exactly that kind: #7500's test_dirty_lazy_array_external_cache_scan_marks_bitmap_selected_child was green for its entire life because no producer ever wrote a real entry, so it only ever exercised a hand-planted one.

Adds the missing precondition. Raised by CodeRabbit on #7546; applied here because that agent's worktree was removed before it could — my cleanup, not its error.

33 callback-scanner tests green, cargo fmt --check clean.

Summary by CodeRabbit

  • Release

    • Updated the application version to 0.5.1310.
  • Bug Fixes

    • Improved runtime validation for sparse cache handling and external reference tracking, helping prevent missed edge cases during memory management.
  • Tests

    • Strengthened coverage to ensure cache generation state is validated before related behavior is exercised.
  • Documentation

    • Added a changelog entry describing the cache liveness test improvement.

@proggeramlug
proggeramlug merged commit 9a77a26 into main Aug 6, 2026
@proggeramlug
proggeramlug deleted the fix/7549-cache-oldgen-assertion branch August 6, 2026 20:09
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8736d790-38a6-4b92-99b0-752ae492adc6

📥 Commits

Reviewing files that changed from the base of the PR and between b98fcaa and aa60587.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • CLAUDE.md
  • Cargo.toml
  • changelog.d/7549-cache-oldgen-liveness-assertion.md
  • crates/perry-runtime/src/gc/tests/runtime_roots/callback_scanners.rs

📝 Walkthrough

Walkthrough

The sparse-cache external-edge test now verifies old-generation allocation before checking remembered-set behavior. The workspace version, documented version, and changelog update to reflect the change.

Changes

GC test and release update

Layer / File(s) Summary
Old-generation precondition for sparse-cache test
crates/perry-runtime/src/gc/tests/runtime_roots/callback_scanners.rs, changelog.d/7549-cache-oldgen-liveness-assertion.md
The test asserts old-generation allocation before validating sparse-cache page placement and remembered-set tracking. The changelog documents this precondition.
Version metadata update
Cargo.toml, CLAUDE.md
The workspace package version and documented current version change from 0.5.1309 to 0.5.1310.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • PerryTS/perry#7546: The test strengthens the sparse-cache lazy_get regression coverage introduced by this PR.

Suggested reviewers: thehypnoo

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/7549-cache-oldgen-assertion

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant