Skip to content

Checkpoint GC architecture progress toward #1090 - #1235

Merged
proggeramlug merged 37 commits into
PerryTS:mainfrom
andrewtdiz:codex/gc-1090-checkpoint
May 21, 2026
Merged

Checkpoint GC architecture progress toward #1090#1235
proggeramlug merged 37 commits into
PerryTS:mainfrom
andrewtdiz:codex/gc-1090-checkpoint

Conversation

@andrewtdiz

Copy link
Copy Markdown
Contributor

Summary

Checkpoint toward #1090: make Perry's minor GC structurally cheaper and safer to reason about.

This PR collects the current GC architecture work into a reviewable unit:

  • makes copied-minor GC the default-safe path for key churn workloads
  • strengthens precise root coverage and copied-minor fallback reporting
  • keeps write-barrier/dirty tracking evidence visible in trace output
  • adds target collector architecture gates to the memory-stability suite
  • splits the large GC runtime implementation into owner modules behind the same public facade
  • removes JSON tape scratch/key-cache allocation churn and documents the stable force-evac verifier RSS bound

This is not intended to close #1090. It is a strong checkpoint: default-safe copied-minor behavior, better evidence, and a maintainable module layout for the remaining root/barrier/layout/old-gen work.

Why

#1090's target invariant is:

minor GC cost = live young objects + dirty old cards/pages + mutable roots
not arena size + malloc table + block persistence + sweep walk

This PR moves Perry closer to that invariant by making copied-minor behavior observable and verified, reducing fallback causes, and giving the collector code clearer ownership boundaries before the next architecture work.

Evidence

Verified locally on this branch:

  • cargo fmt --check
  • cargo test -p perry-runtime --release json_tape -> 6 passed
  • cargo build --release -p perry
  • git diff --check
  • PERRY_GC_EVIDENCE_DIR=/tmp/perry-gc-pr-checkpoint-evidence scripts/run_memory_stability_tests.sh -> 58 PASS / 0 FAIL

Memory-stability highlights:

  • JSON churn default/gen-gc: 240 MB under 250 MB gate
  • JSON churn mark-sweep: 90 MB under 250 MB gate
  • JSON churn force-evac+verify: stable 262 MB under documented 275 MB verifier-only gate
  • copied-minor fallback evidence: top_remaining_reason=none
  • target collector stress gates passed
  • low-pressure benchmark gates passed:
    • 07_object_create: 3 ms / 6 MB
    • 12_binary_trees: 4 ms / 6 MB
    • bench_gc_pressure: 23 ms / 26 MB

Evidence artifacts from the local run were written to:

/tmp/perry-gc-pr-checkpoint-evidence

Deliberately not included

The remaining #1090 production-grade work is still ahead:

  • full 11-run benchmark matrix packet from fresh worktrees
  • broader old-gen/page layout work
  • complete GC type/layout metadata replacement for hard-coded ranges
  • broader unboxed-field and typed heap layouts
  • further reduction of conservative fallback paths
  • making write barriers permanent infrastructure rather than mode-controlled behavior

andrewtdiz added 30 commits May 20, 2026 20:13
@andrewtdiz
andrewtdiz force-pushed the codex/gc-1090-checkpoint branch from a80998d to 6294f51 Compare May 21, 2026 03:14
@proggeramlug
proggeramlug merged commit 08cd820 into PerryTS:main May 21, 2026
9 checks passed
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.

GC roadmap: make minor GC structurally cheap

2 participants